fixing path issues with "files" in the name

git-svn-id: 295275ead0c997ff8920a9abe88dec0903829be9@142 9c008b19-a030-0410-9975-d76d301b4276

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
	"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

	<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
	<title><%= page_title %></title>
	<%= stylesheet_link_tag 'application' %>
	<%= random_header_css %>

		<% for event in @reminders %>

<%= link_to h(event.title), event_path(event) %>

		<% end %>

<%= link_to(SITE_TITLE, home_path) %>

All an elaborate, unapproachable, unprofitable, retributive joke

			<li class="<%= tab('home') %>"><%= link_to('Home', home_path) %>

			<li class="<%= tab('events') %>"><%= link_to('Events', events_path) %>

			<li class="<%= tab('files') %>"><%= link_to('Files', files_path) %>

			<li class="<%= tab('topics') %>"><%= link_to('Topics', topics_path) %>

			<li class="<%= tab('users') %>"><%= link_to('Users', users_path) %>

			<% if admin? %><li class="<%= tab('admin') %>"><%= link_to('Admin', admin_path) %>
<% end %>

					<% if logged_in? %>
						Logged in as <%= link_to h(current_user.login), user_path(current_user.id) %> |
						Last visit <%= time_ago_in_words(session[:last_login_at]) %> ago
					<% else %>
						You are not logged in
					<% end %>

					<% if logged_in? %>
						<% if current_controller == "topics" %>
							<%= link_to('Start a New Topic', new_topic_path) %>
						<% elsif current_controller == "events" %>
							<%= link_to('Add a New Event', new_event_path) %>
						<% elsif current_controller == "users" %>
							<%= link_to('Register a New User', new_user_path) %>
							<% elsif current_controller == "files" %>
								<%= link_to('Upload a New File', :controller => 'files') %>
						<% end %>
						  <%= link_to('Logout', logout_path) %>
					<% else %>
						<%= link_to('Register', register_path) %>
						<%= link_to('Login', login_path) %>
					<% end %>

			<%= content_tag 'div', h(flash[:notice]), :id => 'notice' if flash[:notice] %>
			<%= content_tag 'div', h(flash[:error]), :id => 'error' if flash[:error] %>

			<%= yield %>

<%= SITE_FOOTER_1 %>

<%= SITE_FOOTER_2 %>

Local Time: <%= Time.now %> | UTC Time: <%= Time.now.utc %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
	"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

	<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
	<title><%= page_title %></title>
	<%= stylesheet_link_tag 'application' %>
	<%= random_header_css %>

		<% for event in @reminders %>

<%= link_to h(event.title), event_path(event) %>

		<% end %>

<%= link_to(SITE_TITLE, home_path) %>

All an elaborate, unapproachable, unprofitable, retributive joke

			<li class="<%= tab('home') %>"><%= link_to('Home', home_path) %>

			<li class="<%= tab('events') %>"><%= link_to('Events', events_path) %>

			<li class="<%= tab('files') %>"><%= link_to('Files', files_path) %>

			<li class="<%= tab('topics') %>"><%= link_to('Topics', topics_path) %>

			<li class="<%= tab('users') %>"><%= link_to('Users', users_path) %>

			<% if admin? %><li class="<%= tab('admin') %>"><%= link_to('Admin', admin_path) %>
<% end %>

					<% if logged_in? %>
						Logged in as <%= link_to h(current_user.login), user_path(current_user.id) %> |
						Last visit <%= time_ago_in_words(session[:last_login_at]) %> ago
					<% else %>
						You are not logged in
					<% end %>

					<% if logged_in? %>
						<% if current_controller == "topics" %>
							<%= link_to('Start a New Topic', new_topic_path) %>
						<% elsif current_controller == "events" %>
							<%= link_to('Add a New Event', new_event_path) %>
						<% elsif current_controller == "users" %>
							<%= link_to('Register a New User', new_user_path) %>
							<% elsif current_controller == "files" %>
								<%= link_to('Upload a New File', new_files_path) %>
						<% end %>
						  <%= link_to('Logout', logout_path) %>
					<% else %>
						<%= link_to('Register', register_path) %>
						<%= link_to('Login', login_path) %>
					<% end %>

			<%= content_tag 'div', h(flash[:notice]), :id => 'notice' if flash[:notice] %>
			<%= content_tag 'div', h(flash[:error]), :id => 'error' if flash[:error] %>

			<%= yield %>

<%= SITE_FOOTER_1 %>

<%= SITE_FOOTER_2 %>

Local Time: <%= Time.now %> | UTC Time: <%= Time.now.utc %>


bug in which index to display 'journal level only' warning for in list

<%
   fulltxt = get_service_type('fulltext')
   title_level_fulltxt = get_service_type('fulltext_title_level')
   all_fulltext = fulltxt + title_level_fulltxt
%>

<div id="fulltext" class="main_column_section <%= unless fulltxt.blank? && title_level_fulltxt.blank?; 'highlighted_section' ; end %>">

<%= ServiceTypeValue[:fulltext].display_name %> via:

<%
    list_with_limit('umlaut_fulltext', all_fulltext) do |item, index |
      # Display special warnign header if it's title-level only,
      # and it's an article or issue level link. Are we
      # at the beginning of title level display?
      if ( index == fulltxt.length &&
           index != 0 &&
           !title_level_request? )
         genre = @user_request.referent.metadata['genre']
         genre = "Journal" if genre && genre.downcase == 'article' %>

<%= genre ? genre.titlecase : "Title" %>-level Page Only

Can not link directly to citation. Dates or extent of coverage may be unknown.

      <% end %>

      <%= render(:partial => "fulltext_element", :object=> item) %>
<% end %>

<%
if (fulltxt.empty? && title_level_fulltxt.empty? &&
    ! service_type_in_progress?('fulltext') &&
    ! service_type_in_progress?('fulltext_title_level'))
%>

Not Available

<%
end
if (service_type_in_progress?('fulltext') ||
    service_type_in_progress?('fulltext_title_level'))
%>

<%= render(:partial => "background_progress",
                 :locals => { :svc_types => [ServiceTypeValue[:fulltext],
                              ServiceTypeValue[:fulltext_title_level]],
                              :current_set_empty => fulltxt.empty? && title_level_fulltxt.empty?
                             } ) %>

<% end %>

<%
   fulltxt = get_service_type('fulltext')
   title_level_fulltxt = get_service_type('fulltext_title_level')
   all_fulltext = fulltxt + title_level_fulltxt
%>

<div id="fulltext" class="main_column_section <%= unless fulltxt.blank? && title_level_fulltxt.blank?; 'highlighted_section' ; end %>">

<%= ServiceTypeValue[:fulltext].display_name %> via:

<%
    list_with_limit('umlaut_fulltext', all_fulltext) do |item, index |
      # Display special warnign header if it's title-level only,
      # and it's an article or issue level link. Are we
      # at the beginning of title level display?
      if ( index == title_level_fulltxt.length &&
           index != 0 &&
           !title_level_request? )
         genre = @user_request.referent.metadata['genre']
         genre = "Journal" if genre && genre.downcase == 'article' %>

<%= genre ? genre.titlecase : "Title" %>-level Page Only

Can not link directly to citation. Dates or extent of coverage may be unknown.

      <% end %>

      <%= render(:partial => "fulltext_element", :object=> item) %>
<% end %>

<%
if (fulltxt.empty? && title_level_fulltxt.empty? &&
    ! service_type_in_progress?('fulltext') &&
    ! service_type_in_progress?('fulltext_title_level'))
%>

Not Available

<%
end
if (service_type_in_progress?('fulltext') ||
    service_type_in_progress?('fulltext_title_level'))
%>

<%= render(:partial => "background_progress",
                 :locals => { :svc_types => [ServiceTypeValue[:fulltext],
                              ServiceTypeValue[:fulltext_title_level]],
                              :current_set_empty => fulltxt.empty? && title_level_fulltxt.empty?
                             } ) %>

<% end %>


fixed 'for' value for form fields

fixed 'for' value for form fields

<%= error_messages_for model_underscore %>

  <% model_ui.edit_columns.each do |column| %>
    <% if column.is_displayable_in_context?(self) %>

<label class="streamlined_label" for="<%= model_underscore %>_<%= column.name %>"><%= column.human_name %>
          <%= column.render_td(self, @streamlined_item) %>

    <% end %>
  <% end %>

<%= error_messages_for model_underscore %>

  <% model_ui.edit_columns.each do |column| %>
    <% if column.is_displayable_in_context?(self) %>

<%= column.human_name %>
          <%= column.render_td(self, @streamlined_item) %>

    <% end %>
  <% end %>


Fixed js error

Fixed js error

<% if info[1] -%>

Version <%= dec info[1].revision %>, <%= info[1].active? ? 'Active'.t : 'Inactive'.t %>, <%= render :partial => '/edit/saved_by', :locals => { :revision => info[1] } %>

  <% info[1].used_images.each do |img| %>

         <img src='<%= img.thumbnail_url(theme,'thumb') %>'/>

         <%= h(img.name) %>

  <% end -%>

<% if permit?('editor_editor') %>
  <input type='submit' value='<%= "Edit Page".t %>' onclick='document.location="<%= url_for :controller => 'edit', :action => 'page', :path => ['page',@node.id,info[0] ] %>";' />
<% end -%>

  <% if info[1].active? %>
    <input type='submit' value='<%= "Goto Page".t %>' onclick='document.location="/view/<%= info[0] %><%= @node.node_path %>";' />
  <% end -%>
<% else -%>
<% if permit?('editor_structure') %>

  <% remote_form_for :revision_create, info[1],
      :update => "node_#{@node.id}_#{info[0]}",
      :method => 'post',
      :url =>  { :action => 'create_revision', :language  => info[0]  } do  |f| -%>
    <input type='submit' value='<%= "Create Page".t %>' /> From
    <%= f.select :from_revision_id, @revision_info.find_all { |inf| inf[1] }.collect { |inf| [ inf[0].upcase, inf[1].id ] } %>
  <% end -%>
<% else %>
  <%= "No Existing Revision".t %>
<% end -%>

<% end -%>

<% if info[1] -%>

<% if permit?('editor_structure') %>
  <div id='<%= "node_#{@node.id}_#{info[0]}_view" %>' >
  <% link_edit_form_for  :revision_view, info[1],
      :styled_form => {
	  :onclick => "Element.hide(\"node_#{@node.id}_#{info[0]}_view\"); Element.show(\"node_#{@node.id}_#{info[0]}_edit\");",
	  :classname => "ajax_link"
      } do |f| -%>
      <%= render :partial => 'revision_info_table', :locals => { :f => f } %>
  <% end -%>

  <div id='node_<%= @node.id %>_<%= info[0] %>_edit' style='display:none;'>
  <% remote_cms_form_for :revision_edit, info[1],
      :update => "node_#{@node.id}_#{info[0]}",
      :method => 'post',
      :html => { :class => 'admin_form' },
      :url =>  { :action => 'update_revision', :revision  => info[1].id  } do  |f| -%>
      <%= render :partial => 'revision_info_table', :locals => { :f => f  } %>

    <%= f.header 'Additional Page Options' %>
    <%= f.filemanager_image :icon_id, :label => 'Page Icon' %>
    <%= f.filemanager_image :icon_hot_id, :label => 'Page Icon Hot' %>
    <%= f.filemanager_image :icon_disabled_id, :label => 'Page Icon Disabled' %>
    <%= f.filemanager_image :icon_selected_id, :label => 'Page Icon Selected'  %>
    <%= f.color_field :color, :label => 'Color' %>
    <%= f.color_field :color_selected, :label => 'Selected Color' %>
    <%= f.color_field :color_hover, :label => 'Hover Color' %>
    <%= f.text_field :field1, :description => 'Additional Field available in Menu Features' %>
    <%= f.text_field :field2, :description => '2nd Additional Field available in Menu Features' %>

    <%= f.submit_cancel_tags 'Update','Cancel',
	      {},
	      {
		:onclick => "Element.show(\"node_#{@node.id}_#{info[0]}_view\"); Element.hide(\"node_#{@node.id}_#{info[0]}_edit\"); return false;"
	      } %>
  <% end -%>
