2017-02-10 21:27:20 +08:00
|
|
|
<div class="panel panel-default module-large
|
2019-02-07 21:23:37 +08:00
|
|
|
<%= get_task_alert_color(my_module) %>"
|
2016-02-12 23:52:43 +08:00
|
|
|
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) %>"
|
2020-04-14 23:25:36 +08:00
|
|
|
data-module-users-tab-url="<%= index_old_my_module_user_my_modules_url(my_module_id: my_module.id, format: :json) %>"
|
2019-01-12 00:20:04 +08:00
|
|
|
data-module-tags-url="<%= my_module_tags_experiment_path(my_module.experiment, format: :json) %>">
|
2016-02-12 23:52:43 +08:00
|
|
|
|
2018-02-09 23:14:40 +08:00
|
|
|
<% if can_manage_module?(my_module) %>
|
2016-02-12 23:52:43 +08:00
|
|
|
<a class="edit-tags-link pull-right" data-remote="true" href="<%= my_module_tags_edit_url(my_module, format: :json) %>">
|
2018-02-09 23:14:40 +08:00
|
|
|
<%= render partial: "canvas/tags.html.erb", locals: { my_module: my_module } %>
|
2016-02-12 23:52:43 +08:00
|
|
|
</a>
|
|
|
|
<% else %>
|
2018-02-09 23:14:40 +08:00
|
|
|
<span class="edit-tags-link pull-right">
|
|
|
|
<%= render partial: "canvas/tags.html.erb", locals: { my_module: my_module } %>
|
2016-02-12 23:52:43 +08:00
|
|
|
</span>
|
|
|
|
<% end %>
|
|
|
|
|
|
|
|
<div class="panel-heading">
|
|
|
|
<h3 class="panel-title">
|
2018-01-29 18:36:36 +08:00
|
|
|
<%= link_to_if can_read_experiment?(my_module.experiment), my_module.name, protocols_my_module_path(my_module) %>
|
2016-02-12 23:52:43 +08:00
|
|
|
</h3>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="panel-body">
|
2020-03-17 00:55:35 +08:00
|
|
|
<% if !my_module.completed? && can_manage_module?(my_module) %>
|
2018-09-14 19:07:09 +08:00
|
|
|
<%= link_to due_date_my_module_path(my_module, format: :json), remote: true,
|
2020-04-28 18:30:43 +08:00
|
|
|
class: "due-date-link due-date-refresh" do %>
|
2020-03-17 00:55:35 +08:00
|
|
|
<%= render partial: "my_modules/card_due_date_label.html.erb", locals: { my_module: my_module, format: :full_date } %>
|
2017-02-10 21:27:20 +08:00
|
|
|
<% end %>
|
|
|
|
<% else %>
|
2020-03-17 00:55:35 +08:00
|
|
|
<%= render partial: "my_modules/card_due_date_label.html.erb", locals: { my_module: my_module, format: :full_date } %>
|
2017-02-10 21:27:20 +08:00
|
|
|
<% end %>
|
2016-02-12 23:52:43 +08:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="panel-footer panel-footer-scinote buttons-container">
|
|
|
|
<ul class="nav nav-tabs nav-tabs-less" role="tablist">
|
2018-02-09 23:14:40 +08:00
|
|
|
<% if can_read_experiment?(my_module.experiment) %>
|
2016-02-12 23:52:43 +08:00
|
|
|
<li role="presentation">
|
2020-04-14 23:25:36 +08:00
|
|
|
<a class="btn btn-link task-card-view-users" href="<%= index_old_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">
|
2018-05-22 22:55:58 +08:00
|
|
|
<span class="fas fa-users" aria-hidden="true"></span>
|
2017-05-08 23:32:55 +08:00
|
|
|
<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>
|
2016-02-12 23:52:43 +08:00
|
|
|
</a>
|
|
|
|
</li>
|
|
|
|
<li role="presentation">
|
2019-04-02 17:14:36 +08:00
|
|
|
<a class="btn btn-link task-card-view-activities" href="<%= activities_my_module_url(id: my_module.id) %>" aria-controls="<%= my_module.id %>_activities" role="tab">
|
2018-05-22 22:55:58 +08:00
|
|
|
<span class="fas fa-list" aria-hidden="true"></span>
|
2016-02-12 23:52:43 +08:00
|
|
|
</a>
|
|
|
|
</li>
|
|
|
|
<li role="presentation">
|
2017-05-10 16:33:34 +08:00
|
|
|
<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">
|
2018-05-22 22:55:58 +08:00
|
|
|
<span class="fas fa-comment" aria-hidden="true"></span>
|
2019-06-04 20:40:21 +08:00
|
|
|
<span id="comment-counter-<%= my_module.id %>" class="badge badge-indicator comments-badge-indicator <%= 'hidden' unless my_module.task_comments.count.positive? %>"
|
2017-05-08 23:32:55 +08:00
|
|
|
data-linked-id="<%= my_module.id %>">
|
|
|
|
<%= my_module.task_comments.count %>
|
|
|
|
</span>
|
2016-02-12 23:52:43 +08:00
|
|
|
</a>
|
|
|
|
</li>
|
|
|
|
<% end %>
|
|
|
|
</ul>
|
|
|
|
|
|
|
|
<!-- Tab panes -->
|
|
|
|
<div class="tab-content">
|
2018-02-09 23:14:40 +08:00
|
|
|
<% if can_read_experiment?(my_module.experiment) %>
|
2016-02-12 23:52:43 +08:00
|
|
|
<div role="tabpanel" class="tab-pane" id="<%= my_module.id %>_info" data-contents="info"></div>
|
|
|
|
<div role="tabpanel" class="tab-pane" id="<%= my_module.id %>_users" data-contents="users"></div>
|
|
|
|
<div role="tabpanel" class="tab-pane" id="<%= my_module.id %>_activities" data-contents="activities"></div>
|
|
|
|
<div role="tabpanel" class="tab-pane" id="<%= my_module.id %>_comments" data-contents="comments"></div>
|
|
|
|
<% end %>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|