make sure search text field is blank

make sure search text field is blank

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

<% if RAILS_ENV == "development" %>
  <% flash[:error] ||= "You are on our development site -- you should NOT be filling in your app or reference here.  Remove the 'dev.' from your url, and email #{$tech_email_only} with how you got here"
  %>

<% end %>

  <%
=begin
  flash[:error] = %|
  There will be a short, approximately 10-20 minutes, scheduled outage between 12pm-2pm PST

  -CIM team, Wed May 7
  |
=end
  %>

    <title>Project Application Tool</title>
    <%= stylesheet_link_tag 'main2', 'connexion_default' %>
    <%= render :partial => "externs/sortable_tables" %>
    <%= javascript_include_tag "prototype", "effects" %>
    <%= render :partial => "externs/load_extern" %>

    <%= connexion_bar if @viewer && session[:login_source] == 'gcx' %>

    <% if RAILS_ENV == 'development' && @debug -%>

debug: <%= @debug -%>

    <% end -%>

      Loading <%=image_tag('spinner.gif')%>

      Saving <%=image_tag('spinner.gif')%>

        <% if @viewer %>

user:
            <%= @viewer.name %>
            <% unless session[:login_source] == 'gcx' -%>
               - <%= link_to "logout", :action => :logout, :controller => :security %>
            <% end %>

        <% end %>

        <% if @eg %>

group:
            <%= @eg.to_s_with_eg_path %>
            <%= link_to 'change', scope_event_groups_url %>

        <% end %>

      <% if session[:logo_url] -%>
          <%= image_tag session[:logo_url], :class => 'branding_logo' %>
          Project Application Tool
      <% else %>

Project Application Tool

      <% end -%>

    <% if @viewer %>

          <%= new_item "Your Apps", "your_apps", :list %>
          <% if @show_your_project %>
            <%= new_item "Your Projects", "main", :your_projects %>
          <% end %>
          <% unless @viewer.is_student?(@eg) %>
            <%= new_item "App Processing", "main", :your_applications %>
            <% if @eg && @eg.has_your_campuses %>
              <%= new_item "Your Campuses", "main", :your_campuses %>
	          <% end %>
            <% if @viewer.is_eventgroup_coordinator?(@eg) %>
              <%= new_item "Tools", "tools", :index %>
              <%= new_item "Manage Forms", "forms" %>
              <%= new_item "Manage Groups", "event_groups" %>
            <% end %>
            <%= new_item "Manage Projects", "manage_projects", :list %>
            <%= new_item "Reports", "reports", :index %>
          <% end %>
          <%= new_item "Profiles", "profiles", :index%>

    <% end %>

    <% flash.each do |key, msg| -%>
      <% full_msg = msg %>
      <%= content_tag :div, full_msg, :id => "flash_#{key}", :class => 'error flash' %>
    <% end -%>

    <% @notifications.each do |n| -%>
      <% full_msg = n.message
         full_msg = h(full_msg) unless n.allow_html
         full_msg += "
"

         unless n.no_hide_button || @viewer.nil?
           full_msg += link_to_remote('Hide',
            :url => { :controller => 'notification_acknowledgments',
                      :action => 'create', :notification_id => n.id },
            :success => "$(\"notification_#{n.id}\").fade()"
           )
         end
        %>
      <%= content_tag :div, full_msg, :id => "notification_#{n.id}", :class => 'error flash' %>
    <% end -%>

     <% if @viewer && !@eg.nil? && !@viewer.is_student?(@eg) %>

        <%= form_remote_tag :url => { :controller => 'main', :action => :find_people },	:before => "Element.show('loading');", :complete  => "Element.hide('loading');" %>
          Search People:
          <%= text_field 'viewer', 'name', :size => 20, :value => '' %>
          <%= submit_tag "Search" %>
        </form>

    <% end %>

    <% if @title %>

<%=@title%>

    <% end %>

    <%= render_if_possible(controller.controller_name + "/menu") ||
           (@submenu && render_if_possible(@submenu + "/menu"))
    %>

    <% submenu_items_html = yield :submenu %>
    <% if submenu_items_html && !@eg.nil? %>

          <%= submenu_items_html %>

    <% end %>

        <% if @form && params[:controller] != 'forms' %>
          <%= render "qe_forms/form_#{@form}" %>
        <% else %>
          <%= yield %>
        <% end %>

    <% if @eg || @show_contact_emails_override %>

        Questions?

				Campus for Christ - projects@campusforchrist.org

				LeaderImpact Group - vip@leaderimpactgroup.com

				Athletes in Action - morgank@athletesinaction.com

			General Inquiries:help.pat@powertochange.org

			Online help can be found here.

    <% end %>

    <%= initialize_sortable_tables %>

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

<% if RAILS_ENV == "development" %>
  <% flash[:error] ||= "You are on our development site -- you should NOT be filling in your app or reference here.  Remove the 'dev.' from your url, and email #{$tech_email_only} with how you got here"
  %>

<% end %>

  <%
=begin
  flash[:error] = %|
  There will be a short, approximately 10-20 minutes, scheduled outage between 12pm-2pm PST

  -CIM team, Wed May 7
  |
=end
  %>

    <title>Project Application Tool</title>
    <%= stylesheet_link_tag 'main2', 'connexion_default' %>
    <%= render :partial => "externs/sortable_tables" %>
    <%= javascript_include_tag "prototype", "effects" %>
    <%= render :partial => "externs/load_extern" %>

    <%= connexion_bar if @viewer && session[:login_source] == 'gcx' %>

    <% if RAILS_ENV == 'development' && @debug -%>

debug: <%= @debug -%>

    <% end -%>

      Loading <%=image_tag('spinner.gif')%>

      Saving <%=image_tag('spinner.gif')%>

        <% if @viewer %>

user:
            <%= @viewer.name %>
            <% unless session[:login_source] == 'gcx' -%>
               - <%= link_to "logout", :action => :logout, :controller => :security %>
            <% end %>

        <% end %>

        <% if @eg %>

group:
            <%= @eg.to_s_with_eg_path %>
            <%= link_to 'change', scope_event_groups_url %>

        <% end %>

      <% if session[:logo_url] -%>
          <%= image_tag session[:logo_url], :class => 'branding_logo' %>
          Project Application Tool
      <% else %>

Project Application Tool

      <% end -%>

    <% if @viewer %>

          <%= new_item "Your Apps", "your_apps", :list %>
          <% if @show_your_project %>
            <%= new_item "Your Projects", "main", :your_projects %>
          <% end %>
          <% unless @viewer.is_student?(@eg) %>
            <%= new_item "App Processing", "main", :your_applications %>
            <% if @eg && @eg.has_your_campuses %>
              <%= new_item "Your Campuses", "main", :your_campuses %>
	          <% end %>
            <% if @viewer.is_eventgroup_coordinator?(@eg) %>
              <%= new_item "Tools", "tools", :index %>
              <%= new_item "Manage Forms", "forms" %>
              <%= new_item "Manage Groups", "event_groups" %>
            <% end %>
            <%= new_item "Manage Projects", "manage_projects", :list %>
            <%= new_item "Reports", "reports", :index %>
          <% end %>
          <%= new_item "Profiles", "profiles", :index%>

    <% end %>

    <% flash.each do |key, msg| -%>
      <% full_msg = msg %>
      <%= content_tag :div, full_msg, :id => "flash_#{key}", :class => 'error flash' %>
    <% end -%>

    <% @notifications.each do |n| -%>
      <% full_msg = n.message
         full_msg = h(full_msg) unless n.allow_html
         full_msg += "
"

         unless n.no_hide_button || @viewer.nil?
           full_msg += link_to_remote('Hide',
            :url => { :controller => 'notification_acknowledgments',
                      :action => 'create', :notification_id => n.id },
            :success => "$(\"notification_#{n.id}\").fade()"
           )
         end
        %>
      <%= content_tag :div, full_msg, :id => "notification_#{n.id}", :class => 'error flash' %>
    <% end -%>

     <% if @viewer && !@eg.nil? && !@viewer.is_student?(@eg) %>

        <%= form_remote_tag :url => { :controller => 'main', :action => :find_people },	:before => "Element.show('loading');", :complete  => "Element.hide('loading');" %>
          Search People:
          <%= text_field 'viewer', 'name', :size => 20%>
          <%= submit_tag "Search" %>
        </form>

    <% end %>

    <% if @title %>

<%=@title%>

    <% end %>

    <%= render_if_possible(controller.controller_name + "/menu") ||
           (@submenu && render_if_possible(@submenu + "/menu"))
    %>

    <% submenu_items_html = yield :submenu %>
    <% if submenu_items_html && !@eg.nil? %>

          <%= submenu_items_html %>

    <% end %>

        <% if @form && params[:controller] != 'forms' %>
          <%= render "qe_forms/form_#{@form}" %>
        <% else %>
          <%= yield %>
        <% end %>

    <% if @eg || @show_contact_emails_override %>

        Questions?

				Campus for Christ - projects@campusforchrist.org

				LeaderImpact Group - vip@leaderimpactgroup.com

				Athletes in Action - morgank@athletesinaction.com

			General Inquiries:help.pat@powertochange.org

			Online help can be found here.

    <% end %>

    <%= initialize_sortable_tables %>


