Skip to content

Commit

Permalink
Merge branch 'master' into AO3-6773_invite_request_declined_mailer_pr…
Browse files Browse the repository at this point in the history
…eview
  • Loading branch information
amecreate committed Nov 25, 2024
2 parents 6d50154 + 1687ff5 commit 3a84601
Show file tree
Hide file tree
Showing 75 changed files with 4,422 additions and 2,036 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/automated-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ jobs:
run: bundle exec ${{ matrix.tests.command }} ${{ matrix.tests.arguments }}

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
uses: codecov/codecov-action@v5
with:
# Optional for public repos. However, individual forks can set this
# secret to reduce the chance of being rate-limited by GitHub.
Expand Down
5 changes: 5 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,11 @@ Migration/LargeTableSchemaUpdate:
- users
- works

Naming/VariableNumber:
AllowedIdentifiers:
- age_over_13
- no_age_over_13

Rails/DefaultScope:
Enabled: true

Expand Down
116 changes: 57 additions & 59 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -24,75 +24,75 @@ GEM
remote: https://rubygems.org/
specs:
aaronh-chronic (0.3.9)
actioncable (7.0.8.4)
actionpack (= 7.0.8.4)
activesupport (= 7.0.8.4)
actioncable (7.0.8.5)
actionpack (= 7.0.8.5)
activesupport (= 7.0.8.5)
nio4r (~> 2.0)
websocket-driver (>= 0.6.1)
actionmailbox (7.0.8.4)
actionpack (= 7.0.8.4)
activejob (= 7.0.8.4)
activerecord (= 7.0.8.4)
activestorage (= 7.0.8.4)
activesupport (= 7.0.8.4)
actionmailbox (7.0.8.5)
actionpack (= 7.0.8.5)
activejob (= 7.0.8.5)
activerecord (= 7.0.8.5)
activestorage (= 7.0.8.5)
activesupport (= 7.0.8.5)
mail (>= 2.7.1)
net-imap
net-pop
net-smtp
actionmailer (7.0.8.4)
actionpack (= 7.0.8.4)
actionview (= 7.0.8.4)
activejob (= 7.0.8.4)
activesupport (= 7.0.8.4)
actionmailer (7.0.8.5)
actionpack (= 7.0.8.5)
actionview (= 7.0.8.5)
activejob (= 7.0.8.5)
activesupport (= 7.0.8.5)
mail (~> 2.5, >= 2.5.4)
net-imap
net-pop
net-smtp
rails-dom-testing (~> 2.0)
actionpack (7.0.8.4)
actionview (= 7.0.8.4)
activesupport (= 7.0.8.4)
actionpack (7.0.8.5)
actionview (= 7.0.8.5)
activesupport (= 7.0.8.5)
rack (~> 2.0, >= 2.2.4)
rack-test (>= 0.6.3)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.2.0)
actionpack-page_caching (1.2.4)
actionpack (>= 4.0.0)
actiontext (7.0.8.4)
actionpack (= 7.0.8.4)
activerecord (= 7.0.8.4)
activestorage (= 7.0.8.4)
activesupport (= 7.0.8.4)
actiontext (7.0.8.5)
actionpack (= 7.0.8.5)
activerecord (= 7.0.8.5)
activestorage (= 7.0.8.5)
activesupport (= 7.0.8.5)
globalid (>= 0.6.0)
nokogiri (>= 1.8.5)
actionview (7.0.8.4)
activesupport (= 7.0.8.4)
actionview (7.0.8.5)
activesupport (= 7.0.8.5)
builder (~> 3.1)
erubi (~> 1.4)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.1, >= 1.2.0)
active_record_query_trace (1.8.2)
activerecord (>= 6.0.0)
activejob (7.0.8.4)
activesupport (= 7.0.8.4)
activejob (7.0.8.5)
activesupport (= 7.0.8.5)
globalid (>= 0.3.6)
activemodel (7.0.8.4)
activesupport (= 7.0.8.4)
activemodel (7.0.8.5)
activesupport (= 7.0.8.5)
activemodel-serializers-xml (1.0.2)
activemodel (> 5.x)
activesupport (> 5.x)
builder (~> 3.1)
activerecord (7.0.8.4)
activemodel (= 7.0.8.4)
activesupport (= 7.0.8.4)
activestorage (7.0.8.4)
actionpack (= 7.0.8.4)
activejob (= 7.0.8.4)
activerecord (= 7.0.8.4)
activesupport (= 7.0.8.4)
activerecord (7.0.8.5)
activemodel (= 7.0.8.5)
activesupport (= 7.0.8.5)
activestorage (7.0.8.5)
actionpack (= 7.0.8.5)
activejob (= 7.0.8.5)
activerecord (= 7.0.8.5)
activesupport (= 7.0.8.5)
marcel (~> 1.0)
mini_mime (>= 1.1.0)
activesupport (7.0.8.4)
activesupport (7.0.8.5)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 1.6, < 2)
minitest (>= 5.1)
Expand Down Expand Up @@ -308,7 +308,7 @@ GEM
httparty (0.21.0)
mini_mime (>= 1.0.0)
multi_xml (>= 0.5.2)
i18n (1.14.5)
i18n (1.14.6)
concurrent-ruby (~> 1.0)
i18n-tasks (1.0.14)
activesupport (>= 4.0.2)
Expand Down Expand Up @@ -336,7 +336,7 @@ GEM
activesupport (>= 4)
railties (>= 4)
request_store (~> 1.0)
loofah (2.22.0)
loofah (2.23.1)
crass (~> 1.0.2)
nokogiri (>= 1.12.0)
mail (2.8.1)
Expand Down Expand Up @@ -437,20 +437,20 @@ GEM
rack (~> 2.2, >= 2.2.4)
rack-test (2.1.0)
rack (>= 1.3)
rails (7.0.8.4)
actioncable (= 7.0.8.4)
actionmailbox (= 7.0.8.4)
actionmailer (= 7.0.8.4)
actionpack (= 7.0.8.4)
actiontext (= 7.0.8.4)
actionview (= 7.0.8.4)
activejob (= 7.0.8.4)
activemodel (= 7.0.8.4)
activerecord (= 7.0.8.4)
activestorage (= 7.0.8.4)
activesupport (= 7.0.8.4)
rails (7.0.8.5)
actioncable (= 7.0.8.5)
actionmailbox (= 7.0.8.5)
actionmailer (= 7.0.8.5)
actionpack (= 7.0.8.5)
actiontext (= 7.0.8.5)
actionview (= 7.0.8.5)
activejob (= 7.0.8.5)
activemodel (= 7.0.8.5)
activerecord (= 7.0.8.5)
activestorage (= 7.0.8.5)
activesupport (= 7.0.8.5)
bundler (>= 1.15.0)
railties (= 7.0.8.4)
railties (= 7.0.8.5)
rails-controller-testing (1.0.5)
actionpack (>= 5.0.1.rc1)
actionview (>= 5.0.1.rc1)
Expand All @@ -465,9 +465,9 @@ GEM
rails-i18n (7.0.8)
i18n (>= 0.7, < 2)
railties (>= 6.0.0, < 8)
railties (7.0.8.4)
actionpack (= 7.0.8.4)
activesupport (= 7.0.8.4)
railties (7.0.8.5)
actionpack (= 7.0.8.5)
activesupport (= 7.0.8.5)
method_source
rake (>= 12.2)
thor (~> 1.0)
Expand Down Expand Up @@ -499,8 +499,7 @@ GEM
http-cookie (>= 1.0.2, < 2.0)
mime-types (>= 1.16, < 4.0)
netrc (~> 0.8)
rexml (3.3.6)
strscan
rexml (3.3.9)
rollout (2.4.3)
rspec-core (3.13.0)
rspec-support (~> 3.13.0)
Expand Down Expand Up @@ -587,7 +586,6 @@ GEM
rack (> 1, < 3)
stackprof (0.2.26)
stringex (2.8.6)
strscan (3.1.0)
sys-uname (1.2.3)
ffi (~> 1.1)
terminal-table (3.0.2)
Expand Down Expand Up @@ -618,7 +616,7 @@ GEM
addressable (>= 2.8.0)
crack (>= 0.3.2)
hashdiff (>= 0.4.0, < 2.0.0)
webrick (1.8.1)
webrick (1.8.2)
webrobots (0.1.2)
websocket (1.2.10)
websocket-driver (0.7.6)
Expand Down
2 changes: 1 addition & 1 deletion SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ with details and reproduction steps. We will get back to you as soon as possible
and we may ask for additional information or guidance.

