alembic 0.2.0 → 0.3.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 (30) hide show
  1. checksums.yaml +4 -4
  2. data/app/controllers/alembic/application_controller.rb +1 -0
  3. data/app/controllers/alembic/manage/base_controller.rb +1 -0
  4. data/app/controllers/alembic/manage/flows_controller.rb +8 -3
  5. data/app/controllers/concerns/alembic/summarizes.rb +23 -2
  6. data/app/helpers/alembic/application_helper.rb +2 -2
  7. data/app/helpers/alembic/pages_helper.rb +5 -4
  8. data/app/helpers/alembic/result_blocks_helper.rb +45 -0
  9. data/app/models/alembic/flow/definition_summary.rb +1 -0
  10. data/app/models/alembic/flow/summaries.rb +8 -0
  11. data/app/models/alembic/outputs/band.rb +1 -1
  12. data/app/models/alembic/outputs/lowest.rb +5 -3
  13. data/app/models/alembic/page/options.rb +14 -7
  14. data/app/models/alembic/result_blocks.rb +29 -0
  15. data/app/models/alembic/summary/report.rb +1 -1
  16. data/app/models/alembic/summary/result.rb +1 -1
  17. data/app/views/alembic/blocks/_answers.html.erb +11 -0
  18. data/app/views/alembic/blocks/_band.html.erb +6 -0
  19. data/app/views/alembic/blocks/_categories.html.erb +11 -0
  20. data/app/views/alembic/blocks/_lead.html.erb +15 -0
  21. data/app/views/alembic/blocks/_score.html.erb +7 -0
  22. data/app/views/alembic/blocks/_weakest.html.erb +12 -0
  23. data/app/views/alembic/flows/complete.html.erb +9 -3
  24. data/app/views/alembic/flows/summary_page.html.erb +5 -0
  25. data/app/views/alembic/manage/flows/edit.html.erb +6 -0
  26. data/db/migrate/20260930120000_add_summary_page_to_alembic_flow_definition_summaries.rb +6 -0
  27. data/lib/alembic/engine.rb +4 -0
  28. data/lib/alembic/version.rb +1 -1
  29. data/lib/alembic.rb +5 -1
  30. metadata +11 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0a28b9683aee21510ccc84055b1f946263171af250b924b7fa16b89fe758ae4b
4
- data.tar.gz: f64da9c1a64cc8a20fd48aa05e773973fc1eee8d3a8ee222d3d4de5de9d21154
3
+ metadata.gz: 9e0b25fc3373eb9220014c3c13e37b349b68b928ae417fa2f1b93081304bbb0d
4
+ data.tar.gz: 0727dcc579e6a0cc0e38eff459ac31f29854e567a072c1ffb21f0eed687f70e2
5
5
  SHA512:
6
- metadata.gz: fffcf2c82312ff28a404fe1d4569572b9908a1f2b9a30295efaf3c869e246fdcf6258125b5295b2b400898f8b0ffb075ca000b0c33686dadf7d7b0d2d19918fd
7
- data.tar.gz: 6d71eaad3a26a0c2e77a033a16ff6fb791af402a2ce04efaca9c731c84eb53d86253f003d8e4b44b57f3f9de7682e4ad7dadcde8a9278111a653e6137fb55ef0
6
+ metadata.gz: 88f5a0b2349fa2d04fcb5766651d645b031e706146360096e9e215c4bf19b2c5557c3e0e7e294e7700fabe1937da4511f3cbdecfadf4277d30e192d489bfe2f5
7
+ data.tar.gz: 7f34afb77cc986dfdbe1df1f02a405d1f3a721117e8285be2854a90e5adfc10eb2eb3c1e9971887f5dafaa21817d6791c4eb35ea30df82d7915c75e3a63b5a6a
@@ -2,6 +2,7 @@ module Alembic
2
2
  class ApplicationController < Alembic.base_controller.constantize
3
3
  layout -> { Alembic.layout }
4
4
  helper KeystoneUiHelper
5
+ helper ResultBlocksHelper
5
6
 
6
7
  rescue_from NotPublished, NotPermitted, Withdrawn, with: :refuse
7
8
 
