scinote-web/app/views/canvas/edit/_my_module.html.erb

69 lines
2.9 KiB
Text
Raw Normal View History

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) %>">
<% module_group = my_module.my_module_group %>
<% can_manage_module_group = module_group && (module_group.new_record? || module_group.my_modules.all? { |my_module| can_manage_module?(my_module) }) %>
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">
<span class="fas fa-caret-down" aria-hidden="true"></span>
2016-02-12 23:52:43 +08:00
</a>
<ul class="dropdown-menu custom-dropdown-menu no-scale" aria-labelledby="<%= my_module.id %>_options">
2016-02-12 23:52:43 +08:00
<li class="dropdown-header"><%= t('projects.index.options_header') %></li>
<% if can_manage_module?(my_module) %>
2016-02-12 23:52:43 +08:00
<li>
<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 %>
<% if can_manage_experiment?(my_module.experiment) %>
2016-02-12 23:52:43 +08:00
<li>
<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? %>>
<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 %>
<% if can_manage_module?(my_module) %>
2016-08-17 19:48:02 +08:00
<li>
<a class="move-module" href="" data-module-id="<%= my_module.id %>"><%=t "experiments.canvas.edit.move_module" %></a>
</li>
<% end %>
<% if can_manage_module_group %>
<li>
<a class="move-module-group" href="" data-module-id="<%= my_module.id %>"><%=t "experiments.canvas.edit.move_module_group" %></a>
</li>
<% end %>
<% if can_manage_module?(my_module) %>
2016-02-12 23:52:43 +08:00
<li>
<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>
<% end %>
<% if can_manage_module_group %>
<li data-hook="archive-module-group">
<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>
<% if can_manage_experiment?(my_module.experiment) %>
2016-02-12 23:52:43 +08:00
<div class="panel-body ep">
<%=t "experiments.canvas.edit.drag_connections" %>
2016-02-12 23:52:43 +08:00
</div>
<% end %>
<div class="overlay"></div>
</div>