Merge branch 'master' into document-ui-improvements

This commit is contained in:
Andrew Brown 2020-10-02 01:04:52 -07:00 committed by GitHub
commit bc12318ace
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
50 changed files with 252 additions and 152 deletions

View File

@ -1027,7 +1027,7 @@ GEM
bundler-audit (0.6.1)
bundler (>= 1.2.0, < 3)
thor (~> 0.18)
capybara (3.32.1)
capybara (3.33.0)
addressable
mini_mime (>= 0.1.3)
nokogiri (~> 1.8)
@ -1035,7 +1035,7 @@ GEM
rack-test (>= 0.6.3)
regexp_parser (~> 1.5)
xpath (~> 3.2)
chartkick (3.3.1)
chartkick (3.4.0)
childprocess (3.0.0)
climate_control (0.2.0)
cocoon (1.2.14)
@ -1049,8 +1049,8 @@ GEM
coffee-script-source
execjs
coffee-script-source (1.12.2)
concurrent-ruby (1.1.6)
connection_pool (2.2.2)
concurrent-ruby (1.1.7)
connection_pool (2.2.3)
crack (0.4.3)
safe_yaml (~> 1.0.0)
crass (1.0.6)
@ -1100,7 +1100,7 @@ GEM
db_text_search (0.3.1)
activerecord (>= 4.1.15, < 7.0)
debug_inspector (0.0.3)
devise (4.7.1)
devise (4.7.2)
bcrypt (~> 3.0)
orm_adapter (~> 0.1)
railties (>= 4.1.0)
@ -1123,15 +1123,15 @@ GEM
multipart-post (>= 1.2, < 3)
faraday_middleware (0.14.0)
faraday (>= 0.7.4, < 1.0)
faye-websocket (0.10.9)
faye-websocket (0.11.0)
eventmachine (>= 0.12.0)
websocket-driver (>= 0.5.1)
ffi (1.13.1)
filesize (0.2.0)
flamegraph (0.9.5)
flipper (0.17.2)
flipper-redis (0.17.2)
flipper (~> 0.17.2)
flipper (0.18.0)
flipper-redis (0.18.0)
flipper (~> 0.18.0)
redis (>= 2.2, < 5)
font-awesome-rails (4.7.0.5)
railties (>= 3.2, < 6.1)
@ -1179,7 +1179,7 @@ GEM
concurrent-ruby (~> 1.0)
http (~> 4.1.0)
jwt (~> 2.2.1)
ibm_watson (1.4.0)
ibm_watson (1.6.0)
concurrent-ruby (~> 1.0)
eventmachine (~> 1.2)
faye-websocket (~> 0.10)
@ -1200,7 +1200,7 @@ GEM
jquery-ui-rails (6.0.1)
railties (>= 3.2.16)
json (2.3.0)
jwt (2.2.1)
jwt (2.2.2)
kaminari (1.2.1)
activesupport (>= 4.1.0)
kaminari-actionview (= 1.2.1)
@ -1255,7 +1255,7 @@ GEM
mustache (1.1.1)
nenv (0.3.0)
nested_form (0.3.2)
newrelic_rpm (6.10.0.364)
newrelic_rpm (6.12.0.367)
nio4r (2.5.2)
nokogiri (1.10.10)
mini_portile2 (~> 2.4.0)
@ -1307,13 +1307,11 @@ GEM
pundit (2.1.0)
activesupport (>= 3.0.0)
rack (2.2.3)
rack-mini-profiler (2.0.1)
rack-mini-profiler (2.0.4)
rack (>= 1.2.0)
rack-pjax (1.1.0)
nokogiri (~> 1.5)
rack (>= 1.1)
rack-protection (2.0.8.1)
rack
rack-proxy (0.6.5)
rack
rack-test (1.1.0)
@ -1386,7 +1384,7 @@ GEM
redis (4.2.1)
regexp_parser (1.7.1)
remotipart (1.4.4)
responders (3.0.0)
responders (3.0.1)
actionpack (>= 5.0)
railties (>= 5.0)
rexml (3.2.4)
@ -1396,9 +1394,9 @@ GEM
rspec-core (~> 3.9.0)
rspec-expectations (~> 3.9.0)
rspec-mocks (~> 3.9.0)
rspec-core (3.9.1)
rspec-support (~> 3.9.1)
rspec-expectations (3.9.1)
rspec-core (3.9.2)
rspec-support (~> 3.9.3)
rspec-expectations (3.9.2)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.9.0)
rspec-mocks (3.9.1)
@ -1407,7 +1405,7 @@ GEM
rspec-prof (0.0.7)
rspec (~> 3.0)
ruby-prof
rspec-rails (4.0.0)
rspec-rails (4.0.1)
actionpack (>= 4.2)
activesupport (>= 4.2)
railties (>= 4.2)
@ -1415,7 +1413,7 @@ GEM
rspec-expectations (~> 3.9)
rspec-mocks (~> 3.9)
rspec-support (~> 3.9)
rspec-support (3.9.2)
rspec-support (3.9.3)
rubocop (0.88.0)
parallel (~> 1.10)
parser (>= 2.7.1.1)
@ -1454,11 +1452,10 @@ GEM
shellany (0.0.1)
shoulda-matchers (4.3.0)
activesupport (>= 4.2.0)
sidekiq (6.0.7)
sidekiq (6.1.1)
connection_pool (>= 2.2.2)
rack (~> 2.0)
rack-protection (>= 2.0.0)
redis (>= 4.1.0)
redis (>= 4.2.0)
simplecov (0.13.0)
docile (~> 1.1.0)
json (>= 1.8, < 3)
@ -1515,17 +1512,17 @@ GEM
addressable (>= 2.3.6)
crack (>= 0.3.2)
hashdiff (>= 0.4.0, < 2.0.0)
webpacker (5.0.1)
webpacker (5.1.1)
activesupport (>= 5.2)
rack-proxy (>= 0.6.1)
railties (>= 5.2)
semantic_range (>= 2.3.0)
websocket-driver (0.7.2)
websocket-driver (0.7.3)
websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.5)
xpath (3.2.0)
nokogiri (~> 1.8)
zeitwerk (2.3.1)
zeitwerk (2.4.0)
PLATFORMS
ruby

