scinote-web/app/views/canvas/full_zoom/_my_module.html.erb
2016-02-12 16:52:43 +01:00

110 lines
5.3 KiB
Text

<div class="panel panel-default module-large<%= " alert-red" if my_module.is_overdue? %><%= " alert-yellow" if my_module.is_one_day_prior? %>"
id="<%= my_module.id %>"
data-module-id="<%= my_module.id %>"
data-module-name="<%= my_module.name %>"
<% if my_module.my_module_group.present? %>
data-module-group="<%= my_module.my_module_group.id %>"
<% end %>
data-module-x="<%= my_module.x %>"
data-module-y="<%= my_module.y %>"
data-module-conns="<%= construct_module_connections(my_module) %>"
data-module-tags-url="<%= my_module_my_module_tags_url(my_module, format: :json) %>"
data-module-users-tab-url="<%= my_module_user_my_modules_url(my_module_id: my_module.id, format: :json) %>">
<% if can_edit_tags_for_module(my_module) %>
<a class="edit-tags-link pull-right" data-remote="true" href="<%= my_module_tags_edit_url(my_module, format: :json) %>">
<% else %>
<span class="edit-tags-link pull-right">
<% end %>
<%= render partial: "canvas/tags.html.erb", locals: { my_module: my_module } %>
<% if can_edit_tags_for_module(my_module) %>
</a>
<% else %>
</span>
<% end %>
<div class="panel-heading">
<h3 class="panel-title">
<%= link_to_if can_view_module(my_module), my_module.name, steps_my_module_path(my_module) %>
</h3>
</div>
<div class="panel-body">
<div class="row">
<div class="col-xs-6">
<%= link_to_if can_edit_module(my_module), t("projects.canvas.full_zoom.due_date"), due_date_my_module_path(my_module, format: :json), remote: true, class: "due-date-link" %>
</div>
<div class="col-xs-6">
<% if can_edit_module(my_module) %>
<%= link_to due_date_my_module_path(my_module, format: :json), remote: true, class: "due-date-link due-date-refresh" do %>
<%= render partial: "my_modules/due_date_label.html.erb", locals: { my_module: my_module } %>
<% end %>
<% else %>
<%= render partial: "my_modules/due_date_label.html.erb", locals: { my_module: my_module } %>
<% end %>
</div>
</div>
</div>
<div class="panel-footer panel-footer-scinote buttons-container">
<ul class="nav nav-tabs nav-tabs-less" role="tablist">
<% if can_view_module_info(my_module) %>
<li role="presentation">
<a class="btn btn-link" href="<%= my_module_url(id: my_module.id, format: :json) %>" aria-controls="<%= my_module.id %>_info" role="tab" data-remote="true">
<span class="glyphicon glyphicon-info-sign" aria-hidden="true"></span>
</a>
</li>
<% end %>
<% if can_view_module_users(my_module) %>
<li role="presentation">
<a class="btn btn-link" href="<%= my_module_user_my_modules_url(my_module_id: my_module.id, format: :json) %>" aria-controls="<%= my_module.id %>_users" role="tab" data-remote="true">
<span class="glyphicon glyphicon-user" aria-hidden="true"></span>
</a>
</li>
<% end %>
<% if can_view_module_activities(my_module) %>
<li role="presentation">
<a class="btn btn-link" href="<%= activities_tab_my_module_url(id: my_module.id, format: :json) %>" aria-controls="<%= my_module.id %>_activities" role="tab" data-remote="true">
<span class="glyphicon glyphicon-equalizer" aria-hidden="true"></span>
<!--<span class="badge badge-indicator">3</span>-->
</a>
</li>
<% end %>
<% if can_view_module_comments(my_module) %>
<li role="presentation">
<a class="btn btn-link" href="<%= my_module_my_module_comments_url(my_module_id: my_module.id, format: :json) %>" aria-controls="<%= my_module.id %>_comments" role="tab" data-remote="true">
<span class="glyphicon glyphicon-comment" aria-hidden="true"></span>
<!--<span class="badge badge-indicator">3</span>-->
</a>
</li>
<% end %>
<% if can_view_module_samples(my_module) %>
<li role="presentation">
<a class="btn btn-link" href="<%= my_module_sample_my_modules_url(my_module_id: my_module.id, format: :json) %>" aria-controls="<%= my_module.id %>_samples" role="tab" data-remote="true">
<span class="glyphicon glyphicon-tint" aria-hidden="true"></span>
<span class="badge badge-indicator"><%= my_module.samples.count %></span>
</a>
</li>
<% end %>
</ul>
<!-- Tab panes -->
<div class="tab-content">
<% if can_view_module_info(my_module) %>
<div role="tabpanel" class="tab-pane" id="<%= my_module.id %>_info" data-contents="info"></div>
<% end %>
<% if can_view_module_users(my_module) %>
<div role="tabpanel" class="tab-pane" id="<%= my_module.id %>_users" data-contents="users"></div>
<% end %>
<% if can_view_module_activities(my_module) %>
<div role="tabpanel" class="tab-pane" id="<%= my_module.id %>_activities" data-contents="activities"></div>
<% end %>
<% if can_view_module_comments(my_module) %>
<div role="tabpanel" class="tab-pane" id="<%= my_module.id %>_comments" data-contents="comments"></div>
<% end %>
<% if can_view_module_samples(my_module) %>
<div role="tabpanel" class="tab-pane" id="<%= my_module.id %>_samples" data-contents="samples"></div>
<% end %>
</div>
</div>
</div>