<% else -%>
  <% tabled_display_form_for :revision_view, info[1] do |f| -%>
      <%= render :partial => 'revision_info_table', :locals => { :f => f } %>
  <% end -%>
<% end -%>

<% end -%>


missed pagination links in search results

git-svn-id: 295275ead0c997ff8920a9abe88dec0903829be9@436 9c008b19-a030-0410-9975-d76d301b4276

<% if current_controller == 'avatars' and current_action == 'index' %>

    <%= link_to 'Home', home_path %> »
    <%= link_to 'Users', users_path %> » Avatars

    <%= will_paginate @avatars %>

<% end %>

<% if current_controller == 'avatars' and current_action == 'new' %>

    <%= link_to 'Home', home_path %> »
    <%= link_to 'Users', users_path %> »
    <%= link_to 'Avatars', avatars_path %> » New Avatar

<% end %>

<% if current_controller == 'categories' and current_action == 'show' %>

    <%= link_to 'Home', home_path %> »
    <%= link_to 'Forum', forum_home_path %> » <%= h@category.name %>

    <%= will_paginate @topics %>

<% end %>

<% if current_controller == 'events' and current_action == 'index' %>

    <%= link_to 'Home', home_path %> » Events

    <%= will_paginate @events %>

<% end %>

<% if current_controller == 'events' and current_action == 'edit' %>

    <%= link_to 'Home', home_path %> »
    <%= link_to 'Events', events_path %> »
    <%= link_to h(@event.title), event_path(@event) %> » Editing Event

<% end %>

<% if current_controller == 'events' and current_action == 'new' %>

    <%= link_to 'Home', home_path %> »
    <%= link_to 'Events', events_path %> » New Event

<% end %>

<% if current_controller == 'events' and current_action == 'show' %>

    <%= link_to 'Home', home_path %> »
    <%= link_to 'Events', events_path %> » <%=h @event.title %>

    <% if can_edit?(@event) %>
      <%= link_to 'Edit Event', edit_event_path %>
    <% end %>

<% end %>

<% if current_controller == 'forums' and current_action == 'index' %>

    <%= link_to('View All Topics »', topics_path) %>

<% end %>

<% if current_controller == 'forums' and current_action == 'show' %>

    <%= link_to 'Home', home_path %> »
    <%= link_to 'Forum', forum_home_path %> »
    <%= link_to @forum.category.name, category_path(@forum.category) %> » <%= @forum.name %>

    <%= will_paginate @topics %>

<% end %>

<% if current_controller == 'headers' and current_action == 'index' %>

    <%= will_paginate @headers %>

<% end %>

<% if current_controller == 'headers' and current_action == 'new' %>

    <%= link_to 'Home', home_path %> »
    <%= link_to 'Headers', headers_path %> » New Header

<% end %>

<% if current_controller == 'headers' and current_action == 'edit' %>

    <%= link_to 'Home', home_path %> »
    <%= link_to 'Headers', headers_path %> »
    <%= link_to @header.filename, header_path(@header) %> » Editing Header

<% end %>

<% if current_controller == 'headers' and current_action == 'show' %>

    <%= link_to 'Home', home_path %> »
    <%= link_to 'Headers', headers_path %> » <%= @header.filename %>

    <% if can_edit?(@header) %>
      <%= link_to 'Edit Header', edit_header_path %>
    <% end %>

<% end %>

<% if current_controller == 'home' and current_action == 'index' %>

    <%= will_paginate @topics unless @topics.blank? %>

<% end %>

<% if current_controller == 'search' %>
  <%= '

' unless @posts.blank? %>

    <%= will_paginate @events unless @events.blank? %>
    <%= will_paginate @headers unless @headers.blank? %>
    <%= will_paginate @posts unless @posts.blank? %>
    <%= will_paginate @topics unless @topics.blank? %>
    <%= will_paginate @uploads unless @uploads.blank? %>
    <%= will_paginate @users unless @users.blank? %>

<% end %>

<% if current_controller == 'themes' and current_action == 'new' %>

    <%= link_to 'Home', home_path %> »
    <%= link_to 'Users', users_path %> »
    <%= link_to 'Themes', themes_path %> » New Theme

<% end %>

<% if current_controller == 'themes' and current_action == 'index' %>

    <%= link_to 'Home', home_path %> »
    <%= link_to 'Users', users_path %> » Themes

    <%= will_paginate @themes %>

<% end %>

<% if current_controller == 'topics' and current_action == 'index' %>

    <%= link_to 'Home', home_path %> »
    <%= link_to 'Forum', forum_home_path %> » All Topics

    <%= will_paginate @topics %>

<% end %>

<% if current_controller == 'topics' and current_action == 'new' %>

    <%= link_to 'Home', home_path %> »
    <%= link_to 'Forum', forum_home_path %> » New Topic

<% end %>

<% if current_controller == 'topics' and current_action == 'edit' %>

    <%= link_to 'Home', home_path %> »
    <%= link_to @topic.title, topic_path(@topic) %> » Editing Topic

<% end %>

<% if current_controller == 'topics' and current_action == 'show' %>

    <%= link_to 'Home', home_path %> »
    <%= link_to 'Forum', forum_home_path %> <%= link_to 'Topics', topics_path %> »
    <%= link_to @topic.forum.category.name, category_path(@topic.forum.category) %> »
    <%= link_to @topic.forum.name, forum_path(@topic.forum) %> »
    <%=h @topic.title %>

    <% if can_edit?(@topic) %>
      <%= link_to 'Edit Topic', edit_topic_path %>
    <% end %>
    <% if @topic.last_page != 1 && can_edit?(@topic) %> | <% end %>
    <%= will_paginate @posts, :inner_window => 1, :outer_window => 0, :prev_label => '« Prev' %>

<% end %>

<% if current_controller == 'uploads' and current_action == 'index' %>

    <%= will_paginate @uploads %>

<% end %>

<% if current_controller == 'uploads' and current_action == 'new' %>

    <%= link_to 'Home', home_path %> »
    <%= link_to 'Files', files_home_path %> » New File

<% end %>

<% if current_controller == 'users' and current_action == 'index' %>

    <%= will_paginate @users %>

<% end %>

<% if current_controller == 'users' and current_action == 'edit' %>

    <%= link_to 'Home', home_path %> »
    <%= link_to 'Users', users_path %> »
    <%= link_to h(@user.login), user_path(@user) %> » Editing Profile

<% end %>

<% if current_controller == 'users' and current_action == 'show' %>

    <%= link_to 'Home', home_path %> »
    <%= link_to 'Users', users_path %> » <%=h @user.login %>

    <% if can_edit?(@user) && @user.avatar %>
      <%= link_to 'Change Avatar', avatars_path %>
      <%= link_to '(x)', deselect_avatar_path, :method => :post %>
    <% elsif can_edit?(@user) && @user.avatar.nil? %>
      <%= link_to 'Get an Avatar', avatars_path %>
    <% end %>
    <% if can_edit?(@user) %>
        <%= link_to 'Edit Profile', edit_user_path(@user) %>
    <% end %>

<% end %>

<% if current_controller == 'avatars' and current_action == 'index' %>

    <%= link_to 'Home', home_path %> »
    <%= link_to 'Users', users_path %> » Avatars

    <%= will_paginate @avatars %>

<% end %>

<% if current_controller == 'avatars' and current_action == 'new' %>

    <%= link_to 'Home', home_path %> »
    <%= link_to 'Users', users_path %> »
    <%= link_to 'Avatars', avatars_path %> » New Avatar

<% end %>

<% if current_controller == 'categories' and current_action == 'show' %>

    <%= link_to 'Home', home_path %> »
    <%= link_to 'Forum', forum_home_path %> » <%= h@category.name %>

    <%= will_paginate @topics %>

<% end %>

<% if current_controller == 'events' and current_action == 'index' %>

    <%= link_to 'Home', home_path %> » Events

    <%= will_paginate @events %>

<% end %>

<% if current_controller == 'events' and current_action == 'edit' %>

    <%= link_to 'Home', home_path %> »
    <%= link_to 'Events', events_path %> »
    <%= link_to h(@event.title), event_path(@event) %> » Editing Event

<% end %>

<% if current_controller == 'events' and current_action == 'new' %>

    <%= link_to 'Home', home_path %> »
    <%= link_to 'Events', events_path %> » New Event

<% end %>

<% if current_controller == 'events' and current_action == 'show' %>

    <%= link_to 'Home', home_path %> »
    <%= link_to 'Events', events_path %> » <%=h @event.title %>

    <% if can_edit?(@event) %>
      <%= link_to 'Edit Event', edit_event_path %>
    <% end %>

<% end %>

<% if current_controller == 'forums' and current_action == 'index' %>

    <%= link_to('View All Topics »', topics_path) %>

<% end %>

<% if current_controller == 'forums' and current_action == 'show' %>

    <%= link_to 'Home', home_path %> »
    <%= link_to 'Forum', forum_home_path %> »
    <%= link_to @forum.category.name, category_path(@forum.category) %> » <%= @forum.name %>

    <%= will_paginate @topics %>

<% end %>

<% if current_controller == 'headers' and current_action == 'index' %>

    <%= will_paginate @headers %>

<% end %>

<% if current_controller == 'headers' and current_action == 'new' %>

    <%= link_to 'Home', home_path %> »
    <%= link_to 'Headers', headers_path %> » New Header

<% end %>

<% if current_controller == 'headers' and current_action == 'edit' %>

    <%= link_to 'Home', home_path %> »
    <%= link_to 'Headers', headers_path %> »
    <%= link_to @header.filename, header_path(@header) %> » Editing Header

<% end %>

<% if current_controller == 'headers' and current_action == 'show' %>

    <%= link_to 'Home', home_path %> »
    <%= link_to 'Headers', headers_path %> » <%= @header.filename %>

    <% if can_edit?(@header) %>
      <%= link_to 'Edit Header', edit_header_path %>
    <% end %>

<% end %>

<% if current_controller == 'home' and current_action == 'index' %>

    <%= will_paginate @topics unless @topics.blank? %>

<% end %>

<% if current_controller == 'search' %>
  <%= '

' unless @posts.blank? %>

    <%= will_paginate @topics unless @topics.blank? %>
    <%= will_paginate @posts unless @posts.blank? %>

<% end %>

<% if current_controller == 'themes' and current_action == 'new' %>

    <%= link_to 'Home', home_path %> »
    <%= link_to 'Users', users_path %> »
    <%= link_to 'Themes', themes_path %> » New Theme

<% end %>

<% if current_controller == 'themes' and current_action == 'index' %>

    <%= link_to 'Home', home_path %> »
    <%= link_to 'Users', users_path %> » Themes

    <%= will_paginate @themes %>

<% end %>

<% if current_controller == 'topics' and current_action == 'index' %>

    <%= link_to 'Home', home_path %> »
    <%= link_to 'Forum', forum_home_path %> » All Topics

    <%= will_paginate @topics %>

<% end %>

<% if current_controller == 'topics' and current_action == 'new' %>

    <%= link_to 'Home', home_path %> »
    <%= link_to 'Forum', forum_home_path %> » New Topic

<% end %>

<% if current_controller == 'topics' and current_action == 'edit' %>

    <%= link_to 'Home', home_path %> »
    <%= link_to @topic.title, topic_path(@topic) %> » Editing Topic

<% end %>