View File

@ -0,0 +1,7 @@
$(document).ready(function () {
$('.js-prepaid-promo-code').click(function (event) {
var code = $(event.target).text();
$('#promotional_code_promo_code').val(code);
return false;
});
})

View File

@ -1,3 +1,7 @@
.container-fluid {
margin: 0 30px;
}
.force-word-wrap {
overflow-wrap: break-word;
}

View File

@ -9,9 +9,10 @@ class CoreContentAuthorizer < ContentAuthorizer
def self.creatable_by?(user)
return false if ENV.key?('CONTENT_BLACKLIST') && ENV['CONTENT_BLACKLIST'].split(',').include?(user.email)
[
PermissionService.billing_plan_allows_core_content?(user: user)
].any?
return true # All billing plans support core content right now
# [
# PermissionService.billing_plan_allows_core_content?(user: user)
# ].any?
end
end

View File

@ -43,6 +43,12 @@ class DataController < ApplicationController
@collaborating_universes = Universe.where(id: collaborating_ids)
end
def referrals
@referrals = current_user.referrals.includes(:referree)
@referral_count = @referrals.count
@share_link = "https://www.notebook.ai/?referral=#{current_user.referral_code.code}"
end
private
def set_sidenav_expansion

View File

@ -46,8 +46,14 @@ class PageCollectionSubmissionsController < ApplicationController
# DELETE /page_collection_submissions/1
def destroy
unless user_signed_in? && current_user == @page_collection_submission.page_collection.user
raise "Not allowed"
return
end
page_collection = @page_collection_submission.page_collection
@page_collection_submission.destroy
redirect_to page_collection_submissions_url, notice: 'Page collection submission was successfully destroyed.'
redirect_to page_collection, notice: 'The page was successfully removed from this collection.'
end
def approve

