Fix page title for students

This commit is contained in:
Sebastian Serth
2020-05-05 22:42:28 +02:00
parent 854d1dd032
commit 256d1033b2
2 changed files with 12 additions and 12 deletions

View File

@ -18,15 +18,14 @@
- title = "#{active_action} - #{application_name}" - title = "#{active_action} - #{application_name}"
- content_for :breadcrumbs do - content_for :breadcrumbs do
- if current_user.try(:admin?) or current_user.try(:teacher?) && !@embed_options[:hide_navbar] .container
.container ul.breadcrumb
ul.breadcrumb - if root_element.present?
- if root_element.present? li.breadcrumb-item = root_element
li.breadcrumb-item = root_element - if current_element.present?
- if current_element.present? li.breadcrumb-item = current_element
li.breadcrumb-item = current_element - title = "#{object} - #{title}"
- title = "#{object} - #{title}" - else
- else - title = "#{model.model_name.human(count: 2)} - #{title}"
- title = "#{model.model_name.human(count: 2)} - #{title}" li.breadcrumb-item.active = active_action
li.breadcrumb-item.active = active_action
- content_for :title, title - content_for :title, title

View File

@ -51,7 +51,8 @@ html lang='en'
= render('session') = render('session')
div data-controller=controller_name div data-controller=controller_name
= render('flash') = render('flash')
= yield(:breadcrumbs) - if current_user.try(:admin?) or current_user.try(:teacher?) && !@embed_options[:hide_navbar]
= yield(:breadcrumbs)
- if (controller_name == "exercises" && action_name == "implement") - if (controller_name == "exercises" && action_name == "implement")
.container-fluid .container-fluid
= yield = yield