bible270 0.14.0 → 0.14.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/app/controllers/bible270/days_controller.rb +2 -1
- data/app/models/bible270/reader.rb +14 -0
- data/app/views/bible270/admin/index.html.erb +8 -6
- data/app/views/bible270/admin/show.html.erb +3 -1
- data/app/views/bible270/days/show.html.erb +1 -1
- data/app/views/bible270/shared/_styles.html.erb +5 -4
- data/lib/bible270/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 663793ae728057f408f03f490d324349dc105dc07395b1e3f29ee6c410331039
|
|
4
|
+
data.tar.gz: 9243a5ee0e3f921de058155825317684776babbbac0488cfca6bb2cbf5c810ad
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 393484c84f487178ba20d52191a8bbdb79d7e9009e1f7761c0c9514ab894923c52c021b6f9a0c66e8dfcaa5563d953e44e702c49cc800dfedf4ad43037e5b79d
|
|
7
|
+
data.tar.gz: 5c9dee8f97be46ae34b22c6cdf11c6fba418ad3f914847cd57d191d45de72fb77e152d92b44b32bbf8505f0d1bb1557e3e10dcacc3261c46a83bb3c4dc4540b3
|
|
@@ -13,7 +13,8 @@ module Bible270
|
|
|
13
13
|
@readers = @readers.sort_by { |r| -@days_completed[r.id] }
|
|
14
14
|
|
|
15
15
|
@start_day = current_reader&.current_day || 1
|
|
16
|
-
|
|
16
|
+
# nil outside the plan's window, so no "Go to today" before it begins
|
|
17
|
+
@today_day = current_reader&.today_day
|
|
17
18
|
@community_start_date = Bible270.config.start_date
|
|
18
19
|
@allow_reader_start_date = Bible270.config.allow_reader_start_date
|
|
19
20
|
end
|
|
@@ -336,6 +336,20 @@ module Bible270
|
|
|
336
336
|
end
|
|
337
337
|
|
|
338
338
|
# Raw, unclamped — lets callers distinguish "not started yet" / "finished".
|
|
339
|
+
# The plan day that today actually is, or nil when today falls outside the
|
|
340
|
+
# plan's window. calendar_day clamps, so before the start date it reports day
|
|
341
|
+
# 1 — which made day 1 claim to be "today" for anyone whose plan hadn't begun.
|
|
342
|
+
def today_day
|
|
343
|
+
raw = raw_calendar_day
|
|
344
|
+
return nil if raw.nil?
|
|
345
|
+
|
|
346
|
+
Plan.valid_day?(raw) ? raw : nil
|
|
347
|
+
end
|
|
348
|
+
|
|
349
|
+
def today?(day)
|
|
350
|
+
today_day == day
|
|
351
|
+
end
|
|
352
|
+
|
|
339
353
|
def raw_calendar_day
|
|
340
354
|
Plan.day_for(Date.current, effective_start_date, clamp: false)
|
|
341
355
|
end
|
|
@@ -5,17 +5,17 @@
|
|
|
5
5
|
<%= link_to 'Moderate reflections →', admin_comments_path %></p>
|
|
6
6
|
|
|
7
7
|
<div class="b270-panel">
|
|
8
|
-
<h2 class="b270-subhead">This run of the plan
|
|
8
|
+
<h2 class="b270-subhead">This run of the plan is <%= @enrollment_closed ? 'closed' : 'open' %> to new readers.</h2>
|
|
9
9
|
<% if @enrollment_closed %>
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
<% if @enrollment_closed_at %>
|
|
11
|
+
<p class="b270-startline">Enrollment closed
|
|
12
|
+
on <%= @enrollment_closed_at.strftime('%B %-d, %Y') %><% end %>.
|
|
12
13
|
The <%= @readers.size %> reader<%= 's' unless @readers.size == 1 %> already taking part can
|
|
13
14
|
still sign in and carry on.</p>
|
|
14
15
|
<%= button_to 'Open to new readers', admin_enrollment_path, method: :patch,
|
|
15
16
|
params: { state: 'open' }, class: 'b270-btn' %>
|
|
16
17
|
<% else %>
|
|
17
|
-
<p class="b270-startline"
|
|
18
|
-
time joins this run.</p>
|
|
18
|
+
<p class="b270-startline">Anyone signing in for the first time joins this run.</p>
|
|
19
19
|
<%= button_to 'Close to new readers', admin_enrollment_path, method: :patch,
|
|
20
20
|
params: { state: 'closed' }, class: 'b270-btn',
|
|
21
21
|
form: { data: { turbo_confirm: 'Close this run? Existing readers keep their access.' } } %>
|
|
@@ -28,7 +28,9 @@
|
|
|
28
28
|
<div class="b270-li">
|
|
29
29
|
<%= b270_avatar(reader, size: 34) %>
|
|
30
30
|
<div>
|
|
31
|
-
<div class="name"><%= link_to reader.display_name, admin_reader_path(reader), style: 'text-decoration:none'
|
|
31
|
+
<div class="name"><%= link_to reader.display_name, admin_reader_path(reader), style: 'text-decoration:none' %>
|
|
32
|
+
<% if Bible270.config.admin?(reader) %> <span class="sub"><strong>[admin]</strong></span> <% end %>
|
|
33
|
+
</div>
|
|
32
34
|
<div class="sub">
|
|
33
35
|
<%= reader.email.presence || reader.provider %>
|
|
34
36
|
· <%= @days_completed[reader.id] %>/<%= Bible270::Plan::DAYS %> days
|
|
@@ -6,7 +6,9 @@
|
|
|
6
6
|
<%= @reader.email.presence || @reader.provider %> ·
|
|
7
7
|
<%= @days_completed %> of <%= Bible270::Plan::DAYS %> days ·
|
|
8
8
|
<%= @reader.completion_percent %>%
|
|
9
|
-
<% if @reader.
|
|
9
|
+
<% if @reader.today_day %>· day <%= @reader.today_day %> today
|
|
10
|
+
<% elsif @reader.not_started_yet? %>· starts <%= @reader.effective_start_date.strftime('%b %-d, %Y') %>
|
|
11
|
+
<% elsif @reader.past_end_date? %>· finished <%= @reader.plan_end_date.strftime('%b %-d, %Y') %><% end %>
|
|
10
12
|
</p>
|
|
11
13
|
|
|
12
14
|
<div class="b270-panel">
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
<% if signed_in? && current_reader.dated? %>
|
|
7
7
|
<div class="date">
|
|
8
8
|
<%= current_reader.date_for_day(@day).strftime("%A, %B %-d, %Y") %>
|
|
9
|
-
<% if current_reader.
|
|
9
|
+
<% if current_reader.today?(@day) %><span class="b270-badge">Today</span><% end %>
|
|
10
10
|
</div>
|
|
11
11
|
<% end %>
|
|
12
12
|
</div>
|
|
@@ -86,9 +86,10 @@
|
|
|
86
86
|
.b270-arrow:hover{border-color:var(--gold);color:var(--gold)}
|
|
87
87
|
.b270-arrow.disabled{opacity:.35;pointer-events:none}
|
|
88
88
|
.b270-dayhead{flex:1}
|
|
89
|
-
.b270-dayhead .k{font-family:"Spectral",serif;font-size:24px;font-weight:600;line-height:1}
|
|
90
|
-
.b270-
|
|
91
|
-
.b270-dayhead .
|
|
89
|
+
.b270-dayhead .k{display:flex;align-items:center;flex-wrap:wrap;gap:9px;font-family:"Spectral",serif;font-size:24px;font-weight:600;line-height:1}
|
|
90
|
+
.b270-dayhead .date{display:flex;align-items:center;flex-wrap:wrap;gap:9px;color:var(--faint);font-size:13px;margin-top:4px}
|
|
91
|
+
.b270-dayhead .b270-badge{margin-left:0}
|
|
92
|
+
.b270-badge{display:inline-block;vertical-align:middle;line-height:1;font-size:10.5px;font-weight:600;letter-spacing:.1em;text-transform:uppercase;color:#fff;background:var(--gold-lite);padding:5px 8px 4px;border-radius:20px;margin-left:9px}
|
|
92
93
|
|
|
93
94
|
/* readings */
|
|
94
95
|
.b270-readings{background:var(--card);border:1px solid var(--line);border-radius:14px;box-shadow:var(--shadow);overflow:hidden}
|
|
@@ -130,7 +131,7 @@
|
|
|
130
131
|
.b270-cdel{font-size:12px;color:var(--oxblood);background:none;border:none;cursor:pointer;padding:0;margin-left:8px}
|
|
131
132
|
.b270-form textarea{width:100%;font:inherit;font-size:15px;border:1px solid var(--line);border-radius:10px;padding:11px 13px;background:#fff;resize:vertical;min-height:76px}
|
|
132
133
|
.b270-form .row{display:flex;align-items:center;gap:10px;margin-top:10px}
|
|
133
|
-
.b270 .b270-btn{border:none;border-radius:10px;padding:
|
|
134
|
+
.b270 .b270-btn{border:none;border-radius:10px;padding:8px 16px;margin-top:4px;font:inherit;font-weight:600;font-size:14px;cursor:pointer;background:var(--ink);color:var(--paper);text-decoration:none;display:inline-block}
|
|
134
135
|
.b270-btn:hover{background:#3a352b}
|
|
135
136
|
|
|
136
137
|
/* community */
|
data/lib/bible270/version.rb
CHANGED