Unbreak Richard's warning messages. Closes #864.

<%= h(@title) %>

<%= auto_discovery_link_tag :atom, :action => 'georss', :display_name => @display_name, :tag => @tag %>

  <%= rss_link_to :action => 'georss', :display_name => @display_name, :tag => @tag %>
  <% if @user.nil? or @display_name.nil? or @user.display_name != @display_name %>
    | <%= link_to 'See just your traces, or upload a trace', :action => 'mine' %>
  <% end %>
  <% if @tag or @display_name %>
    | <%= link_to 'See all traces', :controller => 'trace', :action => 'list' %>
  <% end %>
  <% if @tag and @user and @user.display_name == @display_name %>
    | <%= link_to 'See all your traces', :controller => 'trace', :action => 'mine' %>
  <% end %>

<% if @user and @user.traces.count(:conditions => "inserted=0") > 4 %>

    You have <%= @user.traces.count(:conditions => "inserted=0") %> traces
    waiting for upload. Please consider waiting for these to finish before
    uploading any more, so as not to block the queue for other users.

<% end %>

<%= h(@title) %>

<%= auto_discovery_link_tag :atom, :action => 'georss', :display_name => @display_name, :tag => @tag %>

  <%= rss_link_to :action => 'georss', :display_name => @display_name, :tag => @tag %>
  <% if @user.nil? or @display_name.nil? or @user.display_name != @display_name %>
    | <%= link_to 'See just your traces, or upload a trace', :action => 'mine' %>
  <% end %>
  <% if @tag or @display_name %>
    | <%= link_to 'See all traces', :controller => 'trace', :action => 'list' %>
  <% end %>
  <% if @tag and @user and @user.display_name == @display_name %>
    | <%= link_to 'See all your traces', :controller => 'trace', :action => 'mine' %>
  <% end %>

<% if @display_name %>
  <% if @user.traces.count(:conditions => "inserted=0") > 4 %>

      You have <%= @user.traces.count(:conditions => "inserted=0") %> traces
      waiting for upload. Please consider waiting for these to finish before
      uploading any more, so as not to block the queue for other users.

  <% end %>
<% end %>


#community dashboard - updating theme

#community dashboard - updating theme

<% extend CommunityHubPlugin::HubHelper %>

<div id="<%=@page.id%>" class="hub">

<%= @page.title %> HUB

<%= @page.body %>

      <%= @page.title %><%= _("Live") %>

      <%= _("Mediation") %>

    <%= check_box_tag 'auto_scrolling', 'yes', true %><%= _("Auto scrolling") %>

      <%= @page.title %><%= _("Live") %>

      <%= _("Mediation") %>

  <% if mediator?(@page) %>

    <% if logged_in? %>

      <%= render :file => 'shared/tiny_mce' %>

      <% form_for :article,
                  :method => 'post',
                  :url => {
                    :controller => 'community_hub_plugin_public',
                    :action => 'new_mediation',
                    :profile_id => profile.id
                  } do |f| %>
        <%= f.hidden_field :parent_id, :value => @page.id %>
        <%= f.text_area :body, :style => "width: 100%;", :class => "mceEditor" %>
        <%= submit_button('add', _('Post'), :onclick => 'new_mediation(this); return false;') %>
      <% end %>

    <% end %>

    <%= render :partial => "community_hub_plugin_public/settings" %>

  <% else %>

    <% if logged_in? %>

        <% form_for :message,
                    :method => 'post',
                    :url => {
                      :controller => 'community_hub_plugin_public',
                      :action => 'new_message',
                      :article_id => @page.id
                    } do |f| %>
          <%= _("Streaming") %>

          <%= f.text_area :body, :style => "width: 99%;", :cols => "38", :rows => "5", :placeholder => _("Type your message here") %>
          <%= submit_button('add', _('Post'), :onclick => 'new_message(this); return false;') %>
        <% end %>

      <% end %>

    <% end %>

<%= javascript_include_tag '/plugins/community_hub/javascripts/community_hub.js' %>


Style for censor rules table

Style for censor rules table

<% if censor_rules.size > 0 %>

      Id
      <% for column in CensorRule.content_columns %>
        <%= column.human_name %>
      <% end %>
      Actions

  <% for censor_rule in censor_rules %>
    <tr class="<%= cycle('odd', 'even') %>">
      <%=h censor_rule.id %>
      <% for column in CensorRule.content_columns.map { |c| c.name } %>
        <%=h censor_rule.send(column) %>
      <% end %>

        <%= link_to "Edit", '../../censor/edit/' + censor_rule.id.to_s %>

  <% end %>

<% else %>

None yet.

<% end %>

<% if defined? info_request %>
  <%= link_to "New censor rule", "../../censor/new?info_request_id=#{info_request.id}", :class => "btn btn-info" %> for this request only
<% end %>

<% if defined? user %>
  <%= link_to "New censor rule", "../../censor/new?user_id=#{user.id}", :class => "btn btn-info" %> for all requests by this user
<% end %>


sorting recipients alphabetically - fixes #371

<%= :create_a_new_thing.t%{ :thing => content_tag(:b, MessagePage.class_display_name.t) } %>

<%= header_for_page_create MessagePage %>

<% form_tag({:action => 'create'}, :multipart => true) do %>

  <%= "subject".t %>
  <%= text_field_tag 'title', params[:title], :size => 80 %>

  <%= "recipients".t %>

    <% to = params[:to]+' ' if params[:to] -%>
    <%= text_field_tag 'to', to, :size => 80 %>

    <%= select_tag('contact_drop',
        options_for_select(
           [["#{'contacts'.t}…",'']] +
           current_user.contacts.sort_by{|c|c.both_names}.to_select(:both_names, :name), params[:user_ids]),
        :onchange => "$('to').value += $('contact_drop').value + ' '") %>
    <%= select_tag('peer_drop',
        options_for_select(
           [["#{'peers'.t}…",'']] +
           current_user.peers.sort_by{|c|c.both_names}.to_select(:both_names, :name), params[:user_ids]),
        :onchange => "$('to').value += $('peer_drop').value + ' '") %>

  <%= 'message'.t %>
  <%= text_area_tag 'message', params[:message], :rows => 20, :cols => 80 %>

  <input type="checkbox" name="email" value="true" /> Send email?

    <%= submit_tag "Send"[:send_button], :name => 'send' %>

<% end %>

<%= :create_a_new_thing.t%{ :thing => content_tag(:b, MessagePage.class_display_name.t) } %>

<%= header_for_page_create MessagePage %>

<% form_tag({:action => 'create'}, :multipart => true) do %>

  <%= "subject".t %>
  <%= text_field_tag 'title', params[:title], :size => 80 %>

  <%= "recipients".t %>

    <% to = params[:to]+' ' if params[:to] -%>
    <%= text_field_tag 'to', to, :size => 80 %>

    <%= select_tag('contact_drop',
        options_for_select(
           [["#{'contacts'.t}…",'']] +
           current_user.contacts.to_select(:both_names, :name), params[:user_ids]),
        :onchange => "$('to').value += $('contact_drop').value + ' '") %>
    <%= select_tag('peer_drop',
        options_for_select(
           [["#{'peers'.t}…",'']] +
           current_user.peers.to_select(:both_names, :name), params[:user_ids]),
        :onchange => "$('to').value += $('peer_drop').value + ' '") %>

  <%= 'message'.t %>
  <%= text_area_tag 'message', params[:message], :rows => 20, :cols => 80 %>

  <input type="checkbox" name="email" value="true" /> Send email?

    <%= submit_tag "Send"[:send_button], :name => 'send' %>

<% end %>


Add custom_contents for custom layouts

