2017-01-12 23:54:15 +08:00
|
|
|
<% provide(:head_title, t("experiments.canvas.head_title", project: h(@project.name)).html_safe) %>
|
2020-12-10 22:15:36 +08:00
|
|
|
<% provide(:sidebar_title, t("sidebar.my_modules.sidebar_title")) %>
|
2021-09-16 15:55:59 +08:00
|
|
|
<% provide(:sidebar_url, sidebar_experiment_path(@experiment)) %>
|
2022-10-18 20:54:29 +08:00
|
|
|
<% provide(:container_class, 'no-second-nav-container') %>
|
2020-12-10 22:15:36 +08:00
|
|
|
|
|
|
|
<%= content_for :sidebar do %>
|
2020-12-13 05:46:30 +08:00
|
|
|
<%= render partial: 'shared/sidebar/my_modules.html.erb', locals: { experiment: @experiment, my_modules: @active_modules } %>
|
2020-12-10 22:15:36 +08:00
|
|
|
<% end %>
|
2016-07-28 15:01:44 +08:00
|
|
|
|
2022-11-24 21:49:42 +08:00
|
|
|
<div class="content-pane flexible experiment-new-my_module" id="experiment-canvas">
|
2022-10-18 20:54:29 +08:00
|
|
|
<%= render partial: 'experiments/show_header' %>
|
2022-10-20 16:42:38 +08:00
|
|
|
<div class="toolbar-row" id="diagram-buttons">
|
2022-10-18 20:54:29 +08:00
|
|
|
<div id="toolbar-left-block">
|
|
|
|
<% if can_manage_experiment?(@experiment) %>
|
2022-11-24 21:49:42 +08:00
|
|
|
<%= link_to modules_new_experiment_path(@experiment, view_mode: 'canvas'),
|
2022-09-29 05:18:36 +08:00
|
|
|
class: 'btn btn-primary new-my-module-button',
|
|
|
|
data: { view_mode: 'active' },
|
|
|
|
remote: true do %>
|
|
|
|
<span class="fas fa-plus"></span>
|
2023-01-06 19:08:35 +08:00
|
|
|
<span class="hidden-sm hidden-xs"><%= t('experiments.canvas.new_my_module') %></span>
|
2022-09-29 05:18:36 +08:00
|
|
|
<% end %>
|
2022-10-18 20:54:29 +08:00
|
|
|
<%=link_to canvas_edit_experiment_url(@experiment),
|
|
|
|
remote: true,
|
|
|
|
type: 'button',
|
|
|
|
id: 'edit-canvas-button',
|
|
|
|
data: { action: 'edit' },
|
|
|
|
class: 'ajax btn btn-light' do %>
|
|
|
|
<span class="fas fa-pencil-alt"></span>
|
2023-01-06 19:08:35 +08:00
|
|
|
<span class="hidden-sm hidden-xs"><%= t('experiments.canvas.canvas_edit') %></span>
|
2022-10-18 20:54:29 +08:00
|
|
|
<% end %>
|
|
|
|
<% end %>
|
|
|
|
</div>
|
|
|
|
<div class="toolbar-right-block">
|
2023-01-06 19:08:35 +08:00
|
|
|
<span class="hidden-sm hidden-xs zoom-text"><%=t 'experiments.canvas.zoom' %></span>
|
2022-10-18 20:54:29 +08:00
|
|
|
<div id="zoom-level-buttons" class="sci-toggles-group change-canvas-view" data-toggle="buttons">
|
|
|
|
<input type="radio" name="canvas-format" class="sci-toggle-item" checked>
|
|
|
|
<%=link_to canvas_full_zoom_experiment_path(@experiment), remote: true, type: "button", class: "ajax sci-toggle-item-label", "data-action" => "full_zoom", "data-toggle" => "button", "aria-pressed" => true do %>
|
2023-01-05 20:29:13 +08:00
|
|
|
<%= render partial: 'experiments/canvas_svg_icons', locals: { type: 'full' } %>
|
2022-10-18 20:54:29 +08:00
|
|
|
<% end %>
|
|
|
|
<input type="radio" name="canvas-format" class="sci-toggle-item" >
|
|
|
|
<%=link_to canvas_medium_zoom_experiment_path(@experiment), remote: true, type: "button", class: "ajax sci-toggle-item-label", "data-action" => "medium_zoom" do %>
|
2023-01-05 20:29:13 +08:00
|
|
|
<%= render partial: 'experiments/canvas_svg_icons', locals: { type: 'medium' } %>
|
2022-05-25 16:22:50 +08:00
|
|
|
<% end %>
|
2022-10-18 20:54:29 +08:00
|
|
|
<input type="radio" name="canvas-format" class="sci-toggle-item" >
|
|
|
|
<%=link_to canvas_small_zoom_experiment_path(@experiment), remote: true, type: "button", class: "ajax sci-toggle-item-label", "data-action" => "small_zoom" do %>
|
2023-01-05 20:29:13 +08:00
|
|
|
<%= render partial: 'experiments/canvas_svg_icons', locals: { type: 'small' } %>
|
2018-05-08 22:33:42 +08:00
|
|
|
<% end %>
|
2016-09-08 18:37:06 +08:00
|
|
|
</div>
|
2016-08-24 23:00:27 +08:00
|
|
|
</div>
|
2016-08-03 15:34:10 +08:00
|
|
|
</div>
|
|
|
|
|
2019-01-14 23:31:23 +08:00
|
|
|
<div id="canvas-container" data-project-id="<%= @project.id %>" data-module-tags-url="<%= my_module_tags_experiment_path(@experiment, format: :json) %>">
|
2018-05-08 22:33:42 +08:00
|
|
|
<%= render partial: 'canvas/full_zoom', locals: { experiment: @experiment, my_modules: @active_modules } %>
|
|
|
|
</div>
|
2016-07-28 15:01:44 +08:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<!-- Manage tags modal -->
|
|
|
|
<%= render partial: "my_modules/modals/manage_module_tags_modal", locals: { my_module: nil } %>
|
|
|
|
|
2018-07-05 20:36:54 +08:00
|
|
|
<!-- Initialize dropdown actions -->
|
|
|
|
<%= javascript_include_tag("experiments/dropdown_actions") %>
|
|
|
|
|
2022-09-29 05:18:36 +08:00
|
|
|
<%= javascript_include_tag("experiments/show") %>
|
|
|
|
|
2016-07-28 15:01:44 +08:00
|
|
|
<!-- Include all the neccesary JS libraries -->
|
|
|
|
<%= javascript_include_tag("eventPause-min") %>
|
|
|
|
|
|
|
|
<%= javascript_include_tag("projects/canvas") %>
|