2016-02-12 23:52:43 +08:00
|
|
|
<div class="panel panel-default module"
|
|
|
|
id="<%= my_module.id %>"
|
|
|
|
data-module-id="<%= my_module.id %>"
|
|
|
|
data-module-name="<%= my_module.name %>"
|
|
|
|
data-module-x="<%= my_module.x %>"
|
|
|
|
data-module-y="<%= my_module.y %>"
|
|
|
|
data-module-conns="<%= construct_module_connections(my_module) %>">
|
|
|
|
|
2018-02-19 21:47:36 +08:00
|
|
|
<% module_group = my_module.my_module_group %>
|
|
|
|
|
2016-02-12 23:52:43 +08:00
|
|
|
<div class="panel-heading">
|
|
|
|
|
|
|
|
<h3 class="panel-title"><%= my_module.name %></h3>
|
|
|
|
|
|
|
|
<div class="dropdown pull-right module-options">
|
|
|
|
<a class="dropdown-toggle" id="<%= my_module.id %>_options" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">
|
2018-07-09 19:13:44 +08:00
|
|
|
<span class="fas fa-caret-down" aria-hidden="true"></span>
|
2016-02-12 23:52:43 +08:00
|
|
|
</a>
|
2018-05-15 00:33:57 +08:00
|
|
|
<ul class="dropdown-menu custom-dropdown-menu no-scale" aria-labelledby="<%= my_module.id %>_options">
|
2021-09-14 17:08:35 +08:00
|
|
|
<% if can_manage_my_module?(my_module) %>
|
2016-02-12 23:52:43 +08:00
|
|
|
<li>
|
2020-07-24 23:00:42 +08:00
|
|
|
<a class="edit-module" href="" data-module-id="<%= my_module.id %>"><%= t('experiments.canvas.edit.edit_module') %></a>
|
2016-02-12 23:52:43 +08:00
|
|
|
</li>
|
|
|
|
<% end %>
|
2018-02-09 23:14:40 +08:00
|
|
|
<% if can_manage_experiment?(my_module.experiment) %>
|
2016-02-12 23:52:43 +08:00
|
|
|
<li>
|
2020-07-24 23:00:42 +08:00
|
|
|
<a class ="clone-module" href="" data-module-id="<%= my_module.id %>"><%= t('experiments.canvas.edit.clone_module') %></a>
|
2016-02-12 23:52:43 +08:00
|
|
|
</li>
|
|
|
|
<li <%= 'style=display:none;' if my_module.my_module_group.blank? %>>
|
2020-07-24 23:00:42 +08:00
|
|
|
<a class ="clone-module-group" href="" data-module-id="<%= my_module.id %>"><%= t('experiments.canvas.edit.clone_module_group') %></a>
|
2016-02-12 23:52:43 +08:00
|
|
|
</li>
|
|
|
|
<% end %>
|
2020-07-24 23:00:42 +08:00
|
|
|
<% if can_move_module?(my_module) %>
|
2016-08-17 19:48:02 +08:00
|
|
|
<li>
|
2020-07-24 23:00:42 +08:00
|
|
|
<a class="move-module" href="" data-module-id="<%= my_module.id %>"><%= t('experiments.canvas.edit.move_module') %></a>
|
2016-08-17 19:48:02 +08:00
|
|
|
</li>
|
2018-02-10 01:02:04 +08:00
|
|
|
<% end %>
|
2021-06-19 23:17:57 +08:00
|
|
|
<li>
|
|
|
|
<%= link_to t('experiments.canvas.edit.task_access'),
|
2021-09-14 17:08:35 +08:00
|
|
|
can_manage_my_module_users?(my_module) ? edit_access_permissions_project_experiment_my_module_path(my_module.experiment.project, my_module.experiment, my_module) : access_permissions_project_experiment_my_module_path(my_module.experiment.project, my_module.experiment, my_module),
|
2021-06-19 23:17:57 +08:00
|
|
|
data: { action: 'remote-modal'} %>
|
|
|
|
</li>
|
2020-09-07 20:54:49 +08:00
|
|
|
<% if module_group&.my_modules&.all? { |my_module| can_move_module?(my_module) } %>
|
2018-02-09 23:14:40 +08:00
|
|
|
<li>
|
2020-07-24 23:00:42 +08:00
|
|
|
<a class="move-module-group" href="" data-module-id="<%= my_module.id %>"><%= t('experiments.canvas.edit.move_module_group') %></a>
|
2016-08-19 23:11:17 +08:00
|
|
|
</li>
|
2018-02-09 23:14:40 +08:00
|
|
|
<% end %>
|
2021-09-14 17:08:35 +08:00
|
|
|
<% if can_archive_my_module?(my_module) %>
|
2016-02-12 23:52:43 +08:00
|
|
|
<li>
|
2020-07-24 23:00:42 +08:00
|
|
|
<a class="delete-module" href="" data-module-id="<%= my_module.id %>"><%= t('experiments.canvas.edit.delete_module') %></a>
|
2016-02-12 23:52:43 +08:00
|
|
|
</li>
|
2018-02-07 18:49:15 +08:00
|
|
|
<% end %>
|
2021-09-14 17:08:35 +08:00
|
|
|
<% if module_group&.my_modules&.all? { |my_module| can_archive_my_module?(my_module) } %>
|
2018-02-09 23:14:40 +08:00
|
|
|
<li data-hook="archive-module-group">
|
2020-07-24 23:00:42 +08:00
|
|
|
<a class ="delete-module-group" href="" data-module-id="<%= my_module.id %>"><%= t('experiments.canvas.edit.delete_module_group') %></a>
|
2016-02-12 23:52:43 +08:00
|
|
|
</li>
|
|
|
|
<% end %>
|
|
|
|
</ul>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
2018-02-09 23:14:40 +08:00
|
|
|
<% if can_manage_experiment?(my_module.experiment) %>
|
2016-02-12 23:52:43 +08:00
|
|
|
<div class="panel-body ep">
|
2020-07-24 23:00:42 +08:00
|
|
|
<%= t('experiments.canvas.edit.drag_connections') %>
|
2016-02-12 23:52:43 +08:00
|
|
|
</div>
|
|
|
|
<% end %>
|
|
|
|
|
|
|
|
<div class="overlay"></div>
|
|
|
|
|
|
|
|
</div>
|