@@ -12,6 +12,7 @@ module Alembic
12
12
  helper KeystoneUi::React::MountHelper
13
13
  helper KsBlocks::ContentHelper
14
14
  helper Alembic::PagesHelper
15
+ helper Alembic::ResultBlocksHelper
15
16
  end
16
17
  end
17
18
  end
@@ -4,12 +4,17 @@ module Alembic
4
4
  hosted_by FLOW_HOST
5
5
  def edit
6
6
  super
7
- @summary = Flow::Summaries.new(@flow).text
7
+ summaries = Flow::Summaries.new(@flow)
8
+ @summary = summaries.text
9
+ @summary_page = summaries.summary_page
10
+ @published_pages = Page.where(id: Page::Version.live.select(:page_id)).order(:name)
8
11
  end
9
12
 
10
13
  def update
11
- summary = params.require(:flow)[:summary]
12
- Flow::Summaries.new(flow_host.flows.find(params[:id])).describe(summary) unless summary.nil?
14
+ details = params.require(:flow)
15
+ summaries = Flow::Summaries.new(flow_host.flows.find(params[:id]))
16
+ summaries.describe(details[:summary]) unless details[:summary].nil?
17
+ summaries.finish_on(Page.find_by(id: details[:summary_page_id])) unless details[:summary_page_id].nil?
13
18
 
14
19
  super
15
20
  end
@@ -5,7 +5,10 @@ module Alembic
5
5
  included do
6
6
  layout -> { Alembic.layout }
7
7
  helper ApplicationHelper
8
- helper_method :flow_summary, :first_step_path
8
+ helper PagesHelper
9
+ helper ResultBlocksHelper
10
+ helper KsBlocks::LayoutHelper
11
+ helper_method :flow_summary, :first_step_path, :summary_values
9
12
  end
10
13
 
11
14
  private
@@ -25,7 +28,25 @@ module Alembic
25
28
  def finished(answers, finished_run)
26
29
  @outputs = outputs_of(answers.transform_keys(&:to_s))
27
30
  Flow::Summaries.new(flow).pin(finished_run) if finished_run && run.nil?
28
- render template: "alembic/flows/complete"
31
+ @summary_page = Flow::Summaries.new(run&.flow || flow).summary_page
32
+ render template: @summary_page&.live_version ? "alembic/flows/summary_page" : "alembic/flows/complete"
33
+ end
34
+
35
+ def summary_values
36
+ @outputs.to_h { |output| [ output.id, output.value ] }
37
+ .merge("slug" => @guide.slug, "note" => result_note, "answers" => answers_given)
38
+ end
39
+
40
+ def answers_given
41
+ @answered.map { |step, value| [ @guide.question_text(step), @guide.choice_label(step, value) ] }
42
+ end
43
+
44
+ def result_note
45
+ finished_flow = run&.flow || flow
46
+ return Alembic.lead_note.call(finished_flow.title, @outputs.to_h { |output| [ output.id, output.value ] }) if Alembic.lead_note
47
+
48
+ [ finished_flow.title, *@outputs.map { |output| "#{output.label}: #{helpers.alembic_output_lines(output.value).join(', ')}" } ]
49
+ .compact_blank.join(". ")
29
50
  end
30
51
 
31
52
  def outputs_of(state)
@@ -2,8 +2,8 @@ module Alembic
2
2
  module ApplicationHelper
3
3
  def alembic_output_lines(value)
4
4
  case value
5
- when Hash then value.map { |name, share| "#{name}: #{share}" }
6
- when Array then value
5
+ when Hash then value.key?("name") ? [ value["name"] ] : value.map { |name, share| "#{name}: #{share}" }
6
+ when Array then value.map { |item| item.is_a?(Hash) ? item["name"] : item }
7
7
  else [ value ]
8
8
  end
9
9
  end
@@ -4,21 +4,22 @@ module Alembic
4
4
  module PagesHelper
5
5
  UNDRAWABLE = "This block cannot be drawn until its fields are filled in.".freeze
6
6
 
7
- def drawn_page(page, being_edited: false)
7
+ def drawn_page(page, being_edited: false, values: {})
8
8
  blocks = being_edited ? page.blocks : page.live_version&.blocks.to_a