<% if current_controller == 'topics' and current_action == 'show' %>

    <%= link_to 'Home', home_path %> »
    <%= link_to 'Forum', forum_home_path %> <%= link_to 'Topics', topics_path %> »
    <%= link_to @topic.forum.category.name, category_path(@topic.forum.category) %> »
    <%= link_to @topic.forum.name, forum_path(@topic.forum) %> »
    <%=h @topic.title %>

    <% if can_edit?(@topic) %>
      <%= link_to 'Edit Topic', edit_topic_path %>
    <% end %>
    <% if @topic.last_page != 1 && can_edit?(@topic) %> | <% end %>
    <%= will_paginate @posts, :inner_window => 1, :outer_window => 0, :prev_label => '« Prev' %>

<% end %>

<% if current_controller == 'uploads' and current_action == 'index' %>

    <%= will_paginate @uploads %>

<% end %>

<% if current_controller == 'uploads' and current_action == 'new' %>

    <%= link_to 'Home', home_path %> »
    <%= link_to 'Files', files_home_path %> » New File

<% end %>

<% if current_controller == 'users' and current_action == 'index' %>

    <%= will_paginate @users %>

<% end %>

<% if current_controller == 'users' and current_action == 'edit' %>

    <%= link_to 'Home', home_path %> »
    <%= link_to 'Users', users_path %> »
    <%= link_to h(@user.login), user_path(@user) %> » Editing Profile

<% end %>

<% if current_controller == 'users' and current_action == 'show' %>

    <%= link_to 'Home', home_path %> »
    <%= link_to 'Users', users_path %> » <%=h @user.login %>

    <% if can_edit?(@user) && @user.avatar %>
      <%= link_to 'Change Avatar', avatars_path %>
      <%= link_to '(x)', deselect_avatar_path, :method => :post %>
    <% elsif can_edit?(@user) && @user.avatar.nil? %>
      <%= link_to 'Get an Avatar', avatars_path %>
    <% end %>
    <% if can_edit?(@user) %>
        <%= link_to 'Edit Profile', edit_user_path(@user) %>
    <% end %>

<% end %>


added link to about page to index

added link to about page to index

CiteParse

Welcome to CiteParse!

CiteParse is a web service that parses reference strings into structured citations.

<%= link_to "Parse a citation", :controller => "citations", :action => "parse_string" %>

<%= link_to "Read about CiteParse", :controller => "welcome", :action => "about" %>

<%= link_to "Learn about our API", :controller => "welcome", :action => "index" %>

CiteParse

Welcome to CiteParse!

CiteParse is a web service that parses reference strings into structured citations.

Learn about our API

Parse citations


Show name of authority here so clearer.

Show name of authority here so clearer.

<% @title = "Make an annotation on '" + h(@info_request.title) + "'" %>

<% if @existing_comment %>

    <%= user_or_you_capital(@existing_comment.user) %> already
    made this annotation on <%=simple_date(@existing_comment.created_at)%>.

<% end %>

<%= foi_error_messages_for :comment %>

Add an annotation to '<%=request_link(@info_request)%>'

Annotations are so anyone, including you, can help the requester with their request. For example:

<% if [ 'waiting_clarification' ].include?(@info_request.described_state) %>

 Advise on how to best clarify the request.

<% end %>

<% if @info_request.awaiting_description %>
<% end %>

<% if not [ 'successful', 'partially_successful' ].include?(@info_request.described_state) %>

 Link to the information requested, if it is already available on the Internet.

 Suggest where else the requester might find the information.

 Offer better ways of wording the request to get the information.

<% end %>

<% if [ 'successful', 'partially_successful' ].include?(@info_request.described_state) %>

 Summarise the content of any information returned.

 Say how you've used the information, with links if possible.

 Thank the public authority or <%=h @info_request.user.name %>.

<% end %>
<% if [ 'partially_successful' ].include?(@info_request.described_state) %>

 Suggest how the requester can find the rest of the information.

<% end %>
<% if [ 'successful', 'partially_successful' ].include?(@info_request.described_state) %>

 Point to related information, campaigns or forums which may be useful.

<% end %>

<% if [ 'not_held' ].include?(@info_request.described_state) %>

 Ideas on what other documents to request which the authority may hold.

<% end %>
<% if [ 'rejected' ].include?(@info_request.described_state) %>

 Advise on whether the rejection is legal, and how to complain about it if not.

<% end %>

<% if [ 'error_message' ].include?(@info_request.described_state) %>

 You know what caused the error, and can suggest a solution, such as a working email address.

<% end %>
<% if [ 'requires_admin' ].include?(@info_request.described_state) %>

 Your thoughts on what the WhatDoTheyKnow administrators should do about the request.

<% end %>

    <big>Annotations will be posted publicly here, and are
        not sent to <%=h @info_request.public_body.name %>.</big>

<%= render :partial => 'comment/comment_form', :locals => { :track_thing => @track_thing } %>

<% @title = "Make an annotation on '" + h(@info_request.title) + "'" %>

<% if @existing_comment %>

    <%= user_or_you_capital(@existing_comment.user) %> already
    made this annotation on <%=simple_date(@existing_comment.created_at)%>.

<% end %>

<%= foi_error_messages_for :comment %>

Add an annotation to '<%=request_link(@info_request)%>'

Annotations are so anyone, including you, can help the requester with their request. For example:

<% if [ 'waiting_clarification' ].include?(@info_request.described_state) %>

 Advise on how to best clarify the request.

<% end %>

<% if @info_request.awaiting_description %>
<% end %>

<% if not [ 'successful', 'partially_successful' ].include?(@info_request.described_state) %>

 Link to the information requested, if it is already available on the Internet.

 Suggest where else the requester might find the information.

 Offer better ways of wording the request to get the information.

<% end %>

<% if [ 'successful', 'partially_successful' ].include?(@info_request.described_state) %>

 Summarise the content of any information returned.

 Say how you've used the information, with links if possible.

 Thank the public authority or <%=h @info_request.user.name %>.

<% end %>
<% if [ 'partially_successful' ].include?(@info_request.described_state) %>

 Suggest how the requester can find the rest of the information.

<% end %>
<% if [ 'successful', 'partially_successful' ].include?(@info_request.described_state) %>

 Point to related information, campaigns or forums which may be useful.

<% end %>

<% if [ 'not_held' ].include?(@info_request.described_state) %>

 Ideas on what other documents to request which the authority may hold.

<% end %>
<% if [ 'rejected' ].include?(@info_request.described_state) %>

 Advise on whether the rejection is legal, and how to complain about it if not.

<% end %>

<% if [ 'error_message' ].include?(@info_request.described_state) %>

 You know what caused the error, and can suggest a solution, such as a working email address.

<% end %>
<% if [ 'requires_admin' ].include?(@info_request.described_state) %>

 Your thoughts on what the WhatDoTheyKnow administrators should do about the request.

<% end %>

    <big>Annotations will be posted publicly here, and are
    not sent to the authority.</big>

<%= render :partial => 'comment/comment_form', :locals => { :track_thing => @track_thing } %>


adding bbcode to events-show

adding bbcode to events-show

git-svn-id: 295275ead0c997ff8920a9abe88dec0903829be9@449 9c008b19-a030-0410-9975-d76d301b4276

  <%= render :partial => 'events/new' if %w(index).include?(current_action) %>

  <%=h @event.title %>

    by <%= link_to h(@event.user.login), user_path(@event.user) %>
     |
    <%= @event.private? ? 'Private' : 'Public' %><%= @event.reminder? ? ', Reminder' : '' %>

<% if !@event.description.blank? %>

      <%=tz @event.date %>

    <%= bb(@event.description) %>

<% end %>

  <%= render :partial => 'events/new' if %w(index).include?(current_action) %>

  <%=h @event.title %>

    by <%= link_to h(@event.user.login), user_path(@event.user) %>
     |
    <%= @event.private? ? 'Private' : 'Public' %><%= @event.reminder? ? ', Reminder' : '' %>

<% if !@event.description.blank? %>

      <%=tz @event.date %>

    <%=h @event.description %>

<% end %>


Say summary again.

Say summary again.

<% @title = "Make an " + h(@info_request.law_used_short) + " request to '" + h(@info_request.public_body.name) + "'" %>

<% if @existing_request %>

    <%= user_or_you_capital_link(@existing_request.user) %> already
    created the same request on <%=simple_date(@existing_request.created_at)%>.
    You can either view the <a href="<%=request_url(@existing_request)%>">existing request,
    or edit the details below to make a new but similar request.

<% end %>

<%= foi_error_messages_for :info_request, :outgoing_message %>

Read this before writing your <%=h(@info_request.law_used_full)%> request

        <% form_tag("http://www.google.co.uk/search", {:id => "search_body_website_form", :method => "get"} ) do %>

                First,
                <% if !@info_request.public_body.publication_scheme.empty? %>
                    browse the authority's
                    <%= link_to "publication scheme", @info_request.public_body.publication_scheme %>
                    or search their web site ...
                <% else %>
                       search the authority's web site ...
                <% end %>
                <% if !@info_request.public_body.calculated_home_page.nil? %>

                            <%= text_field_tag 'q', params[:q], { :size => 20 } %>
                    <%= hidden_field_tag 'as_sitesearch', @info_request.public_body.calculated_home_page %>
                    <%= submit_tag "Search" %>
               <% end %>

               ... to check that the info isn't already published.

        <% end %>

        <% if @info_request.public_body.info_requests.size > 0 %>
            Browse <%= link_to "other requests", public_body_url(@info_request.public_body)  %>
            to '<%= h(@info_request.public_body.name) %>'
            for examples of how to word your request.
        <% else %>
            Browse <%= link_to "other requests", request_list_url %> for examples of how to word your request.
        <% end %>

Write your request in simple, precise language.

Ask for specific documents or information, this site is not suitable for general enquiries.

Keep it focused, you'll be more likely to get what you want (why?).

This site is public. Everything you type and any response will be published.

    <% if @info_request.public_body.has_notes? %>

Special note for this authority!

<%= @info_request.public_body.notes_as_html %>

    <% end %>

    <% if @info_request.public_body.eir_only? %>

Please ask for environmental information only

The Freedom of Information Act does not apply to <%=h(@info_request.public_body.name)%>.
        However, you have the right to request environmental
        information under a different law (explanation).
        This covers a very wide spectrum of information about the state of
        the natural and built environment, such as:

Air, water, soil, land, flora and fauna (including how these effect
        human beings)

Information on emissions and discharges (e.g. noise, energy,
        radiation, waste materials)

Human health and safety

Cultural sites and built structures (as they may be affected by the
        environmental factors listed above)

Plans and administrative measures that affect these matters

Please only request information that comes under those categories, do not waste your
        time or the time of the public authority by requesting unrelated information.

    <% end %>

<% form_for(:info_request, @info_request, :html => { :id => 'write_form' }  ) do |f| %>

			To:
			<%=h(@info_request.public_body.name)%>

			Summary:
			<%= f.text_field :title, :size => 50 %>

			(a one line summary of the information you are requesting,
			e.g.
            <% if @info_request.law_used == 'eir' %>
                'Pollution levels over time for the River Tyne'
            <% else %>
                'Crime statistics by ward level for Wales'
            <% end %>
            )

		<% fields_for :outgoing_message do |o| %>

			Your request:
			<%= o.text_area :body, :rows => 20, :cols => 60 %>

		<% end %>

        <% if !@user %>

                Everything that you enter on this page, including your name,
                will be displayed publicly on
                this website (why?).
                If you are thinking of using a pseudonym,
                please read this first.

        <% else %>

                Everything that you enter on this page
                will be displayed publicly on
                this website (why?).

        <% end %>

			Can I request information about myself?
			No! (Click here for details)

			<%= f.hidden_field(:public_body_id, { :value => @info_request.public_body_id } ) %>
			<%= hidden_field_tag(:submitted_new_request, 1 ) %>
			<%= hidden_field_tag(:preview, 1 ) %>
			<%= submit_tag "Preview your public request" %>

<% end %>

<% @title = "Make an " + h(@info_request.law_used_short) + " request to '" + h(@info_request.public_body.name) + "'" %>

