Fix error, submission, hints and help views

This commit is contained in:
Sebastian Serth
2018-09-30 13:16:07 +02:00
parent 15b1670511
commit 9666683bd7
18 changed files with 88 additions and 79 deletions

View File

@@ -1,6 +1,6 @@
- if current_user.try(:internal_user?)
ul.breadcrumb
- if model = Kernel.const_get(controller_name.classify) rescue nil
- if model = Kernel.const_get(controller_path.classify) rescue nil
- object = model.find_by(id: params[:id])
- if model.try(:nested_resource?)
li = model.model_name.human(count: 2)

View File

@@ -10,7 +10,7 @@
li = link_to(t('breadcrumbs.statistics.show'), statistics_path)
li.divider
= render('navigation_submenu', title: t('activerecord.models.exercise.other'),
models: [Exercise, ExerciseCollection, ProxyExercise, Tag], link: exercises_path, cached: true)
models: [Exercise, ExerciseCollection, ProxyExercise, Tag, Submission], link: exercises_path, cached: true)
= render('navigation_submenu', title: t('navigation.sections.users'), models: [InternalUser, ExternalUser],
cached: true)
= render('navigation_collection_link', model: ExecutionEnvironment, cached: true)

View File

@@ -1,10 +1,10 @@
h1 = ::Error.model_name.human(count: 2)
h1 = CodeOcean::Error.model_name.human(count: 2)
.table-responsive
table.table
thead
tr
th = t('.count')
th = t('errors.index.count')
th = t('activerecord.attributes.error.message')
th = t('shared.created_at')
th = t('shared.actions')

View File

@@ -1,4 +1,4 @@
h1 = ::Error.model_name.human
h1 = CodeOcean::Error.model_name.human
= row(label: 'error.message', value: @error.message)
= row(label: 'shared.created_at', value: l(@error.created_at, format: :short))

View File

@@ -1 +1,3 @@
= link_to(t('shared.edit'), local_assigns.fetch(:path, send(:"edit_#{object.class.name.underscore}_path", object)), class: 'btn btn-default pull-right')
// default value for fetch will always be evaluated even if it is not returned
- link_target = local_assigns.fetch(:path, false) || send(:"edit_#{object.class.name.underscore}_path", object)
= link_to(t('shared.edit'), link_target, class: 'btn btn-default pull-right')

View File

@@ -1,4 +1,6 @@
- if policy(model).new?
a.btn.btn-success href=local_assigns.fetch(:path, send(:"new_#{model.model_name.singular}_path"))
// default value for fetch will always be evaluated even if it is not returned
- href_target = local_assigns.fetch(:path, false) || send(:"new_#{model.model_name.singular}_path")
a.btn.btn-success href=href_target
i.fa.fa-plus
= t('shared.new_model', model: model.model_name.human)