codeharbor_links editable through own profile
This commit is contained in:
@@ -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, CodeharborLink],
|
||||
= render('navigation_submenu', title: t('navigation.sections.integrations'), models: [Consumer],
|
||||
cached: true)
|
||||
|
@@ -1,6 +1,28 @@
|
||||
= form_for(@codeharbor_link) do |f|
|
||||
= render('shared/form_errors', object: @codeharbor_link)
|
||||
.form-group
|
||||
= f.label(:push_url)
|
||||
= f.text_field :push_url, data: {toggle: 'tooltip', placement: 'bottom'}, title: t('codeharbor_link.info.push_url'), class: 'form-control'
|
||||
.form-group
|
||||
= f.label(:oauth2token)
|
||||
= f.text_field(:oauth2token, class: 'form-control', required: true)
|
||||
.actions = render('shared/submit_button', f: f, object: @codeharbor_link)
|
||||
.input-group
|
||||
= f.text_field(:oauth2token, data: {toggle: 'tooltip', placement: 'bottom'}, title: t('codeharbor_link.info.token'), class: 'form-control oauth2-token')
|
||||
.input-group-btn
|
||||
= button_tag t('codeharbor_link.generate'), type: 'button', class: 'generate-oauth2-token btn btn-default'
|
||||
.field-element.form-group
|
||||
= f.label(:client_id)
|
||||
.input-group
|
||||
= f.text_field(:client_id, data: {toggle: 'tooltip', placement: 'bottom'}, title: t('codeharbor_link.info.client_id'), class: 'form-control client-id')
|
||||
.input-group-btn
|
||||
= button_tag t('codeharbor_link.generate'), type: 'button', class: 'generate-client-id btn btn-default'
|
||||
.field-element.form-group
|
||||
= f.label(:client_secret)
|
||||
.input-group
|
||||
= f.text_field(:client_secret, data: {toggle: 'tooltip', placement: 'bottom'}, title: t('codeharbor_link.info.client_secret'), class: 'form-control client-secret')
|
||||
.input-group-btn
|
||||
= button_tag t('codeharbor_link.generate'), type: 'button', class: 'generate-client-secret btn btn-default'
|
||||
.actions
|
||||
= render('shared/submit_button', f: f, object: @codeharbor_link)
|
||||
- if @codeharbor_link.persisted?
|
||||
= link_to(t('codeharbor_link.delete'), codeharbor_link_path(@codeharbor_link), data: {confirm: t('shared.confirm_destroy')}, method: :delete, class: 'btn btn-danger pull-right')
|
||||
|
||||
|
@@ -1,3 +1,3 @@
|
||||
h1 = @codeharbor_link
|
||||
h1 = 'Codeharbor link'
|
||||
|
||||
= render('form')
|
||||
|
@@ -1,18 +0,0 @@
|
||||
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)
|
@@ -1,7 +0,0 @@
|
||||
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))
|
@@ -8,8 +8,9 @@ h1
|
||||
= 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.profile_label', value: @user.codeharbor_link.nil? ? link_to(t('codeharbor_link.new'), new_codeharbor_link_path, class: 'btn btn-secondary') : link_to(t('codeharbor_link.edit'), edit_codeharbor_link_path(@user.codeharbor_link), class: 'btn btn-secondary'))
|
||||
|
||||
= 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'))
|
||||
/ - if @user.codeharbor_link.nil?
|
||||
/ = row(label: 'codeharbor_link.profile_label', value: link_to(t('codeharbor_link.new'), codeharbor_link_new_path, class: 'btn btn-secondary'))
|
||||
/ - else
|
||||
/ = row(label: 'codeharbor_link.profile_label', value: link_to(t('codeharbor_link.edit'), edit_codeharbor_link_path(@user.codeharbor_link), class: 'btn btn-secondary'))
|
||||
|
Reference in New Issue
Block a user