mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-09-14 00:54:32 +08:00
implement first time popup logic
This commit is contained in:
parent
c38a4e2614
commit
5fabe06b8d
5 changed files with 34 additions and 0 deletions
10
app/assets/javascripts/projects/introdutory_popup.js
Normal file
10
app/assets/javascripts/projects/introdutory_popup.js
Normal file
|
@ -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');
|
||||
}
|
||||
})();
|
|
@ -130,6 +130,10 @@
|
|||
</div>
|
||||
<% 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} %>
|
||||
|
|
17
app/views/projects/index/_introductory_popup.html.erb
Normal file
17
app/views/projects/index/_introductory_popup.html.erb
Normal file
|
@ -0,0 +1,17 @@
|
|||
<!-- introductory popup modal -->
|
||||
<div class="modal" id="introductory-popup-modal" tabindex="-1" role="dialog" aria-labelledby="introductory-modal-label">
|
||||
<div class="modal-dialog modal-lg" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title" id="introductory-modal-label"><%=t 'introductory.popup-title' %></h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
// TODO
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal"><%=t 'general.cancel' %></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
|
@ -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 )
|
||||
|
|
|
@ -1480,6 +1480,8 @@ en:
|
|||
new_report_click_org_html: "Click on <strong>%{private_org}</strong> in breadcrumbs to return to the Dashboard."
|
||||
archive_project_html: "Archive demo project by clicking on the down arrow <span class='glyphicon glyphicon-triangle-bottom'></span>. You can always access the archive by clicking the <span class='glyphicon glyphicon-briefcase'></span> 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.
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue