Skip to content

Commit

Permalink
Merge pull request #18 from Better-Conversations/joshuac/bcf-41-add-t…
Browse files Browse the repository at this point in the history
…imer-resource

Add timer resource and broadcast chat messages
  • Loading branch information
joshuacoles authored Sep 26, 2024
2 parents 6143e87 + 808d4be commit f912c5e
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 9 deletions.
4 changes: 2 additions & 2 deletions formats/typst/entry_point.typ.erb
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
#show: flight-plan

<% if style == 'normal' %>
include "./copyright.typ"
pagebreak()
#include "./copyright.typ"
#pagebreak()
<% end %>

= Module <%= flight_plan.module_number %>: <%= flight_plan.module_title %>
Expand Down
4 changes: 2 additions & 2 deletions formats/typst/helpers.typ
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
#let bcf-fixed = bcf-cue

#let spoken(..args) = list(..args.pos().map(arg => text(weight: "bold", arg)))
#let chat(comment: "" ,body) = box(
#let chat(broadcast: false, body) = box(
fill: rgb(93, 187, 168).lighten(20%),
radius: 10pt,
pad(10pt, [
#{if comment == "" {[=== Copy to chat]} else {[=== Copy to chat #comment:]}}
#{if broadcast {[=== Broadcast]} else {[=== Copy to chat]}}

#body
])
Expand Down
2 changes: 1 addition & 1 deletion formats/typst/render_note.typ.erb
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@
<% end %>
)
<% when BCF::FlightPlans::Chat %>
#chat(<%= render_markdown note.content %>)
#chat(broadcast: <%= note.broadcast %>, <%= render_markdown note.content %>)
<% end %>
12 changes: 10 additions & 2 deletions lib/bcf/flight_plans/dsl.rb
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ def flipchart(id, inplace_comment, description: nil, scribed_by: nil)
resources << Resource::Flipchart.new(id:, description:, inplace_comment:, scribed_by:)
end

def breakout_room(id)
resources << Resource::Breakout.new(id)
def breakout_room(id, default_duration:, notify_halfway: true)
resources << Resource::Breakout.new(id, default_duration:, notify_halfway:)
end

def fieldwork(id, description)
Expand All @@ -83,6 +83,10 @@ def name(name)
@block.name = name
end

def index(index)
@block.index = index
end

def length(length)
@block.length = length
end
Expand Down Expand Up @@ -119,6 +123,10 @@ class ProducerNotes
def chat(content)
items << Chat.new(content)
end

def broadcast(content)
items << Chat.new(content, broadcast: true)
end
end

class FacilitatorNotes < Notes
Expand Down
6 changes: 4 additions & 2 deletions lib/bcf/flight_plans/models.rb
Original file line number Diff line number Diff line change
Expand Up @@ -130,10 +130,12 @@ def initialize(content)

class Chat < Note
attr_accessor :content
attr_accessor :broadcast

def initialize(content)
def initialize(content, broadcast: false)
super()
@content = content
@broadcast = broadcast
end
end

Expand Down Expand Up @@ -187,7 +189,7 @@ def pretty_scribed_by
end
end

Breakout = Struct.new(:id)
Breakout = Struct.new(:id, :default_duration, :notify_halfway)
Fieldwork = Struct.new(:id, :description)
end
end
Expand Down

0 comments on commit f912c5e

Please sign in to comment.