bible270 1.0.0 → 1.1.0

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.
Files changed (37) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +57 -9
  3. data/README.md +7 -10
  4. data/app/controllers/bible270/admin_controller.rb +2 -3
  5. data/app/controllers/bible270/days_controller.rb +1 -36
  6. data/app/controllers/bible270/profiles_controller.rb +20 -1
  7. data/app/controllers/bible270/readers_controller.rb +1 -66
  8. data/app/mailers/bible270/notice_mailer.rb +32 -8
  9. data/app/models/bible270/comment.rb +33 -9
  10. data/app/models/bible270/reader.rb +8 -40
  11. data/app/views/bible270/comments/create.turbo_stream.erb +0 -2
  12. data/app/views/bible270/comments/index.html.erb +0 -24
  13. data/app/views/bible270/days/_completers.html.erb +0 -2
  14. data/app/views/bible270/days/_day_progress.html.erb +3 -3
  15. data/app/views/bible270/days/index.html.erb +1 -27
  16. data/app/views/bible270/days/show.html.erb +4 -16
  17. data/app/views/bible270/notice_mailer/{mentioned.html.erb → comment_notice.html.erb} +5 -2
  18. data/app/views/bible270/notice_mailer/{mentioned.text.erb → comment_notice.text.erb} +5 -2
  19. data/app/views/bible270/profiles/edit.html.erb +11 -0
  20. data/app/views/bible270/readers/_next_steps.html.erb +24 -60
  21. data/app/views/bible270/readers/index.html.erb +2 -3
  22. data/app/views/bible270/readers/progress.html.erb +6 -30
  23. data/app/views/bible270/readers/show.html.erb +1 -6
  24. data/app/views/bible270/shared/_day_index.html.erb +6 -4
  25. data/app/views/bible270/shared/_header.html.erb +21 -4
  26. data/app/views/bible270/shared/_progress.html.erb +3 -14
  27. data/app/views/bible270/shared/_styles.html.erb +3 -32
  28. data/config/routes.rb +0 -4
  29. data/db/migrate/20260101000011_add_mention_notices_to_bible270_readers.rb +3 -3
  30. data/lib/bible270/configuration.rb +8 -5
  31. data/lib/bible270/mentions.rb +0 -9
  32. data/lib/bible270/version.rb +1 -1
  33. data/lib/generators/bible270/install/install_generator.rb +2 -0
  34. data/lib/generators/bible270/install/templates/bible270.rb.tt +2 -0
  35. metadata +3 -5
  36. data/app/views/bible270/days/_start_date.html.erb +0 -43
  37. data/app/views/bible270/shared/_reading_mode.html.erb +0 -62
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bible270
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew vonderLuft
@@ -118,17 +118,16 @@ files:
118
118
  - app/views/bible270/days/_completers.html.erb
119
119
  - app/views/bible270/days/_day_progress.html.erb
120
120
  - app/views/bible270/days/_reading.html.erb
121
- - app/views/bible270/days/_start_date.html.erb
122
121
  - app/views/bible270/days/index.html.erb
123
122
  - app/views/bible270/days/show.html.erb
124
123
  - app/views/bible270/likes/_likes.html.erb
125
124
  - app/views/bible270/likes/toggle.turbo_stream.erb
126
125
  - app/views/bible270/notice_mailer/broadcast.html.erb
127
126
  - app/views/bible270/notice_mailer/broadcast.text.erb
127
+ - app/views/bible270/notice_mailer/comment_notice.html.erb
128
+ - app/views/bible270/notice_mailer/comment_notice.text.erb
128
129
  - app/views/bible270/notice_mailer/daily_reminder.html.erb
129
130
  - app/views/bible270/notice_mailer/daily_reminder.text.erb
130
- - app/views/bible270/notice_mailer/mentioned.html.erb
131
- - app/views/bible270/notice_mailer/mentioned.text.erb
132
131
  - app/views/bible270/notice_mailer/new_reader.html.erb
133
132
  - app/views/bible270/notice_mailer/new_reader.text.erb
134
133
  - app/views/bible270/profiles/edit.html.erb
@@ -147,7 +146,6 @@ files:
147
146
  - app/views/bible270/shared/_nav_links.html.erb
148
147
  - app/views/bible270/shared/_passage_source.html.erb
149
148
  - app/views/bible270/shared/_progress.html.erb
150
- - app/views/bible270/shared/_reading_mode.html.erb
151
149
  - app/views/bible270/shared/_reflections.html.erb
152
150
  - app/views/bible270/shared/_styles.html.erb
153
151
  - app/views/bible270/shared/_track_bars.html.erb
