mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-19 15:48:04 +01:00
Merge pull request #1795 from Fandekasp/remove_website
remove broken website field from profile
This commit is contained in:
@@ -24,7 +24,6 @@
|
||||
"PhotoUrl": "Линк към снимка",
|
||||
"FullName": "Име",
|
||||
"Blurb": "Blurb",
|
||||
"Websites": "Уебсайт",
|
||||
"Achievements": "Постижения",
|
||||
"OriginalUser": "Автентичен юзър",
|
||||
"Inventory": "Инвентория",
|
||||
|
||||
@@ -136,8 +136,6 @@
|
||||
"photoUrl": "Photo Url",
|
||||
"fullName": "Full Name",
|
||||
"blurb": "Blurb",
|
||||
"websites": "Websites",
|
||||
"addWebsites": "Add Websites",
|
||||
"items" : "Items",
|
||||
"weapon" : "Weapon",
|
||||
"armor" : "armor",
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
"PhotoUrl": "Foto URL",
|
||||
"FullName": "Volledige Naam",
|
||||
"Blurb": "Blurp",
|
||||
"Websites": "Voeg Website Toe",
|
||||
"Achievements": "Prestaties",
|
||||
"OriginalUser": "Originele Gebruiker!",
|
||||
"Inventory": "Inventaris",
|
||||
|
||||
7
migrations/20131114_migrate_websites_to_blurb.js
Normal file
7
migrations/20131114_migrate_websites_to_blurb.js
Normal 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': ''}
|
||||
})
|
||||
})
|
||||
@@ -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) {
|
||||
|
||||
@@ -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;
|
||||
|
||||
}
|
||||
|
||||
@@ -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];
|
||||
});
|
||||
|
||||
@@ -414,4 +414,4 @@ api.removeMember = function(req, res, next){
|
||||
return res.json(400, {err: "User not found among group's members!"});
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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()
|
||||
@@ -80,4 +72,4 @@ GroupSchema.methods.toJSON = function(){
|
||||
}
|
||||
|
||||
module.exports.schema = GroupSchema;
|
||||
module.exports.model = mongoose.model("Group", GroupSchema);
|
||||
module.exports.model = mongoose.model("Group", GroupSchema);
|
||||
|
||||
@@ -178,7 +178,6 @@ var UserSchema = new Schema({
|
||||
blurb: String,
|
||||
imageUrl: String,
|
||||
name: String,
|
||||
websites: Array // styled like --> ["http://ocdevel.com" ]
|
||||
},
|
||||
stats: {
|
||||
hp: Number,
|
||||
@@ -300,4 +299,4 @@ UserSchema.methods.unlink = function(options, cb) {
|
||||
}
|
||||
|
||||
module.exports.schema = UserSchema;
|
||||
module.exports.model = mongoose.model("User", UserSchema);
|
||||
module.exports.model = mongoose.model("User", UserSchema);
|
||||
|
||||
@@ -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
|
||||
@@ -135,4 +119,4 @@ script(id='partials/options.profile.html', type="text/ng-template")
|
||||
|
||||
.tab-content
|
||||
.tab-pane.active
|
||||
div(ui-view)
|
||||
div(ui-view)
|
||||
|
||||
@@ -25,27 +25,13 @@ 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')
|
||||
|
||||
|
||||
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
|
||||
|
||||
|
||||
@@ -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)}} -
|
||||
|
||||
Reference in New Issue
Block a user