small tweak in sharing guide

small tweak in sharing guide

<%
   object ||= nil
   set_parameters_for_sharing_form object
   disable_advanced_view ||= nil
   show_advanced_permissions = !@resource.respond_to?(:has_advanced_permissions?) || @resource.has_advanced_permissions?
   default_projects_access_type = @resource.is_asset? ? Policy::ACCESSIBLE : Policy::EDITING
   default_consortium_access_type = Policy::VISIBLE
   can_publish = @resource.respond_to?(:can_publish?) ? @resource.can_publish? : true
%>
<%# initialization: required to keep javascript independent of the access type codes, to allow the use the constants instead -%>
<%= render :partial=>"assets/sharing_constants" %>

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

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

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

          You may:

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

          <%
             through_resource = ''
             if @resource.kind_of?(Assay)
               through_resource = '(through projects associated with selected study)'
             elsif @resource.kind_of?(Study)
               through_resource = '(through projects associated with selected investigation)'
             end
          %>

Share within members of projects associated with this <%= @resource_type -%> <%= through_resource%> 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)

You can share with the all visitors right away if you are the gatekeeper or if the projects associated with this <%= @resource_type -%> have no gatekeeper

Or you can request the gatekeepers for their approval to share with all visitors

          <% if !disable_advanced_view%>

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.

          <% end %>

<label for="sharing_scope_<%= Policy::PRIVATE -%>">
            <input type="hidden" id='access_type_select_<%= Policy::PRIVATE -%>' name="sharing[access_type_<%= Policy::PRIVATE -%>]" value="<%= Policy::NO_ACCESS -%>">
            <input <%= 'checked="checked"' if @sharing_mode == Policy::PRIVATE %> id="sharing_scope_<%= Policy::PRIVATE -%>" name="sharing[sharing_scope]"
                                                                                value="<%= Policy::PRIVATE -%>" type="radio" />
            - Keep this <%= @resource_type -%> private (only visible to you)

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

Or share it with..

            <input type="radio" <%= 'checked="checked"' if @sharing_mode == Policy::ALL_SYSMO_USERS -%> id="sharing_scope_<%= Policy::ALL_SYSMO_USERS -%>" name="sharing[sharing_scope]" value="<%= Policy::ALL_SYSMO_USERS -%>" />
            - Members of projects associated with this <%= @resource_type -%>:

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

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

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

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

              <%= check_box_tag 'sharing[request_publish_approval]', 1, false, :disabled => can_publish%>
              - Request approval from the gatekeepers to share with all visitors

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

    <% end -%>

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

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

Additional fine-grained sharing permissions

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

              Loading...

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

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

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

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

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

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

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

<%= favourite_group_popup_link_action_new(@resource.class.name) -%>

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

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

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

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

                  Step 3

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

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

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

                      Step 3: Choose access rights, review and
                      submit

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

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

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

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

<%= workgroup_member_review_popup_link(@resource.class.name) -%>

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

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

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

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

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

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

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

  <% end %>

<%
   object ||= nil
   set_parameters_for_sharing_form object
   disable_advanced_view ||= nil
   show_advanced_permissions = !@resource.respond_to?(:has_advanced_permissions?) || @resource.has_advanced_permissions?
   default_projects_access_type = @resource.is_asset? ? Policy::ACCESSIBLE : Policy::EDITING
   default_consortium_access_type = Policy::VISIBLE
   can_publish = @resource.respond_to?(:can_publish?) ? @resource.can_publish? : true
%>
<%# initialization: required to keep javascript independent of the access type codes, to allow the use the constants instead -%>
<%= render :partial=>"assets/sharing_constants" %>

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

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

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

          You may:

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

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

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

You can share with the all visitors right away if you are the gatekeeper or if the projects associated with this <%= @resource_type -%> have no gatekeeper

Or you can request the gatekeepers for their approval to share with all visitors

          <% if !disable_advanced_view%>

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.

          <% end %>

<label for="sharing_scope_<%= Policy::PRIVATE -%>">
            <input type="hidden" id='access_type_select_<%= Policy::PRIVATE -%>' name="sharing[access_type_<%= Policy::PRIVATE -%>]" value="<%= Policy::NO_ACCESS -%>">
            <input <%= 'checked="checked"' if @sharing_mode == Policy::PRIVATE %> id="sharing_scope_<%= Policy::PRIVATE -%>" name="sharing[sharing_scope]"
                                                                                value="<%= Policy::PRIVATE -%>" type="radio" />
            - Keep this <%= @resource_type -%> private (only visible to you)

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

Or share it with..

            <input type="radio" <%= 'checked="checked"' if @sharing_mode == Policy::ALL_SYSMO_USERS -%> id="sharing_scope_<%= Policy::ALL_SYSMO_USERS -%>" name="sharing[sharing_scope]" value="<%= Policy::ALL_SYSMO_USERS -%>" />
            - Members of projects associated with this <%= @resource_type -%>:

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

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

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

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

              <%= check_box_tag 'sharing[request_publish_approval]', 1, false, :disabled => can_publish%>
              - Request approval from the gatekeepers to share with all visitors

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

    <% end -%>

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

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

Additional fine-grained sharing permissions

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

              Loading...

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

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

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

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

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

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

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

<%= favourite_group_popup_link_action_new(@resource.class.name) -%>

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

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

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

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

                  Step 3

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

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

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

                      Step 3: Choose access rights, review and
                      submit

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

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

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

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

<%= workgroup_member_review_popup_link(@resource.class.name) -%>

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

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

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

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

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

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

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

  <% end %>


cover img tag uses css max-height/width to prevent oddly shaped oddly sized images from being humungous on page overflowing content

<%=
    # Set parameter for size, small|medium|large if you like
  size ||= "medium"
  fix_size ||= true

  # small med and x-large correspond roughly to amazon sm, med and lg.
  # large corresponds roughly to google medium. Just one dimension to
  # prevent disproportionate scaling. We use CSS so we can set maximums
  # in BOTH dimensions but let aspect ratio remain the same. We put it
  # inline so HTML Snippet API clients get images constrained to reasonable
  # sizes without extra CSS. IE6 won't do max-height/max-width, sorry IE6, no
  # way to accomodate you (trying to put a width and a max-width triggers
  # weird IE8 bugs!). Best we can do.
  #
  # generally the 'max-height' is our operative maximum for ordinary ratios,
  # but we let the width be more than the height for weird ratio'd covers
  # that are wider than square.
  dimensions_style = {
            "small"       => "max-height: 80px; max-width: 100px;",
            "medium"      => "max-height: 160px; max-width: 200px;",
            "large"       => "max-height: 200px; max-width: 240px;",
            "extra-large" => "max-height: 475px; max-width: 570px;"
  }

  img_st = cover_image_response(size)
  if img_st
      img_data = img_st.view_data

      img_params = {'src'=>img_data[:url],
      'class'=>'cover_image',
      'alt'=>h(img_data[:display_text])}

      # If we're in https mode, and the original url is http, use
      # Umlaut proxy to avoid browser security warning.
      if (request.protocol != img_params['src'][0..6])
        img_params['src'] = url_for(:controller => "resource", :action => "proxy", :id => img_st.id )
      end

      img_params.merge!( "style" => dimensions_style[size]) if fix_size

      tag('img', img_params )

 end %>

<%=
    # Set parameter for size, small|medium|large if you like
  size ||= "medium"
  fix_size ||= true

  # small med and x-large correspond roughly to amazon sm, med and lg.
  # large corresponds roughly to google medium. Just one dimension to
  # prevent disproportionate scaling.
  dimensions = { "small" => { "height" => 80 },
                 "medium" => { "height" => 160},
                 "large" => { "height" => 200 },
                 "extra-large" => { "height" => 475}}

  img_st = cover_image_response(size)
  if img_st
      img_data = img_st.view_data

      img_params = {'src'=>img_data[:url],
      'class'=>'cover_image',
      'alt'=>h(img_data[:display_text])}

      # If we're in https mode, and the original url is http, use
      # Umlaut proxy to avoid browser security warning.
      if (request.protocol != img_params['src'][0..6])
        img_params['src'] = url_for(:controller => "resource", :action => "proxy", :id => img_st.id )
      end

      img_params.merge!( dimensions[size]) if fix_size

      tag('img', img_params )

 end %>


Updated awstats template to work with debian 5.0 (lenny).

# zena awstats vhost for <%= host %>
# automatically generated file

<VirtualHost *>
  ServerName stats.<%= host %>

  DocumentRoot /usr/share/doc/awstats/examples
  ErrorLog     /var/www/zena/<%= host %>/log/apache2.error.log
  CustomLog    /var/www/zena/<%= host %>/log/apache2.access.log combined

  <location />
    SetEnv AWSTATS_FORCE_CONFIG <%= host %>

    AuthType Basic
    AuthName "<%= host %> stats"
    AuthUserFile /var/www/zena/<%= host %>/log/.awstatspw
    Require valid-user
  </location>

  #
  # Directives to allow use of AWStats as a CGI
  #
  Alias /awstatsclasses "/usr/share/doc/awstats/lib"
  Alias /awstatscss "/usr/share/doc/awstats/examples/css/"
  Alias /awstatsicons "/usr/share/awstats/icon/"
  ScriptAlias / "/usr/lib/cgi-bin/"

  #
  # This is to permit URL access to scripts/files in AWStats directory.
  #
  <Directory "/usr/share/doc/awstats/examples">
      Options None
      AllowOverride None
      Order allow,deny
      Allow from all
  </Directory>

  RewriteEngine On
  RewriteRule ^/$ /awstats.pl [R=302,L]
