Skip to content

Commit

Permalink
Basic Style Changes
Browse files Browse the repository at this point in the history
  • Loading branch information
rahult committed Feb 14, 2011
1 parent 7acde71 commit eff2257
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
4 changes: 2 additions & 2 deletions app/controllers/stories_controller.rb
Expand Up @@ -2,7 +2,7 @@ class StoriesController < ApplicationController
before_filter :load_project, :except => :all

def all
@stories = current_user.stories.all
@stories = current_user.stories.active

respond_to do |format|
format.html { render :index }
Expand All @@ -11,7 +11,7 @@ def all
end

def index
@stories = @project.stories.all
@stories = @project.stories.active

respond_to do |format|
format.html
Expand Down
2 changes: 2 additions & 0 deletions app/models/story.rb
Expand Up @@ -2,4 +2,6 @@ class Story < ActiveRecord::Base
belongs_to :project
belongs_to :user
has_many :time_logs

scope :active, where("stories.current_state <> ?", "accepted")
end
8 changes: 4 additions & 4 deletions app/views/stories/index.html.haml
Expand Up @@ -34,9 +34,9 @@
%td= link_to(image_tag("start.png"), log_project_story_path(:project_id => story.project_id, :id => story.id))
- story.time_logs.each do |log|
%tr
%td(colspan="2")= log.start_time.to_s(:pretty)
%td(colspan="2")= log.end_time.blank? ? "" : log.end_time.to_s(:pretty)
%td(colspan="2")= log.notes
%td(colspan="3")= log.end_time.blank? ? link_to(image_tag("stop.png"), stop_project_story_path(:project_id => story.project_id, :id => story.id)) : image_tag("tick.png")
%td(width="20%"){:class => (log.end_time.blank? ? "negative" : "positive")}= log.start_time.to_s(:pretty)
%td(width="20%")= log.end_time.blank? ? "" : log.end_time.to_s(:pretty)
%td(width="50%" colspan="4")= log.notes
%td(width="10%" class="controls")= log.end_time.blank? ? link_to(image_tag("stop.png"), stop_project_story_path(:project_id => story.project_id, :id => story.id)) : ""

%br

0 comments on commit eff2257

Please sign in to comment.