diff --git a/app/assets/stylesheets/thredded-overrides.scss b/app/assets/stylesheets/thredded-overrides.scss index c9605c50..50052e80 100644 --- a/app/assets/stylesheets/thredded-overrides.scss +++ b/app/assets/stylesheets/thredded-overrides.scss @@ -6,8 +6,20 @@ padding-left: 16px; } + .thredded--navigation-breadcrumbs { + overflow: hidden; + max-height: 60px; + } + .thredded--user-navigation { - height: 64px; + height: 70px; + + margin-top: 10px; + margin-right: 10px; + + .thredded--user-navigation--item a { + padding: 0; + } } .thredded--currently-online { diff --git a/app/controllers/registrations_controller.rb b/app/controllers/registrations_controller.rb index 7051c3a7..0526038e 100644 --- a/app/controllers/registrations_controller.rb +++ b/app/controllers/registrations_controller.rb @@ -24,7 +24,7 @@ class RegistrationsController < Devise::RegistrationsController def account_update_params params.require(:user).permit( :name, :email, :username, :password, :password_confirmation, :email_updates, :fluid_preference, - :bio, :favorite_genre, :favorite_author, :interests, :age, :location, :gender + :bio, :favorite_genre, :favorite_author, :interests, :age, :location, :gender, :forums_badge_text ) end diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index a451cd62..bdcac941 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -78,6 +78,7 @@ class UsersController < ApplicationController private def user_params + # todo is this used anywhere? params.permit(:id, :username) end end diff --git a/app/jobs/document_mention_job.rb b/app/jobs/document_mention_job.rb index 52c4cd5c..94b141a7 100644 --- a/app/jobs/document_mention_job.rb +++ b/app/jobs/document_mention_job.rb @@ -8,6 +8,7 @@ class DocumentMentionJob < ApplicationJob document = Document.find(document_id) return unless document.present? + return if document.body.nil? || document.body.empty? analysis = Documents::Analysis::DocumentAnalysisService.create_placeholder_analysis(document) diff --git a/app/models/users/user.rb b/app/models/users/user.rb index c7e39d4e..56c1aaa6 100644 --- a/app/models/users/user.rb +++ b/app/models/users/user.rb @@ -17,6 +17,11 @@ class User < ApplicationRecord allow_blank: true, length: { maximum: 40 }, format: /\A[A-Za-z0-9\-_\$\+\!\*]+\z/ + + validates :forums_badge_text, + allow_nil: true, + allow_blank: true, + length: { maximum: 20 } has_many :subscriptions, dependent: :destroy has_many :billing_plans, through: :subscriptions diff --git a/app/views/devise/registrations/panes/_information.html.erb b/app/views/devise/registrations/panes/_information.html.erb index bf1e3dab..920d0174 100644 --- a/app/views/devise/registrations/panes/_information.html.erb +++ b/app/views/devise/registrations/panes/_information.html.erb @@ -45,6 +45,16 @@ + +
+
+
+ <%= f.label 'Custom Premium badge text' %>
+ <%= f.text_field :forums_badge_text, data: { length: 20 }, class: 'with-character-counter', placeholder: 'Premium Supporter' %> + Premium users can customize the badge that appears under their name on their profile and next to their name on the forums.
+
+
+
diff --git a/app/views/main/dashboard.html.erb b/app/views/main/dashboard.html.erb index 23ca3072..8037127a 100644 --- a/app/views/main/dashboard.html.erb +++ b/app/views/main/dashboard.html.erb @@ -69,22 +69,24 @@ l_width = 6 %> - <% unless true || current_user.notice_dismissals.where(notice_id: 1).any? %> + <% unless current_user.notice_dismissals.where(notice_id: 2).any? %>
"> -
+

- School, Sport, and Food pages + Analyze your writing with world-class AI

- To celebrate the launch of our three new Premium pages, - you can now create as many School pages as you'd like during the month of June! + Premium users can now analyze their documents — and the characters within them — for readability, style, and emotion with IBM Watson's AI. +

+
+

+ Learn more at our blog post below:

-
- <%= link_to 'Read more', 'https://www.notebook.ai/forum/announcements/new-page-types-food-sports-and-schools-and-a-special-surprise', class: 'white-text' %> - <%= link_to 'Customize my pages', main_app.customization_content_types_path, class: 'white-text' %> +
+ <%= link_to 'Read more', 'https://medium.com/indent-labs/adding-the-ai-to-notebook-ai-950f44d231e5', target: '_new', class: 'white-text' %> <%= link_to 'Dismiss', notice_dismissal_dismiss_path(notice_id: 1), class: 'white-text right' %>
diff --git a/app/views/main/for_designers.html.erb b/app/views/main/for_designers.html.erb index 055ae5a3..2c7005cf 100644 --- a/app/views/main/for_designers.html.erb +++ b/app/views/main/for_designers.html.erb @@ -63,7 +63,7 @@ body {
-
+

How do I use it?

@@ -86,7 +86,7 @@ body {

-
+
<%= image_tag 'screenshots/dashboard.png' %>
@@ -98,7 +98,7 @@ body {
- <% [Character, Location, Item, Creature, Race, Religion, Group, Magic, Language].each do |content_type| %> + <% Rails.application.config.content_types[:all_non_universe].each do |content_type| %>
<%= render partial: 'cards/intros/content_type_intro', locals: { content_type: content_type } %>
@@ -112,7 +112,7 @@ body {
-
+

Separate your worlds with Universes

@@ -131,7 +131,7 @@ body {

-
+
<%= image_tag 'screenshots/universe.png', class: 'left' %>
@@ -140,7 +140,7 @@ body {
<%= image_tag 'screenshots/sharing.png', class: 'right' %>
-
+

Share your game with your team with easy privacy rules

@@ -174,9 +174,9 @@ body {

-
+
-

Keep your game focused in a rich world of consistent details

+

Keep your world focused with consistent details

Having an in-depth reference while developing your game lets you quickly look up even the smallest of details when you need them and keep working uninterrupted. You'll never again have to flip backward to find out what quest rewards should be, or exactly how @@ -201,7 +201,7 @@ body {

-
+
<%= image_tag 'screenshots/character.png', class: 'left' %>
@@ -210,7 +210,7 @@ body {
<%= image_tag 'screenshots/gallery.png', class: 'right' %>
-
+

Upload images for inspiration or reference

@@ -236,7 +236,7 @@ body {

-
+

Export your entire notebook in more and more formats

@@ -253,7 +253,7 @@ body {

-
+
<%= image_tag 'screenshots/exporting.png', class: 'left' %>
@@ -266,7 +266,7 @@ body {
-

+

<%= link_to 'Start worldbuilding right now.', new_user_registration_path, class: 'white-text' %>

No card needed. Upgrade seamlessly any time.
@@ -360,7 +360,7 @@ body {

How much does it cost?

-
+

Creating core notebook pages (universes, characters, locations, and items) is free and doesn't require any payment information to start creating your novel's world immediately upon signup. Free users, however, @@ -376,12 +376,12 @@ body { Additionally, a Premium subscription also increases your image upload storage from 50MB to 10GB.

-
- <% [Character, Location, Item, Creature, Race, Religion, Group, Magic, Language].each_with_index do |content_type, i| %> - +
+ <% Rails.application.config.content_types[:all].each_with_index do |content_type, i| %> + <%= content_type.icon %> - <%= '
'.html_safe if (i + 1) % 3 == 0 %> + <%= '
'.html_safe if (i + 1) % 6 == 0 %> <% end %>
diff --git a/app/views/main/for_roleplayers.html.erb b/app/views/main/for_roleplayers.html.erb index 3b34839e..b6c482b9 100644 --- a/app/views/main/for_roleplayers.html.erb +++ b/app/views/main/for_roleplayers.html.erb @@ -63,7 +63,7 @@ body {
-
+

How do I use it?

@@ -86,7 +86,7 @@ body {

-
+
<%= image_tag 'screenshots/dashboard.png' %>
@@ -98,7 +98,7 @@ body {
- <% [Character, Location, Item, Creature, Race, Religion, Group, Magic, Language].each do |content_type| %> + <% Rails.application.config.content_types[:all_non_universe].each do |content_type| %>
<%= render partial: 'cards/intros/content_type_intro', locals: { content_type: content_type } %>
@@ -110,9 +110,8 @@ body {
-
-
+

Separate your worlds with Universes

@@ -130,7 +129,7 @@ body {

-
+
<%= image_tag 'screenshots/universe.png', class: 'left' %>
@@ -139,7 +138,7 @@ body {
<%= image_tag 'screenshots/sharing.png', class: 'right' %>
-
+

Share your campaign with players with easy privacy rules

@@ -172,7 +171,7 @@ body {

-
+

Keep your players engrossed with a rich world of consistent details

@@ -198,7 +197,7 @@ body {

-
+
<%= image_tag 'screenshots/character.png', class: 'left' %>
@@ -207,7 +206,7 @@ body {
<%= image_tag 'screenshots/gallery.png', class: 'right' %>
-
+

Upload images for inspiration or reference

@@ -233,7 +232,7 @@ body {

-
+

Build family trees and organization hierarchies with ease

@@ -258,7 +257,7 @@ body {

-
+
<%= image_tag 'screenshots/family-tree.png', class: 'left' %>
@@ -271,10 +270,10 @@ body {
-

+

<%= link_to 'Start worldbuilding right now.', new_user_registration_path, class: 'white-text' %>

-
No card needed. Upgrade seamlessly any time.
+
No card needed. Upgrade or downgrade seamlessly any time.
@@ -365,7 +364,7 @@ body {

How much does it cost?

-
+

Creating core notebook pages (universes, characters, locations, and items) is free and doesn't require any payment information to start creating your novel's world immediately upon signup. Free users, however, @@ -381,12 +380,12 @@ body { Additionally, a Premium subscription also increases your image upload storage from 50MB to 10GB.

-
- <% [Character, Location, Item, Creature, Race, Religion, Group, Magic, Language].each_with_index do |content_type, i| %> - +
+ <% Rails.application.config.content_types[:all].each_with_index do |content_type, i| %> + <%= content_type.icon %> - <%= '
'.html_safe if (i + 1) % 3 == 0 %> + <%= '
'.html_safe if (i + 1) % 6 == 0 %> <% end %>
diff --git a/app/views/main/for_writers.html.erb b/app/views/main/for_writers.html.erb index d32ad633..0281785f 100644 --- a/app/views/main/for_writers.html.erb +++ b/app/views/main/for_writers.html.erb @@ -63,7 +63,7 @@ body {
-
+

How do I use it?

@@ -81,12 +81,12 @@ body { items for any relevant objects or trinkets in your story.

- Once you've got the basics, just expand outward for your story! Right now, there are nine different page types you can - create in Notebook.ai. + Once you've got the basics, just expand outward for your story! Right now, there are <%= Rails.application.config.content_types[:all_non_universe].count %> different page types you can + create in Notebook.ai: <%= Rails.application.config.content_types[:all_non_universe].map { |t| t.name.downcase.pluralize }.to_sentence %>.

-
+
<%= image_tag 'screenshots/dashboard.png' %>
@@ -112,7 +112,7 @@ body {
-
+

Separate your worlds with Universes

@@ -129,7 +129,7 @@ body {

-
+
<%= image_tag 'screenshots/universe.png', class: 'left' %>
@@ -138,7 +138,7 @@ body {
<%= image_tag 'screenshots/quick-reference.png', class: 'right' %>
-
+

Build your world piece by piece with personalized writing prompts

@@ -164,7 +164,7 @@ body {

-
+

Keep your readers engrossed with a rich world of consistent details

@@ -189,7 +189,7 @@ body {

-
+
<%= image_tag 'screenshots/character.png', class: 'left' %>
@@ -198,7 +198,7 @@ body {
<%= image_tag 'screenshots/gallery.png', class: 'right' %>
-
+

Upload images for inspiration or reference

@@ -224,7 +224,7 @@ body {

-
+

Build family trees and organization hierarchies with ease

@@ -249,7 +249,7 @@ body {

-
+
<%= image_tag 'screenshots/family-tree.png', class: 'left' %>
@@ -262,10 +262,10 @@ body {
-

+

<%= link_to 'Start worldbuilding right now.', new_user_registration_path, class: 'white-text' %>

-
No card needed. Upgrade seamlessly any time.
+
No card needed. Upgrade or downgrade seamlessly any time.
@@ -338,10 +338,10 @@ body {
-

library_books

-
<%= t('marketing.landing_page.benefits.yours.title') %>
+

security

+
<%= t('marketing.landing_page.benefits.ads.title') %>

- <%= t('marketing.landing_page.benefits.yours.text') %> + <%= t('marketing.landing_page.benefits.ads.text') %>

@@ -358,7 +358,7 @@ body {

How much does it cost?

-
+

Creating core notebook pages (universes, characters, locations, and items) is free and doesn't require any payment information to start creating your novel's world immediately upon signup. Free users, however, @@ -374,12 +374,12 @@ body { Additionally, a Premium subscription also increases your image upload storage from 50MB to 10GB.

-
+
<% Rails.application.config.content_types[:all].each_with_index do |content_type, i| %> - + <%= content_type.icon %> - <%= '
'.html_safe if (i + 1) % 4 == 0 %> + <%= '
'.html_safe if (i + 1) % 6 == 0 %> <% end %>
diff --git a/app/views/main/index.html.erb b/app/views/main/index.html.erb index 1e42aa1c..ac5843d8 100644 --- a/app/views/main/index.html.erb +++ b/app/views/main/index.html.erb @@ -89,7 +89,6 @@
-
@@ -103,25 +102,24 @@
-

schedule

-
<%= t('marketing.landing_page.benefits.speed.title') %>
+

cloud

+
<%= t('marketing.landing_page.benefits.backups.title') %>

- <%= t('marketing.landing_page.benefits.speed.text') %> + <%= t('marketing.landing_page.benefits.backups.text') %>

-

assignment_turned_in

-
<%= t('marketing.landing_page.benefits.continuity.title') %>
+

security

+
<%= t('marketing.landing_page.benefits.ads.title') %>

- <%= t('marketing.landing_page.benefits.continuity.text') %> + <%= t('marketing.landing_page.benefits.ads.text') %>

-
-
+

face

@@ -144,15 +142,14 @@
-

security

-
<%= t('marketing.landing_page.benefits.items.title') %>
+

assignment_turned_in

+
<%= t('marketing.landing_page.benefits.continuity.title') %>

- <%= t('marketing.landing_page.benefits.items.text') %> + <%= t('marketing.landing_page.benefits.continuity.text') %>

-
-
+

search

@@ -173,18 +170,6 @@
-
-
-

cloud

-
<%= t('marketing.landing_page.benefits.backups.title') %>
-

- <%= t('marketing.landing_page.benefits.backups.text') %> -

-
-
-
- -

settings_ethernet

@@ -207,10 +192,20 @@
-

library_books

-
<%= t('marketing.landing_page.benefits.yours.title') %>
+

schedule

+
<%= t('marketing.landing_page.benefits.speed.title') %>

- <%= t('marketing.landing_page.benefits.yours.text') %> + <%= t('marketing.landing_page.benefits.speed.text') %> +

+
+
+ +
+
+

bar_chart

+
<%= t('marketing.landing_page.benefits.quality.title') %>
+

+ <%= t('marketing.landing_page.benefits.quality.text') %>

diff --git a/app/views/thredded/users/_badge.html.erb b/app/views/thredded/users/_badge.html.erb index 164b5ca3..4d8a2989 100644 --- a/app/views/thredded/users/_badge.html.erb +++ b/app/views/thredded/users/_badge.html.erb @@ -1,11 +1,16 @@ -<% badge_style = 'padding: 3px 5px; font-size: 70%; font-weight: normal;' %> +<% + badge_style = 'padding: 3px 5px; font-size: 70%; font-weight: normal;' + badge_text = user.try(:forums_badge_text) # using try() on release for zdd while machines reboot and get reference to this column, can be removed after +%> <% if user.respond_to?(:selected_billing_plan_id) %> - <% if user.selected_billing_plan_id == 2 %> - Beta Tester + <% if user.id == 5 %> + <%= badge_text.presence || 'Admin' %> + <% elsif user.selected_billing_plan_id == 2 %> + <%= badge_text.presence || 'Beta Tester' %> <% elsif user.selected_billing_plan_id == 3 %> - Early Adopter + <%= badge_text.presence || 'Early Adopter' %> <% elsif [4, 5, 6].include? user.selected_billing_plan_id %> - Premium Supporter + <%= badge_text.presence || 'Premium Supporter' %> <% end %> <% end %> diff --git a/config/locales/en.yml b/config/locales/en.yml index bbd448a0..ad7d4600 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -56,11 +56,15 @@ en: benefits: creativity: title: Promotes creativity - text: Your Notebook now asks you questions about your characters and ideas, and your answers are saved too. + text: Your notebook now asks you questions about your characters and ideas, and your answers are saved too. speed: - title: Speeds up writing - text: With a universe of information at your fingertips, you can look up anything quickly and keep writing. + title: Write faster + text: Reference any aspect of any page in your notebook without losing your momentum in our built-in document editor. + + quality: + title: Write better + text: Analyze your writing with a world-class AI that measures readability, style, emotion, and more. continuity: title: Continuity checks @@ -68,15 +72,15 @@ en: characters: title: Deeper characters - text: Get to know your characters. Track every detail of their thoughts, appearance, and personality. + text: Get to know your characters. Track every detail of their thoughts, appearance, family, and personality. locations: title: Richer worlds - text: Immerse yourself in vibrant worlds with tracking available for any kind of locations. + text: Immerse yourself in vibrant worlds with specialized notebook pages for your countries, cities, landmarks, and more. - items: - title: Legendary items - text: Every object has a backstory that can shine as bright as any character — if you let it. + ads: + title: No ads, ever + text: Rest easy knowing your notebook is safe and completely private by default, but shareable if you choose. search: title: Searchable @@ -84,7 +88,7 @@ en: organization: title: Organizable - text: Focus on one universe at a time and filter everything else out. Reorganize, sort, and write freely. + text: Focus on one universe at a time and automatically filter everything else out. Reorganize, sort, and write freely. backups: title: Backed up forever @@ -96,11 +100,7 @@ en: sharing: title: Brainstorm together - text: Invite anyone to review any content you decide to share. Sometimes a second set of eyes makes all the difference. - - yours: - title: Make it yours - text: Plan creatures, magic, scenes, and other page types specific to your world, tailored to you. + text: Invite anyone to review any pages you decide to share. Sometimes a second set of eyes makes all the difference. quote: text: Really clever and beautifully organized way for storytellers to create a world. diff --git a/db/migrate/20190813220011_add_forums_badge_to_users.rb b/db/migrate/20190813220011_add_forums_badge_to_users.rb new file mode 100644 index 00000000..484892fb --- /dev/null +++ b/db/migrate/20190813220011_add_forums_badge_to_users.rb @@ -0,0 +1,5 @@ +class AddForumsBadgeToUsers < ActiveRecord::Migration[5.2] + def change + add_column :users, :forums_badge_text, :string + end +end diff --git a/db/schema.rb b/db/schema.rb index 1824c41e..f62e0e9e 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,7 +10,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 2019_08_09_173934) do +ActiveRecord::Schema.define(version: 2019_08_13_220011) do create_table "api_keys", force: :cascade do |t| t.integer "user_id" @@ -2546,6 +2546,7 @@ ActiveRecord::Schema.define(version: 2019_08_09_173934) do t.string "age" t.string "gender" t.string "interests" + t.string "forums_badge_text" t.index ["deleted_at", "username"], name: "index_users_on_deleted_at_and_username" t.index ["deleted_at"], name: "index_users_on_deleted_at" t.index ["email"], name: "index_users_on_email", unique: true