<% if @existing_request %>

    <%= user_or_you_capital_link(@existing_request.user) %> already
    created the same request on <%=simple_date(@existing_request.created_at)%>.
    You can either view the <a href="<%=request_url(@existing_request)%>">existing request,
    or edit the details below to make a new but similar request.

<% end %>

<%= foi_error_messages_for :info_request, :outgoing_message %>

Read this before writing your <%=h(@info_request.law_used_full)%> request

        <% form_tag("http://www.google.co.uk/search", {:id => "search_body_website_form", :method => "get"} ) do %>

                First,
                <% if !@info_request.public_body.publication_scheme.empty? %>
                    browse the authority's
                    <%= link_to "publication scheme", @info_request.public_body.publication_scheme %>
                    or search their web site ...
                <% else %>
                       search the authority's web site ...
                <% end %>
                <% if !@info_request.public_body.calculated_home_page.nil? %>

                            <%= text_field_tag 'q', params[:q], { :size => 20 } %>
                    <%= hidden_field_tag 'as_sitesearch', @info_request.public_body.calculated_home_page %>
                    <%= submit_tag "Search" %>
               <% end %>

               ... to check that the info isn't already published.

        <% end %>

        <% if @info_request.public_body.info_requests.size > 0 %>
            Browse <%= link_to "other requests", public_body_url(@info_request.public_body)  %>
            to '<%= h(@info_request.public_body.name) %>'
            for examples of how to word your request.
        <% else %>
            Browse <%= link_to "other requests", request_list_url %> for examples of how to word your request.
        <% end %>

Write your request in simple, precise language.

Ask for specific documents or information, this site is not suitable for general enquiries.

Keep it focused, you'll be more likely to get what you want (why?).

This site is public. Everything you type and any response will be published.

    <% if @info_request.public_body.has_notes? %>

Special note for this authority!

<%= @info_request.public_body.notes_as_html %>

    <% end %>

    <% if @info_request.public_body.eir_only? %>

Please ask for environmental information only

The Freedom of Information Act does not apply to <%=h(@info_request.public_body.name)%>.
        However, you have the right to request environmental
        information under a different law (explanation).
        This covers a very wide spectrum of information about the state of
        the natural and built environment, such as:

Air, water, soil, land, flora and fauna (including how these effect
        human beings)

Information on emissions and discharges (e.g. noise, energy,
        radiation, waste materials)

Human health and safety

Cultural sites and built structures (as they may be affected by the
        environmental factors listed above)

Plans and administrative measures that affect these matters

Please only request information that comes under those categories, do not waste your
        time or the time of the public authority by requesting unrelated information.

    <% end %>

<% form_for(:info_request, @info_request, :html => { :id => 'write_form' }  ) do |f| %>

			To:
			<%=h(@info_request.public_body.name)%>

			Subject:
			<%= f.text_field :title, :size => 50 %>

			(a one line summary of the information you are requesting,
			e.g.
            <% if @info_request.law_used == 'eir' %>
                'Pollution levels over time for the River Tyne'
            <% else %>
                'Crime statistics by ward level for Wales'
            <% end %>
            )

		<% fields_for :outgoing_message do |o| %>

			Your request:
			<%= o.text_area :body, :rows => 20, :cols => 60 %>

		<% end %>

        <% if !@user %>

                Everything that you enter on this page, including your name,
                will be displayed publicly on
                this website (why?).
                If you are thinking of using a pseudonym,
                please read this first.

        <% else %>

                Everything that you enter on this page
                will be displayed publicly on
                this website (why?).

        <% end %>

			Can I request information about myself?
			No! (Click here for details)

			<%= f.hidden_field(:public_body_id, { :value => @info_request.public_body_id } ) %>
			<%= hidden_field_tag(:submitted_new_request, 1 ) %>
			<%= hidden_field_tag(:preview, 1 ) %>
			<%= submit_tag "Preview your public request" %>

<% end %>


Add thumbs up to "I also want to know"

Add thumbs up to "I also want to know"

<%
    if @user
        existing_track = TrackThing.find_by_existing_track(@user, track_thing)
    end
%>

<% if own_request %>

<%= _('This is your own request, so you will be automatically emailed when new responses arrive.')%>

<% elsif existing_track %>

<%= track_thing.params[:verb_on_page_already] %>

    <div class="feed_link feed_link_<%=location%>">
  <%= link_to _("Unsubscribe"), {:controller => 'track', :action => 'update', :track_id => existing_track.id, :track_medium => "delete", :r => request.request_uri}, :class => "link_button_green" %>

<% elsif track_thing %>
    <div class="feed_link feed_link_<%=location%>">
     <% if defined? follower_count && follower_count > 0 %>
        <%= link_to _("I like this request"), do_track_path(track_thing), :class => "link_button_green" %>
     <% elsif track_thing.info_request_id %>
         <%= link_to _(" I also want to know"), do_track_path(track_thing), :class => "link_button_green" %>
     <% else %>
        <%= link_to _("Follow"), do_track_path(track_thing), :class => "link_button_green" %>
     <% end %>

    <div class="feed_link feed_link_<%=location%>">
        <%= link_to ''.html_safe, do_track_path(track_thing, 'feed') %>
        <%= link_to (location == 'sidebar' ? _('RSS feed of updates') : _('RSS feed')),  do_track_path(track_thing, 'feed') %>

<% end %>

<%
    if @user
        existing_track = TrackThing.find_by_existing_track(@user, track_thing)
    end
%>

<% if own_request %>

<%= _('This is your own request, so you will be automatically emailed when new responses arrive.')%>

<% elsif existing_track %>

<%= track_thing.params[:verb_on_page_already] %>

    <div class="feed_link feed_link_<%=location%>">
  <%= link_to _("Unsubscribe"), {:controller => 'track', :action => 'update', :track_id => existing_track.id, :track_medium => "delete", :r => request.request_uri}, :class => "link_button_green" %>

<% elsif track_thing %>
    <div class="feed_link feed_link_<%=location%>">
     <% if defined? follower_count && follower_count > 0 %>
        <%= link_to _("I like this request"), do_track_path(track_thing), :class => "link_button_green" %>
     <% elsif track_thing.info_request_id %>
        <%= link_to _("I also want to know"), do_track_path(track_thing), :class => "link_button_green" %>
     <% else %>
        <%= link_to _("Follow"), do_track_path(track_thing), :class => "link_button_green" %>
     <% end %>

    <div class="feed_link feed_link_<%=location%>">
        <%= link_to ''.html_safe, do_track_path(track_thing, 'feed') %>
        <%= link_to (location == 'sidebar' ? _('RSS feed of updates') : _('RSS feed')),  do_track_path(track_thing, 'feed') %>

<% end %>


Use reporter name in update confirmation email. Warn that it will be public.

Hi<%= raw " #{@update.reporter_name}" %>,

Please click on the link below to confirm the update you just
added to FixMyTransport:

<%= raw @link %>

If your email program does not let you click on this link, copy
and paste it into your web browser and press return.

Your update reads: <%= raw @update.text %>

Your name will be shown on the site as: <%= @update.reporter_name %>

Yours,
The FixMyTransport team

Hi<%= raw " #{@recipient.name}" %>,

Please click on the link below to confirm the update you just
added to FixMyTransport:

<%= raw @link %>

If your email program does not let you click on this link, copy
and paste it into your web browser and press return.

Your update reads: <%= raw @update.text %>

Yours,
The FixMyTransport team


Titleize does nothing useful!

Titleize does nothing useful!

<% @title = h(@display_user.name) + (@is_you ? " (you)" : "") %>

<% if (@same_name_users.size >= 1) %>

This is just one person who uses this site and has this name, you may
    mean a different one:
    <% for @same_name_user in @same_name_users %>
        <%= user_link(@same_name_user) %>
    <% end %>
<% end%>

<div class="single_user" id="user-<%=@display_user.id.to_s%>">

<%=@title%>

Joined WhatDoTheyKnow on <%= simple_date(@display_user.created_at) %>

        <%= link_to "Send message to " + h(@display_user.name), contact_user_url(:id => @display_user.id) %>
        <% if @is_you %>
            (just to see how it works)

<%= link_to "Change your password", signchange_url() %>
        <% else %>
        <% end %>

    <% if not @display_user.track_things.empty? %>

        <%= @is_you ? 'You are' : 'This person is' %> tracking
        <%=pluralize(@display_user.track_things.size, "thing") %>

        <% for track_thing in @display_user.track_things %>

<%= track_thing.params[:describe] %>

        <% end %>

    <% end %>

    <% if @display_user.info_requests.empty? %>

Freedom of Information requests made by <%= @is_you ? 'you' : 'this person' %>

<%= @is_you ? 'You have' : 'This person has' %>
        made no Freedom of Information requests using this site.

    <% else %>

        <%= @is_you ? 'You have' : 'This person has' %>
        made <%=pluralize(@display_user.info_requests.size, "Freedom of Information request") %>

        <%= render :partial => 'request/request_listing', :locals => { :info_requests => @display_user.info_requests.sort { |a,b| b.created_at <=> a.created_at } } %>
    <% end %>

<% @title = h(@display_user.name) + (@is_you ? " (you)" : "") %>

<% if (@same_name_users.size >= 1) %>

This is just one person who uses this site and has this name, you may
    mean a different one:
    <% for @same_name_user in @same_name_users %>
        <%= user_link(@same_name_user) %>
    <% end %>
<% end%>

<div class="single_user" id="user-<%=@display_user.id.to_s%>">

<%=@title%>

Joined WhatDoTheyKnow on <%= simple_date(@display_user.created_at) %>

        <%= link_to "Send message to " + h(@display_user.name), contact_user_url(:id => @display_user.id) %>
        <% if @is_you %>
            (just to see how it works)

<%= link_to "Change your password", signchange_url() %>
        <% else %>
        <% end %>

    <% if not @display_user.track_things.empty? %>

        <%= @is_you ? 'You are' : 'This person is' %> tracking
        <%=pluralize(@display_user.track_things.size, "thing") %>

        <% for track_thing in @display_user.track_things %>

<%= track_thing.params[:describe].titleize %>

        <% end %>

    <% end %>

    <% if @display_user.info_requests.empty? %>

Freedom of Information requests made by <%= @is_you ? 'you' : 'this person' %>

<%= @is_you ? 'You have' : 'This person has' %>
        made no Freedom of Information requests using this site.

    <% else %>

        <%= @is_you ? 'You have' : 'This person has' %>
        made <%=pluralize(@display_user.info_requests.size, "Freedom of Information request") %>

        <%= render :partial => 'request/request_listing', :locals => { :info_requests => @display_user.info_requests.sort { |a,b| b.created_at <=> a.created_at } } %>
    <% end %>


changed wording on sharing form to reflect the change to visible and accessible

<%# initialization: required to keep javascript independent of the access type codes, to allow the use the constants instead -%>
<%= render :partial=>"assets/sharing_constants" %>

<%# this hidden input will submit all permission data with the form -%>
<%= hidden_field_tag "sharing[permissions][contributor_types]", "" -%>
<%= hidden_field_tag "sharing[permissions][values]", "" -%>

<%# @resource_type -%>
<%# @favourite_groups -%>
<%# @all_projects -%>

<%# @policy_type -%>
<%# @sharing_mode -%>
<%# @access_mode -%>
<%# @use_custom_sharing -%>
<%# @use_whitelist -%>
<%# @use_blacklist -%>

    <%= help_icon("Here you can specify who can view, download and edit this #{@resource_type}.") -%>
    Sharing

        Here you can specify to whom the <%= @resource_type -%> is visible, accessible and editable.
        <%= link_to_function "More info " + expand_image, visual_effect(:toggle_blind, "more_sharing_info", :duration => 0.3) -%>

          Here you may specify the People, Projects or Groups that may View and Edit the details about your <%= @resource_type -%>.

          You may:

Keep the <%= @resource_type -%> private, and only visible to yourself.