View File

@ -79,6 +79,11 @@ class PageCollectionsController < ApplicationController
# DELETE /page_collections/1
def destroy
unless user_signed_in? && current_user == @page_collection.user
raise "Permission denied"
return
end
@page_collection.destroy
redirect_to page_collections_url, notice: 'Page collection was successfully destroyed.'
end
@ -113,6 +118,27 @@ class PageCollectionsController < ApplicationController
redirect_to root_path, notice: "That Collection has been reported to site administration. Thank you!"
end
def by_user
@page_collection = PageCollection.find(params[:page_collection_id])
unless (@page_collection.privacy == 'public' || (user_signed_in? && @page_collection.user == current_user))
return redirect_to page_collections_path, notice: "That Collection is not public."
end
@pages = @page_collection.accepted_submissions.where(user_id: params[:user_id])
sort_pages
@submittable_content = if user_signed_in?
@current_user_content.slice(*@page_collection.page_types)
else
[]
end
@show_contributor_highlight = true
@highlighted_contributor = User.find_by(id: params[:user_id].to_i)
render :show
end
private
# Use callbacks to share common setup or constraints between actions.

View File

@ -3,6 +3,7 @@ class StreamController < ApplicationController
before_action :set_stream_navbar_actions, only: [:index, :global]
before_action :set_stream_navbar_color, only: [:index, :global]
before_action :set_sidenav_expansion
before_action :cache_linkable_content_for_each_content_type, only: [:index]
def index
followed_users = current_user.followed_users.pluck(:id)

View File

@ -122,12 +122,6 @@ class SubscriptionsController < ApplicationController
end
end
def referrals
@referrals = current_user.referrals.includes(:referree)
@referral_count = @referrals.count
@share_link = "https://www.notebook.ai/?referral=#{current_user.referral_code.code}"
end
# This isn't actually needed since we change the paid plan to the free plan, but will be needed when we
# add a way to deactivate/delete accounts, so the logic is here for when it's needed.
# def cancel
@ -286,9 +280,6 @@ class SubscriptionsController < ApplicationController
}, {
label: "Billing history",
href: main_app.billing_history_path
}, {
label: "Referrals",
href: main_app.referrals_path
}]
end
end

View File

@ -1,4 +1,6 @@
class PaypalInvoice < ApplicationRecord
acts_as_paranoid
belongs_to :user
belongs_to :page_unlock_promo_code, optional: true
@ -26,32 +28,11 @@ class PaypalInvoice < ApplicationRecord
code: 'PP-' + (0...8).map { (65 + rand(26)).chr }.join + '-' + (0...8).map { (65 + rand(26)).chr }.join,
page_types: Rails.application.config.content_types[:premium].map(&:name),
uses_remaining: 1,
days_active: 30 * self.months.to_i,
days_active: 31 * self.months.to_i,
internal_description: "Prepaid with PayPal",
description: "Prepaid Premium subscription"
)
self.save!
if PromoService.active?(:promo_bogo) && (self.months == 3 || self.months == 6)
# During this promo, we create a separate Invoice + PromoCode also
self.user.paypal_invoices.create(
paypal_id: "None -- Created from promo_bogo promo",
status: self.status,
user_id: self.user_id,
months: self.months,
amount_cents: 0,
page_unlock_promo_code: PageUnlockPromoCode.create(
code: 'BOGO-' + (0...8).map { (65 + rand(26)).chr }.join + '-' + (0...8).map { (65 + rand(26)).chr }.join,
page_types: Rails.application.config.content_types[:premium].map(&:name),
uses_remaining: 1,
days_active: 30 * self.months.to_i,
internal_description: "promo_bogo duplicate code",
description: "Your free buy-one-get-one-free Premium Code",
),
approval_url: nil,
payer_id: self.payer_id
)
end
end
def activateable?

