Added a new section to the details page that is displayed if the item is
current blocked.
Signed-off-by: Darryl L. Pierce <mcpierce(a)gmail.com>
---
app/models/backlog_item.rb | 5 +++++
app/views/items/show.html.erb | 10 ++++++++++
2 files changed, 15 insertions(+), 0 deletions(-)
diff --git a/app/models/backlog_item.rb b/app/models/backlog_item.rb
index d3f2b7b..f546e46 100644
--- a/app/models/backlog_item.rb
+++ b/app/models/backlog_item.rb
@@ -117,6 +117,11 @@ class BacklogItem < ActiveRecord::Base
end
end
+ # Returns whether the item is current blocked or not.
+ def blocked?
+ blocked
+ end
+
# Sets the item as blocked.
def set_as_blocked(message)
self.blocked = true
diff --git a/app/views/items/show.html.erb b/app/views/items/show.html.erb
index dd10b1c..1801e12 100644
--- a/app/views/items/show.html.erb
+++ b/app/views/items/show.html.erb
@@ -9,6 +9,16 @@
<dt>Description</dt>
<dd><%= RedCloth.new((a)backlog_item.user_story.description).to_html
%></dd>
+
+ <% if @backlog_item.blocked? %>
+ <dt>This item is currently blocked.</dt>
+ <dd>
+ <p>
+ <b>By <%= link_to @backlog_item.blocker_message.author.display_name,
user_path((a)backlog_item.blocker_message.author) %>,
+ Posted <%= show_date((a)backlog_item.blocker_message.posted, true)
%>:</b></p>
+ <p><%= RedCloth.new((a)backlog_item.blocker_message.body).to_html
%></p>
+ </dd>
+ <% end %>
</dl>
</div>
--
1.6.0.6