mirror of
https://github.com/sudoxnym/habitica.git
synced 2026-07-22 11:38:24 +00:00
port group websites
This commit is contained in:
parent
f5777dc0d0
commit
5744146ff6
4 changed files with 18 additions and 6 deletions
|
|
@ -15,6 +15,15 @@ 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);
|
||||
}
|
||||
|
||||
// ------ Loading ------
|
||||
|
||||
$scope.groups = Groups.groups;
|
||||
|
|
|
|||
|
|
@ -76,7 +76,6 @@ function removeDuplicates(doc){
|
|||
if (uniqWebsites.length != doc.websites.length) {
|
||||
doc.websites = uniqWebsites;
|
||||
}
|
||||
console.log(doc.websites);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -26,9 +26,14 @@ a.pull-right.gem-wallet(popover-trigger='mouseenter', popover-title='Guild Bank'
|
|||
label.control-label Logo URL
|
||||
input.option-content(type='url', placeholder='Logo URL', ng-model='group.logo')
|
||||
.control-group.option-large
|
||||
form.form-inline(x-bind='submit:groupAddWebsite', ng-submit='notPorted()')
|
||||
input.option-content(type='url', placeholder='Website', value='{{_newGroupWebsite}}')
|
||||
input.btn(type='submit', value='Add')
|
||||
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
|
||||
|
|
@ -48,7 +53,7 @@ a.pull-right.gem-wallet(popover-trigger='mouseenter', popover-title='Guild Bank'
|
|||
markdown(ng-model='group.description')
|
||||
div(ng-show='group.websites')
|
||||
h4 Websites
|
||||
ul.unstyled
|
||||
ul
|
||||
li(ng-repeat='website in group.websites')
|
||||
a(target='_blank', ng-href='{{website}}') {{website}}
|
||||
|
||||
|
|
|
|||
|
|
@ -121,7 +121,6 @@
|
|||
form(ng-submit='addWebsite()')
|
||||
input.option-content(type='url', ng-model='_newWebsite', placeholder='Add Website')
|
||||
ul
|
||||
// would prefer if there were and index in #each, instead using data-website to search with indexOf
|
||||
li(ng-repeat='website in editingProfile.websites')
|
||||
| {{website}}
|
||||
a(ng-click='removeWebsite($index)')
|
||||
|
|
|
|||
Loading…
Reference in a new issue