</VirtualHost>

# zena awstats vhost for <%= host %>
# automatically generated file

<VirtualHost *>
  ServerName stats.<%= host %>

  DocumentRoot /usr/share/doc/awstats/examples/wwwroot
  ErrorLog     /var/www/zena/<%= host %>/log/apache2.error.log
  CustomLog    /var/www/zena/<%= host %>/log/apache2.access.log combined

  <location />
    SetEnv AWSTATS_FORCE_CONFIG <%= host %>

    AuthType Basic
    AuthName "<%= host %> stats"
    AuthUserFile /var/www/zena/<%= host %>/log/.awstatspw
    Require valid-user
  </location>

  #
  # Directives to allow use of AWStats as a CGI
  #
  Alias /awstatsclasses "/usr/share/doc/awstats/examples/wwwroot/classes/"
  Alias /awstatscss "/usr/share/doc/awstats/examples/wwwroot/css/"
  Alias /awstatsicons "/usr/share/doc/awstats/examples/wwwroot/icon/"
  ScriptAlias / "/usr/lib/cgi-bin/"

  #
  # This is to permit URL access to scripts/files in AWStats directory.
  #
  <Directory "/usr/share/doc/awstats/examples/wwwroot">
      Options None
      AllowOverride None
      Order allow,deny
      Allow from all
  </Directory>

  RewriteEngine On
  RewriteRule ^/$ /awstats.pl [R=302,L]
</VirtualHost>


Add a few tooltips to the right-menu

Add a few tooltips to the right-menu

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

    <%= javascript_include_merged :base %>
    <%= javascript_include_merged :tt %>

    <%= javascript_include_tag "beast" if ['forums', 'posts', 'topics'].include? controller.controller_name %>

    <%= stylesheet_link_merged :tt %>
    <%= stylesheet_link_tag "beast" if ['forums', 'posts', 'topics'].include? controller.controller_name %>
    <%= javascript_include_tag "builder" if ['activities'].include? controller.controller_name %>
    <% if ['activities'].include? controller.controller_name %>
      <%= javascript_include_tag "portal" %>

      <%= javascript_include_tag "flotr" %>
    <% end %>

    <%= stylesheet_link_tag "print", { :media => "print" } %>
    <%= auto_discovery_link_tag(:rss, {:controller => 'feeds', :action => 'rss', :id => current_user.uuid }) %>

    <title><%= controller.controller_name + " / " + controller.action_name %></title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<% @internal = Customer.find(:first, :conditions => ["(name = 'Internal' or name = ?) AND company_id = ?", current_user.company.name, current_user.company.id]) %>

<%= image_tag('spinner.gif', :border => 0) %>

              <%= render(:partial => "layouts/menu") %>

              <% form_tag( {:controller => 'search', :action => 'search'}, {:method => 'get'}) do %>

                <% if current_user.seen_welcome.to_i == 0 %>
                  <% if controller.controller_name == "activities" && controller.action_name == 'welcome' %>

<%= link_to "#{_('Tutorial')}", { :controller => 'activities', :action => 'welcome'}, :class => "active"%>

                  <% else %>

<%= link_to "#{_('Tutorial')}", { :controller => 'activities', :action => 'welcome'} %>

                  <% end %>
                <% end %>

                <% if controller.controller_name == "activities" && controller.action_name != 'welcome' %>

<%= link_to "#{_('Overview') }", { :controller => 'activities', :action => 'list'}, :class => "active"%>

<%= link_to_remote _('Add New Widget'), :url => { :controller => 'widgets', :action => 'add'} %>

                <% else %>

<%= link_to "#{_('Overview')}", { :controller => 'activities', :action => 'list'} %>
		<% end %>

                <% if controller.controller_name == "tasks" && !['timeline', 'new'].include?(controller.action_name) %>

<%= link_to "#{_('Browse')}", { :controller => 'views', :action => 'browse'}, :class => "active" %>
                <% else %>

<%= link_to "#{_('Browse')}", :controller => 'views', :action => 'browse' %>
                <% end %>

<%= link_to "#{_('Open Tasks')}", :controller => 'views', :action => 'all_tasks'%>

<%= link_to _('My Open Tasks'), :controller => 'views', :action => 'my_tasks'%>

<%= link_to _('My In Progress Tasks'), :controller => 'views', :action => 'my_in_progress_tasks'%>

<%= link_to _('Unassigned Tasks'), :controller => 'views', :action => 'unassigned_tasks'%>

                    <% project_ids = current_project_ids %>
                    <% client_ids = current_projects.collect(&:customer_id).join(',')
                       client_ids = "0" if client_ids.nil? || client_ids.empty?

                       views = View.find(:all, :conditions => ["company_id = ? AND (user_id = ? or shared = 1) AND (filter_customer_id = 0 OR filter_customer_id IS NULL OR filter_customer_id IN (#{client_ids})) AND (filter_project_id = 0 OR filter_project_id IS NULL OR filter_project_id IN (#{project_ids}))", current_user.company_id, current_user.id], :order => "shared, name")
                    for view in views %>

<%= link_to(view.name, { :controller => 'views', :action => 'select', :id => view }) %><%= link_to("[#{_('Edit')}]", {:controller => 'views', :action => 'edit', :id => view}) if view.user_id == current_user.id %><%= "[#{_('Shared')}]" if view.user_id != current_user.id %>

		    <% end %>

<%= link_to "[#{_('New View')}]",  :controller => 'views', :action => 'new' %>

                <% if current_user.option_tracktime.to_i == 1%>
                  <% if controller.controller_name == "timeline" && controller.action_name == "list" %>

<%= link_to "#{_('Timeline')}", { :controller => 'timeline', :action => 'list'}, :class => "active" %>

                  <% else %>

<%= link_to "#{_('Timeline')}", :controller => 'timeline', :action => 'list' %>

                  <% end %>
                <% end %>

                <% if controller.controller_name == "schedule"  %>

<%= link_to "#{_('Schedule')}", {:controller => 'schedule', :action => 'list'}, :class => "active" %>
                <% else %>

<%= link_to "#{_('Schedule')}", :controller => 'schedule', :action => 'list' %>
                <% end %>

<%= link_to "#{_('Plan / GANTT')}", :controller => 'schedule', :action => 'gantt'%>

                <% if current_user.option_tracktime.to_i == 1 && current_user.can_any?(current_user.projects, 'report') %>
                  <% if controller.controller_name == "reports"  %>

<%= link_to "#{_('Reports')}", {:controller => 'reports', :action => 'list'}, :class => "active" %>

                  <% else %>

<%= link_to "#{_('Reports')}", :controller => 'reports', :action => 'list' %>

                  <% end %>
                <% end %>

	        <% if current_user.company.show_wiki? %>
		  <% if controller.controller_name == "wiki"  %>

<%= link_to "#{_('Wiki')}", {:controller => 'wiki', :action => 'show', :id => nil}, :class => "active" %>

                  <% else %>

<%= link_to "#{_('Wiki')}", :controller => 'wiki', :action => 'show' %>

                  <% end %>
	        <% end %>

	        <% if current_user.company.show_chat? %>
                  <% if controller.controller_name == "shout"  %>

<%= link_to "#{_('Chat')}", {:controller => 'shout', :action => 'list'}, :class => "active" %>

                  <% else %>

<%= link_to "#{_('Chat')}", :controller => 'shout', :action => 'list' %>

                  <% end %>
		<% end %>

	        <% if current_user.company.show_forum? %>
                  <% if ['forums', 'posts', 'topics'].include? controller.controller_name  %>

<%= link_to "#{_('Forums')}", {:controller => 'forums', :action => 'index'}, :class => "active" %>

                  <% else %>

<%= link_to "#{_('Forums')}", :controller => 'forums', :action => 'index' %>

                  <% end %>
                <% end %>

                <% if controller.controller_name == "project_files"  %>

<%= link_to "#{_('Files')}", {:controller => 'project_files', :action => 'list'}, :class => "active" %>

                <% else %>

<%= link_to "#{_('Files')}", :controller => 'project_files', :action => 'list' %>

                <% end %>

                <% if controller.controller_name == "projects" %>

<%= link_to "#{_('Projects')}", {:controller => 'projects', :action => 'list'}, :class => "active" %>
                <% else %>

<%= link_to "#{_('Projects')}", {:controller => 'projects', :action => 'list'} %>
                <% end %>

<%= link_to _("New Project"), :controller => 'projects', :action => 'new' %>

                <% if controller.controller_name == "tasks" && controller.action_name == 'new'  %>

<%= link_to "#{_('New Task') + image_tag('tick.png',  :border => 0, :height => 16, :style => "margin-top:-2px;")}", {:controller => 'tasks', :action => 'new'}, :class => "active" %>
                <% else %>

<%= link_to "#{_('New Task') + image_tag('tick.png',  :border => 0, :height => 16, :style => "margin-top:-2px;")}", {:controller => 'tasks', :action => 'new'} %>
                <% end %>

