tracked down the POST /browse problem! hooray.

<% search_url = url_for(params.merge(:controller => controller, :action => :browse, :page => 1, :update => 1, :escape => false)) -%>
<% form_remote_tag :url => search_url, :method => :get,
                   :html => { :action => search_url, :id => record_select_search_id } do %>
  <%= text_field_tag 'search', params[:search], :autocomplete => 'off', :class => 'text-input' %>
<% end %>

<script type="text/javascript">
//<![CDATA[
  var i = $(<%= record_select_search_id.to_json %>).down('input.text-input');
  new Form.Element.Observer(i, 1.0, function(element, value) {
    element.up('form').onsubmit();
    return false;
  });
//]]>
</script>

<% search_url = url_for(params.merge(:controller => controller, :action => :browse, :page => 1, :update => 1, :escape => false)) -%>
<% form_remote_tag :url => search_url, :method => :post,
                   :html => { :action => search_url, :id => record_select_search_id } do %>
  <%= text_field_tag 'search', params[:search], :autocomplete => 'off', :class => 'text-input' %>
<% end %>

<script type="text/javascript">
//<![CDATA[
  var i = $$('#<%= record_select_search_id %> input').first();
  new Form.Element.Observer(i, 1.0, function(element, value) {
    element.parentNode.onsubmit();
    return false;
  });
//]]>
</script>


git-svn-id: svn+ssh://ko.meadowy.net/home/svn/inside/kozuchi/trunk@223 c938ebee-df10-0410-95fc-be8c4b0ebdd5

  資産合計
  <%= number_with_delimiter(@assets.sum) %>円

    正の資産		期末残高

  <% @assets.plus.each do |account| %>

      <%= account.name %>
      <%= account.percentage %>%
      <%= number_with_delimiter(account.balance) %>

  <% end %>

合計	<%= number_with_delimiter(@assets.plus.sum) %>

<%
  labels = ''
  values = ''
  @assets.plus.each do |account|
    next if account.percentage == 100 || account.percentage == 0
    labels += account.name + ','
    values += account.percentage.to_s + ','
  end
%>
<% if labels.count(',') > 1 then %>
<img src="<%= url_for(:controller=>'graph', :action=>'pie', :labels=>labels, :values=>values) %>" />
<% else %>
  グラフは２つ以上の項目があるときに表示されます。
<% end %>

    負の資産		期末残高

  <% @assets.minus.each do |account| %>

      <%= account.name %>
      <%= account.percentage %>%
      <%= number_with_delimiter(account.balance) %>

  <% end %>

合計	<%= number_with_delimiter(@assets.minus.sum) %>

<%
  labels = ''
  values = ''
  @assets.minus.each do |account|
    next if account.percentage == 100 || account.percentage == 0
    labels += account.name + ','
    values += account.percentage.to_s + ','
  end
%>
<% if labels.count(',') > 1 then %>
<img src="<%= url_for(:controller=>'graph', :action=>'pie', :labels=>labels, :values=>values) %>" />
<% else %>
  グラフは２つ以上の項目があるときに表示されます。
<% end %>


git-svn-id: svn://beonebody.org/onebody/trunk@197 88fc0095-4724-0410-ab6c-c99dba55acc4

<% if @person.groups.length > 0 %>

<%=h @person.first_name %> is a member of the following groups:

    <% @person.groups.select { |g| @logged_in.sees? g }.each do |group| %>
      <% if not group.hidden? or @logged_in.admin? %>
        <li <% if group.hidden? %>class="grayed hidden-group" style="display:none;"<% end %>>
          <%= link_to group.name, :controller => 'groups', :action => 'view', :id => group %>
          (<%= n = group.people.length %> <%= n == 1 ? 'person' : 'people' %>)

            email:
            <% if group.get_options_for(@person).get_email %>
              on |
              <%= link_to 'off', {:controller => 'groups', :action => 'toggle_email', :id => group, :person_id => @person, :from => request.request_uri}, :class => 'discreet', :method => 'post', :confirm => 'If you click OK, you will no longer receive email from this group.', :title => 'turn off email from this group' %>
            <% else %>
              <%= link_to 'on', {:controller => 'groups', :action => 'toggle_email', :id => group, :person_id => @person, :from => request.request_uri}, :class => 'discreet', :method => 'post', :confirm => 'If you click OK, you will start receiving email from this group.', :title => 'turn on email from this group' %> |
              off
            <% end %>

      <% end %>
    <% end %>

  <% if @logged_in.admin? %>

<%= link_to_function 'Show Hidden Groups', "$$('.hidden-group').each(function(e){Element.toggle(e)})" %>
  <% end %>
<% else %>

<%=h @person.first_name %> isn't in any groups right now.

<% end %>

<% if @person.groups.length > 0 %>

<%=h @person.first_name %> is a member of the following groups:

    <% @person.groups.select { |g| @logged_in.sees? g }.each do |group| %>
      <% if not group.hidden? or @logged_in.admin? %>
        <li <% if group.hidden? %>class="grayed hidden-group" style="display:none;"<% end %>>
          <%= link_to group.name, :controller => 'groups', :action => 'view', :id => group %>
          (<%= n = group.people.length %> <%= n == 1 ? 'person' : 'people' %>)

            email:
            <% if group.get_options_for(@person).get_email %>
              on |
              <%= link_to 'off', {:controller => 'groups', :action => 'toggle_email', :id => group, :person_id => @person, :from => request.request_uri}, :class => 'discreet', :method => 'post', :confirm => 'If you click OK, you will no longer receive email from this group.', :title => 'turn off email from this group' %>
            <% else %>
              <%= link_to 'on', {:controller => 'groups', :action => 'toggle_email', :id => group, :person_id => @person, :from => request.request_uri}, :class => 'discreet', :method => 'post', :confirm => 'If you click OK, you will start receiving email from this group.', :title => 'turn on email from this group' %> |
              off
            <% end %>

      <% end %>
    <% end %>

  <% if @logged_in.admin? %>

<%= link_to_function 'Show Hidden Groups', "$$(.hidden-group).each(function(e){Element.toggle(e)})" %>
  <% end %>
<% else %>

<%=h @person.first_name %> isn't in any groups right now.

<% end %>


Got rid of the extra space for links if @links == []

<% @title = :rss_log_title.t.nowrap %>

<%
  if @links and @links != []
    new_tab_set do
      for link in @links
        add_tab(*link)
      end
    end
  end
%>

<% paginate_block(@pages) do %>

    <% row_count = 0
    col_count = 0
    for rss_log in @objects
      color = calc_color(row_count, col_count, @layout["alternate_rows"],
                         @layout["alternate_columns"])
      if col_count == 0 %>

      <% end %>
      <td align="center" valign="top" class="ListLine<%= color %>">
        <%= if observation = rss_log.observation
          render(:partial => 'observation', :object => observation,
                 :locals => { :rss_log => rss_log })
        elsif species_list = rss_log.species_list
          render(:partial => 'species_list', :object => species_list)
        elsif name = rss_log.name
          render(:partial => 'name', :object => name)
        else
          render(:partial => 'rss_log', :object => rss_log)
        end %>

      <% if col_count == (@layout["columns"] - 1) %>

      <% end
      col_count += 1
      if col_count >= @layout["columns"]
        col_count = 0
        row_count += 1
      end
    end
    if col_count != 0 %>

    <% end %>

<% end %>

<% @title = :rss_log_title.t.nowrap %>

<%
  if @links
    new_tab_set do
      for link in @links
        add_tab(*link)
      end
    end
  end
%>

<% paginate_block(@pages) do %>

    <% row_count = 0
    col_count = 0
    for rss_log in @objects
      color = calc_color(row_count, col_count, @layout["alternate_rows"],
                         @layout["alternate_columns"])
      if col_count == 0 %>

      <% end %>
      <td align="center" valign="top" class="ListLine<%= color %>">
        <%= if observation = rss_log.observation
          render(:partial => 'observation', :object => observation,
                 :locals => { :rss_log => rss_log })
        elsif species_list = rss_log.species_list
          render(:partial => 'species_list', :object => species_list)
        elsif name = rss_log.name
          render(:partial => 'name', :object => name)
        else
          render(:partial => 'rss_log', :object => rss_log)
        end %>

      <% if col_count == (@layout["columns"] - 1) %>

      <% end
      col_count += 1
      if col_count >= @layout["columns"]
        col_count = 0
        row_count += 1
      end
    end
    if col_count != 0 %>

    <% end %>

<% end %>


changed action from index to list

changed action from index to list

<%= link_to "Home", :controller => 'articles', :action => 'home'-%><%=" | " if category-%><%= property ? link_to(category, :controller => category.downcase, :action => "list") : category.titlecase-%><%=" | " if category and property-%><%= property if category and property-%>

<%= link_to "Home", :controller => 'articles', :action => 'home'-%><%=" | " if category-%><%= property ? link_to(category, :controller => category.downcase) : category.titlecase-%><%=" | " if category and property-%><%= property if category and property-%>


