diff --git a/app/assets/javascripts/projects/introdutory_popup.js b/app/assets/javascripts/projects/introdutory_popup.js new file mode 100644 index 000000000..052bb71f4 --- /dev/null +++ b/app/assets/javascripts/projects/introdutory_popup.js @@ -0,0 +1,10 @@ +(function(){ + // display introductory modal + if( Cookies.get('popup-already-shown') !== 'yes'){ + $("#introductory-popup-modal").modal('show',{ + backdrop: true, + keyboard: false, + }); + Cookies.set('popup-already-shown', 'yes'); + } +})(); diff --git a/app/views/projects/index.html.erb b/app/views/projects/index.html.erb index 7a42ba1b0..4c2eec669 100644 --- a/app/views/projects/index.html.erb +++ b/app/views/projects/index.html.erb @@ -130,6 +130,10 @@ <% end %> +<% if current_user.created_at < Time.new(2016, 8, 25) %> + <%= render partial: 'projects/index/introductory_popup' %> + <%= javascript_include_tag "projects/introdutory_popup"%> +<% end %> <% if @projects_by_orgs.length > 0 %> <% @projects_by_orgs.each do |org, projects| %> <%= render partial: "projects/index/org_projects", locals: {org: org, projects: projects} %> diff --git a/app/views/projects/index/_introductory_popup.html.erb b/app/views/projects/index/_introductory_popup.html.erb new file mode 100644 index 000000000..d42dc7744 --- /dev/null +++ b/app/views/projects/index/_introductory_popup.html.erb @@ -0,0 +1,17 @@ + + diff --git a/config/initializers/assets.rb b/config/initializers/assets.rb index f6132277f..a8726d2f2 100644 --- a/config/initializers/assets.rb +++ b/config/initializers/assets.rb @@ -57,3 +57,4 @@ Rails.application.config.assets.precompile += %w( reports_pdf.css ) Rails.application.config.assets.precompile += %w( jszip.min.js ) Rails.application.config.assets.precompile += %w( assets.js ) Rails.application.config.assets.precompile += %w( projects/show.js ) +Rails.application.config.assets.precompile += %w( projects/introdutory_popup.js ) diff --git a/config/locales/en.yml b/config/locales/en.yml index 94055d701..951fcbecd 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -1480,6 +1480,8 @@ en: new_report_click_org_html: "Click on %{private_org} in breadcrumbs to return to the Dashboard." archive_project_html: "Archive demo project by clicking on the down arrow . You can always access the archive by clicking the button on the top right side of the dashboard and restore any item you have archived." + introductory: + popup-title: "Dear sciNote user," # This section contains general words that can be used in any parts of # application.