<%= link_to "#{_('Log Out')}", { :controller => 'login', :action => 'logout'}, :class => "right" %>

                <% if controller.controller_name == "users" && controller.action_name == "edit_preferences" %>

<%= link_to "#{_('Preferences')}", { :controller => 'users', :action => 'edit_preferences'}, :class => "right active"%>
                <% else %>

<%= link_to "#{_('Preferences')}", { :controller => 'users', :action => 'edit_preferences'}, :class => "right" %>
                <% end %>
                <% if current_user.admin > 0 %>

<%= link_to _('Company Settings'), :controller => 'companies', :action => 'edit', :id => current_user.company_id %>

                <% end %>

                <% if current_user.admin > 0 %>

                <% if current_user.option_externalclients.to_i == 1%>
                <% if controller.controller_name == "customers" %>

<%= link_to "#{_('Clients')}", { :controller => 'customers', :action => 'list'}, :class => "active"%>

                  <% else %>

<%= link_to "#{_('Clients')}", { :controller => 'customers', :action => 'list'}, :class => "right" %>

                <% end %>
                <% end %>

                <% if controller.controller_name == "users" && controller.action_name != "edit_preferences" %>

<%= link_to "#{_('Users')}", { :controller => 'users', :action => 'list'}, :class => "right active"%>

                <% else %>

<%= link_to "#{_('Users')}", { :controller => 'users', :action => 'list'}, :class => "right" %>

                <% end %>

                <% end %>

<%= text_field_tag 'query', _('Search'), {:size => 10, :style => "font-size:9px;", :class => 'optional', :onfocus => "if($('query').value == '#{_('Search')}') {$('query').value = ''; $('query').removeClassName('optional');};"  }%>

                <% end %>

        <% if current_user.respond_to?(:seen_news_id)%>
          <% news = NewsItem.find(:first, :order => "created_at desc", :conditions => ["id > ?", current_user.seen_news_id ]) %>
          <% unless news.nil? %>

[<%= tz.utc_to_local(news.created_at).strftime("#{current_user.time_format} #{current_user.date_format}") %>]	<%= news.body %>
                <%= link_to_remote "[#{_('Hide')}]", :url => { :controller => 'users', :action => 'update_seen_news', :id => news.id },
                :success => visual_effect(:fade, "news", :duration => 0.5) %>

          <% end %>
          <% end %>

          <div id="flash" <%="style=\"display:none\"" unless flash['notice']%>>

<%= flash['notice'] %>
	[<%=_ 'Hide'%>]

          <%= @content_for_layout %>

          <td align="right" valign="top" style="width:15%;<%= "display:none;" if session[:collapse_menu].to_i > 0 %>" id="left_menu">

                <td align="left" class="page_header tooltip" colspan="2" width="100%" title="<%= _'Custom saved filters showing a subset of your tasks'%>">
<%=_ 'Views' %>

<%= link_to _('New'),  :controller => 'views', :action => 'new' %>

<%= link_to "#{_('Open Tasks')}", :controller => 'views', :action => 'all_tasks'%>

<%= link_to _('My Open Tasks'), :controller => 'views', :action => 'my_tasks'%>

<%= link_to _('My In Progress Tasks'), :controller => 'views', :action => 'my_in_progress_tasks'%>

<%= link_to _('Unassigned Tasks'), :controller => 'views', :action => 'unassigned_tasks'%>

                <% project_ids = current_project_ids %>
                <% client_ids = current_projects.collect(&:customer_id).join(',')
                   client_ids = "0" if client_ids.nil? || client_ids.empty?

                   views = View.find(:all, :conditions => ["company_id = ? AND (user_id = ? or shared = 1) AND (filter_customer_id = 0 OR filter_customer_id IS NULL OR filter_customer_id IN (#{client_ids})) AND (filter_project_id = 0 OR filter_project_id IS NULL OR filter_project_id IN (#{project_ids}))", current_user.company_id, current_user.id], :order => "shared, name")
                   for view in views %>

<%= link_to view.name, :controller => 'views', :action => 'select', :id => view %>	<%= link_to _('Edit'), :controller => 'views', :action => 'edit', :id => view if view.user_id == current_user.id %><%= "[#{_('Shared')}]" if view.user_id != current_user.id %>

                   <% end %>

		   <div <%= "style=\"display:none;\"" if @current_sheet.nil? || controller.action_name == "stop_work" %> id="work-log">

		           <div style="float: left;" class="tooltip" title="<%= _'Text entered will be saved automatically to your current work notes.'%>"><%= _'Work Log' %>

				  <form method="post" onsubmit="return false;" id="worklog_form">
		           <textarea name="worklog[body]" id="worklog_body" style="padding:0;margin-top:0.5em;margin-bottom:0.3em;width:100%;" rows="4"><%= @current_sheet.body if @current_sheet%></textarea>
				  </form>

                  <td align=left class="page_header tooltip" width="100%" colspan="2" title="<%= _'Easy access to commonly needed information.'%>">

<%=_ 'Notes'%>

<%= link_to _('New'), :controller => 'pages', :action => 'new' %>

          <% for page in current_pages %>

                  <%= link_to "#{page.name} / #{page.project.name}", { :controller => 'pages', :action => 'show', :id => page} %> (<%=_('%s ago', time_ago_in_words( page.updated_at, false ) )%>)

          <% end %>

  <% if current_user.company.show_messaging %>

	    <% current_user.chats.each do |@chat|
	      @user = @chat.target
            %>
	      <%= render :partial => 'shout/chat_user' if @chat.active >= 0%>
	      <% if @chat.active == 1 %>

	      <% end %>
	    <% end %>

<%= _'Loading'%>...

<%= _('Online')%> (<%= online_users %>)

Clocking IT v0.99.3<% if current_user.locale != 'en_US' %> - <%= _'Help Translate'%><% end %>
<%=_ 'Feedback? Suggestions? Ideas? Bugs?'%><%= link_to "[Admin]", :controller => "admin", :action => "index" if current_user.admin == 10 %>

  <% else %>

Clocking IT v0.99.3<% if current_user.locale != 'en_US' %> - <%= _'Help Translate'%><% end %>
<%=_ 'Feedback? Suggestions? Ideas? Bugs?'%><%= link_to "[Admin]", :controller => "admin", :action => "index" if current_user.admin == 10 %>

  <% end %>

<%= periodically_call_remote(:url => { :controller => 'tasks', :action => 'update_sheet_info' }, :frequency => 90 ) -%>

<%= flash_plugin(session[:channels]) %>

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

    <%= javascript_include_merged :base %>
    <%= javascript_include_merged :tt %>

    <%= javascript_include_tag "beast" if ['forums', 'posts', 'topics'].include? controller.controller_name %>

    <%= stylesheet_link_merged :tt %>
    <%= stylesheet_link_tag "beast" if ['forums', 'posts', 'topics'].include? controller.controller_name %>
    <%= javascript_include_tag "builder" if ['activities'].include? controller.controller_name %>
    <% if ['activities'].include? controller.controller_name %>
      <%= javascript_include_tag "portal" %>

      <%= javascript_include_tag "flotr" %>
    <% end %>

    <%= stylesheet_link_tag "print", { :media => "print" } %>
    <%= auto_discovery_link_tag(:rss, {:controller => 'feeds', :action => 'rss', :id => current_user.uuid }) %>

    <title><%= controller.controller_name + " / " + controller.action_name %></title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<% @internal = Customer.find(:first, :conditions => ["(name = 'Internal' or name = ?) AND company_id = ?", current_user.company.name, current_user.company.id]) %>

<%= image_tag('spinner.gif', :border => 0) %>

              <%= render(:partial => "layouts/menu") %>

              <% form_tag( {:controller => 'search', :action => 'search'}, {:method => 'get'}) do %>

                <% if current_user.seen_welcome.to_i == 0 %>
                  <% if controller.controller_name == "activities" && controller.action_name == 'welcome' %>

<%= link_to "#{_('Tutorial')}", { :controller => 'activities', :action => 'welcome'}, :class => "active"%>

                  <% else %>

<%= link_to "#{_('Tutorial')}", { :controller => 'activities', :action => 'welcome'} %>

                  <% end %>
                <% end %>

                <% if controller.controller_name == "activities" && controller.action_name != 'welcome' %>

<%= link_to "#{_('Overview') }", { :controller => 'activities', :action => 'list'}, :class => "active"%>

<%= link_to_remote _('Add New Widget'), :url => { :controller => 'widgets', :action => 'add'} %>

                <% else %>

<%= link_to "#{_('Overview')}", { :controller => 'activities', :action => 'list'} %>
		<% end %>

                <% if controller.controller_name == "tasks" && !['timeline', 'new'].include?(controller.action_name) %>

<%= link_to "#{_('Browse')}", { :controller => 'views', :action => 'browse'}, :class => "active" %>
                <% else %>

<%= link_to "#{_('Browse')}", :controller => 'views', :action => 'browse' %>
                <% end %>

<%= link_to "#{_('Open Tasks')}", :controller => 'views', :action => 'all_tasks'%>

<%= link_to _('My Open Tasks'), :controller => 'views', :action => 'my_tasks'%>

<%= link_to _('My In Progress Tasks'), :controller => 'views', :action => 'my_in_progress_tasks'%>

