2016-02-12 23:52:43 +08:00
|
|
|
<div id="update-canvas"
|
2016-07-27 17:35:07 +08:00
|
|
|
data-can-create-modules="<%= can_create_modules(@experiment) ? "yes" : "no" %>"
|
|
|
|
data-can-edit-modules="<%= can_edit_modules(@experiment) ? "yes" : "no" %>"
|
|
|
|
data-can-edit-module-groups="<%= can_edit_module_groups(@experiment) ? "yes" : "no" %>"
|
|
|
|
data-can-clone-modules="<%= can_clone_modules(@experiment) ? "yes" : "no" %>"
|
|
|
|
data-can-delete-modules="<%= can_archive_modules(@experiment) ? "yes" : "no" %>"
|
|
|
|
data-can-reposition-modules="<%= can_reposition_modules(@experiment) ? "yes" : "no" %>"
|
|
|
|
data-can-edit-connections="<%= can_edit_connections(@experiment) ? "yes" : "no" %>"
|
2016-07-28 22:41:10 +08:00
|
|
|
data-unsaved-work-text="<%=t "experiments.canvas.edit.unsaved_work" %>"
|
2016-02-12 23:52:43 +08:00
|
|
|
>
|
2016-07-28 16:09:05 +08:00
|
|
|
<%= bootstrap_form_tag url: canvas_experiment_url, method: "post" do |f| %>
|
2016-02-12 23:52:43 +08:00
|
|
|
<div class="btn-group" role="group">
|
|
|
|
<%= f.submit class: "btn btn-primary", id: "canvas-save" do %>
|
2016-07-28 22:41:10 +08:00
|
|
|
<span class="visibile-xs"><%= t("experiments.canvas.edit.save_short") %></span>
|
|
|
|
<span class="hidden-xs"><%= t("experiments.canvas.edit.save") %></span>
|
2016-02-12 23:52:43 +08:00
|
|
|
<% end %>
|
2016-07-28 16:09:05 +08:00
|
|
|
<%= link_to canvas_experiment_path(@experiment), type: "button", class: "btn btn-default cancel-edit-canvas" do %>
|
2016-07-28 22:41:10 +08:00
|
|
|
<span class="hidden-xs"><%= t("experiments.canvas.edit.cancel") %></span>
|
2016-02-12 23:52:43 +08:00
|
|
|
<span class="glyphicon glyphicon-remove visible-xs" style="height: 16px;margin-top: 4px;"> </span>
|
|
|
|
<% end %>
|
|
|
|
</div>
|
2016-07-27 17:35:07 +08:00
|
|
|
<% if can_create_modules(@experiment) %>
|
2016-02-12 23:52:43 +08:00
|
|
|
<%=link_to "", type: "button", class: "btn btn-default", id: "canvas-new-module" do %>
|
|
|
|
<span class="hbtn-default">
|
|
|
|
<span class="glyphicon glyphicon-credit-card"></span>
|
2016-07-28 22:41:10 +08:00
|
|
|
<%= t("experiments.canvas.edit.new_module") %>
|
2016-02-12 23:52:43 +08:00
|
|
|
</span>
|
|
|
|
<span class="hbtn-hover">
|
|
|
|
<span class="glyphicon glyphicon-credit-card"></span>
|
2016-07-28 22:41:10 +08:00
|
|
|
<em class="hidden-xs"><%= t("experiments.canvas.edit.new_module_hover") %></em>
|
|
|
|
<span class="visible-xs-inline"><%= t("experiments.canvas.edit.new_module") %></span>
|
2016-02-12 23:52:43 +08:00
|
|
|
</span>
|
|
|
|
<% end %>
|
|
|
|
<% end %>
|
|
|
|
<%= hidden_field_tag 'connections', '' %>
|
|
|
|
<%= hidden_field_tag 'positions', '' %>
|
|
|
|
<%= hidden_field_tag 'add', '' %>
|
|
|
|
<%= hidden_field_tag 'add-names', '' %>
|
|
|
|
<%= hidden_field_tag 'rename', '{}' %>
|
|
|
|
<%= hidden_field_tag 'cloned', '' %>
|
|
|
|
<%= hidden_field_tag 'remove', '' %>
|
|
|
|
<%= hidden_field_tag 'module-groups', '{}' %>
|
|
|
|
<% end %>
|
|
|
|
<span style="display: none;" id="dropdown-header-placeholder">
|
2016-07-28 22:41:10 +08:00
|
|
|
<%=t "experiments.canvas.edit.options_header" %>
|
2016-02-12 23:52:43 +08:00
|
|
|
</span>
|
|
|
|
<span style="display: none;" id="edit-link-placeholder">
|
2016-07-28 22:41:10 +08:00
|
|
|
<%=t "experiments.canvas.edit.edit_module" %>
|
2016-02-12 23:52:43 +08:00
|
|
|
</span>
|
|
|
|
<span style="display: none;" id="edit-group-link-placeholder">
|
2016-07-28 22:41:10 +08:00
|
|
|
<%=t "experiments.canvas.edit.edit_module_group" %>
|
2016-02-12 23:52:43 +08:00
|
|
|
</span>
|
|
|
|
<span style="display: none;" id="clone-link-placeholder">
|
2016-07-28 22:41:10 +08:00
|
|
|
<%=t "experiments.canvas.edit.clone_module" %>
|
2016-02-12 23:52:43 +08:00
|
|
|
</span>
|
|
|
|
<span style="display: none;" id="clone-group-link-placeholder">
|
2016-07-28 22:41:10 +08:00
|
|
|
<%=t "experiments.canvas.edit.clone_module_group" %>
|
2016-02-12 23:52:43 +08:00
|
|
|
</span>
|
|
|
|
<span style="display: none;" id="delete-link-placeholder">
|
2016-07-28 22:41:10 +08:00
|
|
|
<%=t "experiments.canvas.edit.delete_module" %>
|
2016-02-12 23:52:43 +08:00
|
|
|
</span>
|
|
|
|
<span style="display: none;" id="delete-group-link-placeholder">
|
2016-07-28 22:41:10 +08:00
|
|
|
<%=t "experiments.canvas.edit.delete_module_group" %>
|
2016-02-12 23:52:43 +08:00
|
|
|
</span>
|
|
|
|
<span style="display: none;" id="drag-connections-placeholder">
|
2016-07-28 22:41:10 +08:00
|
|
|
<%=t "experiments.canvas.edit.drag_connections" %>
|
2016-02-12 23:52:43 +08:00
|
|
|
</span>
|
|
|
|
</div>
|
|
|
|
<div id="diagram-container">
|
|
|
|
<div id="diagram" class="diagram">
|
|
|
|
<% my_modules.each do |my_module| %>
|
2016-07-27 17:35:07 +08:00
|
|
|
<%= render partial: "canvas/edit/my_module", locals: {experiment: @experiment, my_module: my_module} %>
|
2016-02-12 23:52:43 +08:00
|
|
|
<% end %>
|
|
|
|
</div>
|
|
|
|
|
2016-07-27 17:35:07 +08:00
|
|
|
<% if can_create_modules(@experiment) %>
|
|
|
|
<%= render partial: "canvas/edit/modal/new_module", locals: {experiment: @experiment} %>
|
2016-02-12 23:52:43 +08:00
|
|
|
<% end %>
|
2016-07-27 17:35:07 +08:00
|
|
|
<% if can_edit_modules(@experiment) %>
|
|
|
|
<%= render partial: "canvas/edit/modal/edit_module", locals: {experiment: @experiment } %>
|
2016-02-12 23:52:43 +08:00
|
|
|
<% end %>
|
2016-07-27 17:35:07 +08:00
|
|
|
<% if can_edit_module_groups(@experiment) %>
|
|
|
|
<%= render partial: "canvas/edit/modal/edit_module_group", locals: {experiment: @experiment } %>
|
2016-02-12 23:52:43 +08:00
|
|
|
<% end %>
|
2016-07-27 17:35:07 +08:00
|
|
|
<% if can_archive_modules(@experiment) %>
|
|
|
|
<%= render partial: "canvas/edit/modal/delete_module", locals: {experiment: @experiment} %>
|
|
|
|
<%= render partial: "canvas/edit/modal/delete_module_group", locals: {experiment: @experiment} %>
|
2016-02-12 23:52:43 +08:00
|
|
|
<% end %>
|