habitica-self-host/website/views/options/social/challenges.jade
GihHubSphinx 071f2796db Adjusting challenges view translation
- Make "Back to all challenges" button translatable
- Allow some flexibility for the line "#_of_gems gem_icon Prize" - this
is made following the practices with linkstart/linkend implementation
- prize "string" is left as is because used as a placeholder
- code comment "prize" had to be moved 1 line up - before the p (as no
room for it is left inside the p) which however seems OK to me, because
the comments above and below has been made the same way before
2015-06-16 02:37:18 +05:00

180 lines
9.5 KiB
Text
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)', style='display:block')
option(value='')
option(ng-repeat='u in closingChal.members', value='{{u._id}}') {{u.profile.name}}
.text-right
small.btn-link(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-model='search._isMember', ng-value='true', ng-change='filterChallenges')
=env.t('participating')
.radio
label
input(type='radio', name='search-participation-radio', ng-model='search._isMember', ng-value='false', ng-change='filterChallenges')
=env.t('notParticipating')
.radio
label
input(type='radio', name='search-participation-radio', ng-model='search._isMember', value='either', ng-change='filterChallenges')
=env.t('either')
h4=env.t('challengedOwnedFilterHeader')
.radio
label
input(type='radio', name='search-owner-radio', ng-model='search._isOwner', ng-value='true', ng-change='filterChallenges')
=env.t('challengedOwnedFilter')
.radio
label
input(type='radio', name='search-owner-radio', ng-model='search._isOwner', ng-value='false', ng-change='filterChallenges')
=env.t('challengedNotOwnedFilter')
.radio
label
input(type='radio', name='search-owner-radio', ng-model='search._isOwner', value='either', ng-change='filterChallenges', checked='checked')
=env.t('challengedEitherOwnedFilter')
.col-md-10
a.btn.btn-info#back-to-challenges(ng-show="cid", ui-sref='options.social.challenges', ui-sref-opts='{reload: true}')
=env.t('backToChallenges')
// 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')
.form-group
.input-group
span.input-group-addon
.Pet_Currency_Gem1x
input.form-control(type='number', min="{{newChallenge.group=='habitrpg' ? 1 : 0}}", max="{{maxPrize}}", ng-model='newChallenge.prize', placeholder=env.t('prize'))
a.hint(popover="{{newChallenge.group=='habitrpg' ? env.t('prizePopTavern') : env.t('prizePop')}}", popover-trigger='mouseenter', popover-placement='right')
=env.t('moreInfo')
.pull-right(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')
// prize
p!=env.t('prizeValue', {gemcount: "{{challenge.prize}}", gemicon: "<span class='inline-block Pet_Currency_Gem1x'></span>"})
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)