+
<%= category[:percent_complete] %>%
<% end %>
diff --git a/app/views/layouts/forum.html.erb b/app/views/layouts/forum.html.erb
index 2901e560..9a1b075e 100644
--- a/app/views/layouts/forum.html.erb
+++ b/app/views/layouts/forum.html.erb
@@ -35,7 +35,6 @@
<%= render 'layouts/ganalytics' %>
-
<%= react_component("Footer") unless defined?(@show_footer) && !@show_footer %>
diff --git a/app/views/thredded/posts/_post.html.erb b/app/views/thredded/posts/_post.html.erb
index fda41c46..7d3e50b6 100644
--- a/app/views/thredded/posts/_post.html.erb
+++ b/app/views/thredded/posts/_post.html.erb
@@ -19,7 +19,7 @@
<%= content_tag :article, id: dom_id(post), class: "thredded--post thredded--#{post.read_state}--post #{muted_post ? muted_post_classes : 'card'}" do %>
<%= render 'thredded/posts_common/actions', post: post, actions: local_assigns[:actions] %>
<%= render 'thredded/posts_common/header', post: post %>
- <%= ForumReplacementService.replace(content) || render('thredded/posts/content', post: post) %>
+ <%= ForumReplacementService.replace_for(content, current_user) || render('thredded/posts/content', post: post) %>
<% if post.pending_moderation? && !Thredded.content_visible_while_pending_moderation %>
<%= t 'thredded.posts.pending_moderation_notice' %>
<% elsif post.blocked? && post.can_moderate? %>
diff --git a/app/views/thredded/private_posts/_private_post.html.erb b/app/views/thredded/private_posts/_private_post.html.erb
index a224d055..6dce3640 100644
--- a/app/views/thredded/private_posts/_private_post.html.erb
+++ b/app/views/thredded/private_posts/_private_post.html.erb
@@ -13,6 +13,7 @@
<%= content_tag :article, id: dom_id(private_post), class: "thredded--post thredded--#{private_post.read_state}--post" do %>
<%= render 'thredded/posts_common/actions', post: private_post, actions: local_assigns[:actions] %>
<%= render 'thredded/posts_common/header', post: private_post %>
- <%= content || render('thredded/private_posts/content', post: private_post) %>
+ <%= ForumReplacementService.replace_for(content, current_user) || render('thredded/private_posts/content', post: private_post) %>
+ <%# content || render('thredded/private_posts/content', post: private_post) %>
<% end %>
<% end %>
\ No newline at end of file
diff --git a/config/attributes/language.yml b/config/attributes/language.yml
index 0db82303..f4b9d605 100644
--- a/config/attributes/language.yml
+++ b/config/attributes/language.yml
@@ -7,6 +7,8 @@
:field_type: name
- :name: other_names
:label: Other names
+ - :name: description
+ :label: Description
- :name: universe_id
:label: Universe
:field_type: universe
diff --git a/config/initializers/promos.rb b/config/initializers/promos.rb
index 560d1547..b1b5cb9b 100644
--- a/config/initializers/promos.rb
+++ b/config/initializers/promos.rb
@@ -14,12 +14,3 @@ if Date.current >= 'March 1, 2020'.to_date
Rails.application.config.content_types[:premium] -= [Lore]
end
end
-
-# Lore free during the month of October
-# Need to change Creature.rb authorizer at the end
-if Date.current >= 'October 1, 2021'.to_date
- if Date.current < 'November 1, 2021'.to_date
- Rails.application.config.content_types[:free] << Creature
- Rails.application.config.content_types[:premium] -= [Creature]
- end
-end
diff --git a/config/routes.rb b/config/routes.rb
index 232b907b..3da255e5 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -156,6 +156,7 @@ Rails.application.routes.draw do
get '/', to: 'export#index', as: :notebook_export
get '/outline', to: 'export#outline', as: :notebook_outline
+ get '/markdown', to: 'export#markdown', as: :notebook_markdown
get '/notebook.json', to: 'export#notebook_json', as: :notebook_json
get '/notebook.xml', to: 'export#notebook_xml', as: :notebook_xml
get '/notebook.yml', to: 'export#notebook_yml', as: :notebook_yml
diff --git a/config/sidekiq.yml b/config/sidekiq.yml
index 536aebc4..7b5f8a6e 100644
--- a/config/sidekiq.yml
+++ b/config/sidekiq.yml
@@ -6,4 +6,5 @@
- default
- cache
- notifications
+ - export
- low_priority
diff --git a/lib/tasks/data_integrity.rake b/lib/tasks/data_integrity.rake
index 0f738259..35fc3a53 100644
--- a/lib/tasks/data_integrity.rake
+++ b/lib/tasks/data_integrity.rake
@@ -111,5 +111,47 @@ namespace :data_integrity do
end
end
+
+ desc "Remove orphan page references"
+ task remove_orphan_page_references: :environment do
+ PageReference.find_each do |reference|
+ if reference.referencing_page.nil?
+ puts "Deleting reference #{reference.id}"
+ reference.destroy
+ next
+ end
+
+ if reference.referenced_page.nil?
+ puts "Deleting reference #{reference.id}"
+ reference.destroy
+ next
+ end
+ end
+ end
+
+ desc "Ensure all users have the correct upload bandwidth amounts"
+ task correct_bandwidths: :environment do
+ puts "Disabling SQL logging"
+ old_logger = ActiveRecord::Base.logger
+ ActiveRecord::Base.logger = nil
+
+ # For the sake of minimizing db updates while blazing through all users,
+ # we ignore a small amount (1kb) of difference between saved bandwidth
+ # and calculated bandwidth. Users should never be more than 1kb off though.
+ byte_lenience = 1000
+
+ User.find_each do |user|
+ correct_bandwidth = SubscriptionService.recalculate_bandwidth_for(user)
+
+ difference = user.upload_bandwidth_kb - correct_bandwidth
+ if difference.abs > byte_lenience
+ # puts "Correcting user #{user.id} bandwidth: #{user.upload_bandwidth_kb} --> #{correct_bandwidth}"
+ user.update(upload_bandwidth_kb: correct_bandwidth)
+ end
+ end
+
+ puts "Re-enabling SQL logging"
+ ActiveRecord::Base.logger = old_logger
+ end
end
diff --git a/test/controllers/page_tags_controller_test.rb b/test/controllers/page_tags_controller_test.rb
index 2f89a08a..a3f2da9f 100644
--- a/test/controllers/page_tags_controller_test.rb
+++ b/test/controllers/page_tags_controller_test.rb
@@ -1,9 +1,5 @@
require 'test_helper'
class PageTagsControllerTest < ActionDispatch::IntegrationTest
- test "should get remove" do
- get page_tags_remove_url
- assert_response :success
- end
end
diff --git a/yarn.lock b/yarn.lock
index 345851e0..06fb3630 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -3312,9 +3312,9 @@ flush-write-stream@^1.0.0:
readable-stream "^2.3.6"
follow-redirects@^1.0.0, follow-redirects@^1.14.0:
- version "1.14.7"
- resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.14.7.tgz#2004c02eb9436eee9a21446a6477debf17e81685"
- integrity sha512-+hbxoLbFMbRKDwohX8GkTataGqO6Jb7jGwpAlwgy2bIz25XtRm7KEzJM76R1WiNT5SwZkX4Y75SwBolkpmE7iQ==
+ version "1.14.8"
+ resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.14.8.tgz#016996fb9a11a100566398b1c6839337d7bfa8fc"
+ integrity sha512-1x0S9UVJHsQprFcEC/qnNzBLcIxsjAV905f/UkQxbclCsoTWlacCNOpQa/anodLl2uaEKFhfWOvM2Qg77+15zA==
for-in@^1.0.2:
version "1.0.2"
@@ -7365,9 +7365,9 @@ urix@^0.1.0:
integrity sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI=
url-parse@^1.4.3, url-parse@^1.5.1:
- version "1.5.3"
- resolved "https://registry.yarnpkg.com/url-parse/-/url-parse-1.5.3.tgz#71c1303d38fb6639ade183c2992c8cc0686df862"
- integrity sha512-IIORyIQD9rvj0A4CLWsHkBBJuNqWpFQe224b6j9t/ABmquIS0qDU2pY6kl6AuOrL5OkCXHMCFNe1jBcuAggjvQ==
+ version "1.5.10"
+ resolved "https://registry.yarnpkg.com/url-parse/-/url-parse-1.5.10.tgz#9d3c2f736c1d75dd3bd2be507dcc111f1e2ea9c1"
+ integrity sha512-WypcfiRhfeUP9vvF0j6rw0J3hrWrw6iZv3+22h6iRMJ/8z1Tj6XfLP4DsUix5MhMPnXpiHDoKyoZ/bdCkwBCiQ==
dependencies:
querystringify "^2.1.1"
requires-port "^1.0.0"