<%= link_to _('Unassigned Tasks'), :controller => 'views', :action => 'unassigned_tasks'%>

                    <% project_ids = current_project_ids %>
                    <% client_ids = current_projects.collect(&:customer_id).join(',')
                       client_ids = "0" if client_ids.nil? || client_ids.empty?

                       views = View.find(:all, :conditions => ["company_id = ? AND (user_id = ? or shared = 1) AND (filter_customer_id = 0 OR filter_customer_id IS NULL OR filter_customer_id IN (#{client_ids})) AND (filter_project_id = 0 OR filter_project_id IS NULL OR filter_project_id IN (#{project_ids}))", current_user.company_id, current_user.id], :order => "shared, name")
                    for view in views %>

<%= link_to(view.name, { :controller => 'views', :action => 'select', :id => view }) %><%= link_to("[#{_('Edit')}]", {:controller => 'views', :action => 'edit', :id => view}) if view.user_id == current_user.id %><%= "[#{_('Shared')}]" if view.user_id != current_user.id %>

		    <% end %>

<%= link_to "[#{_('New View')}]",  :controller => 'views', :action => 'new' %>

                <% if current_user.option_tracktime.to_i == 1%>
                  <% if controller.controller_name == "timeline" && controller.action_name == "list" %>

<%= link_to "#{_('Timeline')}", { :controller => 'timeline', :action => 'list'}, :class => "active" %>

                  <% else %>

<%= link_to "#{_('Timeline')}", :controller => 'timeline', :action => 'list' %>

                  <% end %>
                <% end %>

                <% if controller.controller_name == "schedule"  %>

<%= link_to "#{_('Schedule')}", {:controller => 'schedule', :action => 'list'}, :class => "active" %>
                <% else %>

<%= link_to "#{_('Schedule')}", :controller => 'schedule', :action => 'list' %>
                <% end %>

<%= link_to "#{_('Plan / GANTT')}", :controller => 'schedule', :action => 'gantt'%>

                <% if current_user.option_tracktime.to_i == 1 && current_user.can_any?(current_user.projects, 'report') %>
                  <% if controller.controller_name == "reports"  %>

<%= link_to "#{_('Reports')}", {:controller => 'reports', :action => 'list'}, :class => "active" %>

                  <% else %>

<%= link_to "#{_('Reports')}", :controller => 'reports', :action => 'list' %>

                  <% end %>
                <% end %>

	        <% if current_user.company.show_wiki? %>
		  <% if controller.controller_name == "wiki"  %>

<%= link_to "#{_('Wiki')}", {:controller => 'wiki', :action => 'show', :id => nil}, :class => "active" %>

                  <% else %>

<%= link_to "#{_('Wiki')}", :controller => 'wiki', :action => 'show' %>

                  <% end %>
	        <% end %>

	        <% if current_user.company.show_chat? %>
                  <% if controller.controller_name == "shout"  %>

<%= link_to "#{_('Chat')}", {:controller => 'shout', :action => 'list'}, :class => "active" %>

                  <% else %>

<%= link_to "#{_('Chat')}", :controller => 'shout', :action => 'list' %>

                  <% end %>
		<% end %>

	        <% if current_user.company.show_forum? %>
                  <% if ['forums', 'posts', 'topics'].include? controller.controller_name  %>

<%= link_to "#{_('Forums')}", {:controller => 'forums', :action => 'index'}, :class => "active" %>

                  <% else %>

<%= link_to "#{_('Forums')}", :controller => 'forums', :action => 'index' %>

                  <% end %>
                <% end %>

                <% if controller.controller_name == "project_files"  %>

<%= link_to "#{_('Files')}", {:controller => 'project_files', :action => 'list'}, :class => "active" %>

                <% else %>

<%= link_to "#{_('Files')}", :controller => 'project_files', :action => 'list' %>

                <% end %>

                <% if controller.controller_name == "projects" %>

<%= link_to "#{_('Projects')}", {:controller => 'projects', :action => 'list'}, :class => "active" %>
                <% else %>

<%= link_to "#{_('Projects')}", {:controller => 'projects', :action => 'list'} %>
                <% end %>

<%= link_to _("New Project"), :controller => 'projects', :action => 'new' %>

                <% if controller.controller_name == "tasks" && controller.action_name == 'new'  %>

<%= link_to "#{_('New Task') + image_tag('tick.png',  :border => 0, :height => 16, :style => "margin-top:-2px;")}", {:controller => 'tasks', :action => 'new'}, :class => "active" %>
                <% else %>

<%= link_to "#{_('New Task') + image_tag('tick.png',  :border => 0, :height => 16, :style => "margin-top:-2px;")}", {:controller => 'tasks', :action => 'new'} %>
                <% end %>

<%= link_to "#{_('Log Out')}", { :controller => 'login', :action => 'logout'}, :class => "right" %>

                <% if controller.controller_name == "users" && controller.action_name == "edit_preferences" %>

<%= link_to "#{_('Preferences')}", { :controller => 'users', :action => 'edit_preferences'}, :class => "right active"%>
                <% else %>

<%= link_to "#{_('Preferences')}", { :controller => 'users', :action => 'edit_preferences'}, :class => "right" %>
                <% end %>
                <% if current_user.admin > 0 %>

<%= link_to _('Company Settings'), :controller => 'companies', :action => 'edit', :id => current_user.company_id %>

                <% end %>

                <% if current_user.admin > 0 %>

                <% if current_user.option_externalclients.to_i == 1%>
                <% if controller.controller_name == "customers" %>

<%= link_to "#{_('Clients')}", { :controller => 'customers', :action => 'list'}, :class => "active"%>

                  <% else %>

<%= link_to "#{_('Clients')}", { :controller => 'customers', :action => 'list'}, :class => "right" %>

                <% end %>
                <% end %>

                <% if controller.controller_name == "users" && controller.action_name != "edit_preferences" %>

<%= link_to "#{_('Users')}", { :controller => 'users', :action => 'list'}, :class => "right active"%>

                <% else %>

<%= link_to "#{_('Users')}", { :controller => 'users', :action => 'list'}, :class => "right" %>

                <% end %>

                <% end %>

<%= text_field_tag 'query', _('Search'), {:size => 10, :style => "font-size:9px;", :class => 'optional', :onfocus => "if($('query').value == '#{_('Search')}') {$('query').value = ''; $('query').removeClassName('optional');};"  }%>

                <% end %>

        <% if current_user.respond_to?(:seen_news_id)%>
          <% news = NewsItem.find(:first, :order => "created_at desc", :conditions => ["id > ?", current_user.seen_news_id ]) %>
          <% unless news.nil? %>

[<%= tz.utc_to_local(news.created_at).strftime("#{current_user.time_format} #{current_user.date_format}") %>]	<%= news.body %>
                <%= link_to_remote "[#{_('Hide')}]", :url => { :controller => 'users', :action => 'update_seen_news', :id => news.id },
                :success => visual_effect(:fade, "news", :duration => 0.5) %>

          <% end %>
          <% end %>

          <div id="flash" <%="style=\"display:none\"" unless flash['notice']%>>

<%= flash['notice'] %>
	[<%=_ 'Hide'%>]

          <%= @content_for_layout %>

          <td align="right" valign="top" style="width:15%;<%= "display:none;" if session[:collapse_menu].to_i > 0 %>" id="left_menu">

<%=_ 'Views' %>

<%= link_to _('New'),  :controller => 'views', :action => 'new' %>

<%= link_to "#{_('Open Tasks')}", :controller => 'views', :action => 'all_tasks'%>

<%= link_to _('My Open Tasks'), :controller => 'views', :action => 'my_tasks'%>

<%= link_to _('My In Progress Tasks'), :controller => 'views', :action => 'my_in_progress_tasks'%>

<%= link_to _('Unassigned Tasks'), :controller => 'views', :action => 'unassigned_tasks'%>

                <% project_ids = current_project_ids %>
                <% client_ids = current_projects.collect(&:customer_id).join(',')
                   client_ids = "0" if client_ids.nil? || client_ids.empty?

                   views = View.find(:all, :conditions => ["company_id = ? AND (user_id = ? or shared = 1) AND (filter_customer_id = 0 OR filter_customer_id IS NULL OR filter_customer_id IN (#{client_ids})) AND (filter_project_id = 0 OR filter_project_id IS NULL OR filter_project_id IN (#{project_ids}))", current_user.company_id, current_user.id], :order => "shared, name")
                   for view in views %>

<%= link_to view.name, :controller => 'views', :action => 'select', :id => view %>	<%= link_to _('Edit'), :controller => 'views', :action => 'edit', :id => view if view.user_id == current_user.id %><%= "[#{_('Shared')}]" if view.user_id != current_user.id %>

                   <% end %>

		   <div <%= "style=\"display:none;\"" if @current_sheet.nil? || controller.action_name == "stop_work" %> id="work-log">

<%= _'Work Log' %>

				  <form method="post" onsubmit="return false;" id="worklog_form">
		           <textarea name="worklog[body]" id="worklog_body" style="padding:0;margin-top:0.5em;margin-bottom:0.3em;width:100%;" rows="4"><%= @current_sheet.body if @current_sheet%></textarea>
				  </form>

<%=_ 'Notes'%>