9
- drawn = blocks.to_h { |block| [ block["id"], drawn_block(block) ] }.compact
9
+ drawn = blocks.to_h { |block| [ block["id"], drawn_block(block, values: values) ] }.compact
10
10
 
11
11
  block_layout(blocks.select { |block| drawn.key?(block["id"]) }, kind: :pages) do |block|
12
12
  drawn.fetch(block["id"])
13
13
  end
14
14
  end
15
15
 
16
- def drawn_block(block)
16
+ def drawn_block(block, values: {})
17
17
  component = Page::Drawing.of(block["type"])
18
18
  return unless component
19
19
 
20
+ options = Page::Options.for(block, values: values)
20
21
  body = Page::Options.body_for(block)
21
- body.nil? ? send(component, **Page::Options.for(block)) : send(component, **Page::Options.for(block)) { body }
22
+ body.nil? ? send(component, **options) : send(component, **options) { body }
22
23
  rescue StandardError => undrawable
23
24
  Rails.logger.error("Alembic could not draw the #{block['type']} block: #{undrawable.message}")
24
25
  nil
@@ -0,0 +1,45 @@
1
+ module Alembic
2
+ module ResultBlocksHelper
3
+ def alembic_score_block(value: nil, caption: nil, kicker: "Your result")
4
+ render "alembic/blocks/score", value: value, caption: caption, kicker: kicker
5
+ end
6
+
7
+ def alembic_band_block(value: nil, score: nil)
8
+ render "alembic/blocks/band", band: value.to_h, tone: alembic_tone(score)
9
+ end
10
+
11
+ def alembic_categories_block(value: nil, heading: "Where you stand, area by area")
12
+ render "alembic/blocks/categories", shares: value.to_h, heading: heading
13
+ end
14
+
15
+ def alembic_weakest_block(value: nil, heading: "Your biggest blind spots", cost_label: "What it likely costs you:")
16
+ render "alembic/blocks/weakest", categories: Array(value), heading: heading, cost_label: cost_label
17
+ end
18
+
19
+ def alembic_answers_block(value: nil, heading: "What you told us")
20
+ render "alembic/blocks/answers", answers: Array(value), heading: heading
21
+ end
22
+
23
+ def alembic_lead_block(slug:, note: nil, heading: "The next step", blurb: nil, button: "Send", placeholder: "you@example.com")
24
+ render "alembic/blocks/lead", address: Alembic.lead_address.call(slug), slug: slug, note: note,
25
+ heading: heading, blurb: blurb, button: button, placeholder: placeholder
26
+ end
27
+
28
+ def alembic_default_result(output, outputs = [])
29
+ case output.type
30
+ when "percentage" then alembic_score_block(value: output.value, caption: output.label)
31
+ when "band" then alembic_band_block(value: output.value, score: outputs.find { |other| other.type == "percentage" }&.value)
32
+ when "grouped" then alembic_categories_block(value: output.value)
33
+ when "lowest" then alembic_weakest_block(value: output.value)
34
+ else ui_stat_card(label: output.label, value: alembic_output_lines(output.value).join(" · "))
35
+ end
36
+ end
37
+
38
+ def alembic_tone(percentage)
39
+ return "bg-red-500" if percentage.to_i < 40
40
+ return "bg-amber-500" if percentage.to_i < 70
41
+
42
+ "bg-emerald-500"
43
+ end
44
+ end
45
+ end
@@ -4,6 +4,7 @@ module Alembic
4
4
  self.table_name = "alembic_flow_definition_summaries"
5
5
 
6
6
  belongs_to :flow, class_name: "EasyFlow::Definition"
7
+ belongs_to :summary_page, class_name: "Alembic::Page", optional: true
7
8
  end
8
9
  end
9
10
  end
@@ -34,6 +34,14 @@ module Alembic
34
34
  details.update!(summary: text)
35
35
  end
36
36
 
37
+ def summary_page
38
+ details.summary_page
39
+ end
40
+
41
+ def finish_on(page)
42
+ details.update!(summary_page: page)
43
+ end
44
+
37
45
  def pin(run)
38
46
  RunSummary.create!(run: run, summary_version: current_version) if current_version
39
47
  end
@@ -15,7 +15,7 @@ module Alembic
15
15
  def self.covering(config, number)
