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

@@ -19,5 +19,5 @@
models: [ErrorTemplate, ErrorTemplateAttribute], cached: true)
= render('navigation_submenu', title: t('navigation.sections.files'), models: [FileType, FileTemplate],
cached: true)
= render('navigation_submenu', title: t('navigation.sections.integrations'), models: [Consumer],
= render('navigation_submenu', title: t('navigation.sections.integrations'), models: [Consumer, CodeharborLink],
cached: true)

View File

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

View File

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

View File

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

View File

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

View File

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

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))

View File

@@ -7,3 +7,9 @@ h1
= row(label: 'internal_user.consumer', value: @user.consumer ? link_to_if(policy(@user.consumer).show?, @user.consumer, @user.consumer) : nil)
= row(label: 'internal_user.role', value: t("users.roles.#{@user.role}"))
= row(label: 'internal_user.activated', value: @user.activated?)
- if @user.codeharbor_link.nil?
= row(label: 'codeharbor_link.new', value: link_to(t('codeharbor_link.new'), codeharbor_link_new_path, class: 'btn btn-secondary'))
- else
= row(label: 'codeharbor_link.edit', value: link_to(t('codeharbor_link.edit'), edit_codeharbor_link_path(@user.codeharbor_link), class: 'btn btn-secondary'))