<%= link_to _('New'), :controller => 'pages', :action => 'new' %>

          <% for page in current_pages %>

                  <%= link_to "#{page.name} / #{page.project.name}", { :controller => 'pages', :action => 'show', :id => page} %> (<%=_('%s ago', time_ago_in_words( page.updated_at, false ) )%>)

          <% end %>

  <% if current_user.company.show_messaging %>

	    <% current_user.chats.each do |@chat|
	      @user = @chat.target
            %>
	      <%= render :partial => 'shout/chat_user' if @chat.active >= 0%>
	      <% if @chat.active == 1 %>

	      <% end %>
	    <% end %>

<%= _'Loading'%>...

<%= _('Online')%> (<%= online_users %>)

Clocking IT v0.99.3<% if current_user.locale != 'en_US' %> - <%= _'Help Translate'%><% end %>
<%=_ 'Feedback? Suggestions? Ideas? Bugs?'%><%= link_to "[Admin]", :controller => "admin", :action => "index" if current_user.admin == 10 %>

  <% else %>

Clocking IT v0.99.3<% if current_user.locale != 'en_US' %> - <%= _'Help Translate'%><% end %>
<%=_ 'Feedback? Suggestions? Ideas? Bugs?'%><%= link_to "[Admin]", :controller => "admin", :action => "index" if current_user.admin == 10 %>

  <% end %>

<%= periodically_call_remote(:url => { :controller => 'tasks', :action => 'update_sheet_info' }, :frequency => 90 ) -%>

<%= flash_plugin(session[:channels]) %>


updating title for site

updating title for site

git-svn-id: 86f0fce46016f090801773733838b5fec293694e@69 f0bc2f90-cf15-dc11-b192-0016e6374d05

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

	<title>RubyURL » <%= (title = yield :title) ? title : 'Keep it short (and sweet)' %></title>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
	<meta name="description" content="description goes here" />
	<meta name="keywords" content="keywords go here" />
	<meta http-equiv="Content-Language" content="en-us" />
	<meta name="ROBOTS" content="ALL" />
	<meta http-equiv="imagetoolbar" content="false" />
	<meta name="MSSmartTagsPreventParsing" content="true" />

	<%= stylesheet_link_tag "reset" %>
	<%= stylesheet_link_tag "master" %>

	<% if flash[:notice] %>

<%= flash[:notice] %>

	<% end %>

	<% if flash[:message] %>

<%= flash[:message] %>

	<% end %>

	<% if flash[:warning] %>

<%= flash[:warning] %>

	<% end %>

			<%= render :partial => 'shared/header' %>

			<%= yield %>

Terms of Use:

RubyURL was created as a free service to make posting long URLs easier. If you use it for spamming or illegal purposes, your RubyURL will be disabled. This service is provided without warranty of any kind.

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

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

	<title>RubyURL » <%= (title = yield :title) ? title : 'Happy URLS for Happy Developers' %></title>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
	<meta name="description" content="description goes here" />
	<meta name="keywords" content="keywords go here" />
	<meta http-equiv="Content-Language" content="en-us" />
	<meta name="ROBOTS" content="ALL" />
	<meta http-equiv="imagetoolbar" content="false" />
	<meta name="MSSmartTagsPreventParsing" content="true" />

	<%= stylesheet_link_tag "reset" %>
	<%= stylesheet_link_tag "master" %>

	<% if flash[:notice] %>

<%= flash[:notice] %>

	<% end %>

	<% if flash[:message] %>

<%= flash[:message] %>

	<% end %>

	<% if flash[:warning] %>

<%= flash[:warning] %>

	<% end %>

			<%= render :partial => 'shared/header' %>

			<%= yield %>

Terms of Use:

RubyURL was created as a free service to make posting long URLs easier. If you use it for spamming or illegal purposes, your RubyURL will be disabled. This service is provided without warranty of any kind.

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


changes made for ROR

changes made for ROR

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

<% 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} %>
  <%= link_to "Edit",{:controller => 'review', :action => 'edit_review', :id => @review.id} %>

  <% else %>

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

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

 <% if @can_view_review_of_review == 1 && @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_review_of_review', :id => @ror.id} %>
  <%= link_to "Edit",{:controller => 'review_of_review', :action => 'edit_review_of_review', :id => @ror.id} %>

  <% else %>

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

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

 <%end%>

<% 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} %>
  <%= link_to "Edit",{:controller => 'review', :action => 'edit_review', :id => @review.id} %>

  <% else %>

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

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

 <% if @can_view_review_of_review == 1 && @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)%>

Review of Review <%=ror_no%>  <%= link_to "View",{:controller => 'review_of_review', :action => 'view_review_of_review', :id => @ror.id} %>

  <% else %>

Review of Review <%=ror_no%>  <%= link_to "Begin",{:controller => 'review_of_review', :action => 'new_review_of_review', :id => ror_map.id} %>

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

 <%end%>


Applied Tim Connor's fix for commenting with IE to a Scribbish themed
blog. Thanks Tim.

git-svn-id: 70ab0960c3db1cbf656efd6df54a8f3de72dc710@1279 820eb932-12ee-0310-9ca8-eeb645f39767

<%= form_remote_tag :url      => {:action => 'comment', :id => @article},
                    :update   => 'comments_div',
                    :loading  => 'commentLoading()',
                    :complete => 'commentComplete()',
                    :html     => {:id => 'commentform', :class => 'comments' } %>

<fieldset>
  <legend>Comments</legend>

    Name:

      <%= text_field "comment", "author" %>
      (<%= link_to_function("leave url/email »", "Effect.toggle('extra_fields', 'blind', {duration: .3})") %>)

        Email: <%= content_tag('small', "(#{link_to('gravatar', 'http://gravatar.com')} enabled)") if this_blog.use_gravatar %>

          <%= text_field "comment", "email" %>

        Url:

          <%= text_field "comment", "url" %>

      Comments:
      <%= content_tag('small', link_to("Textile enabled", "http://hobix.com/textile/")) if this_blog.comment_text_filter.include? 'textile' %>
      <%= content_tag('small', link_to("Markdown enabled", "http://daringfireball.net/projects/markdown/")) if this_blog.comment_text_filter.include? 'markdown' %>

      <%= text_area 'comment', 'body' %>

    <%= submit_to_remote('preview', 'Preview!',
                         :update => 'preview',
                         :complete => "Element.show('preview')",
                         :url    => { :action => 'comment_preview' }) %>
    <%= submit_tag 'Submit', :onclick => "$('commentform').onsubmit();this.disabled=true;Element.hide('preview');return false;" %>
    <%= image_tag '/images/theme/spinner.gif', :id => 'spinner', :style => 'display:none' %>

</fieldset>
<%= end_form_tag %>

<%= form_remote_tag :url      => {:action => 'comment', :id => @article},
                    :update   => 'comments_div',
                    :loading  => 'commentLoading()',
                    :complete => 'commentComplete()',
                    :html     => {:id => 'commentform', :class => 'comments' } %>

<fieldset>
  <legend>Comments</legend>

    Name:

      <%= text_field "comment", "author" %>
      (<%= link_to_function("leave url/email »", "Effect.toggle('extra_fields', 'blind', {duration: .3})") %>)

	    Email: <%= content_tag('small', "(#{link_to('gravatar', 'http://gravatar.com')} enabled)") if this_blog.use_gravatar %>

	      <%= text_field "comment", "email" %>

	    Url:

	      <%= text_field "comment", "url" %>

      Comments:
      <%= content_tag('small', link_to("Textile enabled", "http://hobix.com/textile/")) if this_blog.comment_text_filter.include? 'textile' %>
      <%= content_tag('small', link_to("Markdown enabled", "http://daringfireball.net/projects/markdown/")) if this_blog.comment_text_filter.include? 'markdown' %>

      <%= text_area 'comment', 'body' %>

    <%= submit_to_remote('preview', 'Preview!',
                         :update => 'preview',
                         :complete => "Element.show('preview')",
                         :url    => { :action => 'comment_preview' }) %>
    <%= submit_tag 'Submit', :onclick => "this.disabled=true; Element.hide('preview');" %>
    <%= image_tag '/images/theme/spinner.gif', :id => 'spinner', :style => 'display:none' %>

</fieldset>
<%= end_form_tag %>


Add touch-appropriate meta-tags

Add touch-appropriate meta-tags

<% # SPROUTCORE DEFAULT INDEX TEMPLATE
   # This template provide provides a basic wrapper for a SproutCore client.
   # Most of the time, it will be sufficient for your own needs.  However, if
   # you need to create your own template, you can do so by copying this file
   # into your client, naming it 'index.rhtml' and then adding the options
   # :layout => 'lib/index' to your Buildfile.
   #
   # See the comments in this file for more information on what you can
   # change.
-%>
<!DOCTYPE html>

    <meta http-equiv="Content-type" content="text/html; charset=utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=8" />
    <meta http-equiv="Content-Script-Type" content="text/javascript" />
    <meta name="apple-mobile-web-app-capable" content="yes" />
    <meta name="apple-mobile-web-app-status-bar-style" content="black" />
    <meta name = "viewport" content = "initial-scale = 1.0, minimum-scale=1.0, maximum-scale = 1.0, user-scalable = no" />

<% # Set the 'title' in your config to alter this setting %>
    <title><%= title %></title>
<% #
   # You may choose to load one or more bootstrap resources.  These are
   # JS targets that you would like to load at the top of the page.  Specify
   # these in your Buildfile with the 'bootstrap' config.