Share with all other users, including those that are not a member of a Sysmo project.

Share with all other users that are a member of a Sysmo project.

Define more fine-grained sharing, by selecting Custom sharing permissions.
 By using custom sharing permissions you can share within your Project/Institution only,
 with specific individuals, or set up custom favourite groups for people you regularly need to share with.

<label for="sharing_scope_<%= Policy::PRIVATE -%>">
        <input type="hidden" name="sharing[access_type_<%= Policy::PRIVATE -%>]" value="<%= Policy::NO_ACCESS -%>">
        <input type="hidden" name="sharing[include_custom_sharing_<%= Policy::PRIVATE -%>]" value="0">

        <input <%= 'checked="checked"' if @sharing_mode == Policy::PRIVATE %> id="sharing_scope_<%= Policy::PRIVATE -%>" name="sharing[sharing_scope]"
                                                                              value="<%= Policy::PRIVATE -%>" type="radio" onclick="javascript:setSharingElementVisibility(<%= Policy::PRIVATE -%>);" />
        - Keep this <%= @resource_type -%> private.

Or share it with..

      <label for="sharing_scope_<%= Policy::ALL_REGISTERED_USERS -%>">
        <input type="radio" <%= 'checked="checked"' if @sharing_mode == Policy::ALL_REGISTERED_USERS -%> id="sharing_scope_<%= Policy::ALL_REGISTERED_USERS -%>" name="sharing[sharing_scope]"
               value="<%= Policy::ALL_REGISTERED_USERS -%>" onclick="javascript:setSharingElementVisibility(<%= Policy::ALL_REGISTERED_USERS -%>);" />
        - All users, including those that are not members of SysMO projects, for

      <%= render :partial => "assets/sharing_form_access_type_dropdown", :locals => { :access_type_selector_for_scope => Policy::ALL_REGISTERED_USERS,
        :sharing_scope => @sharing_mode, :access_type => @access_mode } -%>

      <%= render :partial => "assets/sharing_form_custom_permissions_checkbox", :locals => { :custom_sharing_cb_for_scope => Policy::ALL_REGISTERED_USERS,
        :sharing_scope => @sharing_mode, :use_custom_sharing => @use_custom_sharing } -%>

      <label for="sharing_scope_<%= Policy::ALL_SYSMO_USERS -%>">
        <input type="radio" <%= 'checked="checked"' if @sharing_mode == Policy::ALL_SYSMO_USERS -%> id="sharing_scope_<%= Policy::ALL_SYSMO_USERS -%>" name="sharing[sharing_scope]"
               value="<%= Policy::ALL_SYSMO_USERS -%>" onclick="javascript:setSharingElementVisibility(<%= Policy::ALL_SYSMO_USERS -%>);" />
        - All registered users that are members of a SysMO project for

      <%= render :partial => "assets/sharing_form_access_type_dropdown", :locals => { :access_type_selector_for_scope => Policy::ALL_SYSMO_USERS,
        :sharing_scope => @sharing_mode, :access_type => @access_mode } -%>

      <%= render :partial => "assets/sharing_form_custom_permissions_checkbox", :locals => { :custom_sharing_cb_for_scope => Policy::ALL_SYSMO_USERS,
        :sharing_scope => @sharing_mode, :use_custom_sharing => @use_custom_sharing } -%>

      <label for="sharing_scope_<%= Policy::CUSTOM_PERMISSIONS_ONLY -%>">
        <input type="radio" <%= 'checked="checked"' if @sharing_mode == Policy::CUSTOM_PERMISSIONS_ONLY -%> id="sharing_scope_<%= Policy::CUSTOM_PERMISSIONS_ONLY -%>" name="sharing[sharing_scope]"
               value="<%= Policy::CUSTOM_PERMISSIONS_ONLY -%>" onclick="javascript:setSharingElementVisibility(<%= Policy::CUSTOM_PERMISSIONS_ONLY -%>);" />
        - Use custom sharing permissions only

    <div id="specific_sharing" style="display: <%= (@use_custom_sharing || @sharing_mode == Policy::CUSTOM_PERMISSIONS_ONLY) ? "block" : "none" -%>; margin-top: 2em;">

        Custom sharing permissions

          So far you have selected to share this <%= @resource_type -%> with:

          Loading...

          Build up the list of people and groups to share with.
          Select from the options below and click "Add" to apply
          your choices and add collaborators to your current selection:

            <%= image_tag icon_filename_for_key("spinner"), :id => "f_group_deleting_spinner", :alt=>"loading...", :title=>"loading...", :style => "display: none; vertical-align: middle; float: right;" -%>
            <%= help_icon("Here you can choose your favourite groups to share this #{@resource_type} with.") -%>
            Favourite Groups

              <% favourite_groups = FavouriteGroup.get_all_without_blacklists_and_whitelists(current_user.id) -%>
              <% f_group_select_options = (favourite_groups.blank? ? "<option value=\"\">You don't have any favourite groups</option>" : options_for_select(favourite_groups)) -%>

              <%= select_tag "favourite_group_select", f_group_select_options, :onchange => "javascript: replaceFavouriteGroupRedboxActionURL(); return(false);", :style => "width: 82%; vertical-align: middle; margin-right: 0.4em;", :disabled => (favourite_groups.blank?) -%>

              <%= link_to "Add", "", :id => "add_f_group_link", :style => "font-weight: bold; vertical-align: middle;", :disabled => (favourite_groups.blank?),
                :onclick => "javascript: if($('favourite_group_select').disabled) return(false); addContributor('FavouriteGroup', $('favourite_group_select').options[$('favourite_group_select').selectedIndex].text, parseInt($('favourite_group_select').options[$('favourite_group_select').selectedIndex].value), #{Policy::DETERMINED_BY_GROUP}); return(false);" -%>

              <li id="edit_f_group_li" style="display: <%= favourite_groups.blank? ? "none" : "block" -%>; list-style-type: disc; padding: 0;"><%= favourite_group_popup_link_action_edit() -%>

              <li id="delete_f_group_li" style="display: <%= favourite_groups.blank? ? "none" : "block" -%>; list-style-type: disc; padding: 0;">
                <%= link_to "Delete selected favourite group", delete_favourite_group_path(0), :onclick => "deleteSelectedFavouriteGroup(); return(false);" -%>

<%= favourite_group_popup_link_action_new() -%>

            <%= help_icon("Here you can choose projects, institutions and workgroups to share this #{@resource_type} with.") -%>
            Projects and Institutions

              <% right_arrow_image = icon_filename_for_key("arrow_right") -%>

              Step 1
              <%= image_tag right_arrow_image, :style => "vertical-align: middle; padding: 0 0.8em;" -%>

              Step 2
              <%= image_tag right_arrow_image, :style => "vertical-align: middle; padding: 0 0.8em;" -%>

              Step 3

                <input type="hidden" id="proj_select_step_index" value="1">

                  <%= image_tag icon_filename_for_key("spinner"), :id => "institutions_loading_spinner", :alt=>"loading...", :title=>"loading...", :style => "display: none; vertical-align: middle; float: right;" -%>
                  Step 1: Select a project
                  <%= select("proj_project", "select",
                    Project.find(:all).collect {|p| [ p.name, p.id ] },
                    {:include_blank => 'All Projects @ Institution (from Step 2)'}, {:style => "width: 100%; vertical-align: middle; margin: 0.3em 0;"}) -%>

                  Step 2: Select scope of the project
                  <%= select_tag("proj_institution_select", nil, {:style => "width: 100%; vertical-align: middle; margin: 0.3em 0;"}) -%>

                  Step 3: Choose access rights, review and submit

                  <select name="proj_access_type_select" id="proj_access_type_select" onchange="javascript: replaceReviewWorkGroupURL();" style="width: 100%; vertical-align: middle; margin: 0.3em 0;">
                    <%= policy_selection_options [Policy::VISIBLE,Policy::ACCESSIBLE,Policy::EDITING] -%>
                  </select>

                    <%= link_to "< Previous step", "", :onclick => "javascript: projectInstitutionStepAction(-1); return(false);", :style => "font-weight: bold;" -%>

                    <%= link_to "Next step >", "", :onclick => "javascript: projectInstitutionStepAction(1); return(false);", :style => "font-weight: bold;" -%>

                        <%= link_to "Add immediately", "", :onclick => "javascript: addProjectInstitution(); return(false);", :style => "font-weight: bold; padding: 0;" -%>

<%= workgroup_member_review_popup_link() -%>

            <%= help_icon("Here you can specify individual people to share this #{@resource_type} with.") -%>
            Individual People

                Please type names of people to share this <%= @resource_type -%> with into the box below - suggestions will be displayed as you type.
                Select access rights from drop-down menu; these will be applied to all chosen people.
                Clicking "Add" will add selected people to the list.

                      ^_^<input type="text" id="ip_hidden_input" tabindex="-1" >

                        <input type="text" size="1" tabindex="" id="ip_autocomplete_input" />

Type the name of a friend, friend list, or email address

                    <select name="individual_people_access_type_select" id="individual_people_access_type_select" style="width: 344px; vertical-align: middle; margin-top: 0.3em;">
                      <%= policy_selection_options -%>
                    </select>

                    <%= link_to "Add", "", :onclick => "javascript: addIndividualPeople(); return(false);" -%>

    <%= "
" unless @enable_black_white_listing %>

Also include people in my..

          <input <%= "disabled" if @sharing_mode == Policy::PRIVATE -%> style="margin-right: 0.3em;" value="1" type="checkbox" name="sharing[use_whitelist]" id="cb_use_whitelist" <%= "checked='checked'" if @use_whitelist -%> />
          - "white list", who always get full access

        <% white_lst = current_user.get_whitelist -%>
        <%= hidden_field_tag "#{FavouriteGroup::WHITELIST_NAME}_group_id", (white_lst ? white_lst.id : "none") -%>
          [
          <span id="<%= FavouriteGroup::WHITELIST_NAME -%>_edit_span" style="display: <%= white_lst ? "inline" : "none" -%>;">
            <%= link_to "edit", "/", :onclick => "editWhitelistBlacklist('#{FavouriteGroup::WHITELIST_NAME}'); return(false);" -%>

          <% unless white_lst -%>
            <span id="<%= FavouriteGroup::WHITELIST_NAME -%>_create_span">
              <%= link_to "create", "/", :onclick => "createWhitelistBlacklist('#{FavouriteGroup::WHITELIST_NAME}'); return(false);" -%>

          <% end -%>
          ]
        <%= image_tag icon_filename_for_key("spinner"), :id => "#{FavouriteGroup::WHITELIST_NAME}_creation_spinner", :alt=>"loading...", :title=>"loading...", :style => "display: none; vertical-align: middle;" -%>

          <input <%= "disabled" if @sharing_mode == Policy::PRIVATE -%> style="margin-right: 0.3em;" value="1" type="checkbox" name="sharing[use_blacklist]" id="cb_use_blacklist" <%= "checked='checked'" if @use_blacklist -%> />
          - "black list", who have no access at all

        <% black_lst = current_user.get_blacklist -%>
        <%= hidden_field_tag "#{FavouriteGroup::BLACKLIST_NAME}_group_id", (black_lst ? black_lst.id : "none") -%>
          [
          <span id="<%= FavouriteGroup::BLACKLIST_NAME -%>_edit_span" style="display: <%= black_lst ? "inline" : "none" -%>;">
            <%= link_to "edit", "/", :onclick => "editWhitelistBlacklist('#{FavouriteGroup::BLACKLIST_NAME}'); return(false);" -%>

          <% unless black_lst -%>
            <span id="<%= FavouriteGroup::BLACKLIST_NAME -%>_create_span">
              <%= link_to "create", "/", :onclick => "createWhitelistBlacklist('#{FavouriteGroup::BLACKLIST_NAME}'); return(false);" -%>

          <% end -%>
          ]
        <%= image_tag icon_filename_for_key("spinner"), :id => "#{FavouriteGroup::BLACKLIST_NAME}_creation_spinner", :alt=>"loading...", :title=>"loading...", :style => "display: none; vertical-align: middle;" -%>

  <%# this DIV is to hold the 'redbox' links generated by a method in application_helper, -%>
  <%# these will be "clicked" by javascript, because hidden divs that are present in the -%>
  <%# generated code causes IE to break layout by inserting extra line break otherwise -%>
        <div id="<%= FavouriteGroup::WHITELIST_NAME -%>_redbox_link_div">
          <%= whitelist_blacklist_edit_popup_link(FavouriteGroup::WHITELIST_NAME) -%>

        <div id="<%= FavouriteGroup::BLACKLIST_NAME -%>_redbox_link_div">
          <%= whitelist_blacklist_edit_popup_link(FavouriteGroup::BLACKLIST_NAME) -%>

    <%= "
