- <%= link_to_if can_edit_module(my_module), t("experiments.canvas.full_zoom.due_date"), due_date_my_module_path(my_module, format: :json), remote: true, class: "due-date-link" %>
+ <%= link_to_if can_edit_module(my_module), t("projects.canvas.full_zoom.due_date"), due_date_my_module_path(my_module, format: :json), remote: true, class: "due-date-link" %>
<% if can_edit_module(my_module) %>
diff --git a/app/views/experiments/canvas.html.erb b/app/views/experiments/canvas.html.erb
new file mode 100644
index 000000000..c8885e52e
--- /dev/null
+++ b/app/views/experiments/canvas.html.erb
@@ -0,0 +1,39 @@
+<% provide(:head_title, raw(t("projects.canvas.head_title", project: @project.name))) %>
+<%= render partial: "shared/sidebar" %>
+<%= render partial: "shared/secondary_navigation" %>
+
+
+
+ <%= render partial: 'canvas/full_zoom', locals: { project: @project, experiment: @experiment, my_modules: @experiment.active_modules } %>
+
+
+
+<%= render partial: "my_modules/modals/manage_module_tags_modal", locals: { my_module: nil } %>
+
+
+<%= javascript_include_tag("jsPlumb-2.0.4-min") %>
+<%= javascript_include_tag("jsnetworkx") %>
+<%= javascript_include_tag("eventPause-min") %>
+
+<%= javascript_include_tag("projects/canvas") %>
diff --git a/app/views/shared/_sidebar.html.erb b/app/views/shared/_sidebar.html.erb
index 8d7d4e779..5d510b825 100644
--- a/app/views/shared/_sidebar.html.erb
+++ b/app/views/shared/_sidebar.html.erb
@@ -23,9 +23,14 @@
<%= @project.name %>
<% end %>
- <% @experiments.each do |experiment| %>
- <%= render 'shared/sidebar_elements' %>
- <% end %>
+
+ -
+
+
+ <%= @experiment.name %>
+
+ <%= render 'shared/sidebar_elements' %>
+
New experiment...
diff --git a/app/views/shared/_sidebar_elements.html.erb b/app/views/shared/_sidebar_elements.html.erb
index 19441126f..06fab15a8 100644
--- a/app/views/shared/_sidebar_elements.html.erb
+++ b/app/views/shared/_sidebar_elements.html.erb
@@ -1,6 +1,6 @@
-<% if experiment.active_modules.present? then %>
+<% if @experiment.active_modules.present? then %>
- <% experiment.active_module_groups.each do |my_module_group| %>
+ <% @experiment.active_module_groups.each do |my_module_group| %>
-
@@ -35,7 +35,7 @@
<% end %>
<% end %>
- <% modules_without_group = experiment.modules_without_group %>
+ <% modules_without_group = @experiment.modules_without_group %>
<% if modules_without_group.present? then %>
-
diff --git a/config/locales/en.yml b/config/locales/en.yml
index 4dabda6ce..01181d3b6 100644
--- a/config/locales/en.yml
+++ b/config/locales/en.yml
@@ -376,8 +376,6 @@ en:
restore_option: "Restore"
archived_on: "Archived on"
archived_on_title: "Task archived on %{date} at %{time}."
-
- experiments:
canvas:
head_title: "%{project} | Overview"
canvas_edit: "Edit workflow"
diff --git a/config/routes.rb b/config/routes.rb
index 11b5c2db5..9ec7bbcbe 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -88,13 +88,18 @@ Rails.application.routes.draw do
post 'destroy', as: :destroy # Destroy multiple entries at once
end
end
+ resources :experiments, only: [:new, :create, :edit, :update, :archive]
+ resources :experiments, shallow: true, only: [:show] do
+ member do
+ get 'canvas' # Overview/structure for single project
+ get 'canvas/edit', to: 'canvas#edit' # AJAX-loaded canvas edit mode (from canvas)
+ get 'canvas/full_zoom', to: 'canvas#full_zoom' # AJAX-loaded canvas zoom
+ get 'canvas/medium_zoom', to: 'canvas#medium_zoom' # AJAX-loaded canvas zoom
+ get 'canvas/small_zoom', to: 'canvas#small_zoom' # AJAX-loaded canvas zoom
+ post 'canvas', to: 'canvas#update' # Save updated canvas action
+ end
+ end
member do
- get 'canvas' # Overview/structure for single project
- get 'canvas/edit', to: 'canvas#edit' # AJAX-loaded canvas edit mode (from canvas)
- get 'canvas/full_zoom', to: 'canvas#full_zoom' # AJAX-loaded canvas zoom
- get 'canvas/medium_zoom', to: 'canvas#medium_zoom' # AJAX-loaded canvas zoom
- get 'canvas/small_zoom', to: 'canvas#small_zoom' # AJAX-loaded canvas zoom
- post 'canvas', to: 'canvas#update' # Save updated canvas action
get 'notifications' # Notifications popup for individual project in projects index
get 'samples' # Samples for single project
get 'module_archive' # Module archive for single project
@@ -106,8 +111,6 @@ Rails.application.routes.draw do
get 'users/edit', to: 'user_projects#index_edit'
end
- resources :experiments, only: [:show]
-
# Show action is a popup (JSON) for individual module in full-zoom canvas,
# as well as "module info" page for single module (HTML)
resources :my_modules, path: "/modules", only: [:show, :edit, :update, :destroy] do