-%>
  <%= bootstrap %>

<% #
   # This line should appear in your head area to include the stylesheets
   # generated by your client.  If you need to include your own
   # stylesheets, you don't need to change it here.  Instead use the
   # required option in your config.
-%>
   <%= stylesheets_for_client %>
   <%= @content_for_page_styles %>

<% # The theme CSS class is added automatically based on your chosen theme.
   # If you need to specify a custom theme name, use CONFIG.theme_name
-%>
  <body class="<%= [theme_name(:default => 'sc-theme'), 'focus'].compact.join(' ') %>" <%= config.hide_body_overflow ? 'style="overflow:hidden;"' : '' %> >
<% # This section is used to setup additional optional class names on the
   # body content based on JS-selected conditions.  Use this to make sure you
   # show the proper CSS as soon as the page appears.
-%>
<%= inline_javascript('sproutcore/bootstrap:setup_body_class_names') %>

<% #
   # This is where you root body element will appear.  To cause your
   # content to appear here, just declare content_for('body') in one of
   # your partials.
-%>
<%= @content_for_body %>
<% #
   # This is where your loading screen will appear.  To add a loading screen
   # just declare content_for('loading') in one of your partials. If you use
   # sc-gen to generate your app, it will create a file called loading.rhtml
   # under english.lproj. You can insert the desired content there.
-%>
<% unless @content_for_loading.blank? %>

<%= @content_for_loading %>

<% end -%>
<% #
   # This is where the resources you declare will appear.  By default anything
   # you add to partials will be added to this section unless you specify
   # otherwise.  Note that resources are initially hidden so you can pull them
   # apart as needed on page load.
-%>
<% unless @content_for_resources.blank? %>

      <%= @content_for_resources -%>

<% end -%>
<% #
   # This line should appear at the bottom of your page to include your
   # generated JavaScript and any libraries you reference.  If you need
   # to include other javascripts, add them to the :requires option of
   # your client in routes.rb instead of changing it here.
-%>
<%= javascripts_for_client %>
<% unless @content_for_page_javascript.blank? %>
<%= @content_for_page_javascript %>
<% end -%>
<% #
   # If you use old-style view helpers in your page, this method must be
   # called to actually add the page views to your HTML.  Normally this will
   # not generate any content.
-%>
<% #render_page_views -%>
<% # Older SproutCore applications need SC.didLoad to be called after onload.
   # This is no longer required by SproutCore so it is off by default.  To
   # reenable set use_window_onload = true in yur config.
-%>
<% if config.use_window_onload %>

<% end -%>
<% #
   # The final content section can be used to add any last minute setup you
   # need to do before the page ends.  This is required for loading unit
   # tests among other things.
-%>
<%= @content_for_final -%>

<% # SPROUTCORE DEFAULT INDEX TEMPLATE
   # This template provide provides a basic wrapper for a SproutCore client.
   # Most of the time, it will be sufficient for your own needs.  However, if
   # you need to create your own template, you can do so by copying this file
   # into your client, naming it 'index.rhtml' and then adding the options
   # :layout => 'lib/index' to your Buildfile.
   #
   # See the comments in this file for more information on what you can
   # change.
-%>
<!DOCTYPE html>

    <meta http-equiv="Content-type" content="text/html; charset=utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=8" />
    <meta http-equiv="Content-Script-Type" content="text/javascript" />
<% # Set the 'title' in your config to alter this setting %>
    <title><%= title %></title>
<% #
   # You may choose to load one or more bootstrap resources.  These are
   # JS targets that you would like to load at the top of the page.  Specify
   # these in your Buildfile with the 'bootstrap' config.
-%>
  <%= bootstrap %>

<% #
   # This line should appear in your head area to include the stylesheets
   # generated by your client.  If you need to include your own
   # stylesheets, you don't need to change it here.  Instead use the
   # required option in your config.
-%>
   <%= stylesheets_for_client %>
   <%= @content_for_page_styles %>

<% # The theme CSS class is added automatically based on your chosen theme.
   # If you need to specify a custom theme name, use CONFIG.theme_name
-%>
  <body class="<%= [theme_name(:default => 'sc-theme'), 'focus'].compact.join(' ') %>" <%= config.hide_body_overflow ? 'style="overflow:hidden;"' : '' %> >
<% # This section is used to setup additional optional class names on the
   # body content based on JS-selected conditions.  Use this to make sure you
   # show the proper CSS as soon as the page appears.
-%>
<%= inline_javascript('sproutcore/bootstrap:setup_body_class_names') %>

<% #
   # This is where you root body element will appear.  To cause your
   # content to appear here, just declare content_for('body') in one of
   # your partials.
-%>
<%= @content_for_body %>
<% #
   # This is where your loading screen will appear.  To add a loading screen
   # just declare content_for('loading') in one of your partials. If you use
   # sc-gen to generate your app, it will create a file called loading.rhtml
   # under english.lproj. You can insert the desired content there.
-%>
<% unless @content_for_loading.blank? %>

<%= @content_for_loading %>

<% end -%>
<% #
   # This is where the resources you declare will appear.  By default anything
   # you add to partials will be added to this section unless you specify
   # otherwise.  Note that resources are initially hidden so you can pull them
   # apart as needed on page load.
-%>
<% unless @content_for_resources.blank? %>

      <%= @content_for_resources -%>

<% end -%>
<% #
   # This line should appear at the bottom of your page to include your
   # generated JavaScript and any libraries you reference.  If you need
   # to include other javascripts, add them to the :requires option of
   # your client in routes.rb instead of changing it here.
-%>
<%= javascripts_for_client %>
<% unless @content_for_page_javascript.blank? %>
<%= @content_for_page_javascript %>
<% end -%>
<% #
   # If you use old-style view helpers in your page, this method must be
   # called to actually add the page views to your HTML.  Normally this will
   # not generate any content.
-%>
<% #render_page_views -%>
<% # Older SproutCore applications need SC.didLoad to be called after onload.
   # This is no longer required by SproutCore so it is off by default.  To
   # reenable set use_window_onload = true in yur config.
-%>
<% if config.use_window_onload %>

<% end -%>
<% #
   # The final content section can be used to add any last minute setup you
   # need to do before the page ends.  This is required for loading unit
   # tests among other things.
-%>
<%= @content_for_final -%>


tweaking pagination visibility according to ticket #464

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

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

      <td colspan="<%= active_scaffold_config.list.columns.length + 1 -%>" class="messages-container">
        <div id="<%= active_scaffold_messages_id -%>">
          <%= render :partial => 'messages' %>

        <p id="<%= empty_message_id %>" class="empty-message" <%= ' style="display:none;" ' unless @page.items.empty? %>>
          <%= as_('No Entries') %>

  <tbody class="records" id="<%= active_scaffold_tbody_id %>">
    <% if !@records.empty? -%>
      <%= render :partial => 'list_record', :collection => @page.items, :locals => { :hidden => false } %>
      <% if active_scaffold_config.list.columns.any? {|c| c.calculation?} -%>
        <%= render :partial => 'list_calculations' %>
      <% end -%>
    <% end -%>

<%= @page.pager.count -%> <%=as_('Found') %>

    <%= render :partial => 'list_pagination_links', :locals => { :current_page => @page } unless @page.pager.number_of_pages < 2 %>

<%# a hack for the Rico Corner problem %>

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

      <td colspan="<%= active_scaffold_config.list.columns.length + 1 -%>" class="messages-container">
        <div id="<%= active_scaffold_messages_id -%>">
          <%= render :partial => 'messages' %>

        <p id="<%= empty_message_id %>" class="empty-message" <%= ' style="display:none;" ' unless @page.items.empty? %>>
          <%= as_('No Entries') %>

  <tbody class="records" id="<%= active_scaffold_tbody_id %>">
    <% if !@records.empty? -%>
      <%= render :partial => 'list_record', :collection => @page.items, :locals => { :hidden => false } %>
      <% if active_scaffold_config.list.columns.any? {|c| c.calculation?} -%>
        <%= render :partial => 'list_calculations' %>
      <% end -%>
    <% end -%>

<%= @page.pager.count -%> <%=as_('Found') %>

    <%= render :partial => 'list_pagination_links', :locals => { :current_page => @page } unless @page.pager.number_of_pages == 1 %>

<%# a hack for the Rico Corner problem %>


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

Submit work for <%= @student.assignment.name %>

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

	<%= flash[:notice] %>

<% end %>
<% ret =  display_directory_tree (@files, @student) %>

<%
@user = session[:user]
if(@user.master_permission_granted == nil && !@student.permission_granted)%>

Your work cannot be published because you haven't granted us permission to publish your work.

Click <%= link_to 'yes', :action =>'set_publish_permission_yes', :id => @student.id%> to grant permission for this work.

Click <%= link_to 'always', :action =>'set_publish_master_permission_yes', :id => @student.id%> to grant permission for all your work.

Click <%= link_to 'never', :action =>'set_publish_master_permission_no', :id => @student.id%> to deny permission for all your work.

<%end%>

<%= link_to "View feedback on submissions",{:action => 'view_feedback', :id => @student.id} %>

<%= link_to "Evaluate your team members",{:action => 'peer_review', :id => @student.id} %>

<% if @student.assignment.wiki_type_id == 1%>
Submit your work for the assignment titled: <%= @student.assignment.name %>