" unless @enable_black_white_listing %>

<%# initialization: required to keep javascript independent of the access type codes, to allow the use the constants instead -%>
<%= render :partial=>"assets/sharing_constants" %>

<%# this hidden input will submit all permission data with the form -%>
<%= hidden_field_tag "sharing[permissions][contributor_types]", "" -%>
<%= hidden_field_tag "sharing[permissions][values]", "" -%>

<%# @resource_type -%>
<%# @favourite_groups -%>
<%# @all_projects -%>

<%# @policy_type -%>
<%# @sharing_mode -%>
<%# @access_mode -%>
<%# @use_custom_sharing -%>
<%# @use_whitelist -%>
<%# @use_blacklist -%>

    <%= help_icon("Here you can specify who can view, download and edit this #{@resource_type}.") -%>
    Sharing

        Here you can specify who can view, download and edit this <%= @resource_type -%>.
        <%= link_to_function "More info " + expand_image, visual_effect(:toggle_blind, "more_sharing_info", :duration => 0.3) -%>

          Here you may specify the People, Projects or Groups that may View and Edit the details about your <%= @resource_type -%>.

          You may:

Keep the <%= @resource_type -%> private, and only visible to yourself.

Share with all other users, including those that are not a member of a Sysmo project.

Share with all other users that are a member of a Sysmo project.

Define more fine-grained sharing, by selecting Custom sharing permissions.
 By using custom sharing permissions you can share within your Project/Institution only,
 with specific individuals, or set up custom favourite groups for people you regularly need to share with.

<label for="sharing_scope_<%= Policy::PRIVATE -%>">
        <input type="hidden" name="sharing[access_type_<%= Policy::PRIVATE -%>]" value="<%= Policy::NO_ACCESS -%>">
        <input type="hidden" name="sharing[include_custom_sharing_<%= Policy::PRIVATE -%>]" value="0">

        <input <%= 'checked="checked"' if @sharing_mode == Policy::PRIVATE %> id="sharing_scope_<%= Policy::PRIVATE -%>" name="sharing[sharing_scope]"
                                                                              value="<%= Policy::PRIVATE -%>" type="radio" onclick="javascript:setSharingElementVisibility(<%= Policy::PRIVATE -%>);" />
        - Keep this <%= @resource_type -%> private.

Or share it with..

      <label for="sharing_scope_<%= Policy::ALL_REGISTERED_USERS -%>">
        <input type="radio" <%= 'checked="checked"' if @sharing_mode == Policy::ALL_REGISTERED_USERS -%> id="sharing_scope_<%= Policy::ALL_REGISTERED_USERS -%>" name="sharing[sharing_scope]"
               value="<%= Policy::ALL_REGISTERED_USERS -%>" onclick="javascript:setSharingElementVisibility(<%= Policy::ALL_REGISTERED_USERS -%>);" />
        - All users, including those that are not members of SysMO projects, for

      <%= render :partial => "assets/sharing_form_access_type_dropdown", :locals => { :access_type_selector_for_scope => Policy::ALL_REGISTERED_USERS,
        :sharing_scope => @sharing_mode, :access_type => @access_mode } -%>

      <%= render :partial => "assets/sharing_form_custom_permissions_checkbox", :locals => { :custom_sharing_cb_for_scope => Policy::ALL_REGISTERED_USERS,
        :sharing_scope => @sharing_mode, :use_custom_sharing => @use_custom_sharing } -%>

      <label for="sharing_scope_<%= Policy::ALL_SYSMO_USERS -%>">
        <input type="radio" <%= 'checked="checked"' if @sharing_mode == Policy::ALL_SYSMO_USERS -%> id="sharing_scope_<%= Policy::ALL_SYSMO_USERS -%>" name="sharing[sharing_scope]"
               value="<%= Policy::ALL_SYSMO_USERS -%>" onclick="javascript:setSharingElementVisibility(<%= Policy::ALL_SYSMO_USERS -%>);" />
        - All registered users that are members of a SysMO project for

      <%= render :partial => "assets/sharing_form_access_type_dropdown", :locals => { :access_type_selector_for_scope => Policy::ALL_SYSMO_USERS,
        :sharing_scope => @sharing_mode, :access_type => @access_mode } -%>

      <%= render :partial => "assets/sharing_form_custom_permissions_checkbox", :locals => { :custom_sharing_cb_for_scope => Policy::ALL_SYSMO_USERS,
        :sharing_scope => @sharing_mode, :use_custom_sharing => @use_custom_sharing } -%>

      <label for="sharing_scope_<%= Policy::CUSTOM_PERMISSIONS_ONLY -%>">
        <input type="radio" <%= 'checked="checked"' if @sharing_mode == Policy::CUSTOM_PERMISSIONS_ONLY -%> id="sharing_scope_<%= Policy::CUSTOM_PERMISSIONS_ONLY -%>" name="sharing[sharing_scope]"
               value="<%= Policy::CUSTOM_PERMISSIONS_ONLY -%>" onclick="javascript:setSharingElementVisibility(<%= Policy::CUSTOM_PERMISSIONS_ONLY -%>);" />
        - Use custom sharing permissions only

    <div id="specific_sharing" style="display: <%= (@use_custom_sharing || @sharing_mode == Policy::CUSTOM_PERMISSIONS_ONLY) ? "block" : "none" -%>; margin-top: 2em;">

        Custom sharing permissions

          So far you have selected to share this <%= @resource_type -%> with:

          Loading...

          Build up the list of people and groups to share with.
          Select from the options below and click "Add" to apply
          your choices and add collaborators to your current selection:

            <%= image_tag icon_filename_for_key("spinner"), :id => "f_group_deleting_spinner", :alt=>"loading...", :title=>"loading...", :style => "display: none; vertical-align: middle; float: right;" -%>
            <%= help_icon("Here you can choose your favourite groups to share this #{@resource_type} with.") -%>
            Favourite Groups

              <% favourite_groups = FavouriteGroup.get_all_without_blacklists_and_whitelists(current_user.id) -%>
              <% f_group_select_options = (favourite_groups.blank? ? "<option value=\"\">You don't have any favourite groups</option>" : options_for_select(favourite_groups)) -%>

              <%= select_tag "favourite_group_select", f_group_select_options, :onchange => "javascript: replaceFavouriteGroupRedboxActionURL(); return(false);", :style => "width: 82%; vertical-align: middle; margin-right: 0.4em;", :disabled => (favourite_groups.blank?) -%>

              <%= link_to "Add", "", :id => "add_f_group_link", :style => "font-weight: bold; vertical-align: middle;", :disabled => (favourite_groups.blank?),
                :onclick => "javascript: if($('favourite_group_select').disabled) return(false); addContributor('FavouriteGroup', $('favourite_group_select').options[$('favourite_group_select').selectedIndex].text, parseInt($('favourite_group_select').options[$('favourite_group_select').selectedIndex].value), #{Policy::DETERMINED_BY_GROUP}); return(false);" -%>

              <li id="edit_f_group_li" style="display: <%= favourite_groups.blank? ? "none" : "block" -%>; list-style-type: disc; padding: 0;"><%= favourite_group_popup_link_action_edit() -%>

              <li id="delete_f_group_li" style="display: <%= favourite_groups.blank? ? "none" : "block" -%>; list-style-type: disc; padding: 0;">
                <%= link_to "Delete selected favourite group", delete_favourite_group_path(0), :onclick => "deleteSelectedFavouriteGroup(); return(false);" -%>

<%= favourite_group_popup_link_action_new() -%>

            <%= help_icon("Here you can choose projects, institutions and workgroups to share this #{@resource_type} with.") -%>
            Projects and Institutions

              <% right_arrow_image = icon_filename_for_key("arrow_right") -%>

              Step 1
              <%= image_tag right_arrow_image, :style => "vertical-align: middle; padding: 0 0.8em;" -%>

              Step 2
              <%= image_tag right_arrow_image, :style => "vertical-align: middle; padding: 0 0.8em;" -%>

              Step 3

                <input type="hidden" id="proj_select_step_index" value="1">

                  <%= image_tag icon_filename_for_key("spinner"), :id => "institutions_loading_spinner", :alt=>"loading...", :title=>"loading...", :style => "display: none; vertical-align: middle; float: right;" -%>
                  Step 1: Select a project
                  <%= select("proj_project", "select",
                    Project.find(:all).collect {|p| [ p.name, p.id ] },
                    {:include_blank => 'All Projects @ Institution (from Step 2)'}, {:style => "width: 100%; vertical-align: middle; margin: 0.3em 0;"}) -%>

                  Step 2: Select scope of the project
                  <%= select_tag("proj_institution_select", nil, {:style => "width: 100%; vertical-align: middle; margin: 0.3em 0;"}) -%>

                  Step 3: Choose access rights, review and submit

                  <select name="proj_access_type_select" id="proj_access_type_select" onchange="javascript: replaceReviewWorkGroupURL();" style="width: 100%; vertical-align: middle; margin: 0.3em 0;">
                    <%= policy_selection_options [Policy::VISIBLE,Policy::ACCESSIBLE,Policy::EDITING] -%>
                  </select>

                    <%= link_to "< Previous step", "", :onclick => "javascript: projectInstitutionStepAction(-1); return(false);", :style => "font-weight: bold;" -%>

                    <%= link_to "Next step >", "", :onclick => "javascript: projectInstitutionStepAction(1); return(false);", :style => "font-weight: bold;" -%>

                        <%= link_to "Add immediately", "", :onclick => "javascript: addProjectInstitution(); return(false);", :style => "font-weight: bold; padding: 0;" -%>

<%= workgroup_member_review_popup_link() -%>

            <%= help_icon("Here you can specify individual people to share this #{@resource_type} with.") -%>
            Individual People

                Please type names of people to share this <%= @resource_type -%> with into the box below - suggestions will be displayed as you type.
                Select access rights from drop-down menu; these will be applied to all chosen people.
                Clicking "Add" will add selected people to the list.

                      ^_^<input type="text" id="ip_hidden_input" tabindex="-1" >

                        <input type="text" size="1" tabindex="" id="ip_autocomplete_input" />

Type the name of a friend, friend list, or email address

                    <select name="individual_people_access_type_select" id="individual_people_access_type_select" style="width: 344px; vertical-align: middle; margin-top: 0.3em;">
                      <%= policy_selection_options -%>
                    </select>

                    <%= link_to "Add", "", :onclick => "javascript: addIndividualPeople(); return(false);" -%>

    <%= "
" unless @enable_black_white_listing %>

