scinote-web/app/views/protocols/_header.html.erb
aignatov-bio 71b3228310
Update protocol preview style [SCI-3416] (#1729)
* Update protocol appearance
2019-05-13 10:45:12 +02:00

93 lines
3.8 KiB
Text

<div class="page-header">
<% if can_manage_protocol_in_repository?(@protocol) %>
<a class="edit-name-link" data-action="edit-name" data-role="name-refresh" data-remote="true" href="<%= edit_name_modal_protocol_path(@protocol, format: :json) %>" style="color: inherit;">
<%= render partial: "protocols/header/name_label.html.erb" %>
</a>
<% else %>
<%= render partial: "protocols/header/name_label.html.erb" %>
<% end %>
</div>
<div class="row protocol-info">
<div class="col-xs-6 col-sm-4 col-md-4">
<div class="badge-icon">
<span class="fas fa-calendar-alt"></span>
</div>
<div class="well well-sm">
<span class="hidden-xs hidden-sm hidden-md"><%=t "protocols.header.created_at" %>:</span>
<strong><%= l(@protocol.created_at, format: :full) %></strong>
</div>
</div>
<div class="col-xs-6 col-sm-4 col-md-4">
<div class="badge-icon">
<span class="fas fa-calendar-alt"></span>
</div>
<div class="well well-sm">
<span class="hidden-xs hidden-sm hidden-md"><%=t "protocols.header.updated_at" %>:</span>
<strong data-role="updated-at-refresh"><%= render partial: "protocols/header/updated_at_label.html.erb" %></strong>
</div>
</div>
<div class="col-xs-12 col-sm-4 col-md-4">
<div class="badge-icon">
<span class="fas fa-user"></span>
</div>
<div class="well well-sm">
<span class="hidden-xs hidden-sm hidden-md"><%=t "protocols.header.added_by" %>:</span>
<strong><%= @protocol.added_by.full_name %></strong>
</div>
</div>
<div class="col-xs-12 col-sm-8 col-md-8">
<div class="badge-icon">
<% if can_manage_protocol_in_repository?(@protocol) %>
<a data-action="edit-keywords" data-remote="true" href="<%= edit_keywords_modal_protocol_path(@protocol, format: :json) %>" style="color: inherit;">
<span class="fas fa-font"></span>
</a>
<% else %>
<span class="fas fa-font"></span>
<% end %>
</div>
<div class="well well-sm">
<span class="hidden-xs hidden-sm hidden-md"><%=t "protocols.header.keywords" %>:</span>
<% if can_manage_protocol_in_repository?(@protocol) %>
<%= link_to edit_keywords_modal_protocol_path(@protocol, format: :json), remote: true, style: "color: inherit;", data: { action: "edit-keywords", role: "keywords-refresh" } do %>
<%= render partial: "protocols/header/keywords_label.html.erb" %>
<% end %>
<% else %>
<%= render partial: "protocols/header/keywords_label.html.erb" %>
<% end %>
</div>
</div>
<div class="col-xs-12 col-sm-4 col-md-4">
<div class="badge-icon">
<% if can_manage_protocol_in_repository?(@protocol) %>
<a data-action="edit-authors" data-remote="true" href="<%= edit_authors_modal_protocol_path(@protocol, format: :json) %>" style="color: inherit;">
<span class="fas fa-graduation-cap"></span>
</a>
<% else %>
<span class="fas fa-graduation-cap"></span>
<% end %>
</div>
<div class="well well-sm">
<span class="hidden-xs hidden-sm hidden-md"><%=t "protocols.header.authors" %>:</span>
<% if can_manage_protocol_in_repository?(@protocol) %>
<%= link_to edit_authors_modal_protocol_path(@protocol, format: :json), remote: true, style: "color: inherit;", data: { action: "edit-authors", role: "authors-refresh" } do %>
<%= render partial: "protocols/header/authors_label.html.erb" %>
<% end %>
<% else %>
<%= render partial: "protocols/header/authors_label.html.erb" %>
<% end %>
</div>
</div>
<div class="col-xs-12 col-sm-12 col-md-12 protocol-description">
<%= render partial: "protocols/header/description_label.html.erb", locals: {edit_mode: true} %>
</div>
</div>
<%= render partial: "protocols/header/edit_metadata_modal.html.erb" %>
<%= javascript_include_tag "protocols/header" %>