transferred Code Ocean from original repository to GitHub
This commit is contained in:
17
app/views/hints/_form.html.slim
Normal file
17
app/views/hints/_form.html.slim
Normal file
@@ -0,0 +1,17 @@
|
||||
= form_for(@hint, multipart: true, url: execution_environment_hints_path(params[:execution_environment_id])) do |f|
|
||||
= render('shared/form_errors', object: @hint)
|
||||
.form-group
|
||||
= f.label(:name)
|
||||
= f.text_field(:name, class: 'form-control', required: true)
|
||||
.form
|
||||
= f.label(:locale)
|
||||
= f.select(:locale, I18n.available_locales.map { |locale| [t("locales.#{locale}"), locale] }, {}, class: 'form-control')
|
||||
.form-group
|
||||
= f.label(:message)
|
||||
= f.text_field(:message, class: 'form-control', placeholder: "'$2' has no method '$1'.", required: true)
|
||||
.help-block = t('.hints.message')
|
||||
.form-group
|
||||
= f.label(:regular_expression)
|
||||
= f.text_field(:regular_expression, class: 'form-control', placeholder: 'undefined method (\w+) for (\w+)', required: true)
|
||||
.help-block = t('.hints.regular_expression')
|
||||
.actions = render('shared/submit_button', f: f, object: @hint)
|
3
app/views/hints/edit.html.slim
Normal file
3
app/views/hints/edit.html.slim
Normal file
@@ -0,0 +1,3 @@
|
||||
h1 = @hint
|
||||
|
||||
= render('form')
|
19
app/views/hints/index.html.slim
Normal file
19
app/views/hints/index.html.slim
Normal file
@@ -0,0 +1,19 @@
|
||||
h1 = Hint.model_name.human(count: 2)
|
||||
|
||||
.table-responsive
|
||||
table.table
|
||||
thead
|
||||
tr
|
||||
th = t('activerecord.attributes.hint.name')
|
||||
th = t('activerecord.attributes.hint.locale')
|
||||
th colspan=3 = t('shared.actions')
|
||||
tbody
|
||||
- @hints.each do |hint|
|
||||
tr
|
||||
td = hint.name
|
||||
td = t("locales.#{hint.locale}")
|
||||
td = link_to(t('shared.show'), execution_environment_hint_path(params[:execution_environment_id], hint.id))
|
||||
td = link_to(t('shared.edit'), edit_execution_environment_hint_path(params[:execution_environment_id], hint.id))
|
||||
td = link_to(t('shared.destroy'), execution_environment_hint_path(params[:execution_environment_id], hint.id), data: {confirm: t('shared.confirm_destroy')}, method: :delete)
|
||||
|
||||
p = render('shared/new_button', model: Hint, path: new_execution_environment_hint_path(params[:execution_environment_id]))
|
3
app/views/hints/new.html.slim
Normal file
3
app/views/hints/new.html.slim
Normal file
@@ -0,0 +1,3 @@
|
||||
h1 = t('shared.new_model', model: Hint.model_name.human)
|
||||
|
||||
= render('form')
|
8
app/views/hints/show.html.slim
Normal file
8
app/views/hints/show.html.slim
Normal file
@@ -0,0 +1,8 @@
|
||||
h1
|
||||
= @hint
|
||||
= render('shared/edit_button', object: @hint, path: edit_execution_environment_hint_path(params[:execution_environment_id], @hint.id))
|
||||
|
||||
= row(label: 'hint.name', value: @hint.name)
|
||||
= row(label: 'hint.locale', value: t("locales.#{@hint.locale}"))
|
||||
= row(label: 'hint.message', value: @hint.message)
|
||||
= row(label: 'hint.regular_expression', value: code_tag(@hint.regular_expression))
|
Reference in New Issue
Block a user