Added breadcrumbs for Editor Search Results, Thang Editor and Article Editor pages.

This commit is contained in:
Tay Yang Shun 2014-03-01 14:47:31 +08:00
parent 7855ca02d8
commit f43dd2f3ff
4 changed files with 32 additions and 3 deletions

View file

@ -1,6 +1,15 @@
extends /templates/base
block content
div
ol.breadcrumb
li
a(href="/editor", data-i18n="editor.main_title") CodeCombat Editors
li
a(href="/editor/thang", data-i18n="editor.article_title") Article Editor
li.active
| #{article.attributes.name}
button(data-toggle="coco-modal", data-target="modal/revert", data-i18n="revert.revert").btn.btn-primary#revert-button Revert
button(data-i18n="article.edit_btn_preview").btn.btn-primary#preview-button Preview
button(data-toggle="coco-modal", data-target="modal/save_version", data-i18n="common.save").btn.btn-primary#save-button Save

View file

@ -1,6 +1,14 @@
extends /templates/base
block content
div
ol.breadcrumb
li
a(href="/editor", data-i18n="editor.main_title") CodeCombat Editors
li
a(href="/editor/thang", data-i18n="editor.thang_title") Thang Editor
li.active
| #{thangType.attributes.name}
img#portrait.img-thumbnail

View file

@ -1,5 +1,12 @@
extends /templates/base
block content
div
ol.breadcrumb
li
a(href="/editor", data-i18n="editor.main_title") CodeCombat Editors
li.active(data-i18n="#{currentEditor}")
| #{currentEditor}
if me.get('anonymous')
a.btn.btn-primary.open-modal-button(data-toggle="coco-modal", data-target="modal/signup", role="button") Sign Up to Create a New #{modelLabel}
else

View file

@ -27,9 +27,14 @@ module.exports = class ThangTypeHomeView extends View
'hidden.bs.modal #new-model-modal': 'onModalHidden'
getRenderData: ->
c = super()
c.modelLabel = @modelLabel
c
context = super()
context.modelLabel = @modelLabel
switch @modelLabel
when 'Thang Type'
context.currentEditor = 'editor.thang_title'
when 'Article'
context.currentEditor = 'editor.article_title'
context
constructor: (options) ->
@runSearch = _.debounce(@runSearch, 500)