Skip to content

Commit c2f8fb6

Browse files
committed
Add broad structure for training
1 parent efe75e7 commit c2f8fb6

6 files changed

Lines changed: 172 additions & 0 deletions

File tree

app/assets/stylesheets/_variables.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ $danger: #EB5959;
1818
$success: #2ECC71;
1919
$info: #58A09A;
2020
$brand: #4B68FF;
21+
$brand-comp: #F05137;
2122

2223

2324
$data: (

app/assets/stylesheets/complaints.scss

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,3 +60,44 @@
6060
.is-lead + h1.complaint-title {
6161
margin-top: -1rem;
6262
}
63+
64+
.is-brand-comp {
65+
color: $brand-comp;
66+
}
67+
68+
.with-subtitle {
69+
margin-bottom: 0;
70+
}
71+
72+
.subtitle {
73+
margin-top: 0;
74+
font-weight: normal;
75+
font-size: 1.2rem;
76+
}
77+
78+
.modules {
79+
display: grid;
80+
grid-template-columns: repeat(auto-fit, minmax(20rem, 1fr));
81+
gap: 0.5rem;
82+
}
83+
84+
.module-widget {
85+
border: 1px solid $muted-graphic;
86+
border-radius: 0.2rem;
87+
padding: 0.5rem;
88+
color: $key !important;
89+
90+
> h4 {
91+
text-decoration: underline;
92+
}
93+
94+
> p {
95+
text-decoration: none;
96+
}
97+
98+
&:hover {
99+
background: $primary;
100+
color: white !important;
101+
text-decoration: none !important;
102+
}
103+
}

app/controllers/complaints_controller.rb

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ class ComplaintsController < ApplicationController
33
before_action :access_check, only: [:show, :comment]
44
before_action :write_access_check, only: [:self_assign, :update_status, :change_content_type]
55
before_action :verify_staff, only: [:reports, :reporting]
6+
before_action :training_access, only: [:training]
67

78
def index
89
render layout: 'without_sidebar'
@@ -202,6 +203,16 @@ def reporting
202203
render layout: 'without_sidebar'
203204
end
204205

206+
def training
207+
pages = Dir.glob(Rails.root.join('app', 'views', 'complaints', 'training', '*.html.erb'))
208+
.map { |page| File.basename(page, '.html.erb') }
209+
if pages.include?(params[:page])
210+
render "complaints/training/#{params[:page]}", layout: 'osa_training'
211+
else
212+
not_found!
213+
end
214+
end
215+
205216
private
206217

207218
def access_check
@@ -235,4 +246,10 @@ def set_complaint
235246

236247
@complaint
237248
end
249+
250+
def training_access
251+
unless user_signed_in? && (current_user.staff? || current_user.at_least_moderator?)
252+
not_found!
253+
end
254+
end
238255
end
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
<h1 class="is-brand-comp with-subtitle">Online Safety Act</h1>
2+
<h2 class="subtitle">Moderator Training</h2>
3+
4+
<p>
5+
As part of our responsibilities under the Online Safety Act, we're obligated to provide training to all staff and
6+
volunteers undertaking moderation duties.
7+
</p>
8+
<p>
9+
Take your training here. Completing all the modules will record that you have completed the training, but you can
10+
revisit these pages at any time if you need guidance when making moderation decisions.
11+
</p>
12+
13+
<div class="modules">
14+
<%= link_to osa_training_path('overview'), class: 'module-widget' do %>
15+
<h4>Overview</h4>
16+
<p class="has-font-size-small">
17+
An overview of the Online Safety Act, our duties, and your responsibilities as a volunteer moderator.
18+
</p>
19+
<% end %>
20+
<%= link_to osa_training_path('illegal-content'), class: 'module-widget' do %>
21+
<h4>Priority & Non-Priority Illegal Content</h4>
22+
<p class="has-font-size-small">
23+
An explanation of the difference between the 17 types of priority illegal content, and other applicable types of
24+
non-priority illegal content.
25+
</p>
26+
<% end %>
27+
<%= link_to osa_training_path('overview'), class: 'module-widget' do %>
28+
<h4>Definitions</h4>
29+
<p class="has-font-size-small">
30+
Definitions of all the types of illegal content which apply to us.
31+
</p>
32+
<% end %>
33+
<%= link_to osa_training_path('overview'), class: 'module-widget' do %>
34+
<h4>Handling Illegal Content</h4>
35+
<p class="has-font-size-small">
36+
Your responsibilities and the steps you need to take in response to identifying potentially illegal content.
37+
</p>
38+
<% end %>
39+
<%= link_to osa_training_path('overview'), class: 'module-widget' do %>
40+
<h4>Higher-Risk Content</h4>
41+
<p class="has-font-size-small">
42+
Some types of content are more likely to occur in our communities than others. More detail on those here.
43+
</p>
44+
<% end %>
45+
<%= link_to osa_training_path('overview'), class: 'module-widget' do %>
46+
<h4>Conclusion</h4>
47+
<p class="has-font-size-small">
48+
Thank you for taking the time to complete this training. Mark it as complete here and come back here if you need
49+
to refer back to it.
50+
</p>
51+
<% end %>
52+
</div>
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
<!DOCTYPE html>
2+
<html lang="en" dir="ltr">
3+
<head>
4+
<%= render 'layouts/head' %>
5+
</head>
6+
<body class="<%= Rails.env.development? ? 'development' : '' %>"
7+
data-user-id="<%= user_signed_in? ? current_user.id : 'none' %>"
8+
data-mathjax="<%= SiteSetting['MathJaxEnabled'] %>">
9+
<%= render 'layouts/header' %>
10+
11+
<main class="container">
12+
<div class="grid">
13+
<div class="grid--cell is-8-lg is-12">
14+
<div class="has-padding-4">
15+
<%= render 'shared/notices' %>
16+
17+
<% if @first_visit_notice %>
18+
<%= render 'notices/first_visit' %>
19+
<% end %>
20+
21+
<%= yield %>
22+
</div>
23+
</div>
24+
25+
<div class="grid--cell is-4-lg is-12 js-sidebar" role="complementary">
26+
<nav class="widget">
27+
<div class="widget--body">
28+
<h3>Modules</h3>
29+
<p>Navigate through the modules here.</p>
30+
<div class="menu">
31+
<%= link_to 'Home', osa_training_path('home'),
32+
class: "menu--item #{'is-active' if params[:page] == 'home'}" %>
33+
<%= link_to 'Overview', osa_training_path('overview'),
34+
class: "menu--item #{'is-active' if params[:page] == 'overview'}" %>
35+
<%= link_to 'Priority & Non-Prority Illegal Content', osa_training_path('illegal-content'),
36+
class: "menu--item #{'is-active' if params[:page] == 'illegal-content'}" %>
37+
<%= link_to 'Definitions', osa_training_path('definitions'),
38+
class: "menu--item #{'is-active' if params[:page] == 'definitions'}" %>
39+
<%= link_to 'Handling Illegal Content', osa_training_path('handling'),
40+
class: "menu--item #{'is-active' if params[:page] == 'handling'}" %>
41+
<%= link_to 'Higher-Risk Content', osa_training_path('higher-risk'),
42+
class: "menu--item #{'is-active' if params[:page] == 'higher-risk'}" %>
43+
<%= link_to 'Conclusion', osa_training_path('conclusion'),
44+
class: "menu--item #{'is-active' if params[:page] == 'conclusion'}" %>
45+
</div>
46+
</div>
47+
</nav>
48+
</div>
49+
</div>
50+
</main>
51+
52+
<%= render 'layouts/footer' %>
53+
54+
<%= render 'layouts/matomo' %>
55+
56+
<% if Rails.env.production? %>
57+
<script src="https://7zb04r9ckbwg.statuspage.io/embed/script.js"></script>
58+
<% end %>
59+
</body>
60+
</html>

config/routes.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -388,6 +388,7 @@
388388
post 'report/:token/content_type', to: 'complaints#change_content_type', as: :update_complaint_content_type
389389
get 'reports', to: 'complaints#reports', as: :complaints
390390
get 'reporting', to: 'complaints#reporting', as: :complaints_reporting
391+
get 'training/:page', to: 'complaints#training', as: :osa_training
391392
end
392393

393394
get '403', to: 'errors#forbidden'

0 commit comments

Comments
 (0)