Files
habitica/website/views/options/social/challenges.jade
T
Sphinx 69e1b4f8e6 Update challenges.jade
Additional changes in translations required before merging!

https://trello.com/c/SvTsLdRF/12-translations
"0leg
It would be great if we could have "%number_of% Participants" instead of just "Participants" in the source language so that we could translate it as "участников: %number_of%" which is the only correct way to translate it into Russian without grammatical mistakes. (This example is from Challenges tab.)"
2015-04-09 07:55:44 -05:00

175 lines
8.7 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
script(type='text/ng-template', id='partials/options.social.challenges.detail.close.html')
a.btn.btn-sm.btn-danger(ng-click="delete(closingChal)")=env.t('delete')
h5= '- ' + env.t('or') + ' -'
select(ui-select2, ng-required=true, ng-model='closingChal.winner', data-placeholder=env.t('selectWinner'), ng-change='selectWinner(closingChal)', )
option(value='')
option(ng-repeat='u in closingChal.members', value='{{u._id}}') {{u.profile.name}}
small.pull-right
a(ng-click='cancelClosing(closingChal)')=env.t('cancel')
script(type='text/ng-template', id='partials/options.social.challenges.detail.member.html')
.modal.bs-modal-lg(style='display: block')
.modal-dialog.modal-lg
.modal-content
.modal-header
button.close(type='button', ng-click='$state.go("^")', aria-hidden='true') ×
h3 {{obj.profile.name}}
.modal-body
habitrpg-tasks(main=false, modal='true')
.modal-footer
a.btn.btn-default(ng-click='$state.go("^")')=env.t('close')
script(type='text/ng-template', id='partials/options.social.challenges.detail.html')
// Edit button
div(bindonce='challenge', ng-if='challenge.leader._id==user._id')
div(ng-hide='challenge._locked==false')
button.btn.btn-sm.btn-default(ng-click='edit(challenge)')=env.t('edit')
button.btn.btn-sm.btn-warning(ng-click='close(challenge, $event)', tooltip=env.t('deleteOrSelect'))=env.t('endChallenge')
form(ng-show='challenge._locked==false')
.form-group(ng-show='challenge._locked==false')
button.btn.btn-sm.btn-primary(ng-click='save(challenge)')=env.t('save')
button.btn.btn-sm.btn-default(ng-click='challenge._locked=true')=env.t('cancel')
.form-group
input.form-control(type='text', ng-model='challenge.name')
.form-group
input.form-control(type='text', minlength="3", maxlength="16", ng-model='challenge.shortName', placeholder=env.t('challengeTag'), required)
.form-group
textarea.form-control(cols='3', placeholder=env.t('challengeDescr'), ng-model='challenge.description')
hr
.well(bindonce='challenge', ng-if='challenge.description')
markdown(text='challenge.description')
.modal-body=env.t('challengeDiscription')
habitrpg-tasks(obj='challenge', main=false)
// Member List
div(bindonce='challenge', ng-if='challenge.members.length > 0')
a.btn.btn-primary.btn-sm.pull-right(ng-href='/api/v2/challenges/{{challenge._id}}/csv')
=env.t('exportChallengeCSV')
h3=env.t('hows')
menu
button.customize-option(ng-repeat='member in challenge.members track by member._id', ng-click='toggleMember(challenge._id, member._id)') {{member.profile.name}}
div(ui-view)
// Accordion version if we choose that instead
//- div(ng-if='challenge.members')
h4=env.t('hows')
.accordion-group(bindonce='challenge.members', ng-repeat='member in challenge.members')
.accordion-heading
a.accordion-toggle(ng-click='toggleMember(challenge._id, member._id)') {{member.profile.name}}
.accordion-body(ng-class='{collapse: $stateParams.uid != member._id}')
.accordion-inner(ng-if='$stateParams.uid == member._id')
div(ui-view)
script(type='text/ng-template', id='partials/options.social.challenges.html')
.container-fluid
.row
.col-md-2
.well#challenges-filters(ng-hide="cid")
h3=env.t('filter') + ':'
h4=env.t('groups')
ul.list-unstyled
a.btn.btn-xs.btn-default.pull-left(ng-click='selectAll()')=env.t('all')
a.btn.btn-xs.btn-default(ng-click='selectNone()')=env.t('none')
br
.checkbox(ng-repeat='group in groupsFilter')
label
input(type='checkbox', ng-model='search.group[group._id]')
| {{group.name}}
h4=env.t('membership')
.radio
label
input(type='radio', name='search-participation-radio', ng-click='search._isMember = true')
=env.t('participating')
.radio
label
input(type='radio', name='search-participation-radio', ng-click='search._isMember = false')
=env.t('notParticipating')
.radio
label
input(type='radio', name='search-participation-radio', ng-click='search._isMember = undefined', checked='checked')
=env.t('either')
.col-md-10
a.btn.btn-info#back-to-challenges(ng-show="cid", ui-sref='options.social.challenges', ui-sref-opts='{reload: true}')
| Back to all challenges
// Creation form
button.btn.btn-success#create-challenge-btn(ng-click='create()', ng-hide='newChallenge')=env.t('createChallenge')
.create-challenge-from.well(ng-if='newChallenge')
form(ng-submit='save(newChallenge)')
div
input.btn.btn-success(type='submit', value=env.t('save'))
input.btn.btn-danger(type='button', ng-click='discard()', value=env.t('discard'))
select(ng-model='newChallenge.group', ng-required='required', name='Group', ng-options='g._id as g.name for g in groups')
.challenge-options
.form-group
input.form-control(type='text', ng-model='newChallenge.name', placeholder=env.t('challengeTitle'), required='required')
.form-group
input.form-control(type='text', minlength="3", maxlength="16", ng-model='newChallenge.shortName', placeholder=env.t('challengeTag'), required)
| 
a.hint.vertical-20(target='_blank', href='http://habitrpg.wikia.com/wiki/Tags', popover=env.t('challengeTagPop'), popover-trigger='mouseenter', popover-placement='right')
=env.t('moreInfo')
.form-group
textarea.form-control(cols='3', placeholder=env.t('challengeDescr'), ng-model='newChallenge.description')
//- what's going on here?
br
br
.form-group
input.form-control(type='number', min="{{newChallenge.group=='habitrpg' ? 1 : 0}}", max="{{maxPrize}}", ng-model='newChallenge.prize', placeholder=env.t('prize'))
span.input-suffix.Pet_Currency_Gem1x.inline-gems
| 
span.hint.vertical-20(popover=env.t('prizePop'), popover-trigger='mouseenter', popover-placement='right')
=env.t('moreInfo')
span(ng-show='newChallenge.group=="habitrpg"')
!=env.t('publicChallenges')
.form-group(ng-if='user.contributor.admin')
.checkbox
label
input(type='checkbox', ng-model='newChallenge.official')
=env.t('officialChallenge')
habitrpg-tasks(main=false, obj='newChallenge')
// Challenges list
.panel-group
.panel.panel-default(ng-repeat='challenge in challenges|filter:filterChallenges track by challenge._id ')
.panel-heading
ul.pull-right.challenge-accordion-header-specs
li.bg-transparent(ng-if='challenge.official')
span.label.label-success=env.t('officialChallenge')
li
a(ui-sref="options.social.guilds.detail({gid:challenge.group._id})" ng-if="challenge.group.type=='guild'")
| {{challenge.group.name}}
a(ui-sref="options.social.party" ng-if="challenge.group.type=='party'")
| {{challenge.group.name}}
li
=env.t('by') + ' '
a(ng-click='clickMember(challenge.leader._id, true)') {{challenge.leader.profile.name}}
li
=env.t('participants', {membercount: "{{challenge.memberCount}}"})
li(ng-show='challenge.prize')
p
// prize
| {{challenge.prize}} 
span.inline-block.Pet_Currency_Gem1x
|  
=env.t('prize')
li.bg-transparent
// leave / join
a.btn.btn-sm.btn-danger(ng-show='challenge._isMember', ng-click='clickLeave(challenge, $event)')
span.glyphicon.glyphicon-ban-circle
=env.t('leave')
a.btn.btn-sm.btn-success(ng-hide='challenge._isMember', ng-click='join(challenge)')
span.glyphicon.glyphicon-ok
=env.t('join')
a.accordion-toggle(id="{{challenge._id}}" ng-click='toggle(challenge._id)') {{challenge.name}}
.panel-body(ng-class='{collapse: !$stateParams.cid == challenge._id}')
.accordion-inner(ng-if='$stateParams.cid == challenge._id')
div(ui-view)