View File

@ -1,4 +1,6 @@
class PageCollection < ApplicationRecord
acts_as_paranoid
belongs_to :user
has_many :page_collection_submissions

View File

@ -1,4 +1,6 @@
class PageCollectionSubmission < ApplicationRecord
acts_as_paranoid
belongs_to :content, polymorphic: true
belongs_to :page_collection
belongs_to :user

View File

@ -0,0 +1,7 @@
class PageGrouper < ApplicationRecord
self.abstract_class = true
include HasContentLinking
belongs_to :user, optional: true
end

View File

@ -1,4 +1,6 @@
class ContentPageShare < ApplicationRecord
acts_as_paranoid
belongs_to :user
belongs_to :content_page, polymorphic: true, optional: true
belongs_to :secondary_content_page, polymorphic: true, optional: true

View File

@ -1,4 +1,6 @@
class ShareComment < ApplicationRecord
acts_as_paranoid
belongs_to :user, optional: true
belongs_to :content_page_share

View File

@ -1,4 +1,6 @@
class TimelineEvent < ApplicationRecord
acts_as_paranoid
belongs_to :timeline
has_many :timeline_event_entities, dependent: :destroy

View File

@ -16,6 +16,13 @@
<div class="row">
<div class="col s12 center">
To be shared, content must either be public <strong>or</strong> in a public Universe.
<%= link_to 'https://medium.com/indent-labs/privacy-on-notebook-ai-how-it-works-c23a59faeae2', class: 'blue-text lighten-1', target: '_new' do %>
Learn more about sharing on Notebook.ai.
<% end %>
</div>
<div class="col s12 center grey-text">
Changes are saved automatically and can be changed at any time.
</div>
</div>
@ -69,10 +76,6 @@
</div>
</div>
<% end %>
<div class="col s12 center grey-text">
Changes are saved automatically and can be changed at any time.
</div>
</div>
<% if shared_content.is_a?(Universe) %>
@ -84,12 +87,29 @@
</div>
<% end %>
<div class="row">
<p class="col s12" style='text-align: center'>
<%= link_to 'https://medium.com/indent-labs/privacy-on-notebook-ai-how-it-works-c23a59faeae2', class: 'blue-text lighten-1', target: '_new' do %>
Click here to learn more about sharing pages on Notebook.ai
<% end %>
</p>
<div class="col s12 m6">
<%= link_to [
'http://twitter.com/share?',
'url=' + URI::escape(send("#{shared_content.class.name.downcase}_url", shared_content)),
'&text=' + URI::escape("I'm using Notebook.ai to create fictional worlds! You can see my #{shared_content.class.name.downcase} #{shared_content.name} at this link:")
].join, target: '_new' do %>
<div class="hoverable card-panel white-text" style="background: #1DA1F2">
<i class="left fa fa-twitter" style="font-size: 150%"></i>
Share to Twitter
</div>
<% end %>
</div>
<div class="col s12 m6">
<a
href="https://www.facebook.com/sharer/sharer.php?app_id=1523926344336934&u=<%= URI::escape(send("#{shared_content.class.name.downcase}_url", shared_content)) %>&display=popup&ref=plugin&src=share_button"
onclick="return !window.open(this.href, 'Facebook', 'width=640,height=580')">
<div class="hoverable card-panel white-text" style="background: #4267B2">
<i class="left fa fa-facebook" style="font-size: 150%"></i>
Share to Facebook
</div>
</a>
</div>
<% else %>

View File

@ -3,10 +3,12 @@
<li>
<%= image_tag(collection.random_public_image) %>
<div class="caption center-align bordered-text">
<h4>
<i class="material-icons <%= PageCollection.color %>-text"><%= PageCollection.icon %></i>
<%= collection.title %>
</h4>
<%= link_to collection, class: 'white-text' do %>
<h4>
<i class="material-icons <%= PageCollection.color %>-text"><%= PageCollection.icon %></i>
<%= collection.title %>
</h4>
<% end %>
<h5 class="light grey-text text-lighten-3">
<% if collection.subtitle? %>
<%= collection.subtitle %>

