readding codeharbor_link views and actions

This commit is contained in:
Karol
2019-08-26 19:06:52 +02:00
parent ecabd9d05c
commit ec48d1f447
20 changed files with 136 additions and 127 deletions

View File

@ -0,0 +1,6 @@
= form_for(@codeharbor_link) do |f|
= render('shared/form_errors', object: @codeharbor_link)
.form-group
= f.label(:oauth2token)
= f.text_field(:oauth2token, class: 'form-control', required: true)
.actions = render('shared/submit_button', f: f, object: @codeharbor_link)

View File

@ -0,0 +1,3 @@
h1 = @codeharbor_link
= render('form')

View File

@ -0,0 +1,18 @@
h1 = CodeharborLink.model_name.human(count: 2)
.table-responsive
table.table
thead
tr
th = t('activerecord.attributes.codeharbor_link.oauth2token')
th colspan=3 = t('shared.actions')
tbody
- @codeharbor_links.each do |codeharbor_link|
tr
td = link_to_if(policy(codeharbor_link).show?, codeharbor_link.oauth2token, codeharbor_link)
td = link_to(t('shared.show'), codeharbor_link) if policy(codeharbor_link).show?
td = link_to(t('shared.edit'), edit_codeharbor_link_path(codeharbor_link)) if policy(codeharbor_link).edit?
td = link_to(t('shared.destroy'), codeharbor_link, data: {confirm: t('shared.confirm_destroy')}, method: :delete) if policy(codeharbor_link).destroy?
= render('shared/pagination', collection: @codeharbor_links)
p = render('shared/new_button', model: CodeharborLink)

View File

@ -0,0 +1,3 @@
h1 = t('shared.new_model', model: CodeharborLink.model_name.human)
= render('form')

View File

@ -0,0 +1,7 @@
h1
= @codeharbor_link
= render('shared/edit_button', object: @codeharbor_link)
- %w[oauth2token].each do |attribute|
= row(label: "codeharbor_link.#{attribute}") do
= content_tag(:input, nil, class: 'form-control', readonly: true, value: @codeharbor_link.send(attribute))