16
16
  ordered = Array(config["bands"]).sort_by { |band| band["ceiling"] || Float::INFINITY }
17
17
 
18
- ordered.find { |band| band["ceiling"].nil? || number < band["ceiling"] }&.fetch("name", nil)
18
+ ordered.find { |band| band["ceiling"].nil? || number < band["ceiling"] }&.slice("name", "description")
19
19
  end
20
20
  end
21
21
  end
@@ -4,7 +4,7 @@ module Alembic
4
4
  def self.output_type
5
5
  Summary::OutputType.define(:lowest) do
6
6
  label "Weakest"
7
- compute { |config, _run, so_far| Lowest.of(so_far[config["of"]], config["count"]) }
7
+ compute { |config, _run, so_far| Lowest.of(so_far[config["of"]], config["count"], config["copy"]) }
8
8
  end
9
9
  end
10
10
 
@@ -12,8 +12,10 @@ module Alembic
12
12
  registry.register(output_type)
13
13
  end
14
14
 
15
- def self.of(shares, count)
16
- shares.to_h.sort_by { |_name, share| share }.first(count.presence&.to_i || 1).map(&:first)
15
+ def self.of(shares, count, copy = nil)
16
+ weakest = shares.to_h.sort_by { |_name, share| share }.first(count.presence&.to_i || 1).map(&:first)
17
+
18
+ weakest.map { |name| { "name" => name, **copy.to_h.fetch(name, {}).slice("miss", "cost") } }
17
19
  end
18
20
  end
19
21
  end
@@ -6,8 +6,8 @@ module Alembic
6
6
  bodies[key.to_sym] = body
7
7
  end
8
8
 
9
- def self.for(block)
10
- named(filled(block).except(bodies[block["type"].to_sym]), declared.fetch(block["type"].to_sym, {}))
9
+ def self.for(block, values: {})
10
+ named(filled(block).except(bodies[block["type"].to_sym]), declared.fetch(block["type"].to_sym, {}), values)
11
11
  end
12
12
 
13
13
  def self.body_for(block)
@@ -28,19 +28,26 @@ module Alembic
28
28
  block.fetch("content", {}).reject { |_key, value| value == "" }.symbolize_keys
29
29
  end
30
30
 
31
- def self.named(filled, options)
31
+ def self.named(filled, options, values)
32
32
  options.each_with_object(filled) do |(option, spec), built|
33
- spec.is_a?(Hash) ? fill(built, option, spec) : built[option] = spec
33
+ spec.is_a?(Hash) ? fill(built, option, spec, values) : built[option] = spec
34
34
  end
35
35
  end
36
36
 
37
- def self.fill(built, option, spec)
38
- value = built.delete(spec.fetch(:from, option))
37
+ def self.fill(built, option, spec, values)
38
+ value = handed(built, option, spec, values)
39
39
  built[option] = value.nil? ? spec[:default] : value
40
40
  built.delete(option) if built[option].nil?
41
41
  end
42
42
 
43
- private_class_method :filled, :named, :fill
43
+ def self.handed(built, option, spec, values)
44
+ return values[spec[:value]] if spec.key?(:value)
45
+ return values[built.delete(spec[:value_of]).to_s] if spec.key?(:value_of)
46
+
47
+ built.delete(spec.fetch(:from, option))
48
+ end
49
+
50
+ private_class_method :filled, :named, :fill, :handed
44
51
  end
45
52
  end
46
53
  end