Please avoid testing for security issues on the Archive of Our Own itself,
as you risk disrupting other users and violating the [Terms of Service](https://archiveofourown.org/tos#IV.C.).
as you risk disrupting other users and violating the [Terms of Service](https://archiveofourown.org/content#II.K.1).

Please give us a reasonable amount of time to address the issue before any
disclosure to the public or a third-party.
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ def load_admin_banner
before_action :load_tos_popup
def load_tos_popup
# Integers only, YYYY-MM-DD format of date Board approved TOS
@current_tos_version = 20180523
@current_tos_version = 2024_11_19 # rubocop:disable Style/NumericLiterals
end

# store previous page in session to make redirecting back possible
Expand Down
8 changes: 5 additions & 3 deletions app/controllers/challenge_assignments_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -219,9 +219,11 @@ def default_all
def default
@challenge_assignment.defaulted_at = Time.now
@challenge_assignment.save
@challenge_assignment.collection.notify_maintainers("Challenge default by #{@challenge_assignment.offer_byline}",
"Signed-up participant #{@challenge_assignment.offer_byline} has defaulted on their assignment for #{@challenge_assignment.request_byline}. " +
"You may want to assign a pinch hitter on the collection assignments page: #{collection_assignments_url(@challenge_assignment.collection)}")

assignments_page_url = collection_assignments_url(@challenge_assignment.collection)

@challenge_assignment.collection.notify_maintainers_challenge_default(@challenge_assignment, assignments_page_url)

flash[:notice] = "We have notified the collection maintainers that you had to default on your assignment."
redirect_to user_assignments_path(current_user)
end
Expand Down
12 changes: 12 additions & 0 deletions app/controllers/home_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,25 @@ class HomeController < ApplicationController
def unicorn_test
end

def content
@page_title = t(".page_title")
render action: "content", layout: "application"
end

def privacy
@page_title = t(".page_title")
render action: "privacy", layout: "application"
end

# terms of service
def tos
@page_title = t(".page_title")
render action: "tos", layout: "application"
end

# terms of service faq
def tos_faq
@page_title = t(".page_title")
render action: "tos_faq", layout: "application"
end

Expand Down
2 changes: 1 addition & 1 deletion app/controllers/users/registrations_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def configure_permitted_parameters
devise_parameter_sanitizer.permit(
:sign_up,
keys: [
:password_confirmation, :email, :age_over_13, :terms_of_service, :accepted_tos_version
:password_confirmation, :email, :age_over_13, :data_processing, :terms_of_service, :accepted_tos_version
]
)
end
Expand Down
14 changes: 13 additions & 1 deletion app/controllers/users_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,18 @@ def edit
authorize @user.profile if logged_in_as_admin?
end

def change_email
@page_subtitle = t(".browser_title")
end

def change_password
@page_subtitle = t(".browser_title")
end

def change_username
@page_subtitle = t(".browser_title")
end

def changed_password
unless params[:password] && reauthenticate
render(:change_password) && return
Expand Down Expand Up @@ -315,7 +327,7 @@ def destroy_author
use_default = params[:use_default] == 'true' || params[:sole_author] == 'orphan_pseud'

Creatorship.orphan(pseuds, works, use_default)
Collection.orphan(pseuds, @sole_owned_collections, use_default)
Collection.orphan(pseuds, @sole_owned_collections, default: use_default)
elsif params[:sole_author] == 'delete'
# Deletes works where user is sole author
@sole_authored_works.each(&:destroy)
Expand Down
2 changes: 2 additions & 0 deletions app/controllers/works_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,8 @@ def drafts
redirect_to logged_in? ? user_path(current_user) : new_user_session_path
return
end

@page_subtitle = t(".page_title", username: @user.login)

if params[:pseud_id]
@pseud = @user.pseuds.find_by(name: params[:pseud_id])
Expand Down
50 changes: 31 additions & 19 deletions app/helpers/application_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,24 +22,23 @@ def classes_for_main
show_sidebar = ((@user || @admin_posts || @collection || show_wrangling_dashboard) && !@hide_dashboard)
class_names += " dashboard" if show_sidebar

if page_has_filters?
class_names += " filtered"
end

if %w(abuse_reports feedbacks known_issues).include?(controller.controller_name)
class_names = "system support " + controller.controller_name + ' ' + controller.action_name
end
if controller.controller_name == "archive_faqs"
class_names = "system docs support faq " + controller.action_name
end
if controller.controller_name == "wrangling_guidelines"
class_names = "system docs guideline " + controller.action_name
end
if controller.controller_name == "home"
class_names = "system docs " + controller.action_name
end
if controller.controller_name == "errors"
class_names = "system " + controller.controller_name + " error-" + controller.action_name
class_names += " filtered" if page_has_filters?

case controller.controller_name
when "abuse_reports", "feedbacks", "known_issues"
class_names = "system support #{controller.controller_name} #{controller.action_name}"
when "archive_faqs"
class_names = "system docs support faq #{controller.action_name}"
when "wrangling_guidelines"
class_names = "system docs guideline #{controller.action_name}"
when "home"
class_names = if %w(content privacy).include?(controller.action_name)
"system docs tos tos-#{controller.action_name}"
else
"system docs #{controller.action_name}"
end
when "errors"
class_names = "system #{controller.controller_name} error-#{controller.action_name}"
end

class_names
Expand Down Expand Up @@ -631,4 +630,17 @@ def disallow_robots?(item)
item.users.all? { |u| u&.preference&.minimize_search_engines? }
end
end
end # end of ApplicationHelper

# Determines if the page (controller and action combination) does not need
# to show the ToS (Terms of Service) popup.
def tos_exempt_page?
case params[:controller]
when "home"
%w[index content dmca privacy tos tos_faq].include?(params[:action])
when "abuse_reports", "feedbacks", "users/sessions"
%w[new create].include?(params[:action])
when "archive_faqs"
%w[index show].include?(params[:action])
end
end
end
Loading

0 comments on commit 3a84601

Please sign in to comment.