Permalink
Browse files

Changed colours of stories in print to reflect project

  • Loading branch information...
1 parent 81f6475 commit 392af150bfbbc2c746950ddf1e2d2cc175548404 Alastair Mair committed Oct 5, 2011
Showing with 35 additions and 20 deletions.
  1. +2 −8 app/controllers/print_controller.rb
  2. +7 −5 app/views/print/index.html.erb
  3. +26 −7 public/stylesheets/pivotal.css
@@ -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
@@ -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>
@@ -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>
@@ -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;
@@ -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.