View File

@ -23,16 +23,11 @@
By default, your notebook pages are all private. Sharing your page here will automatically make it public, but you can change back to private
at any time by editing the page directly.
</div>
<!--
<div class="helper-text">
Only pages you've marked "public" may be shared.
</div>
-->
</div>
</div>
<div class="col s12 m6 l6">
<div class="input-field">
<%= f.text_area :message, class: 'materialize-textarea' %>
<%= f.text_area :message, class: 'materialize-textarea js-can-mention-pages' %>
<%= f.label :message, '2. Write a question or message about your page.' %>
</div>
</div>

View File

@ -47,8 +47,13 @@
<%= link_to [share.user, share] do %><%= time_ago_in_words share.shared_at %> ago<% end %>:
</span>
</div>
<blockquote class="original-comment">
<%= simple_format share.message %>
<blockquote class="original-comment black-text">
<%=
simple_format ContentFormatterService.show(
text: share.message,
viewing_user: current_user
)
%>
</blockquote>
<% end %>

View File

@ -47,8 +47,13 @@
<%= link_to [share.user, share] do %><%= time_ago_in_words share.shared_at %> ago<% end %>:
</span>
</div>
<blockquote class="original-comment">
<%= simple_format share.message %>
<blockquote class="original-comment black-text">
<%=
simple_format ContentFormatterService.show(
text: share.message,
viewing_user: current_user
)
%>
</blockquote>
<% end %>

View File

@ -66,27 +66,34 @@
</li>
</ul>
</div>
<!--
<div>
<ul class="uppercase">
<li class="grey-text">
Reshare this post to...
<ul class="">
<li class="grey-text uppercase">
Reshare to...
</li>
<li>
<%= link_to '#', class: 'btn-flat blue-text' do %>
<i class="material-icons tiny left">share</i>
<%= link_to [
'http://twitter.com/share?',
'url=' + URI::escape(user_content_page_share_url(user_id: @share.user.id, id: @share.id)),
'&text=' + URI::escape(@share.message)
].join, class: 'blue-text', target: '_blank' do %>
<i class="material-icons tiny left" style="margin-top: 4px;">share</i>
Twitter
<% end %>
</li>
<li>
<%= link_to '#', class: 'btn-flat blue-text' do %>
<i class="material-icons tiny left">share</i>
<%=
link_to "https://www.facebook.com/sharer/sharer.php?app_id=1523926344336934&u=#{URI::escape(user_content_page_share_url(user_id: @share.user.id, id: @share.id))}&display=popup&ref=plugin&src=share_button",
class: 'blue-text',
onclick: "return !window.open(this.href, 'Facebook', 'width=640,height=580')" do
%>
<i class="material-icons tiny left" style="margin-top: 4px">share</i>
Facebook
<% end %>
</li>
</ul>
</div>
-->
</div>
<div class="col s12 m12 l7">
<div class="card">
@ -102,8 +109,13 @@
</span>
</p>
<% if @share.message.present? %>
<blockquote class="original-comment">
<%= simple_format @share.message %>
<blockquote class="original-comment black-text">
<%=
simple_format ContentFormatterService.show(
text: @share.message,
viewing_user: current_user
)
%>
</blockquote>
<% end %>

View File

@ -69,6 +69,20 @@
<% end %>
</div>
<div class="col s12 m12 l6">
<%= link_to referrals_path, class: 'black-text' do %>
<div class="hoverable card orange lighten-4">
<div class="card-content">
<i class="material-icons right orange-text text-darken-5">favorite</i>
<div class="card-title">Referrals</div>
<p>
Get your referral code, browse potential rewards, and invite your friends!
</p>
</div>
</div>
<% end %>
</div>
<div class="col s12 m12 l6">
<%= link_to discussions_path, class: 'black-text' do %>
<div class="hoverable card blue lighten-4">