@@ -1,43 +0,0 @@
1
- <div class="b270-startdate">
2
- <% if reader.dated? %>
3
- <p class="b270-startline">
4
- <% if reader.own_start_date? %>
5
- Started <strong><%= reader.start_date.strftime("%B %-d, %Y") %></strong>
6
- <% else %>
7
- Community plan start date: <strong><%= Bible270.config.start_date.strftime("%B %-d, %Y") %></strong>
8
- <% end %>
9
- · finishes <%= reader.plan_end_date.strftime("%B %-d, %Y") %>
10
- <% if reader.not_started_yet? %>
11
- · <em>begins in <%= (reader.effective_start_date - Bible270.today).to_i %> days</em>
12
- <% elsif reader.past_end_date? %>
13
- · <em>the 270 days have elapsed</em>
14
- <% elsif (off = reader.days_off_pace) %>
15
- <% if off > 0 %>
16
- · <em>reading at your own pace</em>
17
- <% elsif off < 0 %>
18
- · <em><%= -off %> day<%= "s" unless off == -1 %> ahead</em>
19
- <% else %>
20
- · <em>right on pace</em>
21
- <% end %>
22
- <% end %>
23
- </p>
24
- <% else %>
25
- <p class="b270-startline">This plan is undated — pick a start date to see it on a calendar.</p>
26
- <% end %>
27
-
28
- <% if Bible270.config.allow_reader_start_date %>
29
- <details class="b270-startedit">
30
- <summary><%= reader.own_start_date? ? "Change start date" : "Set a start date" %></summary>
31
- <%= form_with url: start_date_path, method: :patch, class: "b270-startform" do |f| %>
32
- <%= f.date_field :start_date, value: reader.start_date, required: true %>
33
- <%= f.submit "Save", class: "b270-btn" %>
34
- <% end %>
35
- <% if reader.own_start_date? %>
36
- <%= button_to "Clear my start date", clear_start_date_path, method: :delete,
37
- class: "b270-linkbtn", form: { style: "display:inline" } %>
38
- <% end %>
39
- <p class="b270-hint">Setting a start date only changes how days map onto the calendar.
40
- Your check-offs and reflections are untouched.</p>
41
- </details>
42
- <% end %>
43
- </div>
@@ -1,62 +0,0 @@
1
- <script nonce="<%= content_security_policy_nonce %>">
2
- (() => {
3
- if (window.Bible270ReadingMode) {
4
- window.Bible270ReadingMode.scan();
5
- return;
6
- }
7
-
8
- const storageKey = "bible270:reading-mode";
9
-
10
- function browserStorage() {
11
- try { return window.localStorage; } catch (_error) { return null; }
12
- }
13
-
14
- const storage = browserStorage();
15
- let mode = "full";
16
- if (storage) {
17
- try { mode = storage.getItem(storageKey) === "compact" ? "compact" : "full"; } catch (_error) { /* Use full mode. */ }
18
- }
19
-
20
- function remember(nextMode) {
21
- mode = nextMode;
22
- if (!storage) return;
23
- try { storage.setItem(storageKey, nextMode); } catch (_error) { /* Keep this page's mode. */ }
24
- }
25
-
26
- function apply(page) {
27
- const compact = mode === "compact";
28
- page.dataset.b270ReadingMode = mode;
29
- page.querySelectorAll("[data-b270-compact-toggle]").forEach((button) => {
30
- button.setAttribute("aria-pressed", String(compact));
31
- });
32
- page.querySelectorAll("[data-b270-compact-hide]").forEach((element) => {
33
- element.hidden = compact;
34
- });
35
-
36
- const options = page.querySelector("[data-b270-reading-options]");
37
- if (options) options.hidden = false;
38
- }
39
-
40
- function scan() {
41
- document.querySelectorAll("[data-b270-day-page]").forEach(apply);
42
- }
43
-
44
- document.addEventListener("click", (event) => {
45
- const button = event.target.closest?.("[data-b270-compact-toggle]");
46
- if (!button) return;
47
-
48
- const page = button.closest("[data-b270-day-page]");
49
- if (!page) return;
50
-
51
- remember(page.dataset.b270ReadingMode === "compact" ? "full" : "compact");
52
- apply(page);
53
- });
54
-
55
- document.addEventListener("turbo:load", scan);
56
- window.addEventListener("pageshow", scan);
57
- new MutationObserver(scan).observe(document.documentElement, { childList: true, subtree: true });
58
-
59
- window.Bible270ReadingMode = { scan };
60
- scan();
61
- })();
62
- </script>