Improve title on public authority pages

Improve title on public authority pages

<% @title = h(@public_body.name) + " - view and make Freedom of Information requests" %>

Track this authority

    <%= render :partial => 'track/tracking_links', :locals => { :track_thing => @track_thing, :own_request => false, :location => 'sidebar' } %>

More about this authority

    <% if !@public_body.calculated_home_page.nil? %>
        <%= link_to "Home page", @public_body.calculated_home_page %>

    <% end %>
    <% if !@public_body.publication_scheme.empty? %>
        <%= link_to "Publication scheme", @public_body.publication_scheme %>

    <% end %>
    <% if !@public_body.charity_number.empty? %>
        <%= link_to "Charity overview", 'http://www.charity-commission.gov.uk/SHOWCHARITY/RegisterOfCharities/CharityFramework.aspx?RegisteredCharityNumber=' + @public_body.charity_number %>

    <% end %>
    <%= link_to "View FOI email address", view_public_body_email_url(@public_body.url_name) %>

<%=h(@public_body.name)%>

<%=@public_body.type_of_authority(true)%> in the UK<% if not @public_body.short_name.empty? %>, also called <%= h(@public_body.short_name) %><% end %>
<% if !@user.nil? && @user.admin_page_links? %>
(<%= link_to "admin", public_body_admin_url(@public_body) %>)
<% end %>

<% if @public_body.has_notes? && (@public_body.is_requestable? || @public_body.not_requestable_reason == 'bad_contact') %>

<%= @public_body.notes_as_html %>

<% end %>

<% if @public_body.eir_only? %>

You can only request information about the environment from this authority.

<% end %>

    <% if @public_body.is_requestable? || @public_body.not_requestable_reason == 'bad_contact' %>
        Next,
            <% if @public_body.eir_only? %>
            <%= link_to "make a new EIR request", new_request_to_body_url(:public_body_id => @public_body.id.to_s)%>
            <% else %>
            <%= link_to "make a new FOI request", new_request_to_body_url(:public_body_id => @public_body.id.to_s)%>
            <% end %>
            to <%= h(@public_body.name) %>
    <% elsif @public_body.has_notes? %>
        <%= @public_body.notes_as_html %>
    <% elsif @public_body.not_requestable_reason == 'not_apply' %>
        Freedom of Information law does not apply to this authority, so you cannot make
        a request to it.
    <% elsif @public_body.not_requestable_reason == 'defunct' %>
        This authority no longer exists, so you cannot make a request to it.
    <% else %>
        For an unknown reason, it is not possible to make a request to this authority.
    <% end %>

<% if !@xapian_requests.nil? %>
    <% if @xapian_requests.results.empty? %>
        <% if @public_body.eir_only? %>

Environmental Information Regulations requests made

Nobody has made any Environmental Information Regulations requests to <%=h(@public_body.name)%> using this site yet.

        <% else %>

Freedom of Information requests made

Nobody has made any Freedom of Information requests to <%=h(@public_body.name)%> using this site yet.

        <% end %>
    <% else %>

        <% if @public_body.eir_only? %>
            <%=pluralize(@public_body.info_requests.size, "Environmental Information Regulations request") %> made
        <% else %>
            <%=pluralize(@public_body.info_requests.size, "Freedom of Information request") %> made
        <% end %>
        <%= @page_desc %>

        <% for result in @xapian_requests.results %>
            <%= render :partial => 'request/request_listing_via_event', :locals => { :event => result[:model], :info_request => result[:model].info_request } %>
        <% end %>

        <%= will_paginate WillPaginate::Collection.new(@page, @per_page, @public_body.info_requests.size) %>

Only requests made using WhatDoTheyKnow.com are shown.

    <% end %>
<% else %>
    <% if @public_body.eir_only? %>

Environmental Information Regulations requests made

    <% else %>

Freedom of Information requests made

    <% end %>

The search index is currently offline, so we can't show the Freedom of Information requests that have been made to this authority.

<% end %>

<% @title = "Information freed from '" + h(@public_body.name) + "'" %>

Track this authority

    <%= render :partial => 'track/tracking_links', :locals => { :track_thing => @track_thing, :own_request => false, :location => 'sidebar' } %>

More about this authority

    <% if !@public_body.calculated_home_page.nil? %>
        <%= link_to "Home page", @public_body.calculated_home_page %>

    <% end %>
    <% if !@public_body.publication_scheme.empty? %>
        <%= link_to "Publication scheme", @public_body.publication_scheme %>

    <% end %>
    <% if !@public_body.charity_number.empty? %>
        <%= link_to "Charity overview", 'http://www.charity-commission.gov.uk/SHOWCHARITY/RegisterOfCharities/CharityFramework.aspx?RegisteredCharityNumber=' + @public_body.charity_number %>

    <% end %>
    <%= link_to "View FOI email address", view_public_body_email_url(@public_body.url_name) %>

<%=h(@public_body.name)%>

<%=@public_body.type_of_authority(true)%> in the UK<% if not @public_body.short_name.empty? %>, also called <%= h(@public_body.short_name) %><% end %>
<% if !@user.nil? && @user.admin_page_links? %>
(<%= link_to "admin", public_body_admin_url(@public_body) %>)
<% end %>

<% if @public_body.has_notes? && (@public_body.is_requestable? || @public_body.not_requestable_reason == 'bad_contact') %>

<%= @public_body.notes_as_html %>

<% end %>

<% if @public_body.eir_only? %>

You can only request information about the environment from this authority.

<% end %>

    <% if @public_body.is_requestable? || @public_body.not_requestable_reason == 'bad_contact' %>
        Next,
            <% if @public_body.eir_only? %>
            <%= link_to "make a new EIR request", new_request_to_body_url(:public_body_id => @public_body.id.to_s)%>
            <% else %>
            <%= link_to "make a new FOI request", new_request_to_body_url(:public_body_id => @public_body.id.to_s)%>
            <% end %>
            to <%= h(@public_body.name) %>
    <% elsif @public_body.has_notes? %>
        <%= @public_body.notes_as_html %>
    <% elsif @public_body.not_requestable_reason == 'not_apply' %>
        Freedom of Information law does not apply to this authority, so you cannot make
        a request to it.
    <% elsif @public_body.not_requestable_reason == 'defunct' %>
        This authority no longer exists, so you cannot make a request to it.
    <% else %>
        For an unknown reason, it is not possible to make a request to this authority.
    <% end %>

<% if !@xapian_requests.nil? %>
    <% if @xapian_requests.results.empty? %>
        <% if @public_body.eir_only? %>

Environmental Information Regulations requests made

Nobody has made any Environmental Information Regulations requests to <%=h(@public_body.name)%> using this site yet.

        <% else %>

Freedom of Information requests made

Nobody has made any Freedom of Information requests to <%=h(@public_body.name)%> using this site yet.

        <% end %>
    <% else %>

        <% if @public_body.eir_only? %>
            <%=pluralize(@public_body.info_requests.size, "Environmental Information Regulations request") %> made
        <% else %>
            <%=pluralize(@public_body.info_requests.size, "Freedom of Information request") %> made
        <% end %>
        <%= @page_desc %>

        <% for result in @xapian_requests.results %>
            <%= render :partial => 'request/request_listing_via_event', :locals => { :event => result[:model], :info_request => result[:model].info_request } %>
        <% end %>

        <%= will_paginate WillPaginate::Collection.new(@page, @per_page, @public_body.info_requests.size) %>

Only requests made using WhatDoTheyKnow.com are shown.

    <% end %>
<% else %>
    <% if @public_body.eir_only? %>

Environmental Information Regulations requests made

    <% else %>

Freedom of Information requests made

    <% end %>

The search index is currently offline, so we can't show the Freedom of Information requests that have been made to this authority.

<% end %>


Show component version numbers in admin interface.

<% @title = "Debug" %>

<%=@title%>

You are <%= h @http_auth_user %>

Version numbers

Rails::VERSION::STRING <%=Rails::VERSION::STRING%>

TMail::VERSION::STRING <%=TMail::VERSION::STRING%>

Xapian::version_string <%=Xapian::version_string%>

Environment variables

<%= @request_env.to_yaml %>

Parameters

<%= params.to_yaml %>

Session

<%= session.to_yaml %>

<% @title = "Debug" %>

<%=@title%>

You are <%= h @http_auth_user %>

Environment variables

<%= @request_env.to_yaml %>

Parameters

<%= params.to_yaml %>

Session

<%= session.to_yaml %>


