mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-11-18 15:13:21 +08:00
112 lines
5.5 KiB
Text
112 lines
5.5 KiB
Text
<div class="panel panel-default module-large
|
|
<%= get_task_alert_color(my_module) %>
|
|
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, protocols_my_module_path(my_module) %>
|
|
</h3>
|
|
</div>
|
|
|
|
<div class="panel-body">
|
|
<% if can_edit_module(my_module) && can_edit_modules(my_module.experiment) %>
|
|
<%= 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 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 task-card-view-info" 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 task-card-view-users" 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>
|
|
<span class="badge badge-indicator users-badge-indicator <%= 'hidden' unless my_module.users.count.positive? %>"
|
|
data-linked-id="<%= my_module.id %>">
|
|
<%= my_module.users.count %>
|
|
</span>
|
|
</a>
|
|
</li>
|
|
<% end %>
|
|
<% if can_view_module_activities(my_module) %>
|
|
<li role="presentation">
|
|
<a class="btn btn-link task-card-view-activities" 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>
|
|
</a>
|
|
</li>
|
|
<% end %>
|
|
<% if can_view_module_comments(my_module) %>
|
|
<li role="presentation">
|
|
<a class="btn btn-link task-card-view-comments" 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 comments-badge-indicator <%= 'hidden' unless my_module.task_comments.count.positive? %>"
|
|
data-linked-id="<%= my_module.id %>">
|
|
<%= my_module.task_comments.count %>
|
|
</span>
|
|
</a>
|
|
</li>
|
|
<% end %>
|
|
<% if can_view_module_samples(my_module) %>
|
|
<li role="presentation">
|
|
<a class="btn btn-link task-card-view-samples" 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>
|
|
<% if my_module.samples.count.positive? %>
|
|
<span class="badge badge-indicator"><%= my_module.samples.count %></span>
|
|
<% end %>
|
|
</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>
|