From ca0ba1403d9cf0f6dce2b3ad3d8cb696956ebb90 Mon Sep 17 00:00:00 2001 From: zmagod Date: Wed, 17 Aug 2016 14:17:29 +0200 Subject: [PATCH 1/2] set flask icon to experiment [fixes SCI-330] --- Gemfile | 4 +++- Gemfile.lock | 3 +++ app/assets/stylesheets/application.scss | 1 + app/views/reports/elements/_experiment_element.html.erb | 4 ++-- app/views/search/index.html.erb | 2 +- app/views/search/results/_experiments.html.erb | 2 +- app/views/shared/_secondary_navigation.html.erb | 6 +++--- 7 files changed, 14 insertions(+), 8 deletions(-) diff --git a/Gemfile b/Gemfile index df84bb580..9658b645f 100644 --- a/Gemfile +++ b/Gemfile @@ -11,6 +11,8 @@ gem 'bootstrap-sass', '~> 3.3.5' gem 'sass-rails', '~> 5.0' gem 'bootstrap_form' gem 'yomu' +gem 'font-awesome-rails', '~> 4.6' + # JS datetime library, requirement of datetime picker gem 'momentjs-rails', '>= 2.9.0' # JS datetime picker @@ -52,7 +54,7 @@ gem 'aws-sdk', '~> 2.2.8' gem 'aws-sdk-v1' gem 'delayed_job_active_record' gem 'devise-async' -gem 'ruby-graphviz', '~> 1.2' # Graphviz for rails +gem 'ruby-graphviz', '~> 1.2' # Graphviz for rails group :development, :test do gem 'byebug' diff --git a/Gemfile.lock b/Gemfile.lock index f008db80c..32f598656 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -110,6 +110,8 @@ GEM i18n (~> 0.5) figaro (1.1.1) thor (~> 0.14) + font-awesome-rails (4.6.3.1) + railties (>= 3.2, < 5.1) globalid (0.3.6) activesupport (>= 4.1.0) hammerjs-rails (2.0.4) @@ -305,6 +307,7 @@ DEPENDENCIES devise_invitable faker figaro + font-awesome-rails (~> 4.6) hammerjs-rails i18n-js (>= 3.0.0.rc11) introjs-rails diff --git a/app/assets/stylesheets/application.scss b/app/assets/stylesheets/application.scss index 7f2c9605a..32c8f3c51 100644 --- a/app/assets/stylesheets/application.scss +++ b/app/assets/stylesheets/application.scss @@ -16,4 +16,5 @@ @import "bootstrap-tagsinput-typeahead"; @import "handsontable.full.min"; @import "extend/bootstrap"; +@import "font-awesome"; @import "themes/scinote"; diff --git a/app/views/reports/elements/_experiment_element.html.erb b/app/views/reports/elements/_experiment_element.html.erb index fde6f41dc..372defcb0 100644 --- a/app/views/reports/elements/_experiment_element.html.erb +++ b/app/views/reports/elements/_experiment_element.html.erb @@ -5,7 +5,7 @@ data-type="experiment" data-id="<%= experiment.id %>" data-modal-title="<%=t "projects.reports.elements.modals.experiment_contents.head_title", - experiment: experiment.name %>" data-name="<%= name %>" data-icon-class="glyphicon-filter"> + experiment: experiment.name %>" data-name="<%= name %>" data-icon-class="fa fa-flask">
@@ -20,7 +20,7 @@

- + <%= fa_icon 'flask' %> <%= name %>

diff --git a/app/views/search/index.html.erb b/app/views/search/index.html.erb index 02a076017..9265253da 100644 --- a/app/views/search/index.html.erb +++ b/app/views/search/index.html.erb @@ -27,7 +27,7 @@ > <%= @experiment_search_count %> - + <%= fa_icon 'flask' %> <%= t'Experiments' %> diff --git a/app/views/search/results/_experiments.html.erb b/app/views/search/results/_experiments.html.erb index 153eae5df..04e90fe68 100644 --- a/app/views/search/results/_experiments.html.erb +++ b/app/views/search/results/_experiments.html.erb @@ -1,6 +1,6 @@ <% results.each do |experiment| %>
- + <%= fa_icon 'flask' %> <%= render partial: "search/results/partials/experiment_text.html.erb", locals: { experiment: experiment, query: search_query } %>
diff --git a/app/views/shared/_secondary_navigation.html.erb b/app/views/shared/_secondary_navigation.html.erb index 6d3516adf..7b68c2a2c 100644 --- a/app/views/shared/_secondary_navigation.html.erb +++ b/app/views/shared/_secondary_navigation.html.erb @@ -40,16 +40,16 @@ <% if experiment_page? || module_page? %> <% if !module_page? %>
  • - + <%= fa_icon 'fa-flask' %>
  • <% else %>
  • <% if can_view_experiment(@experiment) %> <%= link_to canvas_experiment_path(@experiment) do %> - + <%= fa_icon 'fa-flask' %> <% end %> <% else %> - + <%= fa_icon 'fa-flask' %> <% end %>
  • <% end %> From 9fd68c7bd56129282028439af3dd7c36babc1af8 Mon Sep 17 00:00:00 2001 From: zmagod Date: Wed, 17 Aug 2016 14:27:59 +0200 Subject: [PATCH 2/2] fixes 'new experiment' button bug on smaller screens --- app/views/projects/show.html.erb | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/app/views/projects/show.html.erb b/app/views/projects/show.html.erb index 8fb4245a0..4416c6718 100644 --- a/app/views/projects/show.html.erb +++ b/app/views/projects/show.html.erb @@ -3,17 +3,24 @@ <%= render partial: "shared/secondary_navigation" %>
    -
    -

    <%= t'projects.show.page_title' %>

    - <% if can_create_experiment(@project) %> - <%= link_to t('experiments.new.create'), - new_project_experiment_url(@project), - remote: true, - type: "button", - id: 'new-experiment', - class: "btn btn-primary center-btn" %> - - <% end %> +
    + <% if can_create_experiment(@project) %> +
    +
    + <%= link_to t('experiments.new.create'), + new_project_experiment_url(@project), + remote: true, + type: "button", + id: 'new-experiment', + class: "btn btn-primary center-btn" %> +
    +
    + <% end %> +
    +
    +

    <%= t'projects.show.page_title' %>

    +
    +