git-svn-id: https://riposte.googlecode.com/svn/trunk@15 c93d8143-eb44-0410-8798-7b17b0fd9f9b

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

    <title><%= h(@title) %></title>

    <link rel="stylesheet" type="text/css" href="/css/prettify.css" media="screen,print,projection" />
    <link rel="stylesheet" type="text/css" href="/css/wonko.css" media="screen,print,projection" />
    <% if check_auth %>
      <link rel="stylesheet" type="text/css" href="/css/admin.css" media="screen,print,projection" />
    <% end %>

    <meta name="geo.position" content="37.250691;-121.78952" />
    <meta name="geo.region" content="US-CA" />
    <meta name="geo.placename" content="San Jose, California" />

    <link rel="openid.server" href="http://www.myopenid.com/server" />
    <link rel="openid.delegate" href="http://wonko.myopenid.com/" />
    <meta http-equiv="X-XRDS-Location" content="http://wonko.myopenid.com/xrds" />

    <link rel="alternate" type="application/atom+xml" href="http://feeds.feedburner.com/wonko" title="Articles (Atom and RSS)" />

    <link rel="icon" href="/images/favicon.png" />
    <link rel="shortcut icon" href="/images/favicon.png" />

          <%= h(SITE_NAME) %>

<%= h(SITE_DESCRIPTION) %>

<%= A('Home',     :href => R(MainController)) %>

<%= A('About',    :href => R(PageController, :about)) %>

<%= A('Archives', :href => R(MainController, :archive, 2)) %>

<%= A('Comments', :href => R(MainController, :comments)) %>

        <%= render_template 'admin/toolbar' %>

          <%= @content %>

Other Stuff

Photos

<%= A('Videos',   :href => R(PageController, :videos),   :title => "Videos I've made") %>

<%= A('Software', :href => R(PageController, :software), :title => "Software I've written") %>

Search

              <form id="search" action="<%= R(MainController, :search) %>" method="get">

                  <input type="text" name="q" maxlength="255" value="<%= request[:q] ? h(request[:q]) : '' %>" />

              </form>

Flickr

Quickies

my del.icio.us

Feeds

                Articles

              Copyright © 2002-<%= Time.now.year %>
              <a href="mailto:<%= h(AUTHOR_EMAIL) %>"><%= h(AUTHOR_NAME) %>.
              All rights reserved.

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

    <title><%= h(@title) %></title>

    <link rel="stylesheet" type="text/css" href="/css/prettify.css" media="screen,print,projection" />
    <link rel="stylesheet" type="text/css" href="/css/wonko.css" media="screen,print,projection" />
    <% if check_auth %>
      <link rel="stylesheet" type="text/css" href="/css/admin.css" media="screen,print,projection" />
    <% end %>

    <meta name="geo.position" content="37.250691;-121.78952" />
    <meta name="geo.region" content="US-CA" />
    <meta name="geo.placename" content="San Jose, California" />

    <link rel="openid.server" href="http://www.myopenid.com/server" />
    <link rel="openid.delegate" href="http://wonko.myopenid.com/" />
    <meta http-equiv="X-XRDS-Location" content="http://wonko.myopenid.com/xrds" />

    <link rel="alternate" type="application/atom+xml" href="http://feeds.feedburner.com/wonko" title="Articles (Atom and RSS)" />

    <link rel="icon" href="/images/favicon.png" />
    <link rel="shortcut icon" href="/images/favicon.png" />

          <%= h(SITE_NAME) %>

<%= h(SITE_DESCRIPTION) %>

<%= A('Home',     :href => R(MainController)) %>

<%= A('About',    :href => R(PageController, :about)) %>

<%= A('Archives', :href => R(MainController, :archive, 2)) %>

<%= A('Comments', :href => R(MainController, :comments)) %>

        <%= render_template 'admin/toolbar' %>

          <%= @content %>

Other Stuff

Photos

<%= A('Videos',   :href => R(PageController, :videos),   :title => "Videos I've made") %>

<%= A('Software', :href => R(PageController, :software), :title => "Software I've written") %>

Search

              <form id="search" action="<%= R(MainController, :search) %>" method="get">

                  <input type="text" name="q" maxlength="255" value="<%= request[:q] ? h(request[:q]) : '' %>" />

              </form>

Flickr

Quickies

my del.icio.us

Feeds

                Articles

              Copyright © 2002-<%= Time.now.strftime('%Y') %>
              <a href="mailto:<%= h(AUTHOR_EMAIL) %>"><%= h(AUTHOR_NAME) %>.
              All rights reserved.


lose the unnecessary <% embed syntax %>

lose the unnecessary <% embed syntax %>

<% if OSM_STATUS == :database_offline or OSM_STATUS == :api_offline %>

The OpenStreetMap database is currently offline while
   essential database maintenance work is carried out.

<% elsif OSM_STATUS == :api_readonly %>

The OpenStreetMap database is currently in read-only mode while
   essential database maintenance work is carried out.

<% elsif !@user.data_public? %>

You haven't set your edits to be public.

You can't use the online editor unless you do so. You can set your edits as public from your
<%= link_to 'user page', {:controller => 'user', :action => 'account', :display_name => @user.display_name}%>.

(Find out why this is the case.)

<% else %>
<% content_for :greeting do %>
<% if @user and !@user.home_lon.nil? and !@user.home_lat.nil? %>
<%= link_to_function 'home', "setPosition(#{@user.home_lat}, #{@user.home_lon}, 10)" %> |
<% end %>
<% end %>

<%= render :partial => 'sidebar', :locals => { :onopen => "resizeMap();", :onclose => "resizeMap();" } %>
<%= render :partial => 'search' %>

<%
session[:token] = @user.tokens.create.token unless session[:token]

if params['mlon'] and params['mlat']
	lon =  h(params['mlon'])
	lat =  h(params['mlat'])
	zoom =  h(params['zoom'] || '14')

elsif @user and params['lon'].nil? and params['lat'].nil? and params['gpx'].nil?
	lon =  @user.home_lon
	lat =  @user.home_lat
	zoom = '14'
else
	lon =  h(params['lon'] || 'null')
	lat =  h(params['lat'] || 'null')
	zoom =  h(params['zoom'] || '14')
end
%>

	You need a Flash player to use Potlatch, the
    OpenStreetMap Flash editor. You can download Flash Player from Adobe.com.

    Several other options are also available
    for editing OpenStreetMap.

<%= javascript_include_tag 'swfobject.js' %>

<% end %>

<% if OSM_STATUS == :database_offline or OSM_STATUS == :api_offline %>

The OpenStreetMap database is currently offline while
   essential database maintenance work is carried out.

<% elsif OSM_STATUS == :api_readonly %>

The OpenStreetMap database is currently in read-only mode while
   essential database maintenance work is carried out.

<% elsif !@user.data_public? %>

You haven't set your edits to be public.

You can't use the online editor unless you do so. You can set your edits as public from your
<%= link_to 'user page', {:controller => 'user', :action => 'account', :display_name => @user.display_name}%>.

(Find out why this is the case.)

<% else %>
<% content_for :greeting do %>
<% if @user and !@user.home_lon.nil? and !@user.home_lat.nil? %>
<%= link_to_function 'home', "setPosition(#{@user.home_lat}, #{@user.home_lon}, 10)" %> |
<% end %>
<% end %>

<%= render :partial => 'sidebar', :locals => { :onopen => "resizeMap();", :onclose => "resizeMap();" } %>
<%= render :partial => 'search' %>

<% session[:token] = @user.tokens.create.token unless session[:token] %>

<% if params['mlon'] and params['mlat'] %>
	<% lon =  h(params['mlon']) %>
	<% lat =  h(params['mlat'])  %>
	<% zoom =  h(params['zoom'] || '14') %>
<% elsif @user and params['lon'].nil? and params['lat'].nil? and params['gpx'].nil? %>
	<% lon =  @user.home_lon %>
	<% lat =  @user.home_lat %>
	<% zoom = '14' %>
<% else %>
	<% lon =  h(params['lon'] || 'null') %>
	<% lat =  h(params['lat'] || 'null') %>
	<% zoom =  h(params['zoom'] || '14') %>
<% end %>

	You need a Flash player to use Potlatch, the
    OpenStreetMap Flash editor. You can download Flash Player from Adobe.com.

    Several other options are also available
    for editing OpenStreetMap.

<%= javascript_include_tag 'swfobject.js' %>

<% end %>


- Updated paths to Flash players in view media_asset_info.   Those players should be refactored into GUI classes.

  <% if Aurita.user.may_edit_content?(media_asset) then %>

      <%= gui.link_to(media_asset, :action => :update_section) { gui.icon_tag(:edit_button) } %>

  <% end %>

