Remove Info tab and change comment title

This commit is contained in:
Mojca Lorber 2016-09-29 14:37:29 +02:00
parent 5d905f0094
commit c9fbf845f1
3 changed files with 89 additions and 92 deletions

View file

@ -49,3 +49,7 @@
padding-right: 15px; padding-right: 15px;
position: relative; position: relative;
} }
.step-comment .col-xs-12 {
float: none;
}

View file

@ -1,5 +1,7 @@
<hr> <hr>
<h5 class="text-center"><%= t('protocols.steps.comments_tab') %></h5> <div class="col-xs-12"">
<strong><%= t('protocols.steps.comments_tab') %></strong>
</div>
<hr> <hr>
<ul class="no-style double-line content-comments"> <ul class="no-style double-line content-comments">
<% if @comments.length == @per_page %> <% if @comments.length == @per_page %>

View file

@ -32,110 +32,101 @@
<div class="panel-collapse collapse" id="step-panel-<%= step.id %>" role="tabpanel"> <div class="panel-collapse collapse" id="step-panel-<%= step.id %>" role="tabpanel">
<div class="panel-body"> <div class="panel-body">
<% if @protocol.in_module? %> <% if @protocol.in_module? %>
<ul class="nav nav-tabs">
<li role="presentation" class="active">
<a class="step-info-tab" href="#step-info-<%= step.id %>" data-toggle="tab"><span class="glyphicon glyphicon-info-sign"></span>
<%= t("protocols.steps.info_tab") %></a>
</li>
</ul>
<div class="tab-content step-container">
<div class="tab-pane active" role="tabpanel" id="step-info-<%= step.id %>">
<div class="row">
<% if step.description.blank? %> <div class="row">
<em><%= t("protocols.steps.no_description") %></em> <% if step.description.blank? %>
<% else %> <em><%= t("protocols.steps.no_description") %></em>
<%= step.description %> <% else %>
<% end %> <%= step.description %>
<hr> <% end %>
<div class="row"> <hr>
<% unless step.tables.blank? then %> <div class="row">
<div class="col-xs-12"> <% unless step.tables.blank? then %>
<strong><%= t("protocols.steps.tables") %></strong> <div class="col-xs-12">
<% step.tables.each do |table| %> <strong><%= t("protocols.steps.tables") %></strong>
<div data-role="hot-table" class="hot-table"> <% step.tables.each do |table| %>
<%= hidden_field(table, :contents, value: table.contents_utf_8, class: "hot-contents") %> <div data-role="hot-table" class="hot-table">
<div data-role="step-hot-table" class="step-result-hot-table"></div> <%= hidden_field(table, :contents, value: table.contents_utf_8, class: "hot-contents") %>
</div> <div data-role="step-hot-table" class="step-result-hot-table"></div>
<% end %> </div>
</div> <% end %>
<% end %> </div>
<% assets = ordered_assets(step) %> <% end %>
<% unless assets.blank? then %> <% assets = ordered_assets(step) %>
<div class="col-xs-12"> <% unless assets.blank? then %>
<strong><%= t("protocols.steps.files") %></strong> <div class="col-xs-12">
<ul> <strong><%= t("protocols.steps.files") %></strong>
<% assets.each do |asset| %> <ul>
<li> <% assets.each do |asset| %>
<% if can_view_or_download_step_assets(@protocol) %> <li>
<% if asset.file_present %> <% if can_view_or_download_step_assets(@protocol) %>
<%= link_to download_asset_path(asset), data: {no_turbolink: true, id: true, status: "asset-present"} do %> <% if asset.file_present %>
<%= image_tag preview_asset_path(asset) if asset.is_image? %> <%= link_to download_asset_path(asset), data: {no_turbolink: true, id: true, status: "asset-present"} do %>
<p><%= truncate(asset.file_file_name, length: 50) %></p>
<% end %>
<% else %>
<%= asset_loading_span(asset) %>
<% end %>
<% else %>
<%= image_tag preview_asset_path(asset) if asset.is_image? %> <%= image_tag preview_asset_path(asset) if asset.is_image? %>
<p><%= truncate(asset.file_file_name, length: 50) %></p> <p><%= truncate(asset.file_file_name, length: 50) %></p>
<% end %> <% end %>
</li> <% else %>
<% end %> <%= asset_loading_span(asset) %>
</ul>
</div>
<% end %>
<% unless step.checklists.blank? then %>
<div class="col-xs-12">
<% step.checklists.each do |checklist| %>
<strong><%= checklist.name %></strong>
<% if checklist.checklist_items.empty? %>
</br>
<%= t("protocols.steps.empty_checklist") %>
</br>
<% else %>
<% ordered_checklist_items(checklist).each do |checklist_item| %>
<div class="checkbox" <%= @protocol.in_module? ? "data-action=check-item" : "" %>>
<label>
<% if @protocol.in_module? %>
<input type="checkbox" value="" data-link-url="<%=checklistitem_state_step_path(step) %>" data-id="<%= checklist_item.id %>" <%= "checked" if checklist_item.checked? %> />
<% else %>
<input type="checkbox" value="" disabled="disabled" />
<% end %>
<%= checklist_item.text %>
</label>
</div>
<% end %> <% end %>
<% else %>
<%= image_tag preview_asset_path(asset) if asset.is_image? %>
<p><%= truncate(asset.file_file_name, length: 50) %></p>
<% end %> <% end %>
<% end %> </li>
</div> <% end %>
<% end %> </ul>
</div> </div>
<% end %>
<% if @protocol.in_module? %> <% unless step.checklists.blank? then %>
<% if !step.completed? and can_complete_step_in_protocol(@protocol) %> <div class="col-xs-12">
<div data-action="complete-step" class="pull-right" data-link-url="<%= toggle_step_state_step_path(step)%>"> <% step.checklists.each do |checklist| %>
<button class="btn btn-primary"><%= t("protocols.steps.options.complete_title") %></button> <strong><%= checklist.name %></strong>
</div> <% if checklist.checklist_items.empty? %>
<% elsif step.completed? and can_uncomplete_step_in_protocol(@protocol) %> </br>
<div data-action="uncomplete-step" class="pull-right" data-link-url="<%= toggle_step_state_step_path(step)%>"> <%= t("protocols.steps.empty_checklist") %>
<button class="btn btn-default"><%= t("protocols.steps.options.uncomplete_title") %></button> </br>
</div> <% else %>
<% ordered_checklist_items(checklist).each do |checklist_item| %>
<div class="checkbox" <%= @protocol.in_module? ? "data-action=check-item" : "" %>>
<label>
<% if @protocol.in_module? %>
<input type="checkbox" value="" data-link-url="<%=checklistitem_state_step_path(step) %>" data-id="<%= checklist_item.id %>" <%= "checked" if checklist_item.checked? %> />
<% else %>
<input type="checkbox" value="" disabled="disabled" />
<% end %>
<%= checklist_item.text %>
</label>
</div>
<% end %>
<% end %>
<% end %> <% end %>
<% end %>
</div>
<% if can_view_step_comments(@protocol) %>
<div class="row">
<div class="step-comment"
id="step-comments-<%= step.id %>"
data-href="<%= url_for step_step_comments_path(step_id: step.id, format: :json) %>">
</div>
</div> </div>
<% end %> <% end %>
</div> </div>
<% if @protocol.in_module? %>
<% if !step.completed? and can_complete_step_in_protocol(@protocol) %>
<div data-action="complete-step" class="pull-right" data-link-url="<%= toggle_step_state_step_path(step)%>">
<button class="btn btn-primary"><%= t("protocols.steps.options.complete_title") %></button>
</div>
<% elsif step.completed? and can_uncomplete_step_in_protocol(@protocol) %>
<div data-action="uncomplete-step" class="pull-right" data-link-url="<%= toggle_step_state_step_path(step)%>">
<button class="btn btn-default"><%= t("protocols.steps.options.uncomplete_title") %></button>
</div>
<% end %>
<% end %>
</div> </div>
<% if can_view_step_comments(@protocol) %>
<div class="row">
<div class="step-comment"
id="step-comments-<%= step.id %>"
data-href="<%= url_for step_step_comments_path(step_id: step.id, format: :json) %>">
</div>
</div>
<% end %>
<% end %> <% end %>
</div> </div>
</div> </div>