<form action="/student_assignment/submit/<%=params[:id] %>" enctype="multipart/form-data" method="post" onsubmit = "return checkIfFileExists(submission.value,0);">

<% stage = StudentAssignmentHelper::get_current_stage(@student.assignment.id) %>
<% if stage != "Complete" %>
<input type="text" name="submission" size=40/><input type="submit" name="upload_link" value="Upload link"/>
</form>
<form action="/student_assignment/submit/<%=params[:id] %>" enctype="multipart/form-data" method="post" onsubmit = "return checkIfFileExists(uploaded_file.value,1);">

<input type="checkbox" name="unzip" value=""/> Unzip submission

<input type="file" id="uploaded_file" name="uploaded_file" size=40 />
<input type="submit" name="upload_file" value="Upload file"/>

</form>
<%end%>
<%= form_tag({:action=>'submit'},:multipart => true, :name=>'submit_form')%>
<% if @student.directory_num != nil and @student.directory_num >= 0 %>
	<% if stage != "Complete" %>

File and folder actions

		<input style="margin-top:0.3em" type="button" onclick="createNewFolder()" name="create_new_folder" value="Create new folder" >
		<input type="button" onclick="copySelectedFile()" value="Copy selected file" name="copy_file" >
		<input type="button" onclick="moveSelectedFile()" value="Move selected file" name="moved_file">
		<input type="button" onclick="renameFile()" value="Rename selected file" name="rename_file" />
		<input type="button" value="Delete selected file" name="delete_files" onclick="deleteSelectedFile();" /><input type="reset" value="Reset">

	<%end%>

					Name
					Size
					Type
					Date Modified

				<%= @ret %>

<% end %>
</form>

<%end%>
<% if @link != nil %>

Hyperlink:
<a href="<%= @link %>" target="new"><%= @link %>

<% end %>

<%if(@review_of_review_mappings.size > 0)%>

Reviews of reviews

  <%ror_no = 1%>
   <% for ror_map in @review_of_review_mappings %>
  <%
  @ror = ReviewOfReview.find(:all,  :conditions => ["review_of_review_mapping_id = ? and review_of_review_mapping_id in( select id from review_of_review_mappings where assignment_id=?)",ror_map.id, @assignment_id]) %>
  <% if (@ror)%>

Review of Review <%=ror_no%>  <%= link_to "View",{:controller => 'review_of_review', :action => 'view_review_of_review', :id => @ror.id} %>
  <% end %>
  <%ror_no += 1
  	end
  end%>

Submit work for <%= @student.assignment.name %>

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

	<%= flash[:notice] %>

<% end %>

<%
@user = session[:user]
if(@user.master_permission_granted == nil && !@student.permission_granted)%>

Your work cannot be published because you haven't granted us publishing permissions.

Click <%= link_to 'here', :action =>'view_publishing' %> to set your publishing preferences.

<%end%>

<%= link_to "View feedback on submissions",{:action => 'view_feedback', :id => @student.id} %>

<%= link_to "Evaluate your team members",{:action => 'peer_review', :id => @student.id} %>

<% if @student.assignment.wiki_type_id == 1%>
Submit your work for the assignment titled: <%= @student.assignment.name %>

<%= form_tag({:action=>'submit'},:multipart => true, :name=>'submit_form')%>
<input type="text" name="submission" size=40 value = " "/><input type="submit" name="upload_link" value="Upload link"/>
<%= end_form_tag%>
<%= form_tag({:action=>'submit'},:multipart => true, :name=>'submit_form')%>

<input type="file" id="uploaded_file" name="uploaded_file" size=40 />
<input type="submit" name="upload_file" value="Upload file" onclick="checkIfFileExists('Upload');"/>

<% if @student.directory_num != nil and @student.directory_num >= 0 %>

File and folder actions

	<input style="margin-top:0.3em" type="button" onclick="createNewFolder()" name="create_new_folder" value="Create new folder" >
	<input type="button" onclick="copySelectedFile()" name="copy_selected_file" value="Copy selected file" >
	<input type="button" onclick="moveSelectedFile()" name="move_selected_file" value="Move selected file">
	<input type="button" onclick="renameFile()" name="rename_file" value="Rename selected file" />
	<input type="submit" name="delete_files" value="Delete selected file" onclick="checkIfFileExists('Delete selected file');" />

			Directory <%= select(:current_folder, :name,
					   @folders, {},
					   {:onchange => "document.forms[0].submit()"} ) %>

					Name
					Size
					Type
					Date Modified

				<%  i = 0
					for file in @files %>

						<input type=radio id="chk_files_<%= i %>" name="chk_files[<%= i %>]">
						<input type=hidden id="filenames_<%=i%>" name="filenames[<%= i %>]" value="<%= File.basename(file) %>">
						<% i = i + 1 %>
						<%= link_to File.basename(file), :action => 'submit', :id => @student.id, :download => File.basename(file), "current_folder[name]" => @current_folder.name %>

					<%= File.size(file) %>

						<% base = File.basename(file)
						   if base.split(".").size > 1 %>
							<%= base.split(".")[base.split(".").size-1] %>
						<% end %>

					<%= File.mtime(file) %>

					<% end %>

<% end %>
</form>

<%end%>
<% if @link != nil %>

Hyperlink:
<a href="<%= @link %>" target="new"><%= @link %>

<% end %>

<%if(@review_of_review_mappings.size > 0)%>

Reviews of reviews

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

Review of Review <%=ror_no%>  <%= link_to "View",{:controller => 'review_of_review', :action => 'view_review_of_review', :id => @ror.id} %>
  <% end %>
  <%ror_no += 1
  	end
  end%>


Only show the schedules tab if we have a published one

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

<% if @site_template -%>

<% else -%>

<% end -%>

  <meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
  <%= stylesheet_link_tag 'global.css' %>
  <%= ae_form_stylesheet %>
  <%= stylesheet_link_tag "thickbox" %>
  <%= javascript_include_tag "jquery", "thickbox", "jquery.ui.all.packed.js" %>
  <% if @rss_url %>
    <link rel="alternate" title="RSS Feed" href="<%=@rss_url%>" type="application/rss+xml"/>
  <% end %>

  <% if not @site_template.themeroller_css.blank? -%>
    <%= stylesheet_link_tag "#{site_template_url(@site_template)}/themeroller.css" %>
  <% else -%>
    <%= stylesheet_link_tag 'themeroller-default.css' %>
  <% end -%>
  <% if not @site_template.css.blank? -%>

  <% end -%>
  <title><%= page_title %></title>

<% if not @site_template.header.blank? -%>
  <%= @site_template.header %>
<% end -%>

<% if not @hide_chrome -%>

<%= page_title %>

          <% if @context and @context.parent -%>

Part of
              <%= link_to @context.parent.fullname, :controller => params[:controller], :context => @context.parent.id %>

          <% end -%>

<%= link_to "Home", :controller => :main, :action => :index %>

<%= link_to "My Events", :controller => :agenda, :action => :index %>

            <% if @context and @context.schedules.count(:conditions => ["published = ?", true]) == 1 -%>

<%= link_to "Event Schedule", schedule_path(@context.schedules[0]) %>

            <% elsif @context and @context.schedules.count(:conditions => ["published = ?", true]) > 1 -%>

<%= link_to "Event Schedules", schedules_path %>

            <% end -%>
            <% if logged_in_person_can_edit?(@context) -%>

Administration »

                  «
                  <%= link_to "Events", events_path %>
                  <%= link_to "Locations", locations_path %>
                  <%= link_to "Site Templates", site_templates_path %>
                  <%= link_to "Schedules", schedules_path %>

            <% end -%>

          <%= render :partial => 'auth/auth_form' %>

<% end -%>

<% if flash[:error_messages] and flash[:error_messages].length > 0 -%>

There were some errors processing your request:

      <% flash[:error_messages].each do |msg| -%>

<%= msg%>

      <% end -%>

<% end -%>

  <%= @content_for_layout %>

<% if not @site_template.footer.blank? -%>
  <%= @site_template.footer %>
<% end -%>

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

<% if @site_template -%>

<% else -%>

<% end -%>

  <meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
  <%= stylesheet_link_tag 'global.css' %>
  <%= ae_form_stylesheet %>
  <%= stylesheet_link_tag "thickbox" %>
  <%= javascript_include_tag "jquery", "thickbox", "jquery.ui.all.packed.js" %>
  <% if @rss_url %>
    <link rel="alternate" title="RSS Feed" href="<%=@rss_url%>" type="application/rss+xml"/>
  <% end %>

  <% if not @site_template.themeroller_css.blank? -%>
    <%= stylesheet_link_tag "#{site_template_url(@site_template)}/themeroller.css" %>
  <% else -%>
    <%= stylesheet_link_tag 'themeroller-default.css' %>
  <% end -%>
  <% if not @site_template.css.blank? -%>

  <% end -%>
  <title><%= page_title %></title>

<% if not @site_template.header.blank? -%>
  <%= @site_template.header %>
<% end -%>

<% if not @hide_chrome -%>

<%= page_title %>

          <% if @context and @context.parent -%>

Part of
              <%= link_to @context.parent.fullname, :controller => params[:controller], :context => @context.parent.id %>

          <% end -%>

<%= link_to "Home", :controller => :main, :action => :index %>