@@ -0,0 +1,29 @@
1
+ module Alembic
2
+ module ResultBlocks
3
+ OUTPUT = { key: :output, label: "Output" }.freeze
4
+ HEADING = { key: :heading, label: "Heading" }.freeze
5
+
6
+ def self.register
7
+ Page.block(:alembic_score, name: "Score", width: 12, height: 3, drawn_by: :alembic_score_block,
8
+ fields: [ OUTPUT, { key: :kicker, label: "Label above" }, { key: :caption, label: "Caption" } ],
9
+ options: { value: { value_of: :output } })
10
+ Page.block(:alembic_band, name: "Band", width: 12, height: 2, drawn_by: :alembic_band_block,
11
+ fields: [ OUTPUT, { key: :score, label: "Score output" } ],
12
+ options: { value: { value_of: :output }, score: { value_of: :score } })
13
+ Page.block(:alembic_categories, name: "Score per category", width: 12, height: 4, drawn_by: :alembic_categories_block,
14
+ fields: [ OUTPUT, HEADING ], options: { value: { value_of: :output } })
15
+ Page.block(:alembic_weakest, name: "Weakest categories", width: 12, height: 4, drawn_by: :alembic_weakest_block,
16
+ fields: [ OUTPUT, HEADING, { key: :cost_label, label: "Cost label" } ], options: { value: { value_of: :output } })
17
+ Page.block(:alembic_answers, name: "Answers given", width: 12, height: 4, drawn_by: :alembic_answers_block,
18
+ fields: [ HEADING ], options: { value: { value: "answers" } })
19
+ register_lead if Alembic.lead_address
20
+ end
21
+
22
+ def self.register_lead
23
+ Page.block(:alembic_lead, name: "Lead", width: 12, height: 3, drawn_by: :alembic_lead_block,
24
+ fields: [ HEADING, { key: :blurb, label: "Text" }, { key: :button, label: "Button" }, { key: :placeholder, label: "Placeholder" } ],
25
+ options: { slug: { value: "slug" }, note: { value: "note" } })
26
+ end
27
+ private_class_method :register_lead
28
+ end
29
+ end
@@ -13,7 +13,7 @@ module Alembic
13
13
  output_type = @registry.fetch(output["type"])
14
14
  produced[output["id"]] = output_type.compute(output, run, produced)
15
15
 
16
- Result.new(id: output["id"], label: label_for(output, output_type), value: produced[output["id"]])
16
+ Result.new(id: output["id"], type: output["type"], label: label_for(output, output_type), value: produced[output["id"]])
17
17
  end
18
18
  end
19
19
 
@@ -1,5 +1,5 @@
1
1
  module Alembic
2
2
  module Summary
3
- Result = Data.define(:id, :label, :value)
3
+ Result = Data.define(:id, :type, :label, :value)
4
4
  end
5
5
  end
