diff --git a/admin/app/helpers/push_type/admin_helper.rb b/admin/app/helpers/push_type/admin_helper.rb index 6375ec64..4ebdeb54 100644 --- a/admin/app/helpers/push_type/admin_helper.rb +++ b/admin/app/helpers/push_type/admin_helper.rb @@ -11,5 +11,9 @@ def ficon(kind, label = nil, opts = {}) [el, label].compact.join(' ').html_safe end + def node_url(node) + "http://#{request.host_with_port}/#{node.parent.permalink + '/' if node.parent}#{node.slug}" + end + end end diff --git a/admin/app/views/push_type/admin/nodes/_form_fields.html.haml b/admin/app/views/push_type/admin/nodes/_form_fields.html.haml index 41ca4b4f..667bc783 100644 --- a/admin/app/views/push_type/admin/nodes/_form_fields.html.haml +++ b/admin/app/views/push_type/admin/nodes/_form_fields.html.haml @@ -14,10 +14,12 @@ .columns{ :'v-bind:class' => '{visible: node.slug}' } %span.key Permalink %span.value - %span.show-for-medium-up http://#{ request.host_with_port }/ - = content_tag :span, @node.parent.permalink+'/' if @node.parent - %span {{ node.slug }} + %span.show-for-medium-up + = node_url(@node) %button.button.tiny.radius.secondary{ data: { dropdown: 'slug-field' } } Edit + - if @node.published? + %a.button.tiny.radius{class: "primary", href: node_url(@node)} + Live page #slug-field.f-dropdown.content{ data: { dropdown: { content: true } } } = f.label :slug = f.text_field :slug, :'v-model' => 'node.slug', :'v-on:keyup' => 'cleanSlug'