<%= media_asset.title.to_s %>

  <% if media_asset.is_video? then %>
    <embed
      src="/aurita/shared/mediaplayer.swf"
      width="420"
      height="350"
      allowscriptaccess="always"
      allowfullscreen="true"
      flashvars="width=420&height=350&file=/aurita/assets/asset_<%= media_asset.media_asset_id %>.<%= media_asset.extension %>"
    />

  <% elsif media_asset.extension == 'mp3' then %>

      <object type="application/x-shockwave-flash" data="/aurita/shared/mp3player.swf" width="200" height="20">
        <param name="movie" value="/aurita/mp3player.mp3" />
        <param name="bgcolor" value="#ffffff" />
        <param name="FlashVars" value="mp3=<%= media_asset.url %>" />
      </object>

  <% else %>
    <a href="<%= media_asset.url %>" target="_blank"
       style="float: left; margin-right: 4px; margin-bottom: 10px; background-color: #ffffff; text-align: center;  "
       <%= gui.context_menu(:entity => media_asset) %>
    >

        <div class="lore_text_button" style="float: left" onclick="Aurita.call('Media_Asset/perform_bookmark/media_asset_id=<%= media_asset.media_asset_id %>'); Element.toggle(this); "><%= tl(:bookmark_file) %>

        <div class="lore_text_button" style="float: left" onclick="resizeable_popup(500,500,'<%= media_asset.url %>');">+

        <img src="<%= media_asset.icon_path(:size => :medium) %>" />

  <% end %>

        <%= tl(:category) %>

        <%= media_asset.categories.map { |category| gui.link_to(category) { category.category_name } }.join(', ') %>

        <%= tl(:download) %>

        <a href="<%= media_asset.url %>" target="_blank"><%= "#{media_asset.title}.#{media_asset.extension.to_s}" %>

        <%= tl(:filetype) %>

        <%= media_asset.extension.upcase %>

        <%= tl(:filesize) %>

        <%= media_asset.filesize %>

  <% if !media_asset.description.empty? then %>

     <%= tl(:description) %>

       <%= media_asset.description %>

  <% end %>

  <% if articles && articles.length > 0 then %>

        <%= tl(:used_in_articles) %>

          <% articles.each do |article| %>

<%= gui.link_to(article) %>

          <% end %>

  <% end %>

        <%= tl(:uploaded_at) %>

      <%= Aurita::Datetime.new(media_asset.created).string("%d.%m.%Y - %H:%M:%S") + ' ' %>
      <%= tl(:by) + ' ' << gui.link_to(owner_user_group) { owner_user_group.label } if owner_user_group%>

        <%= tl(:last_changed_at) %>

        <%= Aurita::Datetime.new(media_asset.changed).string("%d.%m.%Y - %H:%M:%S") %>

        <%= tl(:source_folder) %>

        <%=
        asset_folder_path.map! { |f|
          f = gui.link_to(f) { f.physical_path }
        }
        asset_folder_path.join(' / ')
      %>

        <%= tl(:tags) %>

          <%= content_tags %>

<% if media_asset.extension == 'jpg' then %>

        Exif

          <%= link_to(media_asset, :action => :show_metadata, :element => :media_meta_data) { tl(:show) } %>

<% end %>

<% if media_asset.version.to_i > 0 then %>

<%= tl(:versions) %>

    <%= media_asset_versions %>

<% end %>

  <%= download_stats.string if download_stats %>

 <%= content_comments.string %>

  <% if Aurita.user.may_edit_content?(media_asset) then %>

      <%= gui.link_to(media_asset, :action => :update_section) { gui.icon_tag(:edit_button) } %>

  <% end %>

<%= media_asset.title.to_s %>

  <% if media_asset.is_video? then %>
    <embed
      src="/aurita/mediaplayer.swf"
      width="420"
      height="350"
      allowscriptaccess="always"
      allowfullscreen="true"
      flashvars="width=420&height=350&file=/aurita/assets/asset_<%= media_asset.media_asset_id %>.<%= media_asset.extension %>"
    />

  <% elsif media_asset.extension == 'mp3' then %>

      <object type="application/x-shockwave-flash" data="/aurita/mp3player.swf" width="200" height="20">
        <param name="movie" value="/aurita/mp3player.mp3" />
        <param name="bgcolor" value="#ffffff" />
        <param name="FlashVars" value="mp3=<%= media_asset.url %>" />
      </object>

  <% else %>
    <a href="<%= media_asset.url %>" target="_blank"
       style="float: left; margin-right: 4px; margin-bottom: 10px; background-color: #ffffff; text-align: center;  "
       <%= gui.context_menu(:entity => media_asset) %>
    >

        <div class="lore_text_button" style="float: left" onclick="Aurita.call('Media_Asset/perform_bookmark/media_asset_id=<%= media_asset.media_asset_id %>'); Element.toggle(this); "><%= tl(:bookmark_file) %>

        <div class="lore_text_button" style="float: left" onclick="resizeable_popup(500,500,'<%= media_asset.url %>');">+

        <img src="<%= media_asset.icon_path(:size => :medium) %>" />

  <% end %>

        <%= tl(:category) %>

        <%= media_asset.categories.map { |category| gui.link_to(category) { category.category_name } }.join(', ') %>

        <%= tl(:download) %>

        <a href="<%= media_asset.url %>" target="_blank"><%= "#{media_asset.title}.#{media_asset.extension.to_s}" %>

        <%= tl(:filetype) %>

        <%= media_asset.extension.upcase %>

        <%= tl(:filesize) %>

        <%= media_asset.filesize %>

  <% if !media_asset.description.empty? then %>

     <%= tl(:description) %>

       <%= media_asset.description %>

  <% end %>

  <% if articles && articles.length > 0 then %>

        <%= tl(:used_in_articles) %>

          <% articles.each do |article| %>

<%= gui.link_to(article) %>

          <% end %>

  <% end %>

        <%= tl(:uploaded_at) %>

      <%= Aurita::Datetime.new(media_asset.created).string("%d.%m.%Y - %H:%M:%S") + ' ' %>
      <%= tl(:by) + ' ' << gui.link_to(owner_user_group) { owner_user_group.label } if owner_user_group%>

        <%= tl(:last_changed_at) %>

        <%= Aurita::Datetime.new(media_asset.changed).string("%d.%m.%Y - %H:%M:%S") %>

        <%= tl(:source_folder) %>

        <%=
        asset_folder_path.map! { |f|
          f = gui.link_to(f) { f.physical_path }
        }
        asset_folder_path.join(' / ')
      %>

        <%= tl(:tags) %>

          <%= content_tags %>

<% if media_asset.extension == 'jpg' then %>

        Exif

          <%= link_to(media_asset, :action => :show_metadata, :element => :media_meta_data) { tl(:show) } %>

<% end %>

<% if media_asset.version.to_i > 0 then %>

<%= tl(:versions) %>

    <%= media_asset_versions %>

<% end %>

  <%= download_stats.string if download_stats %>

 <%= content_comments.string %>


make extra elements on costing show up

make extra elements on costing show up

<%= stylesheet_link_tag 'list'  %>
<%-
  # Set cost items load here.  It's not the cleanest to do this in a view, but since it's a special
  # magic page there's no better spot.

  @cost_items = @profile.all_cost_items(@eg)
  @cost_items.sort!
  @opted = Hash[*@cost_items.collect{ |ci| [ci.id, !ci.optins.find_by_profile_id(@profile).nil?] }.flatten]
  @total, *@sums = @profile.calculate_sums(@cost_items)
%>

<%= render :file => "optin_cost_items/list" %>
<%= render :partial => 'instance/elements' %>


Fixed bug - bat list not displaying when no one is logged in.

<%= flash[:bat_notice] %>