@@ -0,0 +1,11 @@
1
+ <div>
2
+ <h2 class="text-xs font-semibold uppercase tracking-wider text-gray-500 mb-4"><%= heading %></h2>
3
+ <ul class="divide-y divide-gray-100 border-y border-gray-100">
4
+ <% answers.each do |question, answer| %>
5
+ <li class="flex items-baseline justify-between gap-6 py-3">
6
+ <span class="text-gray-600"><%= question %></span>
7
+ <span class="shrink-0 font-semibold text-gray-900"><%= answer %></span>
8
+ </li>
9
+ <% end %>
10
+ </ul>
11
+ </div>
@@ -0,0 +1,6 @@
1
+ <div class="text-center">
2
+ <span class="inline-block mt-5 px-4 py-1.5 rounded-full text-sm font-semibold text-white <%= tone %>"><%= band["name"] %></span>
3
+ <% if band["description"].present? %>
4
+ <p class="text-gray-600 leading-relaxed max-w-lg mx-auto mt-4"><%= band["description"] %></p>
5
+ <% end %>
6
+ </div>
@@ -0,0 +1,11 @@
1
+ <div>
2
+ <h2 class="text-xs font-semibold uppercase tracking-wider text-gray-500 mb-4"><%= heading %></h2>
3
+ <% shares.each do |name, share| %>
4
+ <div class="flex items-center gap-3 mb-2.5">
5
+ <span class="text-sm text-gray-600 w-44 shrink-0"><%= name %></span>
6
+ <span class="flex-1 h-2 bg-gray-100 rounded-full overflow-hidden">
7
+ <span class="block h-full rounded-full <%= alembic_tone(share) %>" style="width:<%= [ share.to_i, 4 ].max %>%"></span>
8
+ </span>
9
+ </div>
10
+ <% end %>
11
+ </div>
@@ -0,0 +1,15 @@
1
+ <%= ui_panel(padding: :lg) do %>
2
+ <h2 class="text-xl font-semibold text-gray-900 mb-2"><%= heading %></h2>
3
+ <% if blurb.present? %>
4
+ <p class="text-gray-600 mb-5"><%= blurb %></p>
5
+ <% end %>
6
+ <%= form_with url: address, method: :post, class: "flex flex-col sm:flex-row gap-3" do %>
7
+ <%= render Alembic.lead_fields_partial if Alembic.lead_fields_partial %>
8
+ <%= hidden_field_tag "slug", slug %>
9
+ <%= hidden_field_tag "note", note %>
10
+ <div class="flex-1">
11
+ <%= ui_input(name: "email", type: :email, placeholder: placeholder) %>
12
+ </div>
13
+ <button type="submit" class="inline-flex items-center justify-center font-semibold rounded-lg bg-accent-600 text-white hover:bg-accent-500 px-6 py-3 cursor-pointer whitespace-nowrap"><%= button %></button>
14
+ <% end %>
15
+ <% end %>
@@ -0,0 +1,7 @@
1
+ <div class="text-center">
2
+ <p class="text-xs font-semibold uppercase tracking-widest text-accent-600 mb-4"><%= kicker %></p>
3
+ <div class="text-7xl md:text-8xl font-bold tracking-tight text-gray-900"><%= value.nil? ? "—" : "#{value}%" %></div>
4
+ <% if caption.present? %>
5
+ <p class="text-sm text-gray-500 mt-1"><%= caption %></p>
6
+ <% end %>
7
+ </div>
@@ -0,0 +1,12 @@
1
+ <div>
2
+ <h2 class="text-xs font-semibold uppercase tracking-wider text-gray-500 mb-4"><%= heading %></h2>
3
+ <div class="space-y-4">
4
+ <% categories.each do |category| %>
5
+ <%= ui_panel(padding: :lg) do %>
6
+ <h3 class="text-lg font-semibold text-gray-900 mb-1.5"><%= category["name"] %></h3>
7
+ <p class="text-gray-700 mb-2"><%= category["miss"] %></p>
8
+ <p class="text-sm text-accent-700"><span class="font-semibold"><%= cost_label %></span> <%= category["cost"] %></p>
9
+ <% end %>
10
+ <% end %>
11
+ </div>
12
+ </div>
@@ -11,13 +11,19 @@
11
11
 
12
12
  <% if @outputs.any? %>
13
13
  <%= ui_section do %>
14
- <%= ui_grid(cols: { default: 1, sm: 2 }, gap: :lg) do %>
14
+ <div class="space-y-10">
15
15
  <% @outputs.each do |output| %>
16
16
  <div data-output="<%= output.id %>">
17
- <%= ui_stat_card(label: output.label, value: alembic_output_lines(output.value).join(" · ")) %>
17
+ <%= alembic_default_result(output, @outputs) %>
18
18
  </div>
19
19
  <% end %>
20
- <% end %>
20
+ </div>
21
+ <% end %>
22
+ <% end %>
23
+
24
+ <% if Alembic.lead_address %>
25
+ <%= ui_section do %>
26
+ <%= alembic_lead_block(slug: summary_values["slug"], note: summary_values["note"]) %>
21
27
  <% end %>
22
28
  <% end %>
23
29
 
@@ -0,0 +1,5 @@
1
+ <% content_for :head do %>
2
+ <%= stylesheet_link_tag "ks_blocks" %>
3
+ <% end %>
4
+
5
+ <%= drawn_page(@summary_page, values: summary_values) %>
@@ -17,6 +17,12 @@
17
17
  <%= ui_input(name: "flow[start_label]", value: @flow.start_label) %>
18
18
  <% end %>
19
19
 
20
+ <%= ui_section(title: "Where this finishes") do %>
21
+ <%= ui_select(name: "flow[summary_page_id]", selected: @summary_page&.id,
22
+ include_blank: "Alembic's default summary page",
23
+ options: @published_pages.map { |page| [ page.name, page.id ] }) %>
24
+ <% end %>
25
+
20
26
  <%= ui_section(title: "What this keeps of a run") do %>
