habitica/views/shared/modals/members.jade
2014-12-07 13:50:46 +01:00

96 lines
4.9 KiB
Text

script(type='text/ng-template', id='modals/member.html')
.modal-header
h4
span {{::profile.profile.name}}
span(ng-if='profile.contributor.level') - {{::contribText(profile.contributor, profile.backer)}}
.modal-body
.container-fluid
.row
.col-md-6
img(ng-show='::profile.profile.imageUrl', ng-src='{{::profile.profile.imageUrl}}')
markdown(ng-show='::profile.profile.blurb', ng-model='::profile.profile.blurb')
ul.muted.list-unstyled(ng-if='::profile.auth.timestamps')
li {{profile._id}}
li(ng-show='::profile.auth.timestamps.created')
| 
=env.t('memberSince')
| 
| {{::timestamp(profile.auth.timestamps.created)}} -
li(ng-show='::profile.auth.timestamps.loggedin')
| 
=env.t('lastLoggedIn')
| 
| {{::timestamp(profile.auth.timestamps.loggedin)}} -
h3=env.t('stats')
.label.label-info {{:: {warrior:env.t("warrior"), wizard:env.t("mage"), rogue:env.t("rogue"), healer:env.t("healer")}[profile.stats.class] }}
include ../profiles/stats
.col-md-6
.row
+herobox()
.row
h3=env.t('achievements')
include ../profiles/achievements
.modal-footer
.btn-group.pull-left(ng-if='::user')
button.btn.btn-md.btn-default(ng-show='user.inbox.blocks | contains:profile._id', tooltip=env.t('unblock'), ng-click="user.ops.blockUser({params:{uuid:profile._id}})", tooltip-placement='right')
span.glyphicon.glyphicon-plus
button.btn.btn-md.btn-default(ng-hide='profile._id == user._id || user.inbox.blocks | contains:profile._id', tooltip=env.t('block'), ng-click="user.ops.blockUser({params:{uuid:profile._id}})", tooltip-placement='right')
span.glyphicon.glyphicon-ban-circle
button.btn.btn-md.btn-default(tooltip=env.t('sendPM'), ng-click="openModal('private-message',{controller:'MemberModalCtrl'})", tooltip-placement='right')
span.glyphicon.glyphicon-envelope
button.btn.btn-md.btn-default(tooltip="Send Gift", ng-click="openModal('send-gift',{controller:'MemberModalCtrl'})", tooltip-placement='right')
span.glyphicon.glyphicon-gift
button.btn.btn-default(ng-click='$close()')=env.t('close')
script(type='text/ng-template', id='modals/private-message.html')
.modal-header
h4=env.t('pmHeading', {name: "{{profile.profile.name}}"})
.modal-body
textarea.form-control(type='text',ng-model='_message')
.modal-footer
button.btn.btn-primary(ng-click='sendPrivateMessage(profile._id, _message)')=env.t("send")
button.btn.btn-default(ng-click='$close()')=env.t('cancel')
script(type='text/ng-template', id='modals/send-gift.html')
.modal-header
h4 Send Gift to {{::profile.profile.name}}
.modal-body
.panel.panel-default(class="{{gift.type=='gems' ? 'panel-primary' : 'transparent'}}", ng-click='gift.type="gems"')
.panel-heading
.pull-right
span(ng-show='gift.gems.fromBalance') From {{user.balance*4}} Gems
span(ng-hide='gift.gems.fromBalance') Total: ${{gift.gems.amount/4}} USD
| Gems
.panel-body
.row
.col-md-6
.form-group
input.form-control(type='number', placeholder='Number of Gems', min='0', max='{{gift.gems.fromBalance ? user.balance*4 : ""}}', ng-model='gift.gems.amount')
.col-md-6
.btn-group
a.btn.btn-default(ng-class="{active:gift.gems.fromBalance}", ng-click="gift.gems.fromBalance=true") From Balance
a.btn.btn-default(ng-class="{active:!gift.gems.fromBalance}", ng-click="gift.gems.fromBalance=false") Purchase
.panel.panel-default(class="{{gift.type=='subscription' ? 'panel-primary' : 'transparent'}}", ng-click='gift.type="subscription"')
.panel-heading Subscription
.panel-body
.form-group
each block in env.Content.subscriptionBlocks
.radio
label
input(type="radio", name="subRadio", value="#{block.months}", ng-model='gift.subscription.months')
| #{block.months} Month(s): $#{block.price}
textarea.form-control(rows='3', ng-model='gift.message', placeholder='Personal message (optional)')
.modal-footer
- var fromBal = "gift.type=='gems' && gift.gems.fromBalance"
button.btn.btn-primary(ng-show=fromBal, ng-click='sendGift(profile._id, gift)')=env.t("send")
a.btn.btn-primary(ng-hide=fromBal, ng-click='Payments.showStripe({gift:gift, uuid:profile._id})')=env.t('card')
a.btn.btn-warning(ng-hide=fromBal, href='/paypal/checkout?_id={{::user._id}}&apiToken={{::user.apiToken}}&gift={{Payments.encodeGift(profile._id, gift)}}') PayPal
button.btn.btn-default(ng-click='$close()')=env.t('cancel')
script(type='text/ng-template', id='modals/flag.html')
.modal-header
.modal-body
.modal-footer