Also include people in my..

          <input <%= "disabled" if @sharing_mode == Policy::PRIVATE -%> style="margin-right: 0.3em;" value="1" type="checkbox" name="sharing[use_whitelist]" id="cb_use_whitelist" <%= "checked='checked'" if @use_whitelist -%> />
          - "white list", who always get full access

        <% white_lst = current_user.get_whitelist -%>
        <%= hidden_field_tag "#{FavouriteGroup::WHITELIST_NAME}_group_id", (white_lst ? white_lst.id : "none") -%>
          [
          <span id="<%= FavouriteGroup::WHITELIST_NAME -%>_edit_span" style="display: <%= white_lst ? "inline" : "none" -%>;">
            <%= link_to "edit", "/", :onclick => "editWhitelistBlacklist('#{FavouriteGroup::WHITELIST_NAME}'); return(false);" -%>

          <% unless white_lst -%>
            <span id="<%= FavouriteGroup::WHITELIST_NAME -%>_create_span">
              <%= link_to "create", "/", :onclick => "createWhitelistBlacklist('#{FavouriteGroup::WHITELIST_NAME}'); return(false);" -%>

          <% end -%>
          ]
        <%= image_tag icon_filename_for_key("spinner"), :id => "#{FavouriteGroup::WHITELIST_NAME}_creation_spinner", :alt=>"loading...", :title=>"loading...", :style => "display: none; vertical-align: middle;" -%>

          <input <%= "disabled" if @sharing_mode == Policy::PRIVATE -%> style="margin-right: 0.3em;" value="1" type="checkbox" name="sharing[use_blacklist]" id="cb_use_blacklist" <%= "checked='checked'" if @use_blacklist -%> />
          - "black list", who have no access at all

        <% black_lst = current_user.get_blacklist -%>
        <%= hidden_field_tag "#{FavouriteGroup::BLACKLIST_NAME}_group_id", (black_lst ? black_lst.id : "none") -%>
          [
          <span id="<%= FavouriteGroup::BLACKLIST_NAME -%>_edit_span" style="display: <%= black_lst ? "inline" : "none" -%>;">
            <%= link_to "edit", "/", :onclick => "editWhitelistBlacklist('#{FavouriteGroup::BLACKLIST_NAME}'); return(false);" -%>

          <% unless black_lst -%>
            <span id="<%= FavouriteGroup::BLACKLIST_NAME -%>_create_span">
              <%= link_to "create", "/", :onclick => "createWhitelistBlacklist('#{FavouriteGroup::BLACKLIST_NAME}'); return(false);" -%>

          <% end -%>
          ]
        <%= image_tag icon_filename_for_key("spinner"), :id => "#{FavouriteGroup::BLACKLIST_NAME}_creation_spinner", :alt=>"loading...", :title=>"loading...", :style => "display: none; vertical-align: middle;" -%>

  <%# this DIV is to hold the 'redbox' links generated by a method in application_helper, -%>
  <%# these will be "clicked" by javascript, because hidden divs that are present in the -%>
  <%# generated code causes IE to break layout by inserting extra line break otherwise -%>
        <div id="<%= FavouriteGroup::WHITELIST_NAME -%>_redbox_link_div">
          <%= whitelist_blacklist_edit_popup_link(FavouriteGroup::WHITELIST_NAME) -%>

        <div id="<%= FavouriteGroup::BLACKLIST_NAME -%>_redbox_link_div">
          <%= whitelist_blacklist_edit_popup_link(FavouriteGroup::BLACKLIST_NAME) -%>

    <%= "
" unless @enable_black_white_listing %>


can't deactivate bat from edit form anymore

Editing bat

<%= start_form_tag :action => 'update', :id => @bat, :redirectme => 'list' %>
  <%= render :partial => 'form' %>
  <%= submit_tag 'Edit' %>
<%= end_form_tag %>

<%= link_to 'Show', :action => 'show', :id => @bat %> |
<%= link_to 'List Current Bats', :action => 'list' %> |
<%=# link_to 'Deactivate Bat', { :action => 'deactivate', :id => @bat }, :confirm => 'Are you sure?', :post => true %>

Editing bat

<%= start_form_tag :action => 'update', :id => @bat, :redirectme => 'list' %>
  <%= render :partial => 'form' %>
  <%= submit_tag 'Edit' %>
<%= end_form_tag %>

<%= link_to 'Show', :action => 'show', :id => @bat %> |
<%= link_to 'List Current Bats', :action => 'list' %> |
<%= link_to 'Deactivate Bat', { :action => 'deactivate', :id => @bat }, :confirm => 'Are you sure?', :post => true %>


Adminbar login always takes you to / now.

Caching issues presented awkward security problems.

  <% if user.admin? or user.contributor? or user.editor? or user.moderator? %>

Log out

    <% if workflows %>

        <% workflows.each do |name, href, classes| %>

            <a class="button <%=classes.join(' ')%>" title="<%= attr_h name %>" href="<%= href %>"
              <%= name.to_s[/delete|destroy/i] ? "onclick = \"return confirm('Are you sure you want to delete #{@title.gsub(/'"/, '')}?');\"" : '' %>>
              <%= name %>

        <% end %>

    <% end %>

Journals

Photographs

Pages

Comments

Tags

      <% if user.admin? %>

Users

Admin

      <% end %>

  <% elsif session[:user] %>

Log out

  <% else %>
    <form id="login" action="/users/login" method="post">

        Login <input type="text" name="login" id="admin_login" />
        Password <input type="password" name="password" id="admin_password" />
        <input type="submit" name="action" value="Log in" />

    </form>
  <% end %>

  <% if user.admin? or user.contributor? or user.editor? or user.moderator? %>

Log out

    <% if workflows %>

        <% workflows.each do |name, href, classes| %>

            <a class="button <%=classes.join(' ')%>" title="<%= attr_h name %>" href="<%= href %>"
              <%= name.to_s[/delete|destroy/i] ? "onclick = \"return confirm('Are you sure you want to delete #{@title.gsub(/'"/, '')}?');\"" : '' %>>
              <%= name %>

        <% end %>

    <% end %>

Journals

Photographs

Pages

Comments

Tags

      <% if user.admin? %>

Users

Admin

      <% end %>

  <% elsif session[:user] %>

Log out

  <% else %>
    <form id="login" action="/users/login" method="post">

        Login <input type="text" name="login" id="admin_login" />
        Password <input type="password" name="password" id="admin_password" />
        <input type="hidden" id="target_uri" name="target_uri" value="<%= request.request_uri %>" />
        <input type="submit" name="action" value="Log in" />

    </form>
  <% end %>


Fix text to make it clear the status update is on the website not in the email.

You have a new response to the <%= @info_request.law_used_full %> request
'<%= @info_request.title %>' that you made to
<%= @info_request.public_body.name %>.

To view the response, click on the link below.

<%=@url%>

When you get there, please update the status to say if the response
contains any useful information.

Although all responses are automatically published, we depend on
you, the original requester, to evaluate them.

-- the WhatDoTheyKnow team

You have a new response to the <%= @info_request.law_used_full %> request
'<%= @info_request.title %>' that you made to
<%= @info_request.public_body.name %>.

To view the response, click on the link below.

<%=@url%>

When you get there, let us know if the response contains any
useful information.

Although all responses are automatically published, we depend on
you, the original requester, to evaluate them.

-- the WhatDoTheyKnow team


Added percent change and percent change per day and shows previous  weight even before weighing the bat

 Weigh bats in <%= @cage.name %>

Bat
Today's Weight
Note
Previous Weight
Change
Change Per Day
<% for bat in @bats %>

	<%= link_to bat.band, :controller => 'bats', :action => 'weigh_bat', :id => bat, :redirectme => bat.cage %>

	<% if bat.weights.today %>
		<%=h bat.weights.today.weight %>
		<%=h bat.weights.today.note %>
	<% end %>

	<% if bat.weights.length >= 2 %>
		<% if bat.weights.today %>
			<%= bat.weights[1].weight %> (<%= nice_date(bat.weights[1].date) %>)
			<% percent_change = ((bat.weights.today.weight / bat.weights[1].weight - 1) * 100) %>
			<%= ("%0.2f" % percent_change).to_f %> %
			<%= ("%0.2f" % (percent_change / ((bat.weights.today.date - bat.weights[1].date) / 86400))).to_f %> %
		<% else %>

			<%= bat.weights[0].weight %> (<%= nice_date(bat.weights[1].date) %>)
		<% end %>
	<% end %>

	<% if bat.weights.today %>
		<% if bat.weights.today.weight < bat.species.lower_weight_limit %>
			<warning>Warning: below species lower weight limit (<%= bat.species.lower_weight_limit %>)</warning>
		<% elsif bat.weights.today.weight > bat.species.upper_weight_limit %>
			<warning>Warning: above species upper weight limit (<%= bat.species.upper_weight_limit %>)</warning>
		<% end %>
	<% end %>

<% end %>

<% if @bats.length == 0 %>
There are no bats in this cage.
<% end %>

<% if @updateable_tasks != nil %>

The following weighing tasks will be updated after all bats in cage have been weighed:

<%= render :partial => 'tasks/tasks_list', :locals =>{:tasks => @updateable_tasks, :div_id => 'weighing_tasks',
							:same_type_task_list => false, :manage => false, :sorted_by => 'repeat_code'} %>

<% else %>

No weighing tasks for this cage will be updated after all bats are weighed

<% end %>

<%= link_to 'Back', :controller => 'cages', :action => 'choose_cage_to_weigh' %>

 Weigh bats in <%= @cage.name %>

Bat
Today's Weight
Note
Previous Weight
<% for bat in @bats %>

<%= link_to bat.band, :controller => 'bats', :action => 'weigh_bat', :id => bat, :redirectme => bat.cage %>

<% if bat.weights.today %>
<%=h bat.weights.today.weight %>
<%=h bat.weights.today.note %>

<% if bat.weights.length >= 2 %>
<%= bat.weights[1].weight %>
<% end %>

<% if bat.weights.today.weight < bat.species.lower_weight_limit %>
	<warning>Warning: below species lower weight limit (<%= bat.species.lower_weight_limit %>)</warning>
<% elsif bat.weights.today.weight > bat.species.upper_weight_limit %>
	<warning>Warning: above species upper weight limit (<%= bat.species.upper_weight_limit %>)</warning>
<% end %>

<% end %>

<% end %>

<% if @bats.length == 0 %>
There are no bats in this cage.
<% end %>

<% if @updateable_tasks != nil %>

The following weighing tasks will be updated after all bats in cage have been weighed:

<%= render :partial => 'tasks/tasks_list', :locals =>{:tasks => @updateable_tasks, :div_id => 'weighing_tasks',
							:same_type_task_list => false, :manage => false, :sorted_by => 'repeat_code'} %>

<% else %>

No weighing tasks for this cage will be updated after all bats are weighed

<% end %>

<%= link_to 'Back', :controller => 'cages', :action => 'choose_cage_to_weigh' %>


Make url in link actually be something sensible

<% @title = "Summary" %>

<%=@title%>

<%=@public_body_count%> public authorities

        <%=@info_request_count%> requests, <%=@outgoing_message_count%> outgoing messages,
        <%=@incoming_message_count%> incoming messages

<%=@user_count%> users, <%=@track_thing_count%> tracked things

<%=@comment_count%> annotations

