diff options
Diffstat (limited to 'app')
-rw-r--r-- | app/controllers/application_controller.rb | 11 | ||||
-rw-r--r-- | app/controllers/general_controller.rb | 6 | ||||
-rw-r--r-- | app/models/info_request.rb | 6 | ||||
-rw-r--r-- | app/views/comment/_single_comment.rhtml | 2 | ||||
-rw-r--r-- | app/views/request/_correspondence.rhtml | 24 | ||||
-rw-r--r-- | app/views/request/show.rhtml | 3 | ||||
-rw-r--r-- | app/views/user/_show_user_info.rhtml | 2 |
7 files changed, 24 insertions, 30 deletions
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 3f3c169ae..f9649c868 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -117,17 +117,14 @@ class ApplicationController < ActionController::Base # Override default error handler, for production sites. def rescue_action_in_public(exception) - # Call `set_view_paths` from the theme, if it exists. + # Looks for before_filters called something like `set_view_paths_{themename}`. These + # are set by the themes. # Normally, this is called by the theme itself in a # :before_filter, but when there's an error, this doesn't # happen. By calling it here, we can ensure error pages are # still styled according to the theme. - begin - set_view_paths - rescue NameError => e - if !(e.message =~ /undefined local variable or method `set_view_paths'/) - raise - end + ActionController::Base.before_filters.select{|f| f.to_s =~ /set_view_paths/}.each do |f| + self.send(f) end # Make sure expiry time for session is set (before_filters are # otherwise missed by this override) diff --git a/app/controllers/general_controller.rb b/app/controllers/general_controller.rb index 0cde238cd..3ba636e29 100644 --- a/app/controllers/general_controller.rb +++ b/app/controllers/general_controller.rb @@ -226,12 +226,6 @@ class GeneralController < ApplicationController redirect_to request_url(info_request) end - # For debugging - def fai_test - sleep 10 - render :text => "awake\n" - end - def custom_css long_cache @locale = self.locale_from_params() diff --git a/app/models/info_request.rb b/app/models/info_request.rb index 85524e798..194f8e105 100644 --- a/app/models/info_request.rb +++ b/app/models/info_request.rb @@ -1124,7 +1124,11 @@ public } if deep - ret[:user] = self.user.json_for_api + if self.user + ret[:user] = self.user.json_for_api + else + ret[:user_name] = self.user_name + end ret[:public_body] = self.public_body.json_for_api ret[:info_request_events] = self.info_request_events.map { |e| e.json_for_api(false) } end diff --git a/app/views/comment/_single_comment.rhtml b/app/views/comment/_single_comment.rhtml index 013e5e107..b645721cf 100644 --- a/app/views/comment/_single_comment.rhtml +++ b/app/views/comment/_single_comment.rhtml @@ -11,7 +11,7 @@ </h2> <div class="comment_in_request_text"> <p> - <img class="comment_quote" src="/images/quote.png" alt=""> + <img class="comment_quote" src="/images/quote-marks.png" alt=""> <%= comment.get_body_for_html_display %> </p> </div> diff --git a/app/views/request/_correspondence.rhtml b/app/views/request/_correspondence.rhtml index bcfc93657..99c6c7d26 100644 --- a/app/views/request/_correspondence.rhtml +++ b/app/views/request/_correspondence.rhtml @@ -1,5 +1,5 @@ <div class="ff-print-fix"></div> -<% +<% if !info_request_event.nil? && info_request_event.event_type == 'response' incoming_message = info_request_event.incoming_message end @@ -21,9 +21,9 @@ if not incoming_message.nil? <p class="event_actions"> <% if !@user.nil? && @user.admin_page_links? %> - <%= link_to "Admin", admin_url("request/show_raw_email/" + incoming_message.raw_email_id.to_s) %> | + <%= link_to "Admin", admin_url("request/show_raw_email/" + incoming_message.raw_email_id.to_s) %> | <% end %> - <%= link_to _("Link to this"), incoming_message_url(incoming_message), :class => "link_to_this" %> + <%= link_to _("Link to this"), incoming_message_url(incoming_message), :class => "link_to_this" %> </p> </div> <% @@ -39,28 +39,28 @@ elsif [ 'sent', 'followup_sent' ].include?(info_request_event.event_type) <%= render :partial => 'bubble', :locals => { :body => outgoing_message.get_body_for_html_display(), :attachments => nil } %> - <p class="event_actions"> + <p class="event_actions"> <% if outgoing_message.status == 'ready' && !@info_request.is_external? %> <strong>Warning:</strong> This message has <strong>not yet been sent</strong> for an unknown reason. - <% end %> + <% end %> <!-- Can use this to get name of who followup was too, if say you play with proper from display, but not sure needed <% if outgoing_message.message_type == 'followup' && !outgoing_message.incoming_message_followup.nil? && !outgoing_message.incoming_message_followup.safe_mail_from.nil? %> - Follow up sent to: <%=h outgoing_message.incoming_message_followup.safe_mail_from %> - <% end %> + Follow up sent to: <%=h outgoing_message.incoming_message_followup.safe_mail_from %> + <% end %> --> - <%= link_to _("Link to this"), outgoing_message_url(outgoing_message), :class => "link_to_this" %> + <%= link_to _("Link to this"), outgoing_message_url(outgoing_message), :class => "link_to_this" %> </p> </div> <% elsif [ 'resent', 'followup_resent' ].include?(info_request_event.event_type) %> - <div class="outgoing correspondence" id="outgoing-<%=outgoing_message.id.to_s%>"> + <div class="outgoing correspondence" id="outgoing-<%=info_request_event.outgoing_message.id.to_s%>"> <h2> <%= simple_date(info_request_event.created_at) %> </h2> - <p class="event_plain"> - Sent + <p class="event_plain"> + Sent <% if info_request_event.outgoing_message.message_type == 'initial_request' %> request <% elsif info_request_event.outgoing_message.message_type == 'followup' %> @@ -72,7 +72,7 @@ elsif [ 'sent', 'followup_sent' ].include?(info_request_event.event_type) to <%= public_body_link(@info_request.public_body) %> again<% if not info_request_event.same_email_as_previous_send? %>, using a new contact address<% end %>. </p> </div> -<% elsif info_request_event.event_type == 'comment' +<% elsif info_request_event.event_type == 'comment' comment = info_request_event.comment %> <%= render :partial => 'comment/single_comment', :locals => { :comment => comment } %> diff --git a/app/views/request/show.rhtml b/app/views/request/show.rhtml index cf1f971d9..7aff1aeab 100644 --- a/app/views/request/show.rhtml +++ b/app/views/request/show.rhtml @@ -22,8 +22,6 @@ </div> <% end %> -<%= render :partial => 'sidebar' %> - <div id="left_column"> <h1><%=h(@info_request.title)%></h1> @@ -148,3 +146,4 @@ <%= render :partial => 'after_actions' %> </div> +<%= render :partial => 'sidebar' %> diff --git a/app/views/user/_show_user_info.rhtml b/app/views/user/_show_user_info.rhtml index 5dfecee1e..3c229e9ce 100644 --- a/app/views/user/_show_user_info.rhtml +++ b/app/views/user/_show_user_info.rhtml @@ -1,7 +1,7 @@ <% if !@display_user.get_about_me_for_html_display.empty? || @is_you %> <div class="user_about_me"> - <img class="comment_quote" src="/images/quote.png" alt=""> + <img class="comment_quote" src="/images/quote-marks.png" alt=""> <%= @display_user.get_about_me_for_html_display %> <% if @is_you %> (<%= link_to _("edit text about you"), set_profile_about_me_url() %>) |