21
27
  <%= ui_select(name: "flow[persists]", selected: @flow.persists,
22
28
  options: [ [ "Nothing", "unsaved" ],
@@ -0,0 +1,6 @@
1
+ class AddSummaryPageToAlembicFlowDefinitionSummaries < ActiveRecord::Migration[8.1]
2
+ def change
3
+ add_reference :alembic_flow_definition_summaries, :summary_page,
4
+ foreign_key: { to_table: :alembic_pages, on_delete: :nullify }
5
+ end
6
+ end
@@ -30,5 +30,9 @@ module Alembic
30
30
  Alembic::Outputs::Band.register
31
31
  end
32
32
  end
33
+
34
+ initializer "alembic.result_blocks" do |app|
35
+ app.config.to_prepare { Alembic::ResultBlocks.register }
36
+ end
33
37
  end
34
38
  end
@@ -1,3 +1,3 @@
1
1
  module Alembic
2
- VERSION = "0.2.0"
2
+ VERSION = "0.3.0"
3
3
  end
data/lib/alembic.rb CHANGED
@@ -13,7 +13,7 @@ module Alembic
13
13
  visitor_authorization_method refusal_method].freeze
14
14
 
15
15
  class << self
16
- attr_accessor :lead_partial
16
+ attr_accessor :lead_address, :lead_fields_partial, :lead_note
17
17
  attr_reader :admin_authentication_method, :visitor_authorization_method, :refusal_method
18
18
 
19
19
  FLOW_HOST_SETTINGS.each do |name|
@@ -29,6 +29,10 @@ module Alembic
29
29
  end
30
30
  end
31
31
 
32
+ def lead_partial=(_partial)
33
+ warn "Alembic.lead_partial no longer exists and draws nothing. Set Alembic.lead_address to where the lead block posts."
34
+ end
35
+
32
36
  def base_controller=(value)
33
37
  @base_controller = value
34
38
  EasyFlow.base_controller = 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.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - tylercschneider
@@ -98,6 +98,7 @@ files:
98
98
  - app/controllers/concerns/alembic/summarizes.rb
99
99
  - app/helpers/alembic/application_helper.rb
100
100
  - app/helpers/alembic/pages_helper.rb
101
+ - app/helpers/alembic/result_blocks_helper.rb
101
102
  - app/javascript/alembic/page_builder.jsx
102
103
  - app/javascript/alembic/page_builder/PageBuilder.jsx
103
104
  - app/jobs/alembic/application_job.rb
@@ -117,14 +118,22 @@ files:
117
118
  - app/models/alembic/page/drawing.rb
118
119
  - app/models/alembic/page/options.rb
119
120
  - app/models/alembic/page/version.rb
121
+ - app/models/alembic/result_blocks.rb
120
122
  - app/models/alembic/summary.rb
121
123
  - app/models/alembic/summary/output_type.rb
122
124
  - app/models/alembic/summary/registry.rb
123
125
  - app/models/alembic/summary/report.rb
124
126
  - app/models/alembic/summary/result.rb
125
127
  - app/models/alembic/summary/run.rb
128
+ - app/views/alembic/blocks/_answers.html.erb
129
+ - app/views/alembic/blocks/_band.html.erb
130
+ - app/views/alembic/blocks/_categories.html.erb
131
+ - app/views/alembic/blocks/_lead.html.erb
132
+ - app/views/alembic/blocks/_score.html.erb
133
+ - app/views/alembic/blocks/_weakest.html.erb
126
134
  - app/views/alembic/flows/complete.html.erb
127
135
  - app/views/alembic/flows/show.html.erb
136
+ - app/views/alembic/flows/summary_page.html.erb
128
137
  - app/views/alembic/manage/flows/edit.html.erb
129
138
  - app/views/alembic/manage/pages/_block_content.html.erb
130
139
  - app/views/alembic/manage/pages/index.html.erb
@@ -185,6 +194,7 @@ files:
185
194
  - db/migrate/20260922120000_add_slug_to_alembic_pages.rb
186
195
  - db/migrate/20260922130000_create_alembic_page_versions.rb
187
196
  - db/migrate/20260924220000_move_flows_onto_easy_flow.rb
197
+ - db/migrate/20260930120000_add_summary_page_to_alembic_flow_definition_summaries.rb
188
198
  - lib/alembic.rb
189
199
  - lib/alembic/engine.rb
190
200
  - lib/alembic/leftover_stylesheet.rb