Permalink
Browse files

Merge branch 'issue-with-party-comments'

Closes issue #446.
  • Loading branch information...
2 parents 95ff7e3 + 2033d23 commit 61012e8b6550e9a2f1fbe575a4aca5b871083dca @jarib jarib committed Mar 23, 2013
@@ -130,6 +130,9 @@ figure.position {
> section img {
opacity: 0.25;
}
+ .issue-party-comment {
+
+ }
}
@media (max-width: 400px) {
@@ -54,6 +54,6 @@ def assign_previous_and_next_issues
end
def fetch_issue
- @issue = Issue.find(params[:id])
+ @issue = Issue.includes(:party_comments).find(params[:id])
end
end
@@ -7,6 +7,7 @@ class IssueDecorator < Draper::Decorator
:accountability,
:published?,
:cache_key,
+ :party_comments,
# move to decorator?
:status_text,
@@ -109,6 +110,14 @@ def position_logo
end
end
+ def has_comment?
+ !!comment
+ end
+
+ def comment
+ issue.party_comments.where(:party_id => model.id).first
+ end
+
def promise_logo
key = issue.accountability.key_for(model)
@@ -65,4 +65,13 @@
<% end %>
</div>
</section>
+
+ <% if party.has_comment? %>
+ <section class="issue-party-comment">
+ <div class="content">
+ <h5><%= party.name %>s kommentar</h5>
+ <p><%= party.comment.body %></p>
+ </div>
+ </section>
+ <% end %>
</div>
@@ -56,15 +56,4 @@
<% end %>
</div>
- <!--
- <%= render partial: 'shared/previous_next_links', locals: { next_item: @next_issue, previous_item: @previous_issue, item_text_attr: :title } %>
- -->
-
- <!--
- <div class="issue-big-links span3">
- <p><%= link_to t('app.issues.view_votes', count: @issue.votes.size), votes_issue_path(@issue) %></p>
- <p><%= link_to t('app.method.read'), home_method_path %></p>
- </div>
- -->
-
<% end # cache %>

0 comments on commit 61012e8

Please sign in to comment.