View File

@ -31,9 +31,9 @@
</div>
<div class="col s12">
<div class="card-panel blue">
<div class="card-panel blue white-text">
<strong>Did you know?</strong>
Premium users get an extra 10GB of storage space, but all users can earn even more storage space by referring their friends to Notebook.ai.
Premium users get an extra 10GB of storage space, but you can earn even more storage space by referring friends to Notebook.ai.
<%= link_to 'Learn more.', referrals_path, class: 'orange-text text-lighten-3' %>
</div>
</div>

View File

@ -11,6 +11,21 @@
<div class="card-content">
<div class="card-title">
<%= link_to content.name, content %>
<% if user_signed_in? && current_user == @page_collection.user %>
<a class='dropdown-trigger right' href='#' data-target='dropdown-<%= page.id %>'>
<i class="material-icons">more_vert</i>
</a>
<ul id='dropdown-<%= page.id %>' class='dropdown-content'>
<li>
<%= link_to 'All pages from this user', page_collection_submissions_by_user_path(page_collection_id: @page_collection.id, user_id: page.user_id) %>
</li>
<li class="divider"></li>
<li>
<%= link_to 'Remove from collection', page_collection_submission_path(page), method: :delete %>
</li>
</ul>
<% end %>
</div>
<% if page.explanation? %>
<div>

View File

@ -10,9 +10,14 @@
</div>
<% else %>
<%= render partial: 'page_collections/sort_bar' %>
<% if !!@show_contributor_highlight %>
<div class="card-panel <%= PageCollection.color %> darken-3 white-text">
Showing all submitted pages from <%= link_to @highlighted_contributor.display_name, @highlighted_contributor, class: "#{User.color}-text" %>.
Click <%= link_to 'here', @page_collection, class: 'blue-text text-lighten-3' %> to see all pages regardless of author.
</div>
<% end %>
<%= render partial: 'page_collections/stream', locals: { pages: @pages } %>
<% end %>
<%= render partial: 'page_collections/stream', locals: { pages: @pages } %>
</div>
<div class="col s12 m3 l4">
<%= render partial: 'page_collections/sidebar' %>

View File

@ -1,8 +1,8 @@
<%= form_for ShareComment.new do |f| %>
<div class="input-field comment-form">
<%= f.label :message, 'Leave a message' %>
<%= f.hidden_field :content_page_share_id, value: share.id %>
<%= f.text_area :message, class: 'materialize-textarea' %>
<%= f.label 'Leave a message', for: "share_comment_#{share.id}" %>
<%= f.text_area :message, id: "share_comment_#{share.id}", class: 'materialize-textarea js-can-mention-pages' %>
<%= f.submit 'Comment', class: 'btn right green white-text submit-button' %>
</div>
<% end %>

View File

@ -7,7 +7,10 @@
<% end %>
<%# Nesting from above %>
<%= simple_format comment.message, class: 'black-text' %>
<%= simple_format ContentFormatterService.show(
text: comment.message,
viewing_user: current_user
), class: 'black-text' %>
<div class="metadata">
<%= link_to comment.user, class: "#{User.color}-text text-darken-4" do %>

View File

@ -27,4 +27,6 @@
</div>
</div>
</div>
<% end %>
<% end %>
<%= render partial: 'javascripts/content_linking' %>

View File