Add custom_contents for custom layouts

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<%= html_language %>" lang="<%= html_language %>">

    <title><%= h page_title %></title>
    <%= yield(:feeds) %>

    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <meta name="description" content="<%= @environment.name %>" />
    <link rel="shortcut icon" href="<%= image_path(theme_favicon) %>" type="image/x-icon" />
    <%= noosfero_javascript %>
    <%= stylesheet_link_tag noosfero_stylesheets, :cache => 'cache' %>
    <%= stylesheet_link_tag template_stylesheet_path %>
    <%= stylesheet_link_tag icon_theme_stylesheet_path %>
    <%= stylesheet_link_tag theme_stylesheet_path %>
    <%= stylesheet_link_tag jquery_ui_theme_stylesheet_path %>

    <%# Add custom tags/styles/etc via content_for %>
    <%= yield :head %>
    <%= javascript_tag('render_all_jquery_ui_widgets()') %>

  <body class="<%=
    # Identify the current controller and action for the CSS:
    " controller-"+ @controller.controller_name() +
    " action-"+ @controller.controller_name() +"-"+ @controller.action_name() +
    " template-"+ ( profile.nil? ? "default" : profile.layout_template )
    %>" >

    <%= _("Go to the content") %>

        <%= theme_header %>

            <%= usermenu_logged_in %>

              <%= _('%s or %s') % [thickbox_inline_popup_link('' + _('Login') + '', login_url, 'inlineLoginBox', :id => 'link_login'), link_to('' + _('Register') + '', :controller => 'account', :action => 'signup') ] %>

                <%= render :file => 'account/login', :locals => { :is_thickbox => true } %>

          <form action="/search" class="search_form" method="get" class="clean">
            <input name="query" size="15" value="<%=_('Search...')%>"
                onfocus="this.form.className='focused';
                         if(this.value=='<%=_('Search...')%>'){this.value=''}"
                onblur="this.form.className='';
                        if(/^\s*$/.test(this.value)){
                          this.value='<%=_('Search...')%>';
                          this.form.className='clean'
                        }" />

<%=_('Press Enter to send the search query.')%>

          </form>

          <%= theme_site_title %>

            <%= theme_extra_navigation %>

          <% if controller.respond_to? 'custom_contents' %>
            <% Array(controller.custom_contents).each do |content| %>
              <%= yield content %>
            <% end %>
          <% end %>

          <%= insert_boxes(yield) %>

    <%= render_environment_features(:logged_in) %>

      <%= theme_footer %>

    <%= noosfero_layout_features %>
    <%= theme_javascript_ng %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<%= html_language %>" lang="<%= html_language %>">

    <title><%= h page_title %></title>
    <%= yield(:feeds) %>

    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <meta name="description" content="<%= @environment.name %>" />
    <link rel="shortcut icon" href="<%= image_path(theme_favicon) %>" type="image/x-icon" />
    <%= noosfero_javascript %>
    <%= stylesheet_link_tag noosfero_stylesheets, :cache => 'cache' %>
    <%= stylesheet_link_tag template_stylesheet_path %>
    <%= stylesheet_link_tag icon_theme_stylesheet_path %>
    <%= stylesheet_link_tag theme_stylesheet_path %>
    <%= stylesheet_link_tag jquery_ui_theme_stylesheet_path %>

    <%# Add custom tags/styles/etc via content_for %>
    <%= yield :head %>
    <%= javascript_tag('render_all_jquery_ui_widgets()') %>

  <body class="<%=
    # Identify the current controller and action for the CSS:
    " controller-"+ @controller.controller_name() +
    " action-"+ @controller.controller_name() +"-"+ @controller.action_name() +
    " template-"+ ( profile.nil? ? "default" : profile.layout_template )
    %>" >

    <%= _("Go to the content") %>

        <%= theme_header %>

            <%= usermenu_logged_in %>

              <%= _('%s or %s') % [thickbox_inline_popup_link('' + _('Login') + '', login_url, 'inlineLoginBox', :id => 'link_login'), link_to('' + _('Register') + '', :controller => 'account', :action => 'signup') ] %>

                <%= render :file => 'account/login', :locals => { :is_thickbox => true } %>

          <form action="/search" class="search_form" method="get" class="clean">
            <input name="query" size="15" value="<%=_('Search...')%>"
                onfocus="this.form.className='focused';
                         if(this.value=='<%=_('Search...')%>'){this.value=''}"
                onblur="this.form.className='';
                        if(/^\s*$/.test(this.value)){
                          this.value='<%=_('Search...')%>';
                          this.form.className='clean'
                        }" />

<%=_('Press Enter to send the search query.')%>

          </form>

          <%= theme_site_title %>

            <%= theme_extra_navigation %>

          <%= insert_boxes(yield) %>

    <%= render_environment_features(:logged_in) %>

      <%= theme_footer %>

    <%= noosfero_layout_features %>
    <%= theme_javascript_ng %>


ActionItem980: fixing condition

ActionItem980: fixing condition

<%= profile.name %>

<%= _('Control Panel') %>

<%= render :partial => 'pending_tasks' %>

<% file_manager do %>

  <%= file_manager_button(_('Info and settings'), 'icons-app/edit-profile.png', :controller => 'profile_editor', :action => 'edit') %>

  <%= file_manager_button(_('Mail settings'), 'icons-app/mail.png', :controller => 'mailconf') if profile.person? && MailConf.enabled? %>

  <%= file_manager_button(_('Tasks'), 'icons-app/todo.png', :controller => 'tasks', :action => 'index') %>

  <%= file_manager_button(_('Edit sideboxes'), 'icons-app/design-editor.png', :controller => 'profile_design', :action => 'index') %>

  <%= file_manager_button(_('Edit Appearance'), 'icons-app/design-editor.png', :controller => 'themes', :action => 'index') %>

  <%= file_manager_button(_('Edit Header and Footer'), 'icons-app/header-and-footer.png', :controller => 'profile_editor', :action => 'header_footer') unless profile.enterprise? && environment.enabled?('disable_header_and_footer') && !user.is_admin?(environment) %>

  <%= file_manager_button(_('Manage Content'), 'icons-app/cms.png', :controller => 'cms') if !environment.enabled?('disable_cms') || profile.community? %>

  <% unless profile.enterprise? %>
    <% if profile.has_blog? %>
      <%= file_manager_button(_('Configure blog'), 'icons-app/blog.png', :controller => 'cms', :action => 'edit', :id => profile.blog) %>
    <% else %>
      <%= file_manager_button(_('Create blog'), 'icons-app/blog-disabled.png', :controller => 'cms', :action => 'new', :type => 'Blog') %>
    <% end %>
  <% end %>

  <%= file_manager_button(_('Change Password'), 'icons-app/change-password.png', :controller => 'account', :action => 'change_password') if profile.person? %>

  <%= file_manager_button(__('Manage friends'), 'icons-app/friends.png', :controller => 'friends', :action => 'index') if profile.person? %>

  <%= file_manager_button(_('Manage Members'), 'icons-app/members.png', :controller => 'profile_members') if profile.organization? && user.has_permission?(:manage_memberships, profile) %>

  <%= file_manager_button(_('Manage Products and Services'), 'icons-app/products.png', :controller => 'manage_products') if profile.enterprise? && !environment.enabled?('disable_products_for_enterprises') %>

  <%= file_manager_button(__('Enterprise Validation'), 'icons-app/validation.png', :controller => 'enterprise_validation') if profile.is_validation_entity? %>

  <%= file_manager_button(__('Favorite Enterprises'), 'icons-app/favorites.png', :controller => 'favorite_enterprises') if profile.person? %>

  <% if profile.enterprise? %>
    <% if profile.enabled? %>
      <%= file_manager_button(__('Disable Enterprise'), 'icons-app/disable.png', :action => 'disable') %>
    <% else %>
      <%= file_manager_button(__('Enable Enterprise'), 'icons-app/enable.png', :action => 'enable') %>
    <% end %>
  <% end %>

  <%= file_manager_button(_('Manage my groups'), 'icons-app/groups.png', :controller => 'memberships') if profile.person? %>

<% end %>

<%= profile.name %>

<%= _('Control Panel') %>

<%= render :partial => 'pending_tasks' %>

<% file_manager do %>

  <%= file_manager_button(_('Info and settings'), 'icons-app/edit-profile.png', :controller => 'profile_editor', :action => 'edit') %>

  <%= file_manager_button(_('Mail settings'), 'icons-app/mail.png', :controller => 'mailconf') if profile.person? && MailConf.enabled? %>

  <%= file_manager_button(_('Tasks'), 'icons-app/todo.png', :controller => 'tasks', :action => 'index') %>

  <%= file_manager_button(_('Edit sideboxes'), 'icons-app/design-editor.png', :controller => 'profile_design', :action => 'index') %>

  <%= file_manager_button(_('Edit Appearance'), 'icons-app/design-editor.png', :controller => 'themes', :action => 'index') %>

  <%= file_manager_button(_('Edit Header and Footer'), 'icons-app/header-and-footer.png', :controller => 'profile_editor', :action => 'header_footer') unless profile.enterprise? && environment.enabled?('disable_header_and_footer') && !user.is_admin?(environment) %>

  <%= file_manager_button(_('Manage Content'), 'icons-app/cms.png', :controller => 'cms') unless environment.enabled?('disable_cms') || profile.community? %>

  <% unless profile.enterprise? %>
    <% if profile.has_blog? %>
      <%= file_manager_button(_('Configure blog'), 'icons-app/blog.png', :controller => 'cms', :action => 'edit', :id => profile.blog) %>
    <% else %>
      <%= file_manager_button(_('Create blog'), 'icons-app/blog-disabled.png', :controller => 'cms', :action => 'new', :type => 'Blog') %>
    <% end %>
  <% end %>

  <%= file_manager_button(_('Change Password'), 'icons-app/change-password.png', :controller => 'account', :action => 'change_password') if profile.person? %>

  <%= file_manager_button(__('Manage friends'), 'icons-app/friends.png', :controller => 'friends', :action => 'index') if profile.person? %>

  <%= file_manager_button(_('Manage Members'), 'icons-app/members.png', :controller => 'profile_members') if profile.organization? && user.has_permission?(:manage_memberships, profile) %>

  <%= file_manager_button(_('Manage Products and Services'), 'icons-app/products.png', :controller => 'manage_products') if profile.enterprise? && !environment.enabled?('disable_products_for_enterprises') %>

  <%= file_manager_button(__('Enterprise Validation'), 'icons-app/validation.png', :controller => 'enterprise_validation') if profile.is_validation_entity? %>

  <%= file_manager_button(__('Favorite Enterprises'), 'icons-app/favorites.png', :controller => 'favorite_enterprises') if profile.person? %>

  <% if profile.enterprise? %>
    <% if profile.enabled? %>
      <%= file_manager_button(__('Disable Enterprise'), 'icons-app/disable.png', :action => 'disable') %>
    <% else %>
      <%= file_manager_button(__('Enable Enterprise'), 'icons-app/enable.png', :action => 'enable') %>
    <% end %>
  <% end %>

  <%= file_manager_button(_('Manage my groups'), 'icons-app/groups.png', :controller => 'memberships') if profile.person? %>

