Skip to content

Commit

Permalink
Changed colours of stories in print to reflect project
Browse files Browse the repository at this point in the history
  • Loading branch information
Alastair Mair committed Oct 5, 2011
1 parent 81f6475 commit 392af15
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 20 deletions.
10 changes: 2 additions & 8 deletions app/controllers/print_controller.rb
Expand Up @@ -60,23 +60,17 @@ def get_story (project_id, story_id)
story
end

def filter_stories
filtered_stories = yield

filtered_stories.each { |s| s.div_class = lookupProject s.project_id } unless filtered_stories.empty?
end


def get_filtered_stories
@stories=[]
if (!@@projects.nil?)
@@projects.each do |p|
logger.debug "Getting Stories for project #{p.id}"

begin
state_filtering = params[:state] || "unstarted"
state_filtering = params[:state] || ["unscheduled", "unstarted"]
logger.debug "Showing states #{state_filtering}"
var = p.stories.all(:current_state => state_filtering, :story_type => ['feature', 'bug', 'chore'])
var.each { |s| s.div_class = lookupProject s.project_id } unless var.empty?
rescue => e
logger.error e.response
end
Expand Down
12 changes: 7 additions & 5 deletions app/views/print/index.html.erb
@@ -1,7 +1,7 @@
<h1>Print</h1>

<div class="print_display_opts">
<%= form_tag( {:controller => :print, :action => "index"}, :method => "get", :class => "state_chooser") do %>
<%= form_tag({:controller => :print, :action => "index"}, :method => "get", :class => "state_chooser") do %>

<div class="form_row">
<label for="state[]">Conditions:</label>
Expand All @@ -21,12 +21,14 @@
<div class="print_stories_list">
<%= form_tag do %>

<div class="form_row">
<div class="printrows">
<label for="story[]">Stories:</label>
<% @stories.each do |story| %>
<br><%= check_box_tag 'story[]', [story.project_id, story.id],
(params[:stories] || {}).include?(story.id) %>
<%= story.name %>
<div class=<%= story.div_class %>>
<%= check_box_tag 'story[]', [story.project_id, story.id],
(params[:stories] || {}).include?(story.id) %>
<%= story.name %>
</div>
<% end %>
</div>

Expand Down
33 changes: 26 additions & 7 deletions public/stylesheets/pivotal.css
Expand Up @@ -37,52 +37,52 @@ span.points {
}


div.project {
div.column div.project {
border: 2px solid #FFFFFF;
border-radius: 5px;
padding: 5px;
margin: 2px;
padding: 10px;
}
div.project1 {
div.column div.project1 {
border: 2px solid #0000FF;
border-radius: 5px;
padding: 5px;
margin: 2px;
}

div.project2 {
div.column div.project2 {
border: 2px solid #00FF00;
border-radius: 5px;
padding: 5px;
margin: 2px;
}

div.project3 {
div.column div.project3 {
border: 2px solid #00FFFF;
border-radius: 5px;
padding: 5px;
margin: 2px;
padding: 10px;
}

div.project4 {
div.column div.project4 {
border: 2px solid #FF0000;
border-radius: 5px;
padding: 5px;
margin: 2px;
padding: 10px;
}

div.project5 {
div.column div.project5 {
border: 2px solid #FFFF00;
border-radius: 5px;
padding: 5px;
margin: 2px;
padding: 10px;
}

div.project6 {
div.column div.project6 {
border: 2px solid #ffb500;
border-radius: 5px;
padding: 5px;
Expand Down Expand Up @@ -111,4 +111,23 @@ div.StoryTitle {

div#link {
float: left;
}

div.printrows div.project1 {
color: #0000FF;
}
div.printrows div.project2 {
color: #139513;
}
div.printrows div.project3 {
color: #7e14b6;
}
div.printrows div.project4 {
color: #902a2a;
}
div.printrows div.project5 {
color: #909015;
}
div.printrows div.project6 {
color: #ffb500;
}

0 comments on commit 392af15

Please sign in to comment.