mirror of
https://github.com/indentlabs/notebook.git
synced 2025-10-26 11:19:22 +00:00
add show_notice? helper
This commit is contained in:
parent
6221ec2dea
commit
f69a200b00
@ -40,4 +40,8 @@ module ApplicationHelper
|
||||
html.gsub!(/\<a href=["'](.*?)["']\>(.*?)\<\/a\>/mi, '<a href="\1" rel="nofollow">\2</a>')
|
||||
html.html_safe
|
||||
end
|
||||
|
||||
def show_notice?(id: nil)
|
||||
user_signed_in? && current_user.notice_dismissals.where(notice_id: id).none?
|
||||
end
|
||||
end
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
<% unless user_signed_in? && current_user.notice_dismissals.where(notice_id: 2).any? %>
|
||||
<% unless show_notice?(id: 2) %>
|
||||
<div class="col s12 m6 l4">
|
||||
<div class="card sticky-action" style="max-height: 480px">
|
||||
<div class="card-image waves-effect waves-block waves-light">
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
<% if PromoService.active?(:promo_bogo) %>
|
||||
<% if user_signed_in? && current_user.notice_dismissals.where(notice_id: 6).none? %>
|
||||
<% if show_notice?(id: 6) %>
|
||||
<div class="col s12">
|
||||
<div class="hoverable card-panel orange lighten-5">
|
||||
<%= link_to 'Dismiss this notice.', notice_dismissal_dismiss_path(notice_id: 6), class: 'blue-text right', style: 'padding: 0 10px;' %>
|
||||
|
||||
@ -1,11 +1,9 @@
|
||||
<% if user_signed_in? && current_user.notice_dismissals.where(notice_id: 7).none? %>
|
||||
<div class="col s12">
|
||||
<div class="card-panel blue lighten-5">
|
||||
<i class="material-icons grey-text left">help</i>
|
||||
These associations are automatically created whenever you mention this page from another page.
|
||||
Only you can see this message.
|
||||
<% if show_notice?(id: 7) %>
|
||||
<div class="card-panel blue lighten-5">
|
||||
<i class="material-icons grey-text left">help</i>
|
||||
These associations are automatically created whenever you mention this page from another page.
|
||||
Only you can see this message.
|
||||
|
||||
<%= link_to 'Dismiss this notice.', notice_dismissal_dismiss_path(notice_id: 7), class: 'blue-text' %>
|
||||
</div>
|
||||
<%= link_to 'Dismiss this notice.', notice_dismissal_dismiss_path(notice_id: 7), class: 'blue-text' %>
|
||||
</div>
|
||||
<% end %>
|
||||
@ -1,4 +1,4 @@
|
||||
<% if user_signed_in? && current_user.notice_dismissals.where(notice_id: 8).none? && false %>
|
||||
<% if show_notice?(id: 8) && false %>
|
||||
<div class="col s12">
|
||||
<div class="hoverable card-panel blue lighten-5">
|
||||
<%= link_to 'Dismiss this notice.', notice_dismissal_dismiss_path(notice_id: 8), class: 'blue-text right', style: 'padding: 0 10px;' %>
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
<% if user_signed_in? && current_user.notice_dismissals.where(notice_id: 9).none? %>
|
||||
<% if show_notice?(id: 9) %>
|
||||
<div class="card-panel blue lighten-5">
|
||||
<i class="left material-icons grey-text">help</i>
|
||||
Links will automatically appear here whenever you add this page to a public collection.<br />
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
<% if user_signed_in? && current_user.notice_dismissals.where(notice_id: 10).none? %>
|
||||
<% if show_notice?(id: 10) %>
|
||||
<div class="card-panel blue lighten-5">
|
||||
<i class="left material-icons grey-text">help</i>
|
||||
Documents will automatically appear here whenever you add this page to a document.<br />
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
<% if user_signed_in? && current_user.notice_dismissals.where(notice_id: 11).none? %>
|
||||
<% if show_notice?(id: 11) %>
|
||||
<div class="card-panel blue lighten-5">
|
||||
<i class="left material-icons grey-text">help</i>
|
||||
Links will automatically appear here whenever you share this page to your followers.<br />
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
<% if user_signed_in? && current_user.notice_dismissals.where(notice_id: 12).none? %>
|
||||
<% if show_notice?(id: 12) %>
|
||||
<div class="card-panel <%= ContentPageShare.color %> lighten-5 black-text">
|
||||
You can now share your notebook pages to your <strong>Stream</strong>!<br /><br />
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
<% if user_signed_in? && current_user.notice_dismissals.where(notice_id: 13).none? %>
|
||||
<% if show_notice?(id: 13) %>
|
||||
<%
|
||||
example_character_name = @current_user_content.fetch('Character', []).sample.try(:name) || 'Alice'
|
||||
%>
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
<% if user_signed_in? && current_user.notice_dismissals.where(notice_id: 14).none? %>
|
||||
<% if show_notice?(id: 14) %>
|
||||
<div class="card-panel blue lighten-5">
|
||||
<i class="left material-icons grey-text">help</i>
|
||||
Timelines will automatically appear here whenever you link this page to those timelines in Notebook.ai.
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
<% if user_signed_in? && current_user.notice_dismissals.where(notice_id: 15).none? %>
|
||||
<% if show_notice?(id: 15) %>
|
||||
<div class="card-panel <%= PageCollection.color %> lighten-5">
|
||||
<p>
|
||||
Collections on Notebook.ai are a brand new feature and I'd love to get your feedback on how you would like to use them.
|
||||
|
||||
Loading…
Reference in New Issue
Block a user