<% end %>


removed 'create task list' from group's task list for non-members (fixes #801)

<% @title_box = content_tag :h1, 'tasks'.t %>
<%= link_to "print", "?print=1" %>

  <%= "pending tasks."[:pending_tasks] %>
  <%= link_to ("create a new :thing"[:create_a_new_thing] % {:thing => 'task list'.t}) + ARROW, create_page_url(TaskListPage, :group_id => @group.id) if logged_in? && current_user.member_of?( @group )%>

<%= render :partial => 'tasks/list' %>

<% @title_box = content_tag :h1, 'tasks'.t %>
<%= link_to "print", "?print=1" %>

  <%= "pending tasks."[:pending_tasks] %>
  <%= link_to ("create a new :thing"[:create_a_new_thing] % {:thing => 'task list'.t}) + ARROW, create_page_url(TaskListPage, :group_id => @group.id) %>

<%= render :partial => 'tasks/list' %>


forgot to fix the width for password textbox

<% unless logged_in_and_registered? -%>

            Log in / Register

        <% form_tag session_path do %>
        <%= hidden_field_tag "called_from[controller]", controller.controller_name -%>
        <%= hidden_field_tag "called_from[action]", controller.action_name -%>
        <%= hidden_field_tag "called_from[id]", params[:id] -%>

                    Login:

                    <%= text_field_tag 'login', nil, :class => 'field', :style => 'width:150px'-%>

                    Password:

                    <%= password_field_tag 'password', nil, :class => 'field', :style => 'width:150px'-%>

                    Remember me: <%= check_box_tag 'remember_me',nil,false, {:style=>"width:2em;"} %>

                    <%= image_tag "openid-16x16.gif" %>OpenID:

                    <%= text_field_tag 'openid_identifier', nil, :class => 'field', :style => 'width:150px' -%>

                Alternatively...

                Log in using <%= image_tag "openid-16x16.gif" %>OpenID

            <%= submit_tag "Log in", :id=>"login_button",:onclick=>"$('login_button').disabled=true;this.form.submit();return(false);" %>

        <% end %>

            Need an account?

            <%= link_to "Sign up", signup_url %>

            <%= link_to "Forgotten password?", forgot_password_url %>

<% end -%>

<% unless logged_in_and_registered? -%>

            Log in / Register

        <% form_tag session_path do %>
        <%= hidden_field_tag "called_from[controller]", controller.controller_name -%>
        <%= hidden_field_tag "called_from[action]", controller.action_name -%>
        <%= hidden_field_tag "called_from[id]", params[:id] -%>

                    Login:

                    <%= text_field_tag 'login', nil, :class => 'field', :style => 'width:150px'-%>

                    Password:

                    <%= password_field_tag 'password', nil, :class => 'field', :style => 'width:auto'-%>

                    Remember me: <%= check_box_tag 'remember_me',nil,false, {:style=>"width:2em;"} %>

                    <%= image_tag "openid-16x16.gif" %>OpenID:

                    <%= text_field_tag 'openid_identifier', nil, :class => 'field', :style => 'width:150px' -%>

                Alternatively...

                Log in using <%= image_tag "openid-16x16.gif" %>OpenID

            <%= submit_tag "Log in", :id=>"login_button",:onclick=>"$('login_button').disabled=true;this.form.submit();return(false);" %>

        <% end %>

            Need an account?

            <%= link_to "Sign up", signup_url %>

            <%= link_to "Forgotten password?", forgot_password_url %>

<% end -%>


correct link to drafts

correct link to drafts

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

<tr class="<%= article.status %>" id="article_<%= article.id %>">
  <%= image_tag "icons/#{status_icon[article.status][1]}", :class => "#{status_icon[article.status][0]} icon", :title => "This article is #{article.status}", :alt => "#{article.status}" %>
  <%= link_to(article.title, {:action => (article.is_a?(Article) ? 'edit' : 'draft'), :id => article}) %>

    <% if article.comments.size == 0 %>
      none
    <% else %>
      <%= link_to pluralize(article.comments.size, 'comment'), { :action => 'comments', :id => article } %>
    <% end %>

  <%= published_at_for article %>

<tr class="<%= article.status %>" id="article_<%= article.id %>">
  <%= image_tag "icons/#{status_icon[article.status][1]}", :class => "#{status_icon[article.status][0]} icon", :title => "This article is #{article.status}", :alt => "#{article.status}" %>
  <%= link_to(article.title, {:action => 'edit', :id => article}) %>

    <% if article.comments.size == 0 %>
      none
    <% else %>
      <%= link_to pluralize(article.comments.size, 'comment'), { :action => 'comments', :id => article } %>
    <% end %>

  <%= published_at_for article %>


ActionItem443: don't list private profiles

git-svn-id: 43659daf80e124e0b603d67096418e58e4f21099@2291 3f533792-8f58-4932-b0fe-aaf55b0a4547

<div id="search-results" class="<%= 'only-one-result-box' if @results.size == 1 %>">

<%
  pos2 = :odd  # allow to format in a two columns layout
  pos3 = 3     # allow to format in a thre columns layout
%>
<% @order.each do |name| %>
  <% results = @results[name] %>
  <%
    pos3 += 1;  pos3 = 1 if pos3 > 3
    pos2==:odd ? pos2=:even : pos2=:odd
  %>
  <% if !results.nil? and !results.empty? %>
    <div class="search-results-<%= name %> search-results-box <%= pos2 %> <%= 'col%s_of3' % pos3.to_s %>">
      <% if @controller.action_name != 'assets' %>
        <% if @results.size != 1 %>

            <%= @names[name] %>

        <% end %>
      <%= link_to( results.respond_to?(:total_entries) ? _('see all (%d)') % results.total_entries : _('see all...'),
                   params.merge(:action => 'index',
                   :asset => name ),
                   :class => 'see-more' ) if @results.size > 1 %>
      <% end %>
      <% partial = partial_for_class results.first.class %>
      <div class="search-results-innerbox search-results-type-<%= partial %> <%= 'common-profile-list-block' if partial == 'profile' %>">

          <% hit_pos = 0 %>
          <% results.each do |hit| %>
            <% next if hit.respond_to?(:public_profile) && !hit.public_profile  %>
            <%= render :partial => partial,
                       :object => hit,
                       :locals => { :pos => ( hit_pos += 1 ) } %>
          <% end %>

  <% else %>
    <div class="search-results-<%= name %> search-results-empty search-results-box <%= pos2 %> <%= 'col%s_of3' % pos3.to_s %>">
      <% if @controller.action_name != 'assets' %>
        <% if @results.size != 1 %>

<%= @names[name] %>

        <% end %>
      <% end %>

 <%= _('None') %>

  <% end %>
<% end %>

<div id="search-results" class="<%= 'only-one-result-box' if @results.size == 1 %>">

<%
  pos2 = :odd  # allow to format in a two columns layout
  pos3 = 3     # allow to format in a thre columns layout
