alembic 0.11.0 → 0.13.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ecc91145c614872965f172c8e74a2e0baff6865c2f75ee2fb20e0e2d7d295da6
4
- data.tar.gz: c1ed7caba4454b79b1ff553ba67f0e828be061e92a9c8c9a2dce343f87c531be
3
+ metadata.gz: ae4f6fdd30b863971ed64168da8b19b238930a9d6983978e8fd80f5bad0ff206
4
+ data.tar.gz: 54d74ca4152be0bee97e02a639b11c240f76bd595523d1a21577b43e062caee0
5
5
  SHA512:
6
- metadata.gz: a4d113fc95187a036697aec4d8e075536a2728815db5852c55b63ccf66c321b2b07700003033d3d86b028fdcedb45c61b679c8ca32e64fb78cc43d3cf46fe7fe
7
- data.tar.gz: 65a63a6f80f7ba3fabea54424c45f09a4630f6e5bcb4614687b3f46e050cbbe1c304f862dc3d607220f01e6c5130f56bbd10b2ae6d8d0c151f2cffe0cd7331c3
6
+ metadata.gz: 7b507037a195cb807bccae95dbcfbb982a4325e535631fa4e53ba8f21316dca572904e9d2b92fc71b501407819ab1a4dc137718323730829911046af406363fe
7
+ data.tar.gz: 0cfdcb1374201572a0fadbd1a9671f2dca43cbedddb8c8e480fa845d415399412883faf53f854bbbc9756b2173766e52f84392ecdf5e85ffed6a7f14c77c86dd
@@ -21,6 +21,12 @@ module Alembic
21
21
  run.nil? && params[:answers].blank? && Flow::Summaries.new(flow).asks_on_one_page?
22
22
  end
23
23
 
24
+ def answer_problem(step, answer)
25
+ return "Pick an answer to go on." if step&.type == "question" && answer.blank?
26
+
27
+ super
28
+ end
29
+
24
30
  def questions_in_order
25
31
  state = {}
26
32
  questions = []
@@ -3,7 +3,7 @@
3
3
  <% starting_over = start_over_path %>
4
4
 
5
5
  <%= ui_page(max_width: :md) do %>
6
- <%= ui_page_header(title: "That's everything", subtitle: "Thanks — here's what you told us") do |header| %>
6
+ <%= ui_page_header(title: Alembic.finish_title, subtitle: Alembic.finish_subtitle) do |header| %>
7
7
  <% if starting_over %>
8
8
  <% header.action do %>
9
9
  <%= ui_button(label: "Start over", href: starting_over, variant: :secondary) %>
@@ -35,7 +35,7 @@
35
35
  <% end %>
36
36
  <% end %>
37
37
 
38
- <%= ui_section(title: @outputs.any? ? "What you told us" : nil) do %>
38
+ <%= ui_section(title: @outputs.any? ? Alembic.finish_answers_heading : nil) do %>
39
39
  <ul class="divide-y divide-(color:--ks-color-divider) border-y border-(color:--ks-color-divider) dark:divide-(color:--ks-color-divider-dark) dark:border-(color:--ks-color-divider-dark)">
40
40
  <% @answered.each do |step, value| %>
41
41
  <li data-answer="<%= step %>" class="flex items-baseline justify-between gap-6 py-3">
@@ -32,8 +32,12 @@
32
32
  <%= render @drawing, step: shown(@question), chosen: chosen_answer(@question) %>
33
33
  <% end %>
34
34
 
35
+ <% if (right_answer = chosen_answer(@question)).present? %>
36
+ <%= ui_value_list(rows: [ { label: ui_badge(label: "Right answer", variant: :success), value: @guide.choice_label(@question.id, right_answer) } ]) %>
37
+ <% end %>
38
+
35
39
  <div class="mt-8 flex items-center gap-4">
36
- <%= ui_button(label: "Next", type: :submit) %>
40
+ <%= ui_button(label: "Next", type: :submit) unless single_choice?(@question) %>
37
41
  <% if @answers.any? %>
38
42
  <button type="submit" name="back" value="1" formnovalidate class="ks-tone-muted cursor-pointer text-sm underline underline-offset-2 hover:text-(color:--ks-color-text) dark:hover:text-(color:--ks-color-text-dark)">← Back</button>
39
43
  <% end %>
@@ -1,3 +1,3 @@
1
1
  module Alembic
2
- VERSION = "0.11.0"
2
+ VERSION = "0.13.0"
3
3
  end
data/lib/alembic.rb CHANGED
@@ -15,6 +15,19 @@ module Alembic
15
15
  class << self
16
16
  attr_accessor :lead_address, :lead_fields_partial, :lead_note, :start_over_address, :finish_link
17
17
  attr_reader :admin_authentication_method, :visitor_authorization_method, :refusal_method, :owner_method
18
+ attr_writer :finish_title, :finish_subtitle, :finish_answers_heading
19
+
20
+ def finish_title
21
+ @finish_title || "That's everything"
22
+ end
23
+
24
+ def finish_subtitle
25
+ @finish_subtitle || "Thanks — here's what you told us"
26
+ end
27
+
28
+ def finish_answers_heading
29
+ @finish_answers_heading || "What you told us"
30
+ end
18
31
 
19
32
  FLOW_HOST_SETTINGS.each do |name|
20
33
  define_method(:"#{name}=") do |value|
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: alembic
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.11.0
4
+ version: 0.13.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - tylercschneider