Things to do

  <% if @holding_pen_messages.size > 0 %>

        <%=@holding_pen_messages.size%> Put misdelivered responses with the right request

            <% for message in @holding_pen_messages %>

                  <% if message.get_body_for_quoting.strip.size == 0 %>
                      <%= link_to "(no body)", "request/show_raw_email/" + message.raw_email_id.to_s %>
                  <% else %>
                      <%= link_to excerpt(message.get_body_for_quoting, "", 60), "request/show_raw_email/" + message.raw_email_id.to_s %>
                  <% end %>

                  <%=simple_date(message.sent_at)%>

            <% end %>

  <% end %>

  <% if @error_message_requests.size > 0 %>

        <%=@error_message_requests.size%> Fix these delivery and other errors

            <% for @request in @error_message_requests %>

                  <%= link_to(''.html_safe, admin_request_show_url(@request))%>
                  <%= link_to(@request.title, request_path(@request)) %>

                  <%=simple_date(@request.get_last_event.created_at)%>

            <% end %>

  <% end %>

  <% if @attention_requests.size > 0 %>

        <%=@attention_requests.size%> Review requests marked by users as requiring your attention

            <% for @request in @attention_requests %>

                  <%= link_to(''.html_safe, admin_request_show_url(@request))%>
                  <%= link_to(@request.title, request_path(@request)) %>

                  <%=simple_date(@request.get_last_event.created_at)%>

            <% end %>

  <% end %>

  <% if @requires_admin_requests.size > 0 %>

        <%=@requires_admin_requests.size%> These require administrator attention

            <% for @request in @requires_admin_requests %>

                  <%= link_to(''.html_safe, admin_request_show_url(@request))%>
                  <%= link_to(@request.title, request_path(@request)) %>

                  <%=simple_date(@request.get_last_event.created_at)%>

            <% end %>

  <% end %>

  <% if @blank_contacts.size > 0 %>

        <%=@blank_contacts.size%> Find missing FOI email for these public authorities (try phoning!)

            <% for @blank_contact in @blank_contacts %>

                  <%= link_to(''.html_safe, admin_body_show_path(@blank_contact))%>
                  <%= link_to h(@blank_contact.name), public_body_url(@blank_contact) %>

                  <%=simple_date(@blank_contact.updated_at)%>

            <% end %>

  <% end %>

  <% if @old_unclassified.size > 0 %>

        <%=@old_unclassified.size%> Classify responses that are still unclassified <%=InfoRequest::OLD_AGE_IN_DAYS.inspect %> after response

            <% for @request in @old_unclassified %>

                    <%= link_to("".html_safe, admin_request_show_url(@request)) %>
                    <%= link_to(@request.title, request_path(@request)) %>

                    <%=simple_date(@request.get_last_response_event.created_at)%>

            <% end %>

  <% end %>

<% if @holding_pen_messages.size == 0 && @old_unclassified.size == 0 && @requires_admin_requests.size == 0 && @blank_contacts.size == 0 && @attention_requests.size == 0 %>

      No pending administration required.

<% end %>

<% @title = "Summary" %>

<%=@title%>

<%=@public_body_count%> public authorities

        <%=@info_request_count%> requests, <%=@outgoing_message_count%> outgoing messages,
        <%=@incoming_message_count%> incoming messages

<%=@user_count%> users, <%=@track_thing_count%> tracked things

<%=@comment_count%> annotations

Things to do

  <% if @holding_pen_messages.size > 0 %>

        <%=@holding_pen_messages.size%> Put misdelivered responses with the right request

            <% for message in @holding_pen_messages %>

                  <% if message.get_body_for_quoting.strip.size == 0 %>
                      <%= link_to "(no body)", "request/show_raw_email/" + message.raw_email_id.to_s %>
                  <% else %>
                      <%= link_to excerpt(message.get_body_for_quoting, "", 60), "request/show_raw_email/" + message.raw_email_id.to_s %>
                  <% end %>

                  <%=simple_date(message.sent_at)%>

            <% end %>

  <% end %>

  <% if @error_message_requests.size > 0 %>

        <%=@error_message_requests.size%> Fix these delivery and other errors

            <% for @request in @error_message_requests %>

                  <%= link_to(''.html_safe, admin_request_show_url(@request))%>
                  <%= link_to(@request.title, request_path(@request)) %>

                  <%=simple_date(@request.get_last_event.created_at)%>

            <% end %>

  <% end %>

  <% if @attention_requests.size > 0 %>

        <%=@attention_requests.size%> Review requests marked by users as requiring your attention

            <% for @request in @attention_requests %>

                  <%= link_to(''.html_safe, admin_request_show_url(@request))%>
                  <%= link_to(@request.title, request_path(@request)) %>

                  <%=simple_date(@request.get_last_event.created_at)%>

            <% end %>

  <% end %>

  <% if @requires_admin_requests.size > 0 %>

        <%=@requires_admin_requests.size%> These require administrator attention

            <% for @request in @requires_admin_requests %>

                  <%= link_to(''.html_safe, admin_request_show_url(@request))%>
                  <%= link_to(@request.title, request_path(@request)) %>

                  <%=simple_date(@request.get_last_event.created_at)%>

            <% end %>

  <% end %>

  <% if @blank_contacts.size > 0 %>

        <%=@blank_contacts.size%> Find missing FOI email for these public authorities (try phoning!)

            <% for @blank_contact in @blank_contacts %>

                  <%= link_to(''.html_safe, admin_body_show_path(@blank_contact))%>
                  <%= link_to h(@blank_contact.name), public_body_url(@blank_contact) %>

                  <%=simple_date(@blank_contact.updated_at)%>

            <% end %>

  <% end %>

  <% if @old_unclassified.size > 0 %>

        <%=@old_unclassified.size%> Classify responses that are still unclassified <%=InfoRequest::OLD_AGE_IN_DAYS.inspect %> after response

            <% for @request in @old_unclassified %>

                    <%= link_to("".html_safe, admin_request_show_url(@request)) %>
                    <%= link_to(@request.title, request_link(@request)) %>

                    <%=simple_date(@request.get_last_response_event.created_at)%>

            <% end %>

  <% end %>

<% if @holding_pen_messages.size == 0 && @old_unclassified.size == 0 && @requires_admin_requests.size == 0 && @blank_contacts.size == 0 && @attention_requests.size == 0 %>

      No pending administration required.

<% end %>


Don't register a setHome handler unless we have the flag checkbox prsent on the page.

<% nearest_str = "" %>
<% if !@user.home_lat.nil? and !@user.home_lon.nil? %>
  <% if !@user.nearby.empty? %>
    <% @user.nearby.each do |nearby| %>
    <% nearest_str += "nearest.push( { 'display_name' : '#{nearby.display_name}', 'home_lat' : #{nearby.home_lat}, 'home_lon' : #{nearby.home_lon} } );\n" %>
    <% end %>
  <% end %>
<% end %>

<% if @user.home_lat.nil? or @user.home_lon.nil? %>
  <% lon = h(params['lon'] || '-0.1') %>
  <% lat = h(params['lat'] || '51.5') %>
  <% zoom = h(params['zoom'] || '4') %>
<% else %>
  <% marker = true %>
  <% mlon = @user.home_lon %>
  <% mlat = @user.home_lat %>
  <% lon =  @user.home_lon %>
  <% lat =  @user.home_lat %>
  <% zoom =  '12' %>
<% end %>

<%= javascript_include_tag '/openlayers/OpenLayers.js' %>
<%= javascript_include_tag '/openlayers/OpenStreetMap.js' %>
<%= javascript_include_tag 'map.js' %>


Fix "follow" toolbox HTML to be valid 4.01 transitional

<% form_tag(:controller=>"user", :action=>"set_receive_email_alerts") do %>
 <div>
 <% if @user.receive_email_alerts %>
  <%= _('You are currently receiving notification of new activity on your wall by email.', :wall_url => show_user_wall_path) %>
  <%= hidden_field_tag 'receive_email_alerts', 'false' %>
  <%= submit_tag _("Turn off email alerts") %>
 <% else %>
  <%= _('Items matching the following conditions are currently displayed on your wall.') %>
  <%= hidden_field_tag 'receive_email_alerts', 'true' %>
  <%= submit_tag _("Also send me alerts by email") %>
 <% end %>
 </div>
<% end %>

<% form_tag(:controller=>"user", :action=>"set_receive_email_alerts") do %>
 <% if @user.receive_email_alerts %>
  <%= _('You are currently receiving notification of new activity on your wall by email.', :wall_url => show_user_wall_path) %>
  <%= hidden_field_tag 'receive_email_alerts', 'false' %>
  <%= submit_tag _("Turn off email alerts") %>
 <% else %>
  <%= _('Items matching the following conditions are currently displayed on your wall.') %>
  <%= hidden_field_tag 'receive_email_alerts', 'true' %>
  <%= submit_tag _("Also send me alerts by email") %>
 <% end %>
<% end %>


Fix an invalid html error

Fix an invalid html error

git-svn-id: 4158f9403e16ea83fe8a6e07a45f1f3b56a747ab@1527 567b1171-46fb-0310-a4c9-b4bef9110e78

<% content_for :action_nav do -%>

<% end %>

<% content_for :sidebar do %>
  <%= render :partial => 'shared_options' %>

Optional settings

      <% fields_for :article do |f| -%>

Format with:

          <select name="article[filters][]" id="article_filters">
          <%= options_for_select(filter_options, (@article.filters || []).first.to_s) %>
        </select>

<%= f.check_box :parse_macros %>Use macro filters

Permanent link:

<%= f.text_field :permalink %>

      <% end -%>

<% end %>

<% content_for :form do -%>
  <%= start_form_tag({:action => 'create'}, {:id => 'article-form'}) %>
<% end -%>

<% fields_for :article do |f| -%>
  <%= render :partial => 'form', :object => f %>

    <%= submit_tag 'Save Article' %> or
    <%= link_to "cancel", :controller => "articles" %>

<% end -%>


Adapt field_search to the new dd/dt form layouts.

git-svn-id: b2ff2946fad280430023ee7ead77858f96a610fa@431 561dde7e-7729-0410-be8e-ef83869d6c7d

<%
# We have to remove search form params before the url_for method call, otherwise it throughs it on
search_params = params[:search]
params.merge!(:search => nil)
href = url_for(params_for(:action => :update_table, :escape => false))
-%>
<%= form_remote_tag :url => href,
                    :method => :get,
                    :before => "addActiveScaffoldPageToHistory('#{href}', '#{params[:controller]}')",
                    :after => "$('#{loading_indicator_id(:action => :search, :id => params[:id])}').style.visibility = 'visible'; Form.disable('#{search_form_id}');",
                    :complete => "$('#{loading_indicator_id(:action => :search, :id => params[:id])}').style.visibility = 'hidden'; Form.enable('#{search_form_id}');",
                    :failure => "ActiveScaffold.report_500_response('#{active_scaffold_id}')",
                    :update => active_scaffold_content_id,
                    :html => { :href => href, :id => search_form_id, :class => 'search' } %>

    <% active_scaffold_config.field_search.columns.each do |column| -%>
      <% name = "search[#{column.name}]" %>
      <% value = nil %>
      <% value = search_params[column.name] if search_params %>

            <label for="<%= "search_#{column.name}" %>"><%= column.label %>

        <%= case column.ui_type
          when :boolean
            check_box_tag(name, 1, value || value == 1)
          else
            text_field_tag(name, value, { :autocomplete => "off", :size => 20, :class => 'text-input', :id => "search_#{column.name}"})
          end
        %>

    <% end -%>

    <%= submit_tag as_('Search'), :class => "submit" %>
    <%= as_('Reset') -%>
    <%= loading_indicator_tag(:action => :search) %>

</form>


Tweak in email format

Tweak in email format

Hi<%= raw " #{@recipient.name}" %>,

<%= raw @update.user.name %> has added a new update to the FixMyTransport campaign "<%= @campaign.title %>" (<%= @link %>)<%- if @update.incoming_message %> in response to an email with the subject "<%=@update.incoming_message.subject%>"<%- if !@update.incoming_message.from.blank? %> received from <%=@update.incoming_message.from %><%- end %><%- end %>.

<%= raw @update.user.name %> says:

"<%= @update.text %>"

Yours,
The FixMyTransport team

To leave this campaign and stop receiving updates, please follow this link: <%= @unsubscribe_link %>

Hi<%= raw " #{@recipient.name}" %>,

<%= raw @update.user.name %> has added a new update to the FixMyTransport campaign "<%= link_to(@campaign.title, @link) %>"<%- if @update.incoming_message %> in response to an email with the subject "<%=@update.incoming_message.subject%>"<%- if !@update.incoming_message.from.blank? %> received from <%=@update.incoming_message.from %><%- end %><%- end %>.

<%= raw @update.user.name %> says:

"<%= @update.text %>"

Yours,
The FixMyTransport team

To leave this campaign and stop receiving updates, please follow this link: <%= @unsubscribe_link %>