From 0558d49e2654e2f50f49813f42f88110fac39943 Mon Sep 17 00:00:00 2001 From: Mojca Lorber Date: Wed, 24 Aug 2016 13:50:25 +0200 Subject: [PATCH 1/2] buttons update on experiment overview --- app/views/experiments/canvas.html.erb | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/app/views/experiments/canvas.html.erb b/app/views/experiments/canvas.html.erb index fe217fe8a..bf6be7f51 100644 --- a/app/views/experiments/canvas.html.erb +++ b/app/views/experiments/canvas.html.erb @@ -3,6 +3,14 @@ <%= render partial: "shared/secondary_navigation" %>
+ <% if can_create_experiment(@project) && @experiment.active? %> + <%= link_to t('experiments.new.create'), + new_project_experiment_url(@project), + remote: true, + type: "button", + id: 'new-experiment', + class: "btn btn-primary" %> + <% end %> <% if can_edit_canvas(@experiment) %> <%=link_to t('experiments.canvas.canvas_edit'), canvas_edit_experiment_url(@experiment), @@ -12,14 +20,6 @@ class: "ajax btn btn-default", "data-action" => "edit" %> <% end %> - <% if can_create_experiment(@project) && @experiment.active? %> - <%= link_to t('experiments.new.create'), - new_project_experiment_url(@project), - remote: true, - type: "button", - id: 'new-experiment', - class: "btn btn-primary" %> - <% end %> <% if can_edit_experiment(@experiment) || can_archive_experiment(@experiment) %> From 2a897432e1f3fc645f5320b67952cfdb4007f55e Mon Sep 17 00:00:00 2001 From: Mojca Lorber Date: Wed, 24 Aug 2016 17:00:27 +0200 Subject: [PATCH 2/2] update buttons on canvas view --- app/views/experiments/canvas.html.erb | 60 +++++++++++++++------------ app/views/projects/show.html.erb | 10 +++-- config/locales/en.yml | 1 + 3 files changed, 41 insertions(+), 30 deletions(-) diff --git a/app/views/experiments/canvas.html.erb b/app/views/experiments/canvas.html.erb index bf6be7f51..0141c06f5 100644 --- a/app/views/experiments/canvas.html.erb +++ b/app/views/experiments/canvas.html.erb @@ -3,22 +3,17 @@ <%= render partial: "shared/secondary_navigation" %>
- <% if can_create_experiment(@project) && @experiment.active? %> - <%= link_to t('experiments.new.create'), - new_project_experiment_url(@project), - remote: true, - type: "button", - id: 'new-experiment', - class: "btn btn-primary" %> - <% end %> + <% if can_edit_canvas(@experiment) %> - <%=link_to t('experiments.canvas.canvas_edit'), - canvas_edit_experiment_url(@experiment), - remote: true, - type: "button", - id: "edit-canvas-button", - class: "ajax btn btn-default", - "data-action" => "edit" %> + <%=link_to canvas_edit_experiment_url(@experiment), + remote: true, + type: "button", + id: "edit-canvas-button", + class: "ajax btn btn-default", + "data-action" => "edit" do %> + + <%= t('experiments.canvas.canvas_edit') %> + <% end %> <% end %> <% if can_edit_experiment(@experiment) || can_archive_experiment(@experiment) %> @@ -32,18 +27,31 @@ locals: { project: @project, experiment: @experiment } %> <% end %> - -
- <%=link_to canvas_full_zoom_experiment_path(@experiment), remote: true, type: "button", class: "ajax btn btn-primary active", "data-action" => "full_zoom", "data-toggle" => "button", "aria-pressed" => true do %> - - <% end %> - <%=link_to canvas_medium_zoom_experiment_path(@experiment), remote: true, type: "button", class: "ajax btn btn-primary", "data-action" => "medium_zoom" do %> - - <% end %> - <%=link_to canvas_small_zoom_experiment_path(@experiment), remote: true, type: "button", class: "ajax btn btn-primary", "data-action" => "small_zoom" do %> - - <% end %> +
+ <%= t('experiments.canvas.zoom') %> +
+ <%=link_to canvas_full_zoom_experiment_path(@experiment), remote: true, type: "button", class: "ajax btn btn-default active", "data-action" => "full_zoom", "data-toggle" => "button", "aria-pressed" => true do %> + + <% end %> + <%=link_to canvas_medium_zoom_experiment_path(@experiment), remote: true, type: "button", class: "ajax btn btn-default", "data-action" => "medium_zoom" do %> + + <% end %> + <%=link_to canvas_small_zoom_experiment_path(@experiment), remote: true, type: "button", class: "ajax btn btn-default", "data-action" => "small_zoom" do %> + + <% end %> +
+ + <% if can_create_experiment(@project) && @experiment.active? %> + <%= link_to new_project_experiment_url(@project), + remote: true, + type: "button", + id: 'new-experiment', + class: "btn btn-primary pull-right" do %> + + <%= t('experiments.new.create') %> + <% end %> + <% end %>
<% if can_create_experiment(@project) %>
-
- <%= link_to t('experiments.new.create'), - new_project_experiment_url(@project), +
+ <%= link_to new_project_experiment_url(@project), remote: true, type: "button", id: 'new-experiment', - class: "btn btn-primary center-btn" %> + class: "btn btn-primary pull-right" do %> + + <%= t('experiments.new.create') %> + <% end %>
<% end %> diff --git a/config/locales/en.yml b/config/locales/en.yml index 01ee8da62..5057aea78 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -636,6 +636,7 @@ en: actions: 'Actions' head_title: "%{project} | Overview" canvas_edit: "Edit experiment" + zoom: "Zoom: " modal_manage_tags: head_title: "Manage tags for" subtitle: "Showing tags of task %{module}"