@ -239,8 +239,7 @@
</div>
</div>
<div class="col s12 m12 l3 hide-on-small-only"></div>
<div class="col s12 m12 l9">
<div class="col s12 m12 l9 offset-l3">
<div class="card">
<div class="card-content">
@ -309,7 +308,7 @@
</p>
<ul>
<% current_user.page_unlock_promo_codes.where('uses_remaining > 0').each do |code| %>
<li><strong><%= code.code %></strong> (<%= code.description %>)</li>
<li><a href="#" class="js-prepaid-promo-code green-text"><%= code.code %></a> (<%= code.description %>)</li>
<% end %>
</ul>
<% end %>
@ -363,31 +362,6 @@
</div>
</div>
<div class="row">
<div class="col s12">
<div class="card">
<div class="card-content">
<div class="card-title">
Upload Bandwidth
<div class="right">
<%= (current_user.upload_bandwidth_kb) > 0 ? Filesize.from("#{current_user.upload_bandwidth_kb}KB").pretty : '-' + Filesize.from("#{current_user.upload_bandwidth_kb.abs}KB").pretty %> remaining
</div>
</div>
<p>
You have <strong><%= (current_user.upload_bandwidth_kb) > 0 ? Filesize.from("#{current_user.upload_bandwidth_kb}KB").pretty : '-' + Filesize.from("#{current_user.upload_bandwidth_kb.abs}KB").pretty %></strong> of bandwidth remaining.
</p>
<p>
This bandwidth can be used to upload images to your content anywhere on the site. Deleting an uploaded image frees
up the same amount of bandwidth.
<% unless on_premium_plan %>
To get more bandwidth, upgrade to our Premium plan.
<% end %>
</p>
</div>
</div>
</div>
</div>
<div class="center help-text">
All prices are in US Dollars. Making payments using another currency will automatically exchange into US Dollars at the current exchange rates.
</div>

View File

@ -60,7 +60,7 @@
</div>
<div class="col s12 m6">
<%= link_to prepay_paypal_gateway_path(months: 3), class: 'black-text' do %>
<div class="hoverable card yellow lighten-4" style="min-height: 170px;">
<div class="hoverable card blue lighten-4" style="min-height: 170px;">
<div class="card-content">
<div class="card-title black-text">
<i class="material-icons left">star</i>
@ -77,7 +77,7 @@
</div>
<div class="col s12 m6">
<%= link_to prepay_paypal_gateway_path(months: 6), class: 'black-text' do %>
<div class="hoverable card yellow lighten-4" style="min-height: 170px">
<div class="hoverable card blue lighten-4" style="min-height: 170px">
<div class="card-content">
<div class="card-title black-text">
<i class="material-icons left">star</i>
@ -126,7 +126,7 @@
</p>
<% if current_user.on_premium_plan? && @invoices.any? %>
<div class="card-panel green center">
<div class="card-panel green white-text center">
Since you already have Premium features active, you won't be able to activate any codes on this account yet.<br />
Activation links will appear again whenever you don't have Premium active.
</div>

View File

@ -51,7 +51,7 @@
<div class="grey-text uppercase">
Username
</div>
<div>
<div class="force-word-wrap">
<%= link_to "@#{@user.username}", profile_by_username_path(username: @user.username) %>
</div>
<br />
@ -61,7 +61,7 @@
<div class="grey-text uppercase">
Also known as
</div>
<div>
<div class="force-word-wrap">
<%= @user.other_names %>
</div>
<br />
@ -76,7 +76,7 @@
<div class="grey-text uppercase">
Website
</div>
<div>
<div class="force-word-wrap">
<%= link_to @user.website, @user.website, target: '_new', data: { confirm: "You are about to visit an external website not owned by Notebook.ai. Please only continue if you trust this user." }, ref: 'nofollow' %>
</div>
<br />
@ -111,7 +111,7 @@
<div class="grey-text uppercase">
Bio
</div>
<div>
<div class="force-word-wrap">
<%= simple_format truncate(@user.bio, length: 500) %>
</div>
</div>
@ -126,7 +126,7 @@
<div class="grey-text uppercase">
<%= field.titleize %>
</div>
<div>
<div class="force-word-wrap">
<%= simple_format @user.send(field) %>
</div>
</div>

View File