%>
<% @order.each do |name| %>
  <% results = @results[name] %>
  <%
    pos3 += 1;  pos3 = 1 if pos3 > 3
    pos2==:odd ? pos2=:even : pos2=:odd
  %>
  <% if !results.nil? and !results.empty? %>
    <div class="search-results-<%= name %> search-results-box <%= pos2 %> <%= 'col%s_of3' % pos3.to_s %>">
      <% if @controller.action_name != 'assets' %>
        <% if @results.size != 1 %>

            <%= @names[name] %>

        <% end %>
      <%= link_to( results.respond_to?(:total_entries) ? _('see all (%d)') % results.total_entries : _('see all...'),
                   params.merge(:action => 'index',
                   :asset => name ),
                   :class => 'see-more' ) if @results.size > 1 %>
      <% end %>
      <% partial = partial_for_class results.first.class %>
      <div class="search-results-innerbox search-results-type-<%= partial %> <%= 'common-profile-list-block' if partial == 'profile' %>">

          <% hit_pos = 0 %>
          <% results.each do |hit| %>
            <%= render :partial => partial,
                       :object => hit,
                       :locals => { :pos => ( hit_pos += 1 ) } %>
          <% end %>

  <% else %>
    <div class="search-results-<%= name %> search-results-empty search-results-box <%= pos2 %> <%= 'col%s_of3' % pos3.to_s %>">
      <% if @controller.action_name != 'assets' %>
        <% if @results.size != 1 %>

<%= @names[name] %>

        <% end %>
      <% end %>

 <%= _('None') %>

  <% end %>
<% end %>


Fix starting path for new request on modal log-in

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang="<%= I18n.locale %>">

        <% if @profile_photo_javascript %>

            <link rel="stylesheet" href="/stylesheets/jquery.Jcrop.css" type="text/css" >
        <% end %>

        <title>
        <% if @title %>
            <%=@title%> - <%= site_name %>
        <% else %>
            <%= site_name %> - <%= _('Make and browse Freedom of Information (FOI) requests') %>
        <% end %>
        </title>

        <link rel="shortcut icon" href="/favicon.ico">
	<%= stylesheet_link_tag 'main', :title => "Main", :rel => "stylesheet", :media => "all" %>

	<%= stylesheet_link_tag 'theme', :rel => "stylesheet", :media => "all"  %>
	<%= stylesheet_link_tag 'print', :rel => "stylesheet", :media => "print"  %>
	<% if !params[:print_stylesheet].nil? %>
         <%= stylesheet_link_tag 'print', :rel => "stylesheet", :media => "all"  %>
	<% end %>
	<%= javascript_include_tag 'jquery.js', 'jquery-ui.min','jquery.cookie.js', 'general.js' %>
	<%= stylesheet_link_tag 'admin-theme/jquery-ui-1.8.15.custom.css', :rel => 'stylesheet'%>

        <%= stylesheet_link_tag '../asktheeu-theme/stylesheets/asktheeu.css', :title => "Main", :rel => "stylesheet"  %>
        <% if force_registration_on_new_request %>
        <%= stylesheet_link_tag 'jquery.fancybox-1.3.4', :rel => "stylesheet"  %>
        <% end %>

        <% if @feed_autodetect %>
            <% for feed in @feed_autodetect %>
                <link rel="alternate" type="application/atom+xml" title="<%=h feed[:title] %>" href="<%=h feed[:url]%>">
                <% if feed[:has_json] %>
                    <link rel="alternate" type="application/json" title="JSON version of <%=h feed[:title] %>" href="<%=h feed[:url]%>.json">
                <% end %>
            <% end %>
        <% end %>
        <% if @has_json %>
            <link rel="alternate" type="application/json" title="JSON version of this page" href="<%=h main_url(request.request_uri) %>.json">
        <% end %>

        <% if @no_crawl %>
            <meta name="robots" content="noindex, nofollow">
        <% end %>

    <%= render :partial => 'general/before_head_end' %>

    <body <%= "class='front'" if params[:action] == 'frontpage' %>>

    <% if force_registration_on_new_request && !@user %>
    <%= javascript_include_tag 'jquery.fancybox-1.3.4.pack' %>

    <% end %>

<%= render :partial => 'general/locale_switcher' %>

        <% if not (controller.action_name == 'signin' or controller.action_name == 'signup') %>

          <% if @user %>
              <%= _('Hello, {{username}}!', :username => h(@user.name))%>

                <% if @user %>
                    <%=link_to _("My profile"), user_url(@user) %>
                <% end %>

              <%= link_to _("Sign out"), signout_url(:r => request.request_uri) %>
          <% else %>
              <%= link_to _("Sign in or sign up"), signin_url(:r => request.request_uri) %>
          <% end %>

        <% end %>

        <% if I18n.locale != :en %>

The translations into Spanish and French are still ongoing and we are happy for anyone
                who can support us
in order to make the site even more accessible. If you wish to help us,
                we are more than happy to hear from you.
Please get in touch:
                team@asktheeu.org

Close

        <% end %>

            <% form_tag({:controller => "general", :action => "search_redirect"}, {:id => "navigation_search_form"}) do %>

                   <%= text_field_tag 'query', params[:query], { :size => 40, :id => "navigation_search_query" } %>
                   <%= image_submit_tag('search-button.png') %>

            <% end %>

        <%= render :partial => 'general/orglink' %>

        <%= render :partial => 'general/topnav' %>

            <% if flash[:notice] %>

<%= flash[:notice] %>

            <% end %>
            <% if flash[:error] %>

<%= flash[:error] %>

            <% end %>

            <div id="<%= controller.controller_name + "_" + controller.action_name %>" class="controller_<%= controller.controller_name %>">
            <%= yield :layout %>

    <%= render :partial => 'general/footer' %>

    <%= render :partial => 'general/before_body_end' %>

X
<%= _("Paste this link into emails, tweets, and anywhere else:") %>

<input type="text">


git-svn-id: https://svn.csc.ncsu.edu:8443/svn/research-expertiza/trunk@132 392d7b7b-3f31-0410-9dc3-c95a9635ea79

Grade report: <%=@assignment.name%>

	Author
<%
	for i in 0...@assignment.num_reviews%>
		Review<%=i+1%>
<%
	end
%>
	Review of Review
	Final Score
<%
	for participant in @participants
		student =User.find(participant.user_id)
		if !@assignment.team_assignment
			review_mapping = ReviewMapping.find_by_sql("select * from review_mappings where author_id = "+student.id.to_s+" and assignment_id = "+@assignment.id.to_s)
		elsif @assignment.team_assignment
			teams = TeamsUser.find_by_sql("select * from teams_users where user_id = "+student.id.to_s)
			for team in teams
				if ReviewMapping.find(:all,:conditions => ["team_id = ? and assignment_id = ?", team.team_id, @assignment.id])
					review_mapping = ReviewMapping.find(:all,:conditions => ["team_id = ? and assignment_id = ?", team.team_id, @assignment.id])
				end
			end
		end
		review_mappings_for_student = ReviewMapping.find(:all,:conditions => ["reviewer_id = ?", participant.user_id])
		ror_count =0
		ror_final = 0
		for review_mapping_for_student in review_mappings_for_student
			ror = 0
			for review in review_mapping_for_student.reviews
				review_of_review_mapping = ReviewOfReviewMapping.find(:first,:conditions => ["review_id = ?", review.id])
				if review_of_review_mapping
					ror_count += 1
					for review_of_review in review_of_review_mapping.review_of_reviews
						ror_total = 0
						question_count = 0
						for review_of_review_score in review_of_review.review_of_review_scores
							ror_total += review_of_review_score.score
							question_count += 1
						end
						ror_total = ror_total*100/@sum_of_max.to_f
					end
				end
			end
			ror +=ror_total.to_f
		end
		ror_final +=ror

	review_no = 1
	grade = 0
	_time = Time.now.month.to_s + "/" + Time.now.day.to_s + "/" + Time.now.year.to_s
%>

		<%=student.fullname%>

<%
		if review_mapping
			for review_map in review_mapping
				for review in review_map.reviews
					total = 0
					for review_score in review.review_scores
						total += review_score.score
					end
					grade += total.to_f
					review_no +=1
%>
					  <%= link_to User.find(review_map.reviewer_id).fullname, :controller=>'review', :action => 'view_review', :id=> review.id%>
  <%=sprintf("%.2f",total.to_f*100/@sum_of_max.to_f)%>%
<%
				end
			end
		end
		if review_no < (@assignment.num_reviews+1)
			for i in 0...@assignment.num_reviews+1-review_no
%>

<%
			end
		end
		if review_no-1 > 0
			ror_cnt = 1
			if ror_count > 0
				ror_cnt = ror_count
			end
			review = (grade.to_f/(review_no-1).to_f*100/@sum_of_max.to_f).to_f
			if ror_count < 1
				review_of_review = (100*(100-@assignment.review_weight)/100).to_f
			else
				review_of_review = (ror_final.to_f/(ror_cnt).to_f*100/@sum_of_max.to_f*(100-@assignment.review_weight)/100).to_f
			end
%>
			<%=sprintf("%.2f",(ror_final.to_f/(ror_cnt).to_f*100/@sum_of_max.to_f).to_f)%>%
			<%=sprintf("%.2f",review)%>%
<%
		end
  end
%>

<%= link_to 'Back', :action=>'list'%>

Grade report: <%=@assignment.name%>

	Author
<%
	for i in 0...@assignment.num_reviews%>
		Review<%=i+1%>
<%
	end
%>
	Review of Review
	Final Score
