app/views/georgia/media/edit.html.erb in georgia-0.7.8 vs app/views/georgia/media/edit.html.erb in georgia-0.8.0

- old
+ new

@@ -5,29 +5,15 @@ <%= active_facet_list(:tg) %> <div class="row"> <div class="col-md-9"> - <h2> - <%= link_to @asset.filename, @asset.url %> - <% unless @asset.is_a?(Ckeditor::Picture) %> - <%= link_to icon_tag('link'), @asset.url, title: @asset.url, target: '_blank', class: 'btn btn-default' %> - <% end -%> - </h2> + <h2><%= @asset.filename %></h2> - <% if @asset.is_a?(Ckeditor::Picture) %> - <div class="media-editable js-media-editable"> - <div class="media-actions" style='display:none;'> - <%= link_to icon_tag('link'), @asset.url, class: 'btn btn-default btn--square', target: '_blank' %> - <%= simple_form_for @asset, as: :asset, url: media_path(@asset), html: {class: 'form-asset-replace'} do |f| %> - <span class="btn btn-primary btn-file-upload btn--square"> - <span class='btn-file-upload-text'><%= icon_tag 'refresh' %> Replace</span> - <%= f.input_field :data, as: :file, class: 'input-file-upload js-replace-asset' %> - </span> - <% end -%> - </div> - <%= image_tag @asset.url(:content), title: @asset.filename, class: 'media-image--inline' %> + <% if @asset.image? %> + <div class="media-editable"> + <%= image_tag @asset.url, title: @asset.filename, class: 'media-image--inline' %> </div> <% end -%> </div> <div class="col-md-3"> <div class="panel panel-default"> @@ -44,30 +30,49 @@ <b>Height</b>: <%= @asset.height %>px<br /> <% end -%> <b>Last updated: </b> <em><%= @asset.updated_at.strftime('%F') %></em> </p> <p> - <%= simple_form_for @asset, as: :asset, url: media_path(@asset) do |f| %> - <%= f.input :tag_list, input_html: {class: 'js-token-input'} %> - <%= button_to_save if can?(:update, @asset) %> - <%= link_to_delete media_path(@asset) if can? :destroy, @asset %> - <% end -%> + <%= link_to "#{icon_tag('link')} Link to original file".html_safe, @asset.url, title: @asset.url, target: '_blank', class: 'btn btn-default' %> </p> + <% if @asset.is_a?(Ckeditor::Picture) and policy(@asset).update? %> + <div class="media-editable js-media-editable"> + <%= simple_form_for @asset, as: :asset, url: media_path(@asset), html: {class: 'form-asset-replace'} do |f| %> + <span class="btn btn-primary btn-file-upload"> + <span class='btn-file-upload-text'><%= icon_tag 'refresh' %> Replace File</span> + <%= f.input_field :data, as: :file, class: 'input-file-upload js-replace-asset' %> + </span> + <% end -%> + </div> + <% end -%> </div> </div> - <% if @asset.is_a?(Ckeditor::Picture) %> + <%= simple_form_for @asset, as: :asset, url: media_path(@asset) do |f| %> + <div class="panel panel-default"> <div class="panel-heading"> - <h3 class="panel-title">Featured in <%= pluralize(@asset.pages.length, 'page') %></h3> + <h3 class="panel-title">Tags</h3> </div> <div class="panel-body"> - <ul> - <% @asset.pages.each do |page| %> - <li><%= link_to page.title, [:edit, page] %></li> - <% end -%> - </ul> + <%= f.input :tag_list, as: :text, label: false, input_html: {class: 'js-taggable', rows: 1} %> </div> </div> + <% if @asset.is_a?(Ckeditor::Picture) %> + <div class="panel panel-default"> + <div class="panel-heading"> + <h3 class="panel-title">Featured in <%= pluralize(@asset.pages.length, 'page') %></h3> + </div> + <div class="panel-body"> + <ul> + <% @asset.pages.each do |page| %> + <li><%= link_to page.title, [:edit, page] %></li> + <% end -%> + </ul> + </div> + </div> + <% end -%> + <%= button_to_save if policy(@asset).update? %> + <%= link_to_delete media_path(@asset) if policy(@asset).destroy? %> <% end -%> </div> </div> </section> \ No newline at end of file