diff options
Diffstat (limited to 'app/views')
-rw-r--r-- | app/views/admin_general/debug.rhtml | 2 | ||||
-rw-r--r-- | app/views/admin_public_body/_form.rhtml | 3 | ||||
-rw-r--r-- | app/views/admin_public_body/import_csv.rhtml | 2 | ||||
-rw-r--r-- | app/views/admin_public_body/show.rhtml | 4 | ||||
-rw-r--r-- | app/views/admin_request/show.rhtml | 10 | ||||
-rw-r--r-- | app/views/general/_frontpage_bodies_list.rhtml | 17 | ||||
-rw-r--r-- | app/views/general/_frontpage_new_request.rhtml | 7 | ||||
-rw-r--r-- | app/views/general/_frontpage_requests_list.rhtml | 35 | ||||
-rw-r--r-- | app/views/general/_frontpage_search_box.rhtml | 12 | ||||
-rw-r--r-- | app/views/general/blog.rhtml | 47 | ||||
-rw-r--r-- | app/views/general/frontpage.rhtml | 76 | ||||
-rw-r--r-- | app/views/layouts/default.rhtml | 18 | ||||
-rw-r--r-- | app/views/public_body/show.rhtml | 3 | ||||
-rw-r--r-- | app/views/request/_request_filter_form.rhtml | 30 | ||||
-rw-r--r-- | app/views/request/_request_listing_via_event.rhtml | 10 |
15 files changed, 136 insertions, 140 deletions
diff --git a/app/views/admin_general/debug.rhtml b/app/views/admin_general/debug.rhtml index d7bf1c6da..99488ba0c 100644 --- a/app/views/admin_general/debug.rhtml +++ b/app/views/admin_general/debug.rhtml @@ -2,7 +2,7 @@ <h1><%=@title%></h1> -<p>You are <%= h @http_auth_user %></p> +<p>You are <%= h @admin_current_user %></p> <h2>Version numbers</h2> diff --git a/app/views/admin_public_body/_form.rhtml b/app/views/admin_public_body/_form.rhtml index d854b53f5..0d6ae51e2 100644 --- a/app/views/admin_public_body/_form.rhtml +++ b/app/views/admin_public_body/_form.rhtml @@ -38,6 +38,9 @@ <p><label for="<%= form_tag_id(t.object_name, :publication_scheme, locale) %>">Publication scheme URL</label><br/> <%= t.text_field :publication_scheme, :size => 60, :id => form_tag_id(t.object_name, :publication_scheme, locale) %></p> + <p><label for="<%= form_tag_id(t.object_name, :disclosure_log, locale) %>">Disclosure log URL</label><br/> + <%= t.text_field :disclosure_log, :size => 60, :id => form_tag_id(t.object_name, :disclosure_log, locale) %></p> + <p><label for="<%= form_tag_id(t.object_name, :notes, locale) %>">Public notes</label> <small>(HTML, for users to consider when making FOI requests to the authority)</small><br/> <%= t.text_area :notes, :rows => 3, :cols => 60, :id => form_tag_id(t.object_name, :notes, locale) %></p> </div> diff --git a/app/views/admin_public_body/import_csv.rhtml b/app/views/admin_public_body/import_csv.rhtml index 4a03d0665..62908ba52 100644 --- a/app/views/admin_public_body/import_csv.rhtml +++ b/app/views/admin_public_body/import_csv.rhtml @@ -51,7 +51,7 @@ </blockquote> <p>Supported fields: name (i18n), short_name (i18n), request_email (i18n), notes (i18n), - publication_scheme (i18n), home_page, tag_string (tags separated by spaces).</p> + publication_scheme (i18n), disclosure_log (i18n), home_page, tag_string (tags separated by spaces).</p> <p><strong>Note:</strong> Choose <strong>dry run</strong> to test, without actually altering the database. Choose <strong>upload</strong> to actually diff --git a/app/views/admin_public_body/show.rhtml b/app/views/admin_public_body/show.rhtml index fa17d4027..094007c02 100644 --- a/app/views/admin_public_body/show.rhtml +++ b/app/views/admin_public_body/show.rhtml @@ -9,9 +9,9 @@ for column in columns %> <b><%= column.human_name %>:</b> - <% if column.name == 'home_page' and !column.name.empty? %> + <% if ['home_page', 'publication_scheme', 'disclosure_log'].include? column.name %> <%= link_to(h(@public_body.send(column.name)), @public_body.send(column.name)) %> - <% elsif column.name == 'request_email' and !column.name.empty? %> + <% elsif column.name == 'request_email' %> <%= link_to(h(@public_body.send(column.name)), "mailto:#{@public_body.send(column.name)}") %> <% if !@public_body.is_requestable? %> (not requestable due to: <%=h @public_body.not_requestable_reason %><% if @public_body.is_followupable? %>; but followupable<% end %>) diff --git a/app/views/admin_request/show.rhtml b/app/views/admin_request/show.rhtml index 9d939eb35..2541fd323 100644 --- a/app/views/admin_request/show.rhtml +++ b/app/views/admin_request/show.rhtml @@ -213,15 +213,15 @@ -<h2>Exim delivery logs</h2> +<h2>Mail server delivery logs</h2> <p><i>(Lines containing the request incoming email address, updated hourly.)</i></p> -<% for exim_log_done_id, exim_logs in @info_request.exim_logs.group_by(&:exim_log_done_id) %> - <!-- <h3><%=h exim_logs[0].exim_log_done.filename %></h3> --> - <pre><% for exim_log in exim_logs %><%=h exim_log.line%><% end %></pre> +<% for mail_server_log_done_id, mail_server_logs in @info_request.mail_server_logs.group_by(&:mail_server_log_done_id) %> + <!-- <h3><%=h mail_server_logs[0].mail_server_log_done.filename %></h3> --> + <pre><% for mail_server_log in mail_server_logs %><%=h mail_server_log.line%><% end %></pre> <% end %> -<% if @info_request.exim_logs.size == 0 %> +<% if @info_request.mail_server_logs.size == 0 %> <p>None (perhaps this is an old or a very new request)</p> <% end %> diff --git a/app/views/general/_frontpage_bodies_list.rhtml b/app/views/general/_frontpage_bodies_list.rhtml new file mode 100644 index 000000000..503b38953 --- /dev/null +++ b/app/views/general/_frontpage_bodies_list.rhtml @@ -0,0 +1,17 @@ +<% if @popular_bodies.size > 0 %> + <div id="examples_0"> + <h3><%= _("Who can I request information from?") %></h3> + <%= _("{{site_name}} covers requests to {{number_of_authorities}} authorities, including:", + :site_name => site_name, :number_of_authorities => PublicBody.visible.count) %> + <ul> + <% for popular_body in @popular_bodies %> + <li><%=public_body_link(popular_body)%> + <%= n_('%d request', '%d requests', popular_body.info_requests_count) % popular_body.info_requests_count %> + </li> + <% end%> + </ul> + <p><strong> + <%= link_to _('Browse all authorities...'), list_public_bodies_default %> + </strong></p> + </div> +<% end %> diff --git a/app/views/general/_frontpage_new_request.rhtml b/app/views/general/_frontpage_new_request.rhtml new file mode 100644 index 000000000..fd4225069 --- /dev/null +++ b/app/views/general/_frontpage_new_request.rhtml @@ -0,0 +1,7 @@ +<h1> + <%= _("Make a new<br/> + <strong>Freedom <span>of</span><br/> + Information<br/> + request</strong>") %> +</h1> +<a class="link_button_green_large" href="/select_authority"><%= _("Start now »") %></a> diff --git a/app/views/general/_frontpage_requests_list.rhtml b/app/views/general/_frontpage_requests_list.rhtml new file mode 100644 index 000000000..3b0efb65e --- /dev/null +++ b/app/views/general/_frontpage_requests_list.rhtml @@ -0,0 +1,35 @@ +<div id="examples_1"> + <h3> + <% if @request_events_all_successful %> + <%= _("What information has been released?") %> + <% else %> + <%= _("What information has been requested?") %> + <% end %> + </h3> + <%= _("{{site_name}} users have made {{number_of_requests}} requests, including:", + :site_name => site_name, :number_of_requests => InfoRequest.visible.count) %> + <ul> + <% for event in @request_events %> + <li> + <% if @request_events_all_successful %> + <%= _("{{public_body_link}} answered a request about", + :public_body_link => public_body_link(event.info_request.public_body)) %> + <% else %> + <%= _("{{public_body_link}} was sent a request about", + :public_body_link => public_body_link(event.info_request.public_body)) %> + <% end %> + + <%=link_to h(event.info_request.title), request_url(event.info_request)%> + <%= _('{{length_of_time}} ago', :length_of_time => time_ago_in_words(event.described_at)) %> + <p class="excerpt" onclick="document.location.href='<%=request_url(event.info_request)%>'"><%= excerpt(event.search_text_main(true), "", 200) %></p> + </li> + <% end %> + </ul> + <p><strong> + <% if @request_events_all_successful %> + <%=link_to _('More successful requests...'), request_list_successful_url %> + <% else %> + <%=link_to _('More requests...'), request_list_all_url %> + <% end %> + </strong></p> +</div> diff --git a/app/views/general/_frontpage_search_box.rhtml b/app/views/general/_frontpage_search_box.rhtml new file mode 100644 index 000000000..6de4eae98 --- /dev/null +++ b/app/views/general/_frontpage_search_box.rhtml @@ -0,0 +1,12 @@ +<h2> + <%= _("Search over<br/> + <strong>{{number_of_requests}} requests</strong> <span>and</span><br/> + <strong>{{number_of_authorities}} authorities</strong>", + :number_of_requests => InfoRequest.visible.count, :number_of_authorities => PublicBody.visible.count) %> +</h2> +<form id="search_form" method="post" action="/search"> + <div> + <input id="query" type="text" size="30" name="query"> + <input type="submit" value="<%= _('Search') %>"> + </div> +</form> diff --git a/app/views/general/blog.rhtml b/app/views/general/blog.rhtml index a80f167d8..5258e9bbd 100644 --- a/app/views/general/blog.rhtml +++ b/app/views/general/blog.rhtml @@ -7,53 +7,34 @@ <img src="/images/twitter-16.png" alt="twitter icon" class="twitter-icon"> <a href="https://twitter.com/<%= @twitter_user %>"><%= _("Follow us on twitter") %></a><br/><br/> <img src="/images/feed-16.png" alt="RSS icon" valign="middle"> <a href="<%= @feed_url %>"><%= _("Subscribe to blog") %></a> </div> + <% if Configuration::twitter_widget_id %> <div id="twitter"> - <script src="http://widgets.twimg.com/j/2/widget.js"></script> - <script type="text/javascript"> - new TWTR.Widget({ - version: 2, - type: 'profile', - rpp: 15, - interval: 6000, - width: 'auto', - height: 500, - theme: { - shell: { - background: '#eaeaea', - color: '#000000' - }, - tweets: { - background: '#ffffff', - color: '#000000', - links: '#0b004a' - } - }, - features: { - scrollbar: false, - loop: false, - live: false, - hashtags: true, - timestamp: true, - avatars: true, - behavior: 'all' - } - }).render().setUser('<%=@twitter_user %>').start(); - </script> + <a class="twitter-timeline" data-dnt=true href="https://twitter.com/<%= Configuration::twitter_username %>" data-widget-id="<%= Configuration::twitter_widget_id %>">Tweets by @<%= Configuration::twitter_username %></a> + <script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script> </div> + <% end %> </div> <% end %> <div id="left_column"> <h1><%=@title %></h1> - + <div id="blog"> <% for item in @blog_items: %> <div class="blog_post"> <h2 id="<%= Time.parse(item['pubDate'][0]).to_i %>"><a href="<%=item['link']%>"><%=h item['title'] %></a></h2> <p class="subtitle"><%= _("Posted on {{date}} by {{author}}", :date=>simple_date(Time.parse(item['pubDate'][0])), :author=>item['creator']) %></p> - <div><%= item['encoded'] %></div> + <div> + <% if item['encoded'] %> + <%= item['encoded'] %> + <% elsif item['description'] %> + <%= item['description'] %> + <% end %> + </div> <p><em> + <% if item['comments'] %> <a href="<%=item['comments'][0]%>"><%= _("{{number_of_comments}} comments", :number_of_comments=>item['comments'][1]) %></a> + <% end %> </em> </p> </div> diff --git a/app/views/general/frontpage.rhtml b/app/views/general/frontpage.rhtml index e2d74a5e2..acc7f4095 100644 --- a/app/views/general/frontpage.rhtml +++ b/app/views/general/frontpage.rhtml @@ -1,28 +1,11 @@ <% view_cache :ttl => 5.minutes.to_i, :tag => I18n.locale do %> <div id="frontpage_splash"> <div id="left_column"> - <h1> - <%= _("Make a new<br/> - <strong>Freedom <span>of</span><br/> - Information<br/> - request</strong>") %> - </h1> - <a class="link_button_green_large" href="/select_authority"><%= _("Start now »") %></a> + <%= render :partial => "frontpage_new_request" %> </div> <div id="right_column"> <div id="frontpage_search_box"> - <h2> - <%= _("Search over<br/> - <strong>{{number_of_requests}} requests</strong> <span>and</span><br/> - <strong>{{number_of_authorities}} authorities</strong>", - :number_of_requests => InfoRequest.count, :number_of_authorities => PublicBody.count) %> - </h2> - <% form_tag({:action => "search_redirect"}, {:id => "search_form"}) do %> - <div> - <%= text_field_tag 'query', params[:query], { :size => 30 } %> - <%= submit_tag _('Search') %> - </div> - <% end %> + <%= render :partial => "frontpage_search_box" %> </div> <div id="frontpage_right_to_know"> <%= render :partial => 'frontpage_intro_sentence' %> @@ -30,55 +13,8 @@ </div> <div style="clear:both"></div> </div> - -<div id="frontpage_examples"> - <% if @popular_bodies.size > 0 %> - <div id="examples_0"> - <h3><%= _("Who can I request information from?") %></h3> - <%= _("{{site_name}} covers requests to {{number_of_authorities}} authorities, including:", - :site_name => site_name, :number_of_authorities => PublicBody.count) %> - <ul> - <% for popular_body in @popular_bodies %> - <li><%=public_body_link(popular_body)%> - <%= n_('%d request', '%d requests', popular_body.info_requests_count) % popular_body.info_requests_count %> - </li> - <% end%> - </ul> - <p><strong> - <%= link_to _('Browse all authorities...'), list_public_bodies_default %> - </strong></p> - </div> - <% end %> - - <div id="examples_1"> - <h3> - <% if @request_events_all_successful %> - <%= _("What information has been released?") %> - <% else %> - <%= _("What information has been requested?") %> - <% end %> - </h3> - <%= _("{{site_name}} users have made {{number_of_requests}} requests, including:", - :site_name => site_name, :number_of_requests => InfoRequest.count) %> - <ul> - <% for event in @request_events %> - <li> - <%= public_body_link(event.info_request.public_body) %> <%= _('answered a request about') %> - <%=link_to h(event.info_request.title), request_url(event.info_request)%> - <%= _('{{length_of_time}} ago', :length_of_time => time_ago_in_words(event.described_at)) %> - <p class="excerpt" onclick="document.location.href='<%=request_url(event.info_request)%>'"><%= excerpt(event.search_text_main(true), "", 200) %></p> - </li> - <% end %> - </ul> - <p><strong> - <% if @request_events_all_successful %> - <%=link_to _('More successful requests...'), request_list_successful_url %> - <% else %> - <%=link_to _('More requests...'), request_list_all_url %> - <% end %> - </strong></p> - </div> -</div> - - + <div id="frontpage_examples"> + <%= render :partial => "frontpage_bodies_list" %> + <%= render :partial => "frontpage_requests_list" %> + </div> <% end %> diff --git a/app/views/layouts/default.rhtml b/app/views/layouts/default.rhtml index 0dd493fd0..76bdbd2dd 100644 --- a/app/views/layouts/default.rhtml +++ b/app/views/layouts/default.rhtml @@ -12,7 +12,7 @@ <link rel="shortcut icon" href="/favicon.ico"> <%= render :partial => 'general/stylesheet_includes' %> - <% if is_admin? %> + <% if session[:using_admin] %> <%= stylesheet_link_tag "/adminbootstraptheme/stylesheets/admin", :title => "Main", :rel => "stylesheet" %> <% end %> @@ -41,7 +41,7 @@ <%= render :partial => 'general/before_head_end' %> </head> - <body class="<%= 'admin' if is_admin? %> <%= 'front' if params[:action] == 'frontpage' %>"> + <body class="<%= 'front' if params[:action] == 'frontpage' %>"> <% if Configuration::force_registration_on_new_request && !@user %> <%= javascript_include_tag 'jquery.fancybox-1.3.4.pack' %> <script type="text/javascript"> @@ -100,12 +100,12 @@ <% end %> <div id="navigation_search"> - <% form_tag({:controller => "general", :action => "search_redirect"}, {:id => "navigation_search_form"}) do %> - <p> - <%= text_field_tag 'query', params[:query], { :size => 40, :id => "navigation_search_query" } %> - <%= submit_tag 'search', :id => "navigation_search_button" %> - </p> - <% end %> + <form id="navigation_search_form" method="post" action="/search"> + <p> + <%= text_field_tag 'query', params[:query], { :size => 40, :id => "navigation_search_query" } %> + <input id="navigation_search_button" type="submit" value="search"> + </p> + </form> </div> <%= render :partial => 'general/orglink' %> @@ -139,7 +139,7 @@ <input type="text"> </div> <% - unless Configuration::ga_code.empty? %> + unless Configuration::ga_code.empty? || (@user && @user.super?) %> <script> var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www."); document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E")); diff --git a/app/views/public_body/show.rhtml b/app/views/public_body/show.rhtml index b56556d5d..e13f9d1c0 100644 --- a/app/views/public_body/show.rhtml +++ b/app/views/public_body/show.rhtml @@ -14,6 +14,9 @@ <% if !@public_body.publication_scheme.empty? %> <%= link_to _('Publication scheme'), @public_body.publication_scheme %><br> <% end %> + <% unless @public_body.disclosure_log.empty? %> + <%= link_to _('Disclosure log'), @public_body.disclosure_log %><br> + <% end %> <% if @public_body.has_tag?("charity") %> <% for tag_value in @public_body.get_tag_values("charity") %> <% if tag_value.match(/^SC/) %> diff --git a/app/views/request/_request_filter_form.rhtml b/app/views/request/_request_filter_form.rhtml index fa760bf74..0c215a9b6 100644 --- a/app/views/request/_request_filter_form.rhtml +++ b/app/views/request/_request_filter_form.rhtml @@ -27,22 +27,24 @@ </div> <div class="list-filter-item"> <h3 class="title"><%= _("Showing") %></h3> - <% statuses = [["all", _("all requests")], - ["successful", _("successful requests")], - ["unsuccessful", _("unsuccessful requests")], - ["awaiting", _("unresolved requests")]] %> - <% for status, label in statuses %> - <% if params[:view] != status %> - <% if params[:controller] == "public_body" %> - <%= link_to label, url_for(:controller => "public_body", :action => "show", :view => status, :url_name => @public_body.url_name) + "?" + request.query_string + '#results' %> + <div class="filter-request-types"> + <% statuses = [["all", _("all requests")], + ["successful", _("successful requests")], + ["unsuccessful", _("unsuccessful requests")], + ["awaiting", _("unresolved requests")]] %> + <% for status, label in statuses %> + <% if params[:view] != status %> + <% if params[:controller] == "public_body" %> + <%= link_to label, url_for(:controller => "public_body", :action => "show", :view => status, :url_name => @public_body.url_name) + "?" + request.query_string + '#results' %> + <% else %> + <%= link_to label, url_for(:controller => "request", :action => "list", :view => status) + "?" + request.query_string + '#results' %> + <% end %> <% else %> - <%= link_to label, url_for(:controller => "request", :action => "list", :view => status) + "?" + request.query_string + '#results' %> + <%= label %> <% end %> - <% else %> - <%= label %> - <% end %> - <%= "|" unless statuses.last[0] == status %> - <% end %> + <%= "|" unless statuses.last[0] == status %> + <% end %> + </div> </div> <div class="list-filter-item"> diff --git a/app/views/request/_request_listing_via_event.rhtml b/app/views/request/_request_listing_via_event.rhtml index e3abfe393..ee1cc079a 100644 --- a/app/views/request/_request_listing_via_event.rhtml +++ b/app/views/request/_request_listing_via_event.rhtml @@ -17,13 +17,13 @@ end %> </span> <div class="requester"> <% if event.event_type == 'sent' %> - <%= _('Request sent to {{public_body_name}} by {{info_request_user}} on {{date}}.',:public_body_name=>public_body_link_absolute(info_request.public_body),:info_request_user=>request_user_link_absolute(info_request),:date=>simple_date(event.created_at )) %> + <%= _('Request sent to {{public_body_name}} by {{info_request_user}} on {{date}}.',:public_body_name=>public_body_link_absolute(info_request.public_body),:info_request_user=>request_user_link_absolute(info_request),:date=>simple_date(event.created_at )) %> <% elsif event.event_type == 'followup_sent' %> <%=event.display_status %> - <%= _('sent to {{public_body_name}} by {{info_request_user}} on {{date}}.',:public_body_name=>public_body_link_absolute(info_request.public_body),:info_request_user=>request_user_link_absolute(info_request),:date=>simple_date(event.created_at )) %> + <%= _('sent to {{public_body_name}} by {{info_request_user}} on {{date}}.',:public_body_name=>public_body_link_absolute(info_request.public_body),:info_request_user=>request_user_link_absolute(info_request),:date=>simple_date(event.created_at )) %> <% elsif event.event_type == 'response' %> <%=event.display_status %> - <%= _('by {{public_body_name}} to {{info_request_user}} on {{date}}.',:public_body_name=>public_body_link_absolute(info_request.public_body),:info_request_user=>request_user_link_absolute(info_request),:date=>simple_date(event.created_at )) %> + <%= _('by {{public_body_name}} to {{info_request_user}} on {{date}}.',:public_body_name=>public_body_link_absolute(info_request.public_body),:info_request_user=>request_user_link_absolute(info_request),:date=>simple_date(event.created_at )) %> <% elsif event.event_type == 'comment' %> <%= _('Request to {{public_body_name}} by {{info_request_user}}. Annotated by {{event_comment_user}} on {{date}}.',:public_body_name=>public_body_link_absolute(info_request.public_body),:info_request_user=>user_link_absolute(info_request.user),:event_comment_user=>user_link_absolute(event.comment.user),:date=>simple_date(event.created_at)) %> <% else %> @@ -35,12 +35,12 @@ end %> </div> <span class="bottomline icon_<%= info_request.calculate_status %>"> <strong> - <%= info_request.display_status %> + <%= info_request.display_status(cached_value_ok=true) %> </strong><br> </span> </div> <div class="request_right"> - <span class="desc"> + <span class="desc"> <%= highlight_and_excerpt(event.search_text_main(true), @highlight_words, 150) %> </span> </div> |