<% if bat_list && !bat_list.empty? %>

        <%= link_to_remote( "Med",
          :update => 'bats_div',
          :url =>{ :controller => :bats, :action => :sort_by_med,
            :ids => bat_list,
            :show_leave_date_and_reason => show_leave_date_and_reason,
            :show_weigh_link => show_weigh_link}) %>

        <%= link_to_remote( "Band",
          :update => 'bats_div',
          :url =>{ :controller => :bats, :action => :sort_by_band,
            :ids => bat_list,
            :show_leave_date_and_reason => show_leave_date_and_reason,
            :show_weigh_link => show_weigh_link}) %>

        <%= link_to_remote( "Cage",
          :update => 'bats_div',
          :url =>{ :controller => :bats, :action => :sort_by_cage,
            :ids => bat_list,
            :show_leave_date_and_reason => show_leave_date_and_reason,
            :show_weigh_link => show_weigh_link}) %>

        <%= link_to_remote( "Species",
          :update => 'bats_div',
          :url =>{ :controller => :bats, :action => :sort_by_species,
            :ids => bat_list,
            :show_leave_date_and_reason => show_leave_date_and_reason,
            :show_weigh_link => show_weigh_link}) %>

        <%= link_to_remote( "Sex",
          :update => 'bats_div',
          :url =>{ :controller => :bats, :action => :sort_by_gender,
            :ids => bat_list,
            :show_leave_date_and_reason => show_leave_date_and_reason,
            :show_weigh_link => show_weigh_link}) %>

        <%= link_to_remote( "Weight",
          :update => 'bats_div',
          :url =>{ :controller => :bats, :action => :sort_by_weight,
            :ids => bat_list,
            :show_leave_date_and_reason => show_leave_date_and_reason,
            :show_weigh_link => show_weigh_link}) %>

        <%= link_to_remote( "Weigh Date",
          :update => 'bats_div',
          :url =>{ :controller => :bats, :action => :sort_by_weigh_date,
            :ids => bat_list,
            :show_leave_date_and_reason => show_leave_date_and_reason,
            :show_weigh_link => show_weigh_link}) %>

        <%= link_to_remote( "Last Flown",
          :update => 'bats_div',
          :url =>{ :controller => :bats, :action => :sort_by_last_flown,
            :ids => bat_list,
            :show_leave_date_and_reason => show_leave_date_and_reason,
            :show_weigh_link => show_weigh_link}) %>

        <%= link_to_remote( "Sx",
          :update => 'bats_div',
          :url =>{ :controller => :bats, :action => :sort_by_sx,
            :ids => bat_list,
            :show_leave_date_and_reason => show_leave_date_and_reason,
            :show_weigh_link => show_weigh_link}) %>

        <%= link_to_remote("Protocols",
          :update => 'bats_div',
          :url =>{ :controller => :bats, :action => :sort_by_protocols,
            :ids => bat_list,
            :show_leave_date_and_reason => show_leave_date_and_reason,
            :show_weigh_link => show_weigh_link}) %>

        <%= link_to_remote( "Collected",
          :update => 'bats_div',
          :url =>{ :controller => :bats, :action => :sort_by_collected,
            :ids => bat_list,
            :show_leave_date_and_reason => show_leave_date_and_reason,
            :show_weigh_link => show_weigh_link}) %>

      <% if show_leave_date_and_reason %>

          <%= link_to_remote( "Leave Date",
            :update => 'bats_div',
            :url =>{ :controller => :bats, :action => :sort_by_deactivation_date,
              :ids => bat_list,
              :show_leave_date_and_reason => show_leave_date_and_reason,
              :show_weigh_link => show_weigh_link}) %>

        Leave Reason
      <% end %>

      <% users_length = ((bat_list.collect{|b| b.user}).uniq).length %>
      <% session[:person] ? current_user = User.find(session[:person]) : current_user = nil %>

      <% for bat in bat_list %>

            <%= users_length > 1 && (bat.user == current_user) ? '>' : '' %>

            <%= bat.medical_problems.current.empty? ? '' : link_to(image_tag("med.svg"),
              :controller => :medical_problems, :action => :list,
              :medical_problems => bat.medical_problems.current) %>

          <% if show_weigh_link %>
            <%= button_to bat.band, :controller => :bats, :action => :weigh_bat, :id => bat %>
          <% else %>
            <%= link_to bat.band, :controller => :bats, :action => :show, :id => bat %>
          <% end %>

            <% if bat.cage %>
              <%= link_to bat.cage.name, :controller => 'cages', :action => 'show', :id => bat.cage %>
            <% else %>
              <%= 'Inactive' %>
            <% end %>

          <% if bat.species %><%= link_to bat.species.name, :controller=>:species, :action=>:show, :id=>bat.species %><% end %>
          <%=h bat.gender %>

          <% if bat.weights.length > 0 %>
            <%=h bat.weights.recent.weight %> g

              <span style="<%= !bat.weighed_enough?(Date.today) ? "color:red" : '' %>">
                <%= nice_date_no_year bat.weights.recent.date %>

          <% else %>
            N/A
            N/A
          <% end %>

            <% if bat.flights.empty? %>
              N/A
            <% else %>
              <span style="<%= !bat.flown_enough?(Date.today,3) ? "color:red" : '' %>">
                [<%= link_to(nice_date_no_year(bat.flights[-1].date), :controller=>:flights, :action=>:show, :id=>bat) %>]

            <% end %>

            <%=h bat.surgeries.length %>

            <%=h bat.protocols.length > 0 ?
              link_to(bat.protocols.collect{|p| p.number}.to_sentence, :controller=>:protocols, :action=>:index,:ids=> bat.protocols) :
              bat.protocols.length %>

          <%=h bat.collection_date.strftime("%Y") %>
          <% if show_leave_date_and_reason %>

              <%=h nice_date_no_day(bat.leave_date) %>

              <%=h bat.leave_reason %>

          <% end %>
          <% if !show_weigh_link %>
            <%= button_to 'Edit', {:controller=>:bats, :action => 'edit', :id => bat} %>

              <% if bat.leave_date == nil %>
                <%= button_to 'Deactivate', {:controller=>:bats, :action => 'deactivate', :id => bat } %>
              <% else %>
                <%=  button_to 'Reactivate', {:controller=>:bats, :action => 'reactivate', :id => bat } %>
              <% end %>

          <% end %>
          <% if bat.cage != nil && !show_weigh_link %>
            <%= button_to 'Move', {:controller => :bats, :action=>:single_bat_to_move, :id=>bat} %>
          <% end %>
          <% if bat.leave_date == nil %>
            <%= show_weigh_link ? '' : (button_to 'Weigh', {:controller => :bats, :action => 'weigh_bat', :id => bat}) %>
          <% end %>
          <% if bat.leave_date == nil %>

              <% if bat.flown_on(Date.today) == false %>
                <%= button_to 'Fly', {:controller => :flights, :action=>:new, :bat=>bat} %>
              <% else %>
                <%= button_to 'Flights', {:controller => :flights, :action=>:show, :id=>bat} %>
              <% end %>

          <% end %>

      <% end %>

  <% else %>
    No bats
  <% end %>

<%= flash[:bat_notice] %>

<% if bat_list && !bat_list.empty? %>

        <%= link_to_remote( "Med",
          :update => 'bats_div',
          :url =>{ :controller => :bats, :action => :sort_by_med,
            :ids => bat_list,
            :show_leave_date_and_reason => show_leave_date_and_reason,
            :show_weigh_link => show_weigh_link}) %>

        <%= link_to_remote( "Band",
          :update => 'bats_div',
          :url =>{ :controller => :bats, :action => :sort_by_band,
            :ids => bat_list,
            :show_leave_date_and_reason => show_leave_date_and_reason,
            :show_weigh_link => show_weigh_link}) %>

        <%= link_to_remote( "Cage",
          :update => 'bats_div',
          :url =>{ :controller => :bats, :action => :sort_by_cage,
            :ids => bat_list,
            :show_leave_date_and_reason => show_leave_date_and_reason,
            :show_weigh_link => show_weigh_link}) %>

        <%= link_to_remote( "Species",
          :update => 'bats_div',
          :url =>{ :controller => :bats, :action => :sort_by_species,
            :ids => bat_list,
            :show_leave_date_and_reason => show_leave_date_and_reason,
            :show_weigh_link => show_weigh_link}) %>

        <%= link_to_remote( "Sex",
          :update => 'bats_div',
          :url =>{ :controller => :bats, :action => :sort_by_gender,
            :ids => bat_list,
            :show_leave_date_and_reason => show_leave_date_and_reason,
            :show_weigh_link => show_weigh_link}) %>

        <%= link_to_remote( "Weight",
          :update => 'bats_div',
          :url =>{ :controller => :bats, :action => :sort_by_weight,
            :ids => bat_list,
            :show_leave_date_and_reason => show_leave_date_and_reason,
            :show_weigh_link => show_weigh_link}) %>

        <%= link_to_remote( "Weigh Date",
          :update => 'bats_div',
          :url =>{ :controller => :bats, :action => :sort_by_weigh_date,
            :ids => bat_list,
            :show_leave_date_and_reason => show_leave_date_and_reason,
            :show_weigh_link => show_weigh_link}) %>

        <%= link_to_remote( "Last Flown",
          :update => 'bats_div',
          :url =>{ :controller => :bats, :action => :sort_by_last_flown,
            :ids => bat_list,
            :show_leave_date_and_reason => show_leave_date_and_reason,
            :show_weigh_link => show_weigh_link}) %>

        <%= link_to_remote( "Sx",
          :update => 'bats_div',
          :url =>{ :controller => :bats, :action => :sort_by_sx,
            :ids => bat_list,
            :show_leave_date_and_reason => show_leave_date_and_reason,
            :show_weigh_link => show_weigh_link}) %>

        <%= link_to_remote("Protocols",
          :update => 'bats_div',
          :url =>{ :controller => :bats, :action => :sort_by_protocols,
            :ids => bat_list,
            :show_leave_date_and_reason => show_leave_date_and_reason,
            :show_weigh_link => show_weigh_link}) %>

        <%= link_to_remote( "Collected",
          :update => 'bats_div',
          :url =>{ :controller => :bats, :action => :sort_by_collected,
            :ids => bat_list,
            :show_leave_date_and_reason => show_leave_date_and_reason,
            :show_weigh_link => show_weigh_link}) %>

      <% if show_leave_date_and_reason %>

          <%= link_to_remote( "Leave Date",
            :update => 'bats_div',
            :url =>{ :controller => :bats, :action => :sort_by_deactivation_date,
              :ids => bat_list,
              :show_leave_date_and_reason => show_leave_date_and_reason,
              :show_weigh_link => show_weigh_link}) %>

        Leave Reason
      <% end %>

      <% users_length = ((bat_list.collect{|b| b.user}).uniq).length %>
      <% current_user = User.find(session[:person]) %>

      <% for bat in bat_list %>

            <%= users_length > 1 && (bat.user == current_user) ? '>' : '' %>

            <%= bat.medical_problems.current.empty? ? '' : link_to(image_tag("med.svg"),
              :controller => :medical_problems, :action => :list,
              :medical_problems => bat.medical_problems.current) %>

          <% if show_weigh_link %>
            <%= button_to bat.band, :controller => :bats, :action => :weigh_bat, :id => bat %>
          <% else %>
            <%= link_to bat.band, :controller => :bats, :action => :show, :id => bat %>
          <% end %>

            <% if bat.cage %>
              <%= link_to bat.cage.name, :controller => 'cages', :action => 'show', :id => bat.cage %>
            <% else %>
              <%= 'Inactive' %>
            <% end %>

          <% if bat.species %><%= link_to bat.species.name, :controller=>:species, :action=>:show, :id=>bat.species %><% end %>
          <%=h bat.gender %>

          <% if bat.weights.length > 0 %>
            <%=h bat.weights.recent.weight %> g

              <span style="<%= !bat.weighed_enough?(Date.today) ? "color:red" : '' %>">
                <%= nice_date_no_year bat.weights.recent.date %>

          <% else %>
            N/A
            N/A
          <% end %>

            <% if bat.flights.empty? %>
              N/A
            <% else %>
              <span style="<%= !bat.flown_enough?(Date.today,3) ? "color:red" : '' %>">
                [<%= link_to(nice_date_no_year(bat.flights[-1].date), :controller=>:flights, :action=>:show, :id=>bat) %>]

            <% end %>

            <%=h bat.surgeries.length %>

            <%=h bat.protocols.length > 0 ?
              link_to(bat.protocols.collect{|p| p.number}.to_sentence, :controller=>:protocols, :action=>:index,:ids=> bat.protocols) :
              bat.protocols.length %>

          <%=h bat.collection_date.strftime("%Y") %>
          <% if show_leave_date_and_reason %>

              <%=h nice_date_no_day(bat.leave_date) %>

              <%=h bat.leave_reason %>

          <% end %>
          <% if !show_weigh_link %>
            <%= button_to 'Edit', {:controller=>:bats, :action => 'edit', :id => bat} %>

              <% if bat.leave_date == nil %>
                <%= button_to 'Deactivate', {:controller=>:bats, :action => 'deactivate', :id => bat } %>
              <% else %>
                <%=  button_to 'Reactivate', {:controller=>:bats, :action => 'reactivate', :id => bat } %>
              <% end %>

          <% end %>
          <% if bat.cage != nil && !show_weigh_link %>
            <%= button_to 'Move', {:controller => :bats, :action=>:single_bat_to_move, :id=>bat} %>
          <% end %>
          <% if bat.leave_date == nil %>
            <%= show_weigh_link ? '' : (button_to 'Weigh', {:controller => :bats, :action => 'weigh_bat', :id => bat}) %>
          <% end %>
          <% if bat.leave_date == nil %>

              <% if bat.flown_on(Date.today) == false %>
                <%= button_to 'Fly', {:controller => :flights, :action=>:new, :bat=>bat} %>
              <% else %>
                <%= button_to 'Flights', {:controller => :flights, :action=>:show, :id=>bat} %>
              <% end %>

          <% end %>

      <% end %>

  <% else %>
    No bats
  <% end %>


