Merge pull request #1795 from Fandekasp/remove_website

remove broken website field from profile
This commit is contained in:
Tyler Renelle
2013-11-13 23:09:27 -08:00
12 changed files with 13 additions and 70 deletions

View File

@@ -24,7 +24,6 @@
"PhotoUrl": "Линк към снимка",
"FullName": "Име",
"Blurb": "Blurb",
"Websites": "Уебсайт",
"Achievements": "Постижения",
"OriginalUser": "Автентичен юзър",
"Inventory": "Инвентория",

View File

@@ -136,8 +136,6 @@
"photoUrl": "Photo Url",
"fullName": "Full Name",
"blurb": "Blurb",
"websites": "Websites",
"addWebsites": "Add Websites",
"items" : "Items",
"weapon" : "Weapon",
"armor" : "armor",

View File

@@ -24,7 +24,6 @@
"PhotoUrl": "Foto URL",
"FullName": "Volledige Naam",
"Blurb": "Blurp",
"Websites": "Voeg Website Toe",
"Achievements": "Prestaties",
"OriginalUser": "Originele Gebruiker!",
"Inventory": "Inventaris",

View File

@@ -0,0 +1,7 @@
// Migrate all users websites to the profile blurb field
db.users.find({'profile.websites':{$exists: true}}).forEach(function(user){
db.users.update({_id: user._id}, {
$set: {"profile.blurb": user.profile.blurb + '\n * ' + user.profile.websites.join('\n * ')},
$unset: {'profile.websites': ''}
})
})

View File

@@ -16,15 +16,6 @@ habitrpg.controller("GroupsCtrl", ['$scope', '$rootScope', 'Groups', '$http', 'A
group._editing = false;
}
$scope.addWebsite = function(group){
group.websites.push(group._newWebsite);
group._newWebsite = '';
}
$scope.removeWebsite = function(group, $index){
group.websites.splice($index,1);
}
// ------ Modals ------
$scope.clickMember = function(uid, forceShow) {

View File

@@ -26,15 +26,6 @@ habitrpg.controller("UserCtrl", ['$rootScope', '$scope', '$location', 'User', '$
$scope._editing.profile = false;
}
$scope.addWebsite = function(){
if (!$scope.editingProfile.websites) $scope.editingProfile.websites = [];
$scope.editingProfile.websites.push($scope._newWebsite);
$scope._newWebsite = '';
}
$scope.removeWebsite = function($index){
$scope.editingProfile.websites.splice($index,1);
}
$scope.unlock = User.unlock;
}

View File

@@ -196,7 +196,7 @@ api.update = function(req, res, next) {
if(group.leader !== user._id)
return res.json(401, {err: "Only the group leader can update the group!"});
'name description logo websites logo leaderMessage leader'.split(' ').forEach(function(attr){
'name description logo logo leaderMessage leader'.split(' ').forEach(function(attr){
group[attr] = req.body[attr];
});

View File

@@ -13,7 +13,6 @@ var GroupSchema = new Schema({
type: {type: String, "enum": ['guild', 'party']},
privacy: {type: String, "enum": ['private', 'public']},
_v: {type: Number,'default': 0},
websites: Array,
chat: Array,
/*
# [{
@@ -49,13 +48,6 @@ function removeDuplicates(doc){
doc.members = uniqMembers;
}
}
if (doc.websites) {
var uniqWebsites = _.uniq(doc.websites);
if (uniqWebsites.length != doc.websites.length) {
doc.websites = uniqWebsites;
}
}
}
// FIXME this isn't always triggered, since we sometimes use update() or findByIdAndUpdate()

View File

@@ -178,7 +178,6 @@ var UserSchema = new Schema({
blurb: String,
imageUrl: String,
name: String,
websites: Array // styled like --> ["http://ocdevel.com" ]
},
stats: {
hp: Number,

View File

@@ -92,13 +92,6 @@ script(id='partials/options.profile.profile.html', type='text/ng-template')
span.muted(ng-hide='profile.profile.blurb') - None -
//{{profile.profile.blurb | linky:'_blank'}}
h4 Websites
ul(ng-show='profile.profile.websites.length > 0')
// TODO let's remove links eventually, since we can do markdown on profiles
li(ng-repeat='website in profile.profile.websites')
a(target='_blank', ng-href='{{website}}') {{website}}
span.muted(ng-hide='profile.profile.websites.length > 0') - None -
div.whatever-options(ng-show='_editing.profile')
// TODO use photo-upload instead: https://groups.google.com/forum/?fromgroups=#!topic/derbyjs/xMmADvxBOak
.control-group.option-large
@@ -111,15 +104,6 @@ script(id='partials/options.profile.profile.html', type='text/ng-template')
label.control-label Blurb
textarea.option-content(style='height:15em;', placeholder='Blurb', ng-model='editingProfile.blurb')
include ../shared/formatting-help
.control-group.option-large
label.control-label Websites
form(ng-submit='addWebsite()')
input.option-content(type='url', ng-model='_newWebsite', placeholder='Add Website')
ul
li(ng-repeat='website in editingProfile.websites')
| {{website}}
a(ng-click='removeWebsite($index)')
i.icon-remove
script(id='partials/options.profile.html', type="text/ng-template")
ul.nav.nav-tabs

View File

@@ -25,15 +25,6 @@ a.pull-right.gem-wallet(popover-trigger='mouseenter', popover-title='Guild Bank'
.control-group.option-large
label.control-label Logo URL
input.option-content(type='url', placeholder='Logo URL', ng-model='group.logo')
.control-group.option-large
label.control-label Websites
form(ng-submit='addWebsite(group)')
input.option-content(type='url', ng-model='group._newWebsite', placeholder='Add Website')
ul
li(ng-repeat='website in group.websites')
| {{website}}
a(ng-click='removeWebsite(group, $index)')
i.icon-remove
h4 Assign Group Leader
select#group-leader-selection(ng-model='group._newLeader', ng-options='member.profile.name for member in group.members')
@@ -41,11 +32,6 @@ a.pull-right.gem-wallet(popover-trigger='mouseenter', popover-title='Guild Bank'
div(ng-show='!group._editing')
img.pull-right(ng-show='group.logo', style='max-width:150px', ng-src='{{group.logo}}')
markdown(ng-model='group.description')
div(ng-show='group.websites')
h4 Websites
ul
li(ng-repeat='website in group.websites')
a(target='_blank', ng-href='{{website}}') {{website}}
include ./challenge-box

View File

@@ -9,9 +9,6 @@ div(ng-controller='MemberModalCtrl')
.span6
img(ng-show='profile.profile.imageUrl', ng-src='{{profile.profile.imageUrl}}')
markdown(ng-show='profile.profile.blurb', ng-model='profile.profile.blurb')
ul(ng-show='profile.profile.websites')
li(ng-repeat='website in profile.profile.websites')
a(href='{{website}}', target='_blank') {{website}}
ul.muted.unstyled(ng-if='profile.auth.timestamps', style='margin-top:10px;')
li {{profile._id}}
li(ng-show='profile.auth.timestamps.created') - Member since {{timestamp(profile.auth.timestamps.created)}} -