<%
	for participant in @participants
		student =User.find(participant.user_id)
		if !@assignment.team_assignment
			review_mapping = ReviewMapping.find_by_sql("select * from review_mappings where author_id = "+student.id.to_s+" and assignment_id = "+@assignment.id.to_s)
		elsif @assignment.team_assignment
			teams = TeamsUser.find_by_sql("select * from teams_users where user_id = "+student.id.to_s)
			for team in teams
				if ReviewMapping.find(:all,:conditions => ["team_id = ? and assignment_id = ?", team.team_id, @assignment.id])
					review_mapping = ReviewMapping.find(:all,:conditions => ["team_id = ? and assignment_id = ?", team.team_id, @assignment.id])
				end
			end
		end
		review_mappings_for_student = ReviewMapping.find(:all,:conditions => ["reviewer_id = ?", participant.user_id])
		ror_count =0
		ror_final = 0
		for review_mapping_for_student in review_mappings_for_student
			ror = 0
			for review in review_mapping_for_student.reviews
				review_of_review_mapping = ReviewOfReviewMapping.find(:first,:conditions => ["review_id = ?", review.id])
				if review_of_review_mapping
					ror_count += 1
					for review_of_review in review_of_review_mapping.review_of_reviews
						ror_total = 0
						question_count = 0
						for review_of_review_score in review_of_review.review_of_review_scores
							ror_total += review_of_review_score.score
							question_count += 1
						end
						ror_total = ror_total*100/@sum_of_max.to_f
					end
				end
			end
			ror +=ror_total.to_f
		end
		ror_final +=ror
	end
	review_no = 1
	grade = 0
	_time = Time.now.month.to_s + "/" + Time.now.day.to_s + "/" + Time.now.year.to_s
%>

		<%=student.fullname%>

<%
		if review_mapping
			for review_map in review_mapping
				for review in review_map.reviews
					total = 0
					for review_score in review.review_scores
						total += review_score.score
					end
					grade += total.to_f
					review_no +=1
%>
					  <%= link_to User.find(review_map.reviewer_id).fullname, :controller=>'review', :action => 'view_review', :id=> review.id%>
  <%=sprintf("%.2f",total.to_f*100/@sum_of_max.to_f)%>%
<%
				end
			end
		end
		if review_no < (@assignment.num_reviews+1)
			for i in 0...@assignment.num_reviews+1-review_no
%>

<%
			end
		end
		if review_no-1 > 0
			ror_cnt = 1
			if ror_count > 0
				ror_cnt = ror_count
			end
			review = (grade.to_f/(review_no-1).to_f*100/@sum_of_max.to_f).to_f
			if ror_count < 1
				review_of_review = (100*(100-@assignment.review_weight)/100).to_f
			else
				review_of_review = (ror_final.to_f/(ror_cnt).to_f*100/@sum_of_max.to_f*(100-@assignment.review_weight)/100).to_f
			end
%>
			<%=sprintf("%.2f",(ror_final.to_f/(ror_cnt).to_f*100/@sum_of_max.to_f).to_f)%>%
			<%=sprintf("%.2f",review)%>%
<%
		end
%>

<%= link_to 'Back', :action=>'list'%>


Put date in first column so can see it on narrow screen.

<% @title = "Public authority - " + h(@public_body.name) %>

<%=@title%>

<%
   columns = PublicBody.content_columns + [] # force dup
   columns.delete_if {|c| ['last_edit_comment'].include?(c.name)}

   for column in columns %>
  <%= column.human_name %>:
  <% if column.name == 'home_page' and !column.name.empty? %>
    <%= link_to(h(@public_body.send(column.name)), @public_body.send(column.name))  %>
  <% elsif column.name == 'request_email' and !column.name.empty? %>
    <%= link_to(h(@public_body.send(column.name)), "mailto:" + @public_body.send(column.name))  %>
  <% else %>
      <%=h @public_body.send(column.name) %>
  <% end %>

<% end %>
Calculated home page:
<% if !@public_body.calculated_home_page.nil? %>
    <%= link_to(h(@public_body.calculated_home_page), @public_body.calculated_home_page) %>
<% else %>
    *unknown*
<% end %>

Tags: <%= @public_body.public_body_tags.map { |t|
        link_to(h(t.name), list_public_bodies_url(:tag => t.name)) +
        ' (admin)' }.join(' ') %>

    <%= link_to 'Public page', main_url(public_body_url(@public_body)) %>
    | <%= link_to 'Edit', '../edit/' + @public_body.id.to_s %>

History

Updated at
<%
    history_columns = PublicBody.content_columns + [] # force dup
    history_columns.delete_if {|c| ['created_at', 'updated_at', 'first_letter'].include?(c.name)}
    for column in history_columns %>
  <%= column.human_name %>
<% end %>

<%# There may be an option to versions() to specify order, but I can't find it. TB 2009-03-09 %>
<% for historic_public_body in @public_body.reverse_sorted_versions %>
      <tr class="<%= cycle('odd', 'even') %>">
      <%=h historic_public_body.updated_at %>
    <% for column in history_columns %>
      <%
        value = h(historic_public_body.send(column.name))
        if column.name == 'last_edit_comment'
            value = historic_public_body.last_edit_comment_for_html_display
        end
        # Highlight entries which have changed since previous version
        changed = (!['version', 'last_edit_editor', 'last_edit_comment'].include?(column.name)) && ((historic_public_body.send(column.name) != @public_body.sorted_versions[historic_public_body.version - 2].send(column.name)) || (historic_public_body.version == 1)) %>
      <td <%= changed ? ' class="entry_changed" ': '' %> >
      <%=value%>

    <% end %>

<% end %>

Requests

<%= render :partial => 'admin_request/some_requests', :locals => { :info_requests => @public_body.info_requests } %>

Track things

<%= render :partial => 'admin_track/some_tracks', :locals => { :track_things => @public_body.track_things } %>

<% @title = "Public authority - " + h(@public_body.name) %>

<%=@title%>

<%
   columns = PublicBody.content_columns + [] # force dup
   columns.delete_if {|c| ['last_edit_comment'].include?(c.name)}

   for column in columns %>
  <%= column.human_name %>:
  <% if column.name == 'home_page' and !column.name.empty? %>
    <%= link_to(h(@public_body.send(column.name)), @public_body.send(column.name))  %>
  <% elsif column.name == 'request_email' and !column.name.empty? %>
    <%= link_to(h(@public_body.send(column.name)), "mailto:" + @public_body.send(column.name))  %>
  <% else %>
      <%=h @public_body.send(column.name) %>
  <% end %>

<% end %>
Calculated home page:
<% if !@public_body.calculated_home_page.nil? %>
    <%= link_to(h(@public_body.calculated_home_page), @public_body.calculated_home_page) %>
<% else %>
    *unknown*
<% end %>

Tags: <%= @public_body.public_body_tags.map { |t|
        link_to(h(t.name), list_public_bodies_url(:tag => t.name)) +
        ' (admin)' }.join(' ') %>

    <%= link_to 'Public page', main_url(public_body_url(@public_body)) %>
    | <%= link_to 'Edit', '../edit/' + @public_body.id.to_s %>

History

<%
    history_columns = PublicBody.content_columns + [] # force dup
    history_columns.delete_if {|c| ['created_at', 'updated_at', 'first_letter'].include?(c.name)}
    for column in history_columns %>
  <%= column.human_name %>
<% end %>
Updated at

<%# There may be an option to versions() to specify order, but I can't find it. TB 2009-03-09 %>
<% for historic_public_body in @public_body.reverse_sorted_versions %>
      <tr class="<%= cycle('odd', 'even') %>">
    <% for column in history_columns %>
      <%
        value = h(historic_public_body.send(column.name))
        if column.name == 'last_edit_comment'
            value = historic_public_body.last_edit_comment_for_html_display
        end
        # Highlight entries which have changed since previous version
        changed = (!['version', 'last_edit_editor', 'last_edit_comment'].include?(column.name)) && ((historic_public_body.send(column.name) != @public_body.sorted_versions[historic_public_body.version - 2].send(column.name)) || (historic_public_body.version == 1)) %>
      <td <%= changed ? ' class="entry_changed" ': '' %> >
      <%=value%>

    <% end %>
      <%=h historic_public_body.updated_at %>

<% end %>

Requests

<%= render :partial => 'admin_request/some_requests', :locals => { :info_requests => @public_body.info_requests } %>

Track things

<%= render :partial => 'admin_track/some_tracks', :locals => { :track_things => @public_body.track_things } %>


Don't fail if there's no address or DOB (e.g. for objects created before migration)

<% if !@display_user.get_about_me_for_html_display.empty? || @is_you %>

            <%= @display_user.get_about_me_for_html_display %>
            <% if @is_you %>
                (<%= link_to _("edit text about you"), set_profile_about_me_url() %>)
            <% end %>
	  <% if @is_you %>

<%= _("Address") %>

<%=h @display_user.address if !@display_user.address.nil?  %>