<%= link_to "My Events", :controller => :agenda, :action => :index %>

            <% if @context and @context.schedules.size == 1 -%>

<%= link_to "Event Schedule", schedule_path(@context.schedules[0]) %>

            <% else -%>

<%= link_to "Event Schedules", schedules_path %>

            <% end -%>
            <% if logged_in_person_can_edit?(@context) -%>

Administration »

                  «
                  <%= link_to "Events", events_path %>
                  <%= link_to "Locations", locations_path %>
                  <%= link_to "Site Templates", site_templates_path %>
                  <%= link_to "Schedules", schedules_path %>

            <% end -%>

          <%= render :partial => 'auth/auth_form' %>

<% end -%>

<% if flash[:error_messages] and flash[:error_messages].length > 0 -%>

There were some errors processing your request:

      <% flash[:error_messages].each do |msg| -%>

<%= msg%>

      <% end -%>

<% end -%>

  <%= @content_for_layout %>

<% if not @site_template.footer.blank? -%>
  <%= @site_template.footer %>
<% end -%>


Changed length of notes under images on show_images from 40 to 300 chars.

git-svn-id: 3ebd8a4fd9006ff03462623fffc479a1d4750d42@699 7a65b82a-1d14-0410-b525-e2835e71a0b4

<% if @observation.images.length > 0 %>
  <%= :images.t %>:

<% end %>

<% if check_permission(@observation.user_id) %>
  <%= link_to(:show_observation_add_images.t, :controller => 'image', :action => 'add_image', :id => @observation.id) %>

  <%= link_to(:show_observation_reuse_image.t, :controller => 'image', :action => 'reuse_image', :id => @observation.id) %>

  <% if @observation.images.length > 0 %>
    <%= link_to(:show_observation_remove_images.t, :controller => 'image', :action => 'remove_images', :id => @observation.id) %>

  <% end %>
<% end %>

  <% done = {}
  for image in [@observation.thumb_image] + @observation.images
    if image && !done[image.id]
      done[image.id] = true %>

        <%= link_to(image_tag(sprintf("thumb/%d.jpg", image.id)) + '
' +
                      image.unique_format_name.t,
                    :controller => 'image', :action => 'show_image', :id => image.id, :params => search_params) %>

        <% if image.notes && image.notes != '' %>

            <%= str = image.notes[0..300].tl
            str += '...' if image.notes.length > 301
            str %>

        <% end %>

    <% end %>
  <% end %>

<% if @observation.images.length > 0 %>
  <%= :images.t %>:

<% end %>

<% if check_permission(@observation.user_id) %>
  <%= link_to(:show_observation_add_images.t, :controller => 'image', :action => 'add_image', :id => @observation.id) %>

  <%= link_to(:show_observation_reuse_image.t, :controller => 'image', :action => 'reuse_image', :id => @observation.id) %>

  <% if @observation.images.length > 0 %>
    <%= link_to(:show_observation_remove_images.t, :controller => 'image', :action => 'remove_images', :id => @observation.id) %>

  <% end %>
<% end %>

  <% done = {}
  for image in [@observation.thumb_image] + @observation.images
    if image && !done[image.id]
      done[image.id] = true %>

        <%= link_to(image_tag(sprintf("thumb/%d.jpg", image.id)) + '
' +
                      image.unique_format_name.t,
                    :controller => 'image', :action => 'show_image', :id => image.id, :params => search_params) %>

        <% if image.notes && image.notes != '' %>

            <%= str = image.notes[0..40].tl
            str += '...' if image.notes.length > 41
            str %>

        <% end %>

    <% end %>
  <% end %>


Replace two links with one

Replace two links with one

<%= _('Follow this request') %>

    <% follower_count = TrackThing.count(:all, :conditions => ["info_request_id = ?", @info_request.id]) + 1 %>

<%= n_("There is %d person following this request", "There are %d people following this request", follower_count) % follower_count %>

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

    <% if @info_request.described_state != "attention_requested" %>

<%= _('Offensive? Unsuitable?') %>

      <% if @info_request.attention_requested %>
        <% if @info_request.prominence == 'hidden' %>
          <%# The eccentric formatting of the following string is in order that it be identical
              to the corresponding string in request/show.rhtml %>

<%= _('This request has prominence \'hidden\'. You can only see it because you are logged
    in as a super user.') %>

        <% elsif @info_request.prominence == 'requester_only' %>
          <%# The eccentric formatting of the following string is in order that it be identical
              to the corresponding string in request/show.rhtml %>

<%= raw(_('This request is hidden, so that only you the requester can see it. Please
    contact us if you are not sure why.') % [help_requesting_path]) %>

        <% else %>

<%= raw(_('This request has been marked for review by the site administrators, who have not hidden it at this time. If you believe it should be hidden, please contact us.') % [help_requesting_path]) %>

        <% end %>
     <% else %>

<%= _('Requests for personal information and vexatious requests are not considered valid for FOI purposes (read more).') %>

<%= _('If you believe this request is not suitable, you can report it for attention by the site administrators') %>

       <%= button_to _("Report this request"), report_path, :class => "link_button_green" %>
      <% end %>
    <% end %>

<%= _("Act on what you've learnt") %>

        <%
          # Cast "related" to normal string because html safe string (from rails_xss gem) and CGI::escape
          # interact badly with ':' character. Go figure! Might go away in rails 3
        %>
        <% link_to "https://twitter.com/share?" + {:url => request.url, :via => Configuration::twitter_username, :text => @info_request.title, :related => _('alaveteli_foi:The software that runs {{site_name}}', :site_name => site_name).to_str}.to_query do %>
          <%= image_tag "twitter-16.png", :alt => "twitter icon" %>
          <%= _("Tweet this request") %>
        <% end %>

        <% link_to "http://wordpress.com/" do %>
          <%= image_tag "wordpress.png", :class => "rss" %>
          <%= _("Start your own blog") %>
        <% end %>

    <%= render :partial => 'request/next_actions' %>

    <% # TODO: Cache for 1 day %>
      <% if !@xapian_similar.nil? && @xapian_similar.results.size > 0 %>

<%= _('Similar requests')%>

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

<%= link_to _("More similar requests"), similar_request_path(@info_request) %>

        <% end %>

      <% end %>

<%= link_to _('Event history details'), request_details_path(@info_request) %>

<%= raw(_('Are you the owner of
            any commercial copyright on this page?') % [help_officers_path+"#copyright"]) %>

<%= _('Follow this request') %>

    <% follower_count = TrackThing.count(:all, :conditions => ["info_request_id = ?", @info_request.id]) + 1 %>

<%= n_("There is %d person following this request", "There are %d people following this request", follower_count) % follower_count %>

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

    <% if @info_request.described_state != "attention_requested" %>

<%= _('Offensive? Unsuitable?') %>

      <% if @info_request.attention_requested %>
        <% if @info_request.prominence == 'hidden' %>
          <%# The eccentric formatting of the following string is in order that it be identical
              to the corresponding string in request/show.rhtml %>

<%= _('This request has prominence \'hidden\'. You can only see it because you are logged
    in as a super user.') %>

        <% elsif @info_request.prominence == 'requester_only' %>
          <%# The eccentric formatting of the following string is in order that it be identical
              to the corresponding string in request/show.rhtml %>

<%= raw(_('This request is hidden, so that only you the requester can see it. Please
    contact us if you are not sure why.') % [help_requesting_path]) %>

        <% else %>

<%= raw(_('This request has been marked for review by the site administrators, who have not hidden it at this time. If you believe it should be hidden, please contact us.') % [help_requesting_path]) %>

        <% end %>
     <% else %>

<%= _('Requests for personal information and vexatious requests are not considered valid for FOI purposes (read more).') %>

<%= _('If you believe this request is not suitable, you can report it for attention by the site administrators') %>

       <%= button_to _("Report this request"), report_path, :class => "link_button_green" %>
      <% end %>
    <% end %>

<%= _("Act on what you've learnt") %>

        <%
          # Cast "related" to normal string because html safe string (from rails_xss gem) and CGI::escape
          # interact badly with ':' character. Go figure! Might go away in rails 3
        %>
        <% tweet_link = "https://twitter.com/share?" + {:url => request.url, :via => Configuration::twitter_username, :text => @info_request.title, :related => _('alaveteli_foi:The software that runs {{site_name}}', :site_name => site_name).to_str}.to_query %>
        <% link_to tweet_link do %>
          <%= image_tag "twitter-16.png", :alt => "twitter icon" %>
        <% end %>
        <%= link_to _("Tweet this request"), tweet_link %>

        <% link_to "http://wordpress.com/" do %>
          <%= image_tag "wordpress.png", :class => "rss" %>
        <% end %>
        <%= link_to _("Start your own blog"), "http://wordpress.com/"%>

    <%= render :partial => 'request/next_actions' %>

    <% # TODO: Cache for 1 day %>
      <% if !@xapian_similar.nil? && @xapian_similar.results.size > 0 %>

<%= _('Similar requests')%>

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

<%= link_to _("More similar requests"), similar_request_path(@info_request) %>

        <% end %>

      <% end %>

<%= link_to _('Event history details'), request_details_path(@info_request) %>

<%= raw(_('Are you the owner of
            any commercial copyright on this page?') % [help_officers_path+"#copyright"]) %>