A few fixes to WorldMapView to handle authentication and hiding the parts that aren't done yet.

This commit is contained in:
Nick Winter 2014-09-25 15:58:25 -07:00
parent 0928bb7a81
commit 4ca7df0b32
4 changed files with 38 additions and 7 deletions
app

View file

@ -141,6 +141,7 @@
previous: "Previous"
choose_inventory: "Equip Items"
older_campaigns: "Older Campaigns"
anonymous: "Anonymous Player"
items:
armor: "Armor"

View file

@ -151,7 +151,7 @@ $gameControlMargin: 30px
bottom: 1%
z-index: 3
button.btn
.btn
&:not(:first-child)
margin-left: $gameControlMargin
width: $gameControlSize
@ -188,9 +188,24 @@ $gameControlMargin: 30px
z-index: 3
a
font-size: 20px
font-size: 24px
color: #eee
text-decoration: underline
&:hover
color: white
text-shadow: 1px 1px 0px black
.user-status
position: absolute
bottom: 1%
left: 50%
width: 400px
margin-left: -200px
text-align: center
font-size: 24px
color: white
text-shadow: 1px 1px 0px black
button
margin-left: 10px

View file

@ -30,10 +30,25 @@
.game-controls.header-font
if me.isAdmin()
button.btn.items(data-toggle='coco-modal', data-target='play/modal/PlayItemsModal', data-i18n="[title]play.items")
button.btn.heroes(data-toggle='coco-modal', data-target='play/modal/PlayHeroesModal', data-i18n="[title]play.heroes")
button.btn.achievements(data-toggle='coco-modal', data-target='play/modal/PlayAchievementsModal', data-i18n="[title]play.achievements")
button.btn.account(data-toggle='coco-modal', data-target='play/modal/PlayAccountModal', data-i18n="[title]play.account")
button.btn.settings(data-toggle='coco-modal', data-target='play/modal/PlaySettingsModal', data-i18n="[title]play.settings")
button.btn.heroes(data-toggle='coco-modal', data-target='play/modal/PlayHeroesModal', data-i18n="[title]play.heroes")
button.btn.achievements(data-toggle='coco-modal', data-target='play/modal/PlayAchievementsModal', data-i18n="[title]play.achievements")
if me.isAdmin()
button.btn.account(data-toggle='coco-modal', data-target='play/modal/PlayAccountModal', data-i18n="[title]play.account")
button.btn.settings(data-toggle='coco-modal', data-target='play/modal/PlaySettingsModal', data-i18n="[title]play.settings")
else if me.get('anonymous')
button.btn.settings(data-toggle='coco-modal', data-target='modal/AuthModal', data-i18n="[title]play.settings")
else
a.btn.achievements(href="/user/#{me.getSlugOrID()}/stats", data-i18n="[title]play.achievements")
a.btn.account(href="/user/#{me.getSlugOrID()}", data-i18n="[title]play.account")
a.btn.settings(href='/account', data-i18n="[title]play.settings")
.old-levels
a(href="/play-old", data-i18n="play.older_campaigns").header-font Older Campaigns
.user-status.header-font
if me.get('anonymous')
span.spr(data-i18n="play.anonymous_player") Anonymous Player
button.btn.btn-default.btn-flat.btn-sm(data-toggle='coco-modal', data-target='modal/AuthModal', data-i18n="login.log_in")
else
span.spr= me.get('name')
button#logout-button.btn.btn-default.btn-flat.btn-sm(data-i18n="login.log_out") Log Out

View file

@ -77,7 +77,7 @@ module.exports = class WorldMapView extends RootView
super()
@onWindowResize()
unless application.isIPadApp
_.defer => @$el.find('.game-controls button').tooltip() # Have to defer or i18n doesn't take effect.
_.defer => @$el.find('.game-controls .btn').tooltip() # Have to defer or i18n doesn't take effect.
@$el.find('.level').tooltip()
onSessionsLoaded: (e) ->