@ -16,6 +16,8 @@ Rails.application.routes.draw do
get 'follow', on: :member
get 'unfollow', on: :member
get 'report', on: :member
get 'by/:user_id', to: 'page_collections#by_user', as: :submissions_by_user
end
resources :page_collection_submissions do
get 'approve', on: :member
@ -92,12 +94,13 @@ Rails.application.routes.draw do
# Legacy route: left intact so /my/documents/X URLs continue to work for everyone's bookmarks
resources :documents
get '/referrals', to: 'data#referrals', as: :referrals
# Billing
scope '/billing' do
#get '/', to: 'subscriptions#show', as: :billing
get '/subscription', to: 'subscriptions#new', as: :subscription
get '/history', to: 'subscriptions#history', as: :billing_history
get '/referrals', to: 'subscriptions#referrals', as: :referrals
get '/to/:stripe_plan_id', to: 'subscriptions#change', as: :change_subscription

View File

@ -0,0 +1,8 @@
class AddParanoidFieldsToRecentModels < ActiveRecord::Migration[6.0]
def change
add_column :page_collections, :deleted_at, :datetime
add_column :page_collection_submissions, :deleted_at, :datetime
add_column :paypal_invoices, :deleted_at, :datetime
add_column :timeline_events, :deleted_at, :datetime
end
end

View File

@ -2610,9 +2610,9 @@ bluebird@^3.3.5, bluebird@^3.5.5:
integrity sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg==
bn.js@^4.0.0, bn.js@^4.1.0, bn.js@^4.1.1, bn.js@^4.4.0:
version "4.11.8"
resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-4.11.8.tgz#2cde09eb5ee341f484746bb0309b3253b1b1442f"
integrity sha512-ItfYfPLkWHUjckQCk8xC+LwxgK8NYcXywGigJgSwOP8Y2iyWT4f2vsZnoOXTTbo+o5yXmIUJ4gn5538SO5S3gA==
version "4.11.9"
resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-4.11.9.tgz#26d556829458f9d1e81fc48952493d0ba3507828"
integrity sha512-E6QoYqCKZfgatHTdHzs1RRKP7ip4vvm+EyRUeE2RF0NblwVvb0p6jSVeNTOFxPn26QXN2o6SMfNxKp6kU8zQaw==
body-parser@1.19.0:
version "1.19.0"
@ -4166,9 +4166,9 @@ element-resize-detector@^1.2.1:
batch-processor "1.0.0"
elliptic@^6.0.0:
version "6.5.2"
resolved "https://registry.yarnpkg.com/elliptic/-/elliptic-6.5.2.tgz#05c5678d7173c049d8ca433552224a495d0e3762"
integrity sha512-f4x70okzZbIQl/NSRLkI/+tteV/9WqL98zx+SQ69KbXxmVrmjwsNUPn/gYJJ0sHvEak24cZgHIPegRePAtA/xw==
version "6.5.3"
resolved "https://registry.yarnpkg.com/elliptic/-/elliptic-6.5.3.tgz#cb59eb2efdaf73a0bd78ccd7015a62ad6e0f93d6"
integrity sha512-IMqzv5wNQf+E6aHeIqATs0tOLeOTwj1QKbRcS3jBbYkl5oLAserA8yJTT7/VyHUYG91PRmPyeQDObKLPpeS4dw==
dependencies:
bn.js "^4.4.0"
brorand "^1.0.1"
@ -6563,9 +6563,9 @@ lodash.uniq@^4.5.0:
integrity sha1-0CJTc662Uq3BvILklFM5qEJ1R3M=
lodash@^4.0.0, lodash@^4.17.11, lodash@^4.17.12, lodash@^4.17.13, lodash@^4.17.14, lodash@^4.17.15, lodash@^4.17.5, lodash@~4.17.10:
version "4.17.15"
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.15.tgz#b447f6670a0455bbfeedd11392eff330ea097548"
integrity sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==
version "4.17.19"
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.19.tgz#e48ddedbe30b3321783c5b4301fbd353bc1e4a4b"
integrity sha512-JNvd8XER9GQX0v2qJgsaN/mzFCNA5BRe/j8JN9d+tWyGLSodKQHKFicdwNYzWwI3wjRnaKPsGj1XkBjx/F96DQ==
loglevel@^1.6.8:
version "1.7.0"