<%= _("DOB") %>

<%=l @display_user.dob if !@display_user.dob.nil? %>

          <% end %>

    <% end %>

    <% if @is_you %>

            <% if @display_user.profile_photo %>
                <%= link_to _('Change profile photo'), set_profile_photo_url() %> |
            <% end %>
            <%= link_to _('Change your password'), signchangepassword_url() %> |
            <%= link_to _('Change your email'), signchangeemail_url() %>
            <%= link_to _('Change your address'), signchangeaddress_url() %>
            <%= link_to _('Change your DOB'), signchangedob_url() %>

    <% end %>

<% if !@display_user.get_about_me_for_html_display.empty? || @is_you %>

            <%= @display_user.get_about_me_for_html_display %>
            <% if @is_you %>
                (<%= link_to _("edit text about you"), set_profile_about_me_url() %>)
            <% end %>
	  <% if @is_you %>

<%= _("Address") %>

<%=h @display_user.address %>

<%= _("DOB") %>

<%=l @display_user.dob %>

          <% end %>

    <% end %>

    <% if @is_you %>

            <% if @display_user.profile_photo %>
                <%= link_to _('Change profile photo'), set_profile_photo_url() %> |
            <% end %>
            <%= link_to _('Change your password'), signchangepassword_url() %> |
            <%= link_to _('Change your email'), signchangeemail_url() %>
            <%= link_to _('Change your address'), signchangeaddress_url() %>
            <%= link_to _('Change your DOB'), signchangedob_url() %>

    <% end %>


ActionItem1049: only display message about external feed if it's enabled.

<%= content_tag('em', _('(external feed was not loaded yet)'), :id => 'external-feed-info', :class => 'metadata') if article.blog? && article.external_feed && article.external_feed.enabled && article.external_feed.fetched_at.nil? %>

<%= article.body %>

  <%= (children.compact.empty? ? content_tag('em', _('(no posts)')) : list_posts(user, children)) %>

<%= content_tag('em', _('(external feed was not loaded yet)'), :id => 'external-feed-info', :class => 'metadata') if article.blog? && article.external_feed && article.external_feed.fetched_at.nil? %>

<%= article.body %>

  <%= (children.compact.empty? ? content_tag('em', _('(no posts)')) : list_posts(user, children)) %>


let drafts stay that way

let drafts stay that way

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

<%= error_messages_for 'article' %>

Title

<%= form.text_field :title, :class => 'big'  %>

<%= form.label_for :excerpt %> (<%= link_to_function 'Cancel', %(Element.toggle('x-lbl', 'x-body')) %>)

<%= form.text_area :excerpt, :rows => '8', :class => 'fat'  %>

Write your article (<%= link_to_function 'Add an excerpt', %(Element.toggle('x-lbl', 'x-body')) %>)

<%= form.text_area :body, :class => 'fat'  %>

Show article in these sections

        <% @sections.each do |section| %>

            <%= check_box_tag 'article[section_ids][]', section.id, @article.has_section?(section),
                  :id => "article_section_ids_#{section.id}" %>
            <label for="article_section_ids_<%= section.id %>"><%= section.name %>

        <% end %>

  <% unless @article.published? -%>

Save as Draft?

<%= check_box_tag :draft, '1', !@article.new_record?, :id => 'article-draft' %> Yes, save this article as a draft.

  <% end -%>
  <dt id="publish-date-lbl"<%= %( style="display:none") unless @article.new_record? -%>><%= label_tag 'article_created_at', 'Publish on this date:' %>

  <dd id="publish-date"<%= %( style="display:none") unless @article.new_record? -%>><%= form.datetime_select :published_at, :discard_year => true %>

<% if @article.expire_comments_at && site.accept_comments? && site.comment_age.to_i > 0 %>

<%= label_tag 'article_expire_comments_at', 'Expire Comments on this date:' %>

<%= form.datetime_select :expire_comments_at %>

<% end -%>

Permanent link

<%= form.text_field :permalink %>

<% if false %>

Publish in these sections

      <% @sections.each do |section| %>

          <%= check_box_tag 'article[section_ids][]', section.id, @article.has_section?(section),
                :id => "article_section_ids_#{section.id}" %>
          <label for="article_section_ids_<%= section.id %>"><%= section.name %>

      <% end %>

  <% unless @article.new_record? -%>

Expire Comments At

    <%= form.date_select :expire_comments_at %>
  <% end -%>

<% end %>

<% content_for :sidebar do %>
<% if false %>

Publish in these sections

      <% @sections.each do |section| %>

          <%= check_box_tag 'article[section_ids][]', section.id, @article.has_section?(section),
                :id => "article_section_ids_#{section.id}" %>
          <label for="article_section_ids_<%= section.id %>"><%= section.name %>

      <% end %>

  <% unless @article.new_record? -%>

Expire Comments At

    <%= form.date_select :expire_comments_at %>
  <% end -%>

<% end %>

<% if false %>

Latest files

Search files

Upload

          <% 1.upto(5) do |i| %>
          <%= %(

          ) %>
          <% end %>

Search by tag or title

        <input class="searchbox" type="text" size="30" />
        <%= submit_tag 'Search' %>

1. <input type="file" size="15" />

2. <input type="submit" value="Upload" />

Other options

<%= check_box_tag 'allow_comments' %> Allow comments

  <% end %>
<% end %>

<%= error_messages_for 'article' %>

Title

<%= form.text_field :title, :class => 'big'  %>

<%= form.label_for :excerpt %> (<%= link_to_function 'Cancel', %(Element.toggle('x-lbl', 'x-body')) %>)

<%= form.text_area :excerpt, :rows => '8', :class => 'fat'  %>

Write your article (<%= link_to_function 'Add an excerpt', %(Element.toggle('x-lbl', 'x-body')) %>)

<%= form.text_area :body, :class => 'fat'  %>

Show article in these sections

        <% @sections.each do |section| %>

            <%= check_box_tag 'article[section_ids][]', section.id, @article.has_section?(section),
                  :id => "article_section_ids_#{section.id}" %>
            <label for="article_section_ids_<%= section.id %>"><%= section.name %>

        <% end %>

  <% unless @article.published? -%>

Save as Draft?

<%= check_box_tag :draft, '1', false, :id => 'article-draft' %> Yes, save this article as a draft.

  <% end -%>

<%= label_tag 'article_created_at', 'Publish on this date:' %>

<%= form.datetime_select :published_at, :discard_year => true %>

<% if @article.expire_comments_at && site.accept_comments? && site.comment_age.to_i > 0 %>

<%= label_tag 'article_expire_comments_at', 'Expire Comments on this date:' %>

<%= form.datetime_select :expire_comments_at %>

<% end -%>

Permanent link

<%= form.text_field :permalink %>

<% if false %>

Publish in these sections

      <% @sections.each do |section| %>

          <%= check_box_tag 'article[section_ids][]', section.id, @article.has_section?(section),
                :id => "article_section_ids_#{section.id}" %>
          <label for="article_section_ids_<%= section.id %>"><%= section.name %>

      <% end %>

  <% unless @article.new_record? -%>

Expire Comments At

    <%= form.date_select :expire_comments_at %>
  <% end -%>

<% end %>

<% content_for :sidebar do %>
<% if false %>

Publish in these sections

      <% @sections.each do |section| %>

          <%= check_box_tag 'article[section_ids][]', section.id, @article.has_section?(section),
                :id => "article_section_ids_#{section.id}" %>
          <label for="article_section_ids_<%= section.id %>"><%= section.name %>

      <% end %>

  <% unless @article.new_record? -%>

Expire Comments At

    <%= form.date_select :expire_comments_at %>
  <% end -%>

<% end %>

<% if false %>

Latest files

Search files

Upload

          <% 1.upto(5) do |i| %>
          <%= %(

          ) %>
          <% end %>

Search by tag or title

        <input class="searchbox" type="text" size="30" />
        <%= submit_tag 'Search' %>

1. <input type="file" size="15" />

2. <input type="submit" value="Upload" />

Other options

<%= check_box_tag 'allow_comments' %> Allow comments

  <% end %>
<% end %>


use is_asset? rather than is_isa? to determine the defaults for sharing access_type to account for ISA AND events and specimen/samples defaulting to editable, and assets to downloadable

<%
   set_parameters_for_sharing_form
   show_advanced_permissions = !@resource.respond_to?(:has_advanced_permissions?) || @resource.has_advanced_permissions?
   default_projects_access_type = @resource.is_asset? ? Policy::ACCESSIBLE : Policy::EDITING
   default_consortium_access_type = Policy::VISIBLE
%>
<%# 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]", "" -%>

    <%= help_icon("Here you can specify who can see#{', download' if @resource.is_downloadable?} and edit this #{@resource_type}.") -%>
    Sharing

        Here you can specify who can view the summary of<% if @resource.is_downloadable? %>, get access to the content of,<% end %> and edit the <%= @resource_type -%>.
        <%= link_to_function "More info " + expand_image, visual_effect(:toggle_blind, "more_sharing_info", :duration => 0.3) -%>

          You may:

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