* Added Google Analytics
* Updated header

git-svn-id: b6390d97d9ded5bc793696aad9e4256efc0f90b3@445 561dde7e-7729-0410-be8e-ef83869d6c7d

<!DOCTYPE html
    PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "DTD/xhtml1-strict.dtd">

  <title>ActiveScaffold :: Demo</title>
  <%= javascript_include_tag :defaults, "code_highlighter/code_highlighter", "code_highlighter/ruby" %>
  <%= active_scaffold_includes %>
  <%= stylesheet_link_tag "reset", "main", :media => 'all' %>

ActiveScaffold

A Ruby on Rails plugin from the makers of AjaxScaffold

Home

Documentation

Team

Help

Contribute

Blog

Demo

        Latest release is rc2:

          download |
          svn

      <%= render :partial => "layouts/menu" if @menu %>
      <%= render :partial => "layouts/jump" %>

    <%= yield %>

Source

      <%= render :partial => "demo/source" %>

  <% unless request.host.scan('activescaffold.com').empty? -%>

  <% end -%>

<!DOCTYPE html
    PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "DTD/xhtml1-strict.dtd">

  <title>ActiveScaffold :: Demo</title>
  <%= javascript_include_tag :defaults, "code_highlighter/code_highlighter", "code_highlighter/ruby" %>
  <%= active_scaffold_includes %>
  <%= stylesheet_link_tag "reset", "main", :media => 'all' %>

ActiveScaffold

A Ruby on Rails plugin from the makers of AjaxScaffold

Home

Documentation

Team

Blog

Demo

Forum

Issues / Bugs

        Latest release is rc1:

          download |
          svn

      <%= render :partial => "layouts/menu" if @menu %>
      <%= render :partial => "layouts/jump" %>

    <%= yield %>

Source

      <%= render :partial => "demo/source" %>


Reviews should handle the case where a student/team has been removed as a participant, but the review mapping which includes them as an author has not been removed. A simple logic check was enough to resolve this, but a better approach would be to automatically remove review mappings when the participant/team is removed.

git-svn-id: f67d969b640da65cb7bc1d229e09fd6d2db44ae1@512 392d7b7b-3f31-0410-9dc3-c95a9635ea79

<% session[:return_to] = request.request_uri %>
<% if flash[:notice] != nil and flash[:notice].strip != "" %>

	<%= flash[:notice] %>

<% end %>

Reviews for <%= @assignment.name %>

  <%review_no = 1%>
  <%for review_map in @review_mapping %>
  <% if @assignment.team_assignment
       author = AssignmentTeam.find(review_map.team_id)
     else
       author = AssignmentParticipant.find_by_user_id_and_parent_id(review_map.author_id,@assignment.id)
     end
     if author != nil %>
    <% @review = Review.find_by_review_mapping_id(review_map.id) %>
    <% if (@review)%>

<%= Assignment.find_by_id(review_map.assignment_id).name %> Review <%= review_no%>  <%= link_to "View",{:controller => 'review', :action => 'view_review', :id => @review.id} %>
      <% if StudentAssignmentHelper::get_current_stage(@assignment.id) != "Complete" %>
     	<%= link_to "Edit",{:controller => 'review', :action => 'edit_review', :id => @review.id} %>

      <% end %>
    <% else %>
  	  <% if StudentAssignmentHelper::get_current_stage(@assignment.id) != "Complete" %>

<%= Assignment.find_by_id(review_map.assignment_id).name %> Review <%=review_no%>  <%= link_to "Begin",{:controller => 'review', :action => 'new_review', :id => review_map.id, :assignment => @assignment_id} %>

  	  <% else %>

<%= Assignment.find_by_id(review_map.assignment_id).name %> Review <%=review_no%>  Begin

  	  <% end
     end
    review_no += 1
   end
  end %>

 <% if @can_view_metareview == true && @review_of_review_mappings.size > 0 %>

Reviews of reviews for <%= @assignment.name %>

  <%ror_no = 1%>
  <%for ror_map in @review_of_review_mappings %>
  <%
  @ror = ReviewOfReview.find_by_review_of_review_mapping_id(ror_map.id)
  %>
  <% if (@ror)%>

<%= Assignment.find_by_id(review_map.assignment_id).name %> Review of Review <%=ror_no%>  <%= link_to "View",{:controller => 'review_of_review', :action => 'view', :id => @ror.id} %>
  <% if StudentAssignmentHelper::get_current_stage(@assignment.id) != "Complete" %>
	  <%= link_to "Edit",{:controller => 'review_of_review', :action => 'edit', :id => @ror.id} %>

  <% end %>

  <% else %>
	<% if StudentAssignmentHelper::get_current_stage(@assignment.id) != "Complete" %>

<%= Assignment.find_by_id(review_map.assignment_id).name %> Review of Review <%=ror_no%>  <%= link_to "Begin",{:controller => 'review_of_review', :action => 'new', :id => ror_map.id, :assignment => @assignment_id} %>

	<%else%>

<%= Assignment.find_by_id(review_map.assignment_id).name %> Review of Review <%=ror_no%>  Begin

	<%end%>
  <% end %>
  <%ror_no += 1
  end %>

<%end%>

<%= link_to "Back", :controller=>'student_assignment', :action => 'view_actions', :id => @student.id %>

<% session[:return_to] = request.request_uri %>
<% if flash[:notice] != nil and flash[:notice].strip != "" %>

	<%= flash[:notice] %>

<% end %>

