Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

adds some UI for the compulsory answers

  • Loading branch information...
commit d3f4be252f976ce9d3437d6cb22a5b11edb30121 1 parent 040943a
Felix Schäfer authored
2  app/controllers/doodles_controller.rb
@@ -93,7 +93,7 @@ def find_project
93 93 end
94 94
95 95 def find_doodle
96   - @doodle = Doodle.find(params[:id], :include => [:project, :author, :responses])
  96 + @doodle = Doodle.find(params[:id], :include => [:project, :author, :responses, :should_answer])
97 97 @project = @doodle.project
98 98 rescue ActiveRecord::RecordNotFound
99 99 render_404
4 app/models/doodle.rb
@@ -43,6 +43,10 @@ def visible?(user=User.current)
43 43 !user.nil? && user.allowed_to?(:view_doodles, project)
44 44 end
45 45
  46 + def users_missing_answer
  47 + @users_missing_answer ||= should_answer - responses.collect(&:author)
  48 + end
  49 +
46 50 private
47 51
48 52 def sanitize_options
3  app/views/doodles/show.html.erb
@@ -13,6 +13,9 @@
13 13 <%= authoring @doodle.created_on, @doodle.author %>
14 14 </p>
15 15 <p><strong><%=l(:field_expiry_date)%></strong>: <%= format_date(@doodle.expiry_date) %></p>
  16 + <% unless @doodle.should_answer.empty? -%>
  17 + <p><strong><%=l(:field_missing_answers)%></strong>: <%= @doodle.users_missing_answer.size %> <%= "(#{@doodle.users_missing_answer.collect(&:name).join(", ")})" if User.current == @doodle.author && !@doodle.users_missing_answer.empty? %></p>
  18 + <% end -%>
16 19 <hr />
17 20 <p><strong><%=l(:field_description)%></strong></p>
18 21 <div class="wiki">
1  config/locales/de.yml
@@ -7,6 +7,7 @@ de:
7 7 field_expiry_date: "Expiration date"
8 8 field_option: "Option"
9 9 field_options: "Optionen"
  10 + field_missing_answers: "Ausstehende Antworten"
10 11 permission_manage_doodles: "Doodles verwalten"
11 12 permission_create_doodles: "Doodles erstellen"
12 13 permission_view_doodles: "Doodles ansehen"
1  config/locales/en.yml
@@ -7,6 +7,7 @@ en:
7 7 field_expiry_date: "Expiration date"
8 8 field_option: "Option"
9 9 field_options: "Options"
  10 + field_missing_answers: "Missing answers"
10 11 permission_manage_doodles: "Manage doodles"
11 12 permission_create_doodles: "Create doodles"
12 13 permission_view_doodles: "View doodles"

0 comments on commit d3f4be2

Please sign in to comment.
Something went wrong with that request. Please try again.