Share within the selected projects and with all other users that are a member of a <%= Seek::Config.project_name %> project.

          <% if try_block{@resource.can_publish?} %>

Share with the all visitors (including anonymous visitors with no login)

          <% end %>

Define more fine-grained sharing in the Advanced sharing: 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" id='access_type_select_<%= Policy::PRIVATE -%>' name="sharing[access_type_<%= Policy::PRIVATE -%>]" value="<%= Policy::NO_ACCESS -%>">
            <input <%= 'checked="checked"' if @sharing_mode == Policy::PRIVATE %> id="sharing_scope_<%= Policy::PRIVATE -%>" name="sharing[sharing_scope]"
                                                                                value="<%= Policy::PRIVATE -%>" type="radio" />
            - Keep this <%= @resource_type -%> private (only visible to you)

          <%= additional_advanced_permissions_included @resource, Policy::PRIVATE -%>

Or share it with..

            <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 -%>" />
            - Members of projects associated with this <%= @resource_type -%>:

             <select name="sharing[your_proj_access_type]" id="sharing_your_proj_access_type">
                 <%= policy_selection_options([Policy::VISIBLE,Policy::ACCESSIBLE,Policy::EDITING,Policy::MANAGING], @resource, your_project_access_type(@policy, @resource) || default_projects_access_type) -%>
             </select>

            ... and all other project members:
             <%= render :partial => "assets/sharing_form_access_type_dropdown", :locals => { :access_type_selector_for_scope => Policy::ALL_SYSMO_USERS,
               :sharing_scope => Policy::ALL_SYSMO_USERS, :access_type => (@resource.respond_to?(:policy?) && @resource.policy.try(:sharing_scope)==Policy::ALL_SYSMO_USERS ? @access_mode : default_consortium_access_type), :access_type_options=>[Policy::NO_ACCESS,Policy::VISIBLE,Policy::ACCESSIBLE,Policy::EDITING] } -%>
             <%= additional_advanced_permissions_included @resource, Policy::ALL_SYSMO_USERS -%>

          <label for="sharing_scope_<%= Policy::EVERYONE -%>">
            <input type="radio" <%= 'checked="checked"' if @sharing_mode == Policy::EVERYONE -%> id="sharing_scope_<%= Policy::EVERYONE -%>" name="sharing[sharing_scope]"
                   value="<%= Policy::EVERYONE -%>" <%= 'disabled="true"' if @resource.respond_to?(:can_publish?) && !@resource.can_publish? -%>/>
            - All visitors (including anonymous visitors with no login):

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

    <% if @resource.new_record? && @resource.errors.empty? -%>

    <% end -%>

    <%= link_to_function "Advanced permissions " + expand_image, :class => 'advanced_sharing_link', :style => "display:" + (show_advanced_permissions ? 'none;' : 'block;'), :id =>'advanced_sharing_expand_image' do |page|
        page.visual_effect :toggle_blind, "advanced sharing", :duration => 0.5
        page["advanced_sharing_expand_image"].toggle
        page["advanced_sharing_collapse_image"].toggle
        end
    -%>
    <%= link_to_function "Advanced permissions " + collapse_image, :class => 'advanced_sharing_link', :style => "display:" + (show_advanced_permissions ? 'block;' : 'none;'), :id =>'advanced_sharing_collapse_image'do |page|
        page.visual_effect :toggle_blind, "advanced sharing", :duration => 0.5
        page["advanced_sharing_expand_image"].toggle
        page["advanced_sharing_collapse_image"].toggle
        end
    -%>

    <div id="advanced sharing" class='sharing_box_form' style="display:<%= show_advanced_permissions ? 'block;' : 'none;'-%>">

Additional fine-grained 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, :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(@resource.class.name) -%>

                  <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(@resource.class.name) -%>

                <%= 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::NO_ACCESS,Policy::VISIBLE,Policy::ACCESSIBLE,Policy::EDITING,Policy::MANAGING], @resource -%>
                      </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(@resource.class.name) -%>

                <%= 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 nil, @resource -%>
                        </select>

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

<%
   set_parameters_for_sharing_form
   show_advanced_permissions = !@resource.respond_to?(:has_advanced_permissions?) || @resource.has_advanced_permissions?
   default_projects_access_type = @resource.is_isa? ? Policy::EDITING : Policy::ACCESSIBLE
   default_consortium_access_type = Policy::VISIBLE
%>
<%# 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]", "" -%>

    <%= help_icon("Here you can specify who can see#{', download' if @resource.is_downloadable?} and edit this #{@resource_type}.") -%>
    Sharing

        Here you can specify who can view the summary of<% if @resource.is_downloadable? %>, get access to the content of,<% end %> and edit the <%= @resource_type -%>.
        <%= link_to_function "More info " + expand_image, visual_effect(:toggle_blind, "more_sharing_info", :duration => 0.3) -%>

          You may:

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

Share within the selected projects and with all other users that are a member of a <%= Seek::Config.project_name %> project.

          <% if try_block{@resource.can_publish?} %>

Share with the all visitors (including anonymous visitors with no login)

          <% end %>

Define more fine-grained sharing in the Advanced sharing: 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" id='access_type_select_<%= Policy::PRIVATE -%>' name="sharing[access_type_<%= Policy::PRIVATE -%>]" value="<%= Policy::NO_ACCESS -%>">
            <input <%= 'checked="checked"' if @sharing_mode == Policy::PRIVATE %> id="sharing_scope_<%= Policy::PRIVATE -%>" name="sharing[sharing_scope]"
                                                                                value="<%= Policy::PRIVATE -%>" type="radio" />
            - Keep this <%= @resource_type -%> private (only visible to you)

          <%= additional_advanced_permissions_included @resource, Policy::PRIVATE -%>

Or share it with..

            <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 -%>" />
            - Members of projects associated with this <%= @resource_type -%>:

             <select name="sharing[your_proj_access_type]" id="sharing_your_proj_access_type">
                 <%= policy_selection_options([Policy::VISIBLE,Policy::ACCESSIBLE,Policy::EDITING,Policy::MANAGING], @resource, your_project_access_type(@policy, @resource) || default_projects_access_type) -%>
             </select>

            ... and all other project members:
             <%= render :partial => "assets/sharing_form_access_type_dropdown", :locals => { :access_type_selector_for_scope => Policy::ALL_SYSMO_USERS,
               :sharing_scope => Policy::ALL_SYSMO_USERS, :access_type => (@resource.respond_to?(:policy?) && @resource.policy.try(:sharing_scope)==Policy::ALL_SYSMO_USERS ? @access_mode : default_consortium_access_type), :access_type_options=>[Policy::NO_ACCESS,Policy::VISIBLE,Policy::ACCESSIBLE,Policy::EDITING] } -%>
             <%= additional_advanced_permissions_included @resource, Policy::ALL_SYSMO_USERS -%>

          <label for="sharing_scope_<%= Policy::EVERYONE -%>">
            <input type="radio" <%= 'checked="checked"' if @sharing_mode == Policy::EVERYONE -%> id="sharing_scope_<%= Policy::EVERYONE -%>" name="sharing[sharing_scope]"
                   value="<%= Policy::EVERYONE -%>" <%= 'disabled="true"' if @resource.respond_to?(:can_publish?) && !@resource.can_publish? -%>/>
            - All visitors (including anonymous visitors with no login):

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

    <% if @resource.new_record? && @resource.errors.empty? -%>

    <% end -%>

    <%= link_to_function "Advanced permissions " + expand_image, :class => 'advanced_sharing_link', :style => "display:" + (show_advanced_permissions ? 'none;' : 'block;'), :id =>'advanced_sharing_expand_image' do |page|
        page.visual_effect :toggle_blind, "advanced sharing", :duration => 0.5
        page["advanced_sharing_expand_image"].toggle
        page["advanced_sharing_collapse_image"].toggle
        end
    -%>
    <%= link_to_function "Advanced permissions " + collapse_image, :class => 'advanced_sharing_link', :style => "display:" + (show_advanced_permissions ? 'block;' : 'none;'), :id =>'advanced_sharing_collapse_image'do |page|
        page.visual_effect :toggle_blind, "advanced sharing", :duration => 0.5
        page["advanced_sharing_expand_image"].toggle
        page["advanced_sharing_collapse_image"].toggle
        end
    -%>

    <div id="advanced sharing" class='sharing_box_form' style="display:<%= show_advanced_permissions ? 'block;' : 'none;'-%>">

Additional fine-grained 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, :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(@resource.class.name) -%>

                  <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(@resource.class.name) -%>

                <%= 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::NO_ACCESS,Policy::VISIBLE,Policy::ACCESSIBLE,Policy::EDITING,Policy::MANAGING], @resource -%>
                      </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(@resource.class.name) -%>

                <%= 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 nil, @resource -%>
                        </select>

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