Reviews for <%= @assignment.name %>

  <%review_no = 1%>
  <%for review_map in @review_mapping %>
  <% @review = Review.find_by_review_mapping_id(review_map.id) %>
  <% if (@review)%>

<%= Assignment.find_by_id(review_map.assignment_id).name %> Review <%= review_no%>  <%= link_to "View",{:controller => 'review', :action => 'view_review', :id => @review.id} %>
  <% if StudentAssignmentHelper::get_current_stage(@assignment.id) != "Complete" %>
  	<%= link_to "Edit",{:controller => 'review', :action => 'edit_review', :id => @review.id} %>

  <% end %>
  <% else %>
  	<% if StudentAssignmentHelper::get_current_stage(@assignment.id) != "Complete" %>

<%= Assignment.find_by_id(review_map.assignment_id).name %> Review <%=review_no%>  <%= link_to "Begin",{:controller => 'review', :action => 'new_review', :id => review_map.id, :assignment => @assignment_id} %>

  	<% else %>

<%= Assignment.find_by_id(review_map.assignment_id).name %> Review <%=review_no%>  Begin

  	<% end %>
  <% end %>
  <%review_no += 1
  end %>

 <% if @can_view_metareview == true && @review_of_review_mappings.size > 0 %>

Reviews of reviews for <%= @assignment.name %>

  <%ror_no = 1%>
  <%for ror_map in @review_of_review_mappings %>
  <%
  @ror = ReviewOfReview.find_by_review_of_review_mapping_id(ror_map.id)
  %>
  <% if (@ror)%>

<%= Assignment.find_by_id(review_map.assignment_id).name %> Review of Review <%=ror_no%>  <%= link_to "View",{:controller => 'review_of_review', :action => 'view', :id => @ror.id} %>
  <% if StudentAssignmentHelper::get_current_stage(@assignment.id) != "Complete" %>
	  <%= link_to "Edit",{:controller => 'review_of_review', :action => 'edit', :id => @ror.id} %>

  <% end %>

  <% else %>
	<% if StudentAssignmentHelper::get_current_stage(@assignment.id) != "Complete" %>

<%= Assignment.find_by_id(review_map.assignment_id).name %> Review of Review <%=ror_no%>  <%= link_to "Begin",{:controller => 'review_of_review', :action => 'new', :id => ror_map.id, :assignment => @assignment_id} %>

	<%else%>

<%= Assignment.find_by_id(review_map.assignment_id).name %> Review of Review <%=ror_no%>  Begin

	<%end%>
  <% end %>
  <%ror_no += 1
  end %>

<%end%>

<%= link_to "Back", :controller=>'student_assignment', :action => 'view_actions', :id => @student.id %>


Fix URL.

Fix URL.

<% @title = "User - " + h(@admin_user.name) %>

<%=@title%>

Id: <%= @admin_user.id%>

<% for column in User.content_columns %>
    <%= column.human_name %>:
    <% if column.name == 'email' %>
        <a href="mailto:<%=h @admin_user.email %>"><%=h @admin_user.email%>
    <% else %>
        <%=h @admin_user.send(column.name) %>
    <% end %>

<% end %>

    <%= link_to 'Public page', main_url(user_url(@admin_user)) %>
    | <%= link_to 'Edit', '../edit/' + @admin_user.id.to_s %>
    | <%= link_to 'Log in as this user', '../login_as/' + @admin_user.id.to_s %> (also confirms their email)

Track things

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

Post redirects

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

<% for post_redirect in @admin_user.post_redirects.find(:all, :order => 'created_at desc') %>
  <tr class="<%= cycle('odd', 'even') %>">
  <%=h post_redirect.id %>
  <% for column in PostRedirect.content_columns.map { |c| c.name } %>
    <% if column == 'email_token' %>
    <%=link_to post_redirect.send(column), main_url(confirm_url(:email_token => post_redirect.send(column))) %>
    <% else %>
    <%=h post_redirect.send(column) %>
    <% end %>
  <% end %>

<% end %>

Requests

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

<% @title = "User - " + h(@admin_user.name) %>

<%=@title%>

Id: <%= @admin_user.id%>

<% for column in User.content_columns %>
    <%= column.human_name %>:
    <% if column.name == 'email' %>
        <a href="mailto:<%=h @admin_user.email %>"><%=h @admin_user.email%>
    <% else %>
        <%=h @admin_user.send(column.name) %>
    <% end %>

<% end %>

    <%= link_to 'Public page', main_url(user_url(@admin_user)) %>
    | <%= link_to 'Edit', '../edit/' + @admin_user.id.to_s %>
    | <%= link_to 'Log in as this user', '../login_as/' + @admin_user.id.to_s %> (also confirms their email)

Track things

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

Post redirects

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

<% for post_redirect in @admin_user.post_redirects.find(:all, :order => 'created_at desc') %>
  <tr class="<%= cycle('odd', 'even') %>">
  <%=h post_redirect.id %>
  <% for column in PostRedirect.content_columns.map { |c| c.name } %>
    <% if column == 'email_token' %>
    <%=link_to post_redirect.send(column), confirm_url(:email_token => post_redirect.send(column)) %>
    <% else %>
    <%=h post_redirect.send(column) %>
    <% end %>
  <% end %>

<% end %>

Requests

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


fixed conditional for highlighting the sharing form when it has errors

<% set_parameters_for_sharing_form %>
<%# 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]", "" -%>

<%="
" if !@resource.errors.empty? and !@policy.valid? %>

    <%= 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.

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

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)

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 -%>" />
            - Selected projects:

             <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)) -%>
             </select>
             and all <%= Seek::Config.project_name %> users:
             <%= 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 => @access_mode, :access_type_options=>[Policy::NO_ACCESS,Policy::VISIBLE,Policy::ACCESSIBLE,Policy::EDITING] } -%>

          <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 } -%>

    <%= link_to_function "Advanced sharing " + expand_image, :class => 'advanced_sharing_link', :style => "display:" + (@policy.permissions.empty? ? 'block;' : 'none;'), :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 sharing " + collapse_image, :class => 'advanced_sharing_link', :style => "display:" + (@policy.permissions.empty? ? 'none;' : 'block;'), :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:<%= @policy.permissions.empty? ? 'none;' : 'block;'-%>">

Define more fine-grained sharing

              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);" -%>

Also include people in my..

              <input 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 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) -%>

<%="
" if !@resource.errors.empty? and !@policy.valid? %>

<% set_parameters_for_sharing_form %>
<%# 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]", "" -%>

<%="
" unless @policy.valid? %>

    <%= 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.

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

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)

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 -%>" />
            - Selected projects:

             <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)) -%>
             </select>
             and all <%= Seek::Config.project_name %> users:
             <%= 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 => @access_mode, :access_type_options=>[Policy::NO_ACCESS,Policy::VISIBLE,Policy::ACCESSIBLE,Policy::EDITING] } -%>

          <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 } -%>

    <%= link_to_function "Advanced sharing " + expand_image, :class => 'advanced_sharing_link', :style => "display:" + (@policy.permissions.empty? ? 'block;' : 'none;'), :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 sharing " + collapse_image, :class => 'advanced_sharing_link', :style => "display:" + (@policy.permissions.empty? ? 'none;' : 'block;'), :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:<%= @policy.permissions.empty? ? 'none;' : 'block;'-%>">

Define more fine-grained sharing

              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);" -%>

Also include people in my..

              <input 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 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 @policy.valid? %>


[project @ example: use 'Relying Party' in a few more places]

<title>Rails OpenID Example Relying Party</title>

Rails OpenID Example Relying Party

    <% if flash[:alert] %>

       <%= h(flash[:alert]) %>

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

       <%= h(flash[:error]) %>

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

       <%= h(flash[:success]) %>

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

      <%= flash[:sreg_results] %>

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

      <%= flash[:pape_results] %>

    <% end %>

      <form method="get" accept-charset="UTF-8"
            action='<%= url_for :action => 'start' %>'>
        Identifier:
        <input type="text" class="openid" name="openid_identifier" />
        <input type="submit" value="Verify" />

        <input type="checkbox" name="immediate" id="immediate" />Use immediate mode

        <input type="checkbox" name="use_sreg" id="use_sreg" />Request registration data

        <input type="checkbox" name="use_pape" id="use_pape" />Request phishing-resistent auth policy (PAPE)

        <input type="checkbox" name="force_post" id="force_post" />Force the transaction to use POST by adding 2K of extra data
      </form>

<title>Rails OpenID Example Consumer</title>

