Skip to content
This repository was archived by the owner on Mar 7, 2026. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions app.rb
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,31 @@ class CardOMatic < Sinatra::Base
render_previous_step_with_error(:iterations, 'Please choose an iteration.')
end

@story_link = "http://zxing.org/w/chart?cht=qr&chs=120x120&chld=L&choe=UTF-8&chl=https%3A%2F%2Fwww.pivotaltracker.com%2Fstory%2Fshow%2F"

@stories = case params[:iteration]
when 'icebox'
@project.stories(with_state: "unscheduled", fields: ':default,owners')
when 'backlog'
@project.iterations(scope: 'backlog', fields: ':default,stories(:default,owners)').first.stories
when 'epics'
@story_link = "http://zxing.org/w/chart?cht=qr&chs=120x120&chld=L&choe=UTF-8&chl=https%3A%2F%2Fwww.pivotaltracker.com%2Fepic%2Fshow%2F"
epics = @project.epics
epics.each do |epic|
epic.define_singleton_method(:story_type) do
"epic"
end
epic.define_singleton_method(:labels) do
[]
end
epic.define_singleton_method(:owners) do
[]
end
epic.define_singleton_method(:estimate) do
false
end
end
epics
when /\d+/
iteration = params[:iteration].to_i
options = { limit: 1 }
Expand Down
2 changes: 1 addition & 1 deletion views/cards.erb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<div class="footer">
<% if @with_qr_codes %>
<span class="qr-code">
<img src="http://zxing.org/w/chart?cht=qr&chs=120x120&chld=L&choe=UTF-8&chl=https%3A%2F%2Fwww.pivotaltracker.com%2Fstory%2Fshow%2F<%= story.id %>" alt="Link to pivotal story" class="qr-image"/>
<img src="<%= @story_link %><%= story.id %>" alt="Link to pivotal story" class="qr-image"/>
</span>
<% end %>
<% if story.labels.any? %>
Expand Down
9 changes: 9 additions & 0 deletions views/iterations.erb
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,15 @@
</div>
</label>
</li>
<li>
<label for="iteration_epics">
<input type="radio" id="iteration_epics" name="iteration" value="epics" />
<div class="iteration">
Epics
<span class="date">All your Epics</span>
</div>
</label>
</li>
</ul>

<ul>
Expand Down