Rails OpenID Example Consumer

    <% if flash[:alert] %>

       <%= h(flash[:alert]) %>

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

       <%= h(flash[:error]) %>

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

       <%= h(flash[:success]) %>

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

      <%= flash[:sreg_results] %>

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

      <%= flash[:pape_results] %>

    <% end %>

      <form method="get" accept-charset="UTF-8"
            action='<%= url_for :action => 'start' %>'>
        Identifier:
        <input type="text" class="openid" name="openid_identifier" />
        <input type="submit" value="Verify" />

        <input type="checkbox" name="immediate" id="immediate" />Use immediate mode

        <input type="checkbox" name="use_sreg" id="use_sreg" />Request registration data

        <input type="checkbox" name="use_pape" id="use_pape" />Request phishing-resistent auth policy (PAPE)

        <input type="checkbox" name="force_post" id="force_post" />Force the transaction to use POST by adding 2K of extra data
      </form>


ActionItem1052: clearing the float space after the media panel

<%= error_messages_for 'article' %>

<div class='<%= (environment.enabled?('media_panel') ? 'with_media_panel' : 'no_media_panel') %>'>
<% labelled_form_for 'article', @article, :html => { :multipart => true } do |f| %>

  <%= hidden_field_tag("type", @type) if @type %>

  <%= hidden_field_tag('parent_id', @parent_id) if @parent_id %>

  <%= hidden_field_tag('back_to', @back_to) %>

  <%= render :partial => partial_for_class(@article.class), :locals => { :f => f } %>

  <% if environment.is_portal_community?(profile) %>

      <%= check_box(:article, :highlighted) %>
      <%= _('Highlight this article')%>

  <% end %>

  <% button_bar do %>
    <%= submit_button :save, _('Save') %>
  <% end %>

    <%= lightbox_button :help, _('Why categorize?'), :action => 'why_categorize' %>

  <%= select_categories(:article, _('Categorize your article')) %>

  <%= f.text_field('tag_list', :size => 64) %>
  <%= content_tag( 'small', _('Separate tags with commas') ) %>

    <%= options_for_article(@article) %>

  <% button_bar do %>
    <%= submit_button :save, _('Save') %>
    <% if @back_url %>
      <%= button :cancel, _('Cancel'), @back_url %>
    <% elsif @parent_id || @article.parent %>
      <%= button :cancel, _('Cancel'), :action => 'view', :id => @parent_id || @article.parent %>
    <% else %>
      <%= button :cancel, _('Cancel'), :action => 'index' %>
    <% end %>
  <% end %>
<% end %>

<% if environment.enabled?('media_panel') && [TinyMceArticle, Event, EnterpriseHomepage].any?{|klass| @article.kind_of?(klass)} %>
  <%= render :partial => 'media_listing' %>
<% end %>


Hrrm, like this ...

Hrrm, like this ...

<% @page_title = 'Skapar ny sida' -%>

Skapa ny sida

<% form_for :page do |page| -%>

Titel
<%= page.text_field :title, :maxlength => 35, :size => 35  %>
<%= error_message_on @page, :title %>

Innehåll
<%= page.text_area :content, :cols => 84, :rows => 20  %>

Kommentar
<%= page.text_field :comment, :maxlength => 74, :size => 50 %>

  <%= submit_tag 'Skapa sida' %>
	eller
  <%= link_to 'Avbryt', :action => 'list' %>

Sidbeskrivning
<%= page.text_area :description, :cols => 50, :rows => 3 %>

Formatering
<%= page.select :markup, markups_available %>

<% end -%>

<% @page_title = 'Skapar ny sida' -%>

Skapa ny sida

<% form_for :page do |page| -%>

Titel
<%= page.text_field :title, :maxlength => 35, :size => 35  %>
<%= error_message_on @page, :title %>

Innehåll
<%= page.text_area :content, :cols => 84, :rows => 20  %>

  <%= submit_tag 'Skapa sida' %>
	eller
  <%= link_to 'Avbryt', :action => 'list' %>

Kommentar
<%= page.text_field :comment, :maxlength => 74, :size => 50 %>

Sidbeskrivning
<%= page.text_area :description, :cols => 50, :rows => 3 %>

Formatering
<%= page.select :markup, markups_available %>

<% end -%>


Handle the case of a comment on an external request.

<% if @highlight_words.nil?
      @highlight_words = []
end %>

        <% if event.is_incoming_message? %>
            <%= link_to highlight_words(info_request.title, @highlight_words), incoming_message_url(event.incoming_message_selective_columns("incoming_messages.id")) %>
        <% elsif event.is_outgoing_message? and event.event_type == 'followup_sent' %>
            <%= link_to highlight_words(info_request.title, @highlight_words), outgoing_message_url(event.outgoing_message) %>
        <% elsif event.is_comment? %>
            <%= link_to highlight_words(info_request.title, @highlight_words), comment_url(event.comment) %>
        <% else %>
            <%= link_to highlight_words(info_request.title, @highlight_words), request_url(info_request) %>
        <% end %>

        <% if event.event_type == 'sent' %>
            <%= _('Request sent to {{public_body_name}} by {{info_request_user}} on {{date}}.',:public_body_name=>public_body_link_absolute(info_request.public_body),:info_request_user=>request_user_link_absolute(info_request),:date=>simple_date(event.created_at )) %>
        <% elsif event.event_type == 'followup_sent' %>
            <%=event.display_status %>
            <%= _('sent to {{public_body_name}} by {{info_request_user}} on {{date}}.',:public_body_name=>public_body_link_absolute(info_request.public_body),:info_request_user=>request_user_link_absolute(info_request),:date=>simple_date(event.created_at )) %>
        <% elsif event.event_type == 'response' %>
            <%=event.display_status %>
            <%= _('by {{public_body_name}} to {{info_request_user}} on {{date}}.',:public_body_name=>public_body_link_absolute(info_request.public_body),:info_request_user=>request_user_link_absolute(info_request),:date=>simple_date(event.created_at )) %>
        <% elsif event.event_type == 'comment' %>
            <%= _('Request to {{public_body_name}} by {{info_request_user}}. Annotated by {{event_comment_user}} on {{date}}.',:public_body_name=>public_body_link_absolute(info_request.public_body),:info_request_user=>request_user_link_absolute(info_request),:event_comment_user=>user_link_absolute(event.comment.user),:date=>simple_date(event.created_at)) %>
        <% else %>
            <%# Events of other types will not be indexed: see InfoRequestEvent#indexed_by_search?
                However, it can happen that we see other types of event transiently here in the period
                between a change being made and the update-xapian-index job being run. %>

        <% end %>

      <span class="bottomline icon_<%= info_request.calculate_status %>">

        <%= info_request.display_status(cached_value_ok=true) %>

        <%= highlight_and_excerpt(event.search_text_main(true), @highlight_words, 150) %>

<% if @highlight_words.nil?
      @highlight_words = []
end %>

        <% if event.is_incoming_message? %>
            <%= link_to highlight_words(info_request.title, @highlight_words), incoming_message_url(event.incoming_message_selective_columns("incoming_messages.id")) %>
        <% elsif event.is_outgoing_message? and event.event_type == 'followup_sent' %>
            <%= link_to highlight_words(info_request.title, @highlight_words), outgoing_message_url(event.outgoing_message) %>
        <% elsif event.is_comment? %>
            <%= link_to highlight_words(info_request.title, @highlight_words), comment_url(event.comment) %>
        <% else %>
            <%= link_to highlight_words(info_request.title, @highlight_words), request_url(info_request) %>
        <% end %>

        <% if event.event_type == 'sent' %>
            <%= _('Request sent to {{public_body_name}} by {{info_request_user}} on {{date}}.',:public_body_name=>public_body_link_absolute(info_request.public_body),:info_request_user=>request_user_link_absolute(info_request),:date=>simple_date(event.created_at )) %>
        <% elsif event.event_type == 'followup_sent' %>
            <%=event.display_status %>
            <%= _('sent to {{public_body_name}} by {{info_request_user}} on {{date}}.',:public_body_name=>public_body_link_absolute(info_request.public_body),:info_request_user=>request_user_link_absolute(info_request),:date=>simple_date(event.created_at )) %>
        <% elsif event.event_type == 'response' %>
            <%=event.display_status %>
            <%= _('by {{public_body_name}} to {{info_request_user}} on {{date}}.',:public_body_name=>public_body_link_absolute(info_request.public_body),:info_request_user=>request_user_link_absolute(info_request),:date=>simple_date(event.created_at )) %>
        <% elsif event.event_type == 'comment' %>
            <%= _('Request to {{public_body_name}} by {{info_request_user}}. Annotated by {{event_comment_user}} on {{date}}.',:public_body_name=>public_body_link_absolute(info_request.public_body),:info_request_user=>user_link_absolute(info_request.user),:event_comment_user=>user_link_absolute(event.comment.user),:date=>simple_date(event.created_at)) %>
        <% else %>
            <%# Events of other types will not be indexed: see InfoRequestEvent#indexed_by_search?
                However, it can happen that we see other types of event transiently here in the period
                between a change being made and the update-xapian-index job being run. %>

        <% end %>

      <span class="bottomline icon_<%= info_request.calculate_status %>">

        <%= info_request.display_status(cached_value_ok=true) %>

        <%= highlight_and_excerpt(event.search_text_main(true), @highlight_words, 150) %>