fixed silly error setting the current access_type for existing items shared with SysMO and Your projects

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

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

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

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

          You may:

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

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

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

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

          <% end %>

Define more fine-grained sharing in the Advanced sharing: you can share within your Project/Institution only,
 with specific individuals, or set up custom favourite groups for people you regularly need to share with.

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

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

Or share it with..

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

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

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

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

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

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

    <% end -%>

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

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

Additional fine-grained sharing permissions

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

              Loading...

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

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

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

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

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

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

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

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

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

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

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

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

                  Step 3

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

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

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

                      Step 3: Choose access rights, review and submit

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          You may:

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

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

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

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

          <% end %>

Define more fine-grained sharing in the Advanced sharing: you can share within your Project/Institution only,
 with specific individuals, or set up custom favourite groups for people you regularly need to share with.

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

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

Or share it with..

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

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

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

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

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

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

    <% end -%>

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

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

Additional fine-grained sharing permissions

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

              Loading...

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

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

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

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

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

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

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

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

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

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

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

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

                  Step 3

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

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

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

                      Step 3: Choose access rights, review and submit

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

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

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

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

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

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

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

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

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

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

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

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


use single ext file on production

use single ext file on production

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

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

<% end %>

    <title><%= application_title %></title>
    <%= stylesheet_link_tag 'main2', 'connexion_default' %>
    <%= render :partial => "externs/sortable_tables" %>

    <%= javascript_include_tag "prototype", "effects" %>
    <%= render :partial => "externs/load_extern" %>

    <% if Rails.env.development? %>

    <% else %>

    <% end %>
    <link rel="stylesheet" type="text/css" href="/extjs/resources/css/ext-all-scoped.css">

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

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

debug: <%= @debug -%>

    <% end -%>

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

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

        <% if @viewer %>

Hi <%= @viewer.name %> - <%= link_to "logout", :action => :logout, :controller => :security %>

        <% end %>

        <% if @eg %>

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

        <% end %>

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

<%= application_title %>

      <% end -%>

    <% if @viewer %>

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

    <% end %>

    <% if @title %>

<%=@title%>

    <% end %>

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

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

          <%= submenu_items_html %>

    <% end %>

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

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

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

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

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

    <% end %>

        <% if @form && params[:controller] != 'forms' %>
          <%= render_if_possible("qe_forms/form_#{@form}") || render_if_possible(:file => "layouts/form_#{@form}")%>
        <% else %>
          <%= yield %>
        <% end %>

    <% if @eg || @show_contact_emails_override %>

        Questions?

        Power to Change - Students - susan.dossantos@powertochange.org

        LeaderImpact Group - judyh@leaderimpactgroup.com

        Athletes in Action - morgand@athletesinaction.com

        Drime - info@drime.com

        MinistryNet - ministrynet@ccci.org

        GAiN - lifeteams@globalaid.net

			General Inquiries:pat.help@powertochange.org

			Online help can be found here.

    <% end %>

    <%= initialize_sortable_tables %>

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

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

<% end %>

    <title><%= application_title %></title>
    <%= stylesheet_link_tag 'main2', 'connexion_default' %>
    <%= render :partial => "externs/sortable_tables" %>

    <%= javascript_include_tag "prototype", "effects" %>
    <%= render :partial => "externs/load_extern" %>

    <link rel="stylesheet" type="text/css" href="/extjs/resources/css/ext-all-scoped.css">

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

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

debug: <%= @debug -%>

    <% end -%>

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

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

        <% if @viewer %>

Hi <%= @viewer.name %> - <%= link_to "logout", :action => :logout, :controller => :security %>

        <% end %>

        <% if @eg %>

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

        <% end %>

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

<%= application_title %>

      <% end -%>

    <% if @viewer %>

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

    <% end %>

    <% if @title %>

<%=@title%>

    <% end %>

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

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

          <%= submenu_items_html %>

    <% end %>

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

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

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

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

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

    <% end %>

        <% if @form && params[:controller] != 'forms' %>
          <%= render_if_possible("qe_forms/form_#{@form}") || render_if_possible(:file => "layouts/form_#{@form}")%>
        <% else %>
          <%= yield %>
        <% end %>

    <% if @eg || @show_contact_emails_override %>

        Questions?

        Power to Change - Students - susan.dossantos@powertochange.org

        LeaderImpact Group - judyh@leaderimpactgroup.com

        Athletes in Action - morgand@athletesinaction.com

        Drime - info@drime.com

        MinistryNet - ministrynet@ccci.org

        GAiN - lifeteams@globalaid.net

			General Inquiries:pat.help@powertochange.org

			Online help can be found here.

    <% end %>

    <%= initialize_sortable_tables %>


Add navbar-inverse class to the admin navbar - the bootstrap default is now a white background. Add admin class in order to apply styles from the admin stylesheet even when the navbar is being shown to an admin user using the front end (so no admin class will be applied to the body element).

        <%= link_to 'Alaveteli', main_url('/'), :class => "brand" %>

<%= link_to 'Summary', admin_url("") %>

<%= link_to 'Timeline', admin_url("timeline") %>

<%= link_to 'Stats', admin_url("stats") %>

<%= link_to 'Debug', admin_url("debug") %>

<%= link_to 'Authorities', admin_url("body/list") %>

<%= link_to 'Requests', admin_url("request/list") %>

<%= link_to 'Users', admin_url("user/list") %>

<%= link_to 'Tracks', admin_url("track/list") %>

<%= link_to 'Log out', signout_path %>


Update other reference to Rother attachment.

<% @title = "FOI officer questions" %>

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

<%= @title %> #

I just got here from bottom of an FOI request, what is going on? #

WhatDoTheyKnow is a service run by a charity. It helps ordinary members
of the public make FOI requests, and easily track and share the responses.

The FOI request you received was made by someone using WhatDoTheyKnow. You can
simply reply to the request as you would any other request from an individual.
The only difference is that your response will be automatically published on
the Internet.

If you have privacy or other concerns, please read the answers below.
You might also like to read the introduction to WhatDoTheyKnow to find out more about what
the site does from the point of view of a user. You can also search the
site to find the authority that you work for, and view the status of
any requests made using the site.

Finally, we welcome comments and
thoughts from FOI officers, please get in touch.

Why are you publishing responses to FOI requests? #

We think there are lots of benefits. Most importantly it will encourage the
public to be more interested and involved in the work of government. We
also hope that it will reduce the number of duplicate requests on any
subject that a public body will receive. Given that Freedom of Information
responses contain public information, which anybody could easily request
again from the public authority, we think there should be no reason not to
publish it widely.

Are the people making requests real people? #

Yes. For the purposes of keeping track of responses we use
computer-generated email addresses for each request. However, before
they can send a request, each user must register on the site with a
unique email address that we then verify. You can search this site and
find a page listing all requests that each person has made.

An email isn't a sufficient address for an FOI request! #

Yes it is. This
letter from the ICO to Rother District Council gives guidance on the matter, specifically
in the context of requests made via WhatDoTheyKnow.

Aren't you making lots of vexatious requests? #

WhatDoTheyKnow is not making any requests. We are sending requests on
behalf of our users, who are real people making the requests.

Look at it like this - if lots of different people made requests from
different Hotmail email addresses, then you would not think that Microsoft were
making vexatious requests. It is exactly the same if lots of requests are made
via WhatDoTheyKnow. Moreover, since all requests are public it is much easier
for you to see if one of our users is making vexatious requests.

If that isn't enough for you, the
letter from the ICO to Rother District Council gives some guidance on the matter.

I can see a request on WhatDoTheyKnow, but we never got it by email!#

If a request appears on the site, then we have attempted to send it to
the authority by email. Any delivery failure messages will automatically
appear on the site. You can check the address we're using with the "View FOI
email address" link which appears on the page for the authority. Contact us if there is a better address we can
use.

Requests are sometimes not delivered because they are quietly removed by
"spam filters" in the IT department of the authority. Authorities can make
sure this doesn't happen by asking their IT departments to "whitelist"
any email from @whatdotheyknow.com.
If you ask us we will resend any request,
and/or give technical details of delivery so an IT department can chase
up what happened to the message.

Finally, you can respond to any request from your web browser, without
needing any email, using the "respond to request" link at the bottom of
each request page.

How do you calculate the deadline shown on request pages?#

The Freedom of Information Act says:

A public authority must comply with section 1(1) promptly and
in any event not later than the twentieth working day following the date of
receipt.

The nerdy detail of exactly how weekends are counted, and what happens if
the request arrives out of office hours, is just that - detail. What matters
here is that the law says authorities must respond promptly.

If you've got a good reason why the request is going to take a while to
process, requesters find it really helpful if you can send a quick email with a
sentence or two saying what is happening.

FOI officers often have to do a lot of hard work to answer
requests, and this is hidden from the public. We think it would help everyone
to have more of that complexity visible.

But really, how do you calculate the deadline?#

Please read the answer to the previous question first. Legally, authorities
must respond promptly to FOI requests. If they fail to do that,
it is best if they show the hard work they are doing by explaining what is
taking the extra time to do.

That said, WhatDoTheyKnow does show the maximum legal deadline
for response on each request. Here's how we calculate it.

If the day we deliver the request by email is a working day, we count that
as "day zero", even if it was delivered late in the evening. Days end at
midnight.  We then count the next working day as "day one", and so on up to
20 working days.

If the day the request email was delivered was a non-working day, we count
the next working day as "day one". Delivery is delivery, even if it happened on
the weekend. Some authorities disagree with this, our lawyer disagrees with them.

Requesters are encouraged to mark when they have clarified
their request so the clock resets, but sometimes they get this wrong. If you
see a problem with a particular request, let us know and we'll fix it.

The date thus calculated is shown on requests with the text "By law,
Liverpool City Council should normally have responded by...". There is only
one case which is not normal, see the next question about
public interest test time extensions.

Schools are also a special case, which WhatDoTheyKnow displays differently.

Since June 2009, schools have "20 working days
disregarding any working day which is not a school day, or 60 working days,
whichever is first" (FOI (Time for Compliance with Request) Regulations 2009). WhatDoTheyKnow indicates on requests to schools that the 20 day deadline is only
during term time, and shows them as definitely overdue after 60 working days

If you're getting really nerdy about all this, read the detailed ICO guidance.
Meanwhile, remember that the law says authorities must respond
promptly. That's really what matters.

How do you reflect time extensions for public interest tests?#

The Freedom of Information Act lets authorities claim an indefinite time
extension when applying a public interest test.  Information
Commissioner guidance says that it should only be used in "exceptionally
complex" cases
(FOI Good Practice Guidance No. 4).
WhatDoTheyKnow doesn't specifically handle this case, which is why we use the
phrase "should normally have responded by" when the 20 working day time is
exceeded.

The same guidance says that, even in exceptionally complex cases, no
Freedom of Information request should take more than 40 working days
to answer.  WhatDoTheyKnow displays requests which are overdue by that much
with stronger wording to indicate they are definitely late.

The Freedom of Information (Scotland) Act does not allow such a public
interest extension. WhatDoTheyKnow would like to see the law changed to either
remove the extension from the UK Act, or to reintroduce an absolute time limit
of 40 working days even with the extension (the House of Lords voted
to remove provision for such a time limit during the initial passage
of the UK Act through Parliament).

How can I send a large file, which won't go by email?#

Instead of email, you can respond to a request directly from your web
browser, including uploading a file. To do this, choose "respond to request" at
the bottom of the request's page. Contact us if it
is too big for even that (more than, say, 50Mb).

Why do you publish the names of civil servants and the text of emails? #

We consider what officers or servants do in the course of their employment
to be public information. We will only remove content in exceptional
circumstances, see our take down policy.

Do you publish email addresses or mobile phone numbers? #

To prevent spam, we automatically remove most emails and some mobile numbers from
responses to requests.  Please contact us if we've
missed one.
For technical reasons we don't always remove them from attachments, such as certain PDFs.

If you need to know what an address was that we've removed, please get in touch with us. Occasionally, an email address
forms an important part of a response and we will post it up in an obscured
form in an annotation.

What is your policy on copyright of documents?#

Our Freedom of Information law is "applicant blind", so anyone in the
world can request the same document and get a copy of it.

If you think our making a document available on the internet infringes your
copyright, you may contact us and ask us
to take it down.  However, to save tax payers' money by preventing duplicate
requests, and for good public relations, we'd advise you not to do that.

If you haven't already, read the introduction -->

Otherwise, the credits or the programmers API -->


Oops, forgot to remove debug thing from create_darvin.

<% if can_do_ajax? %>
  <%= javascript_include_tag 'prototype' %>
  <%= javascript_include_tag 'controls' %>
  <%= javascript_include_tag 'effects' %>
  <%= javascript_include_tag 'darvin' %>
<% end %>

<% @title = "Darvin's Special" %>

<%= @title %>

<% if !@js %>

This page will not work if javascript is disabled.

<% else if !can_do_ajax? %>

This page will not work on your browser, sorry!

<% else %>

  Genera
  Species
  Selected

   <%= form_tag({:action => 'create_darvin'}, {}) %>
    <%= submit_tag('Create List') %>
    <%= submit_tag('Show as Plain Text') %>
    <%= submit_tag('Show as Rich Text') %>
    <%= submit_tag('Show as Spreadsheet') %>
    <%= hidden_field_tag('results', @names.join("\n")) %>
   </form>

<%= javascript_tag %(
  var GENERA  = [#{@genera.map  {|n| "'#{n}'"}.join(",")}];
  var SPECIES = [#{@species.map {|n| "'#{n}'"}.join(",")}];
  var NAMES   = [];
  darvin_initialize_names();
  darvin_draw("genera", GENERA);
  darvin_draw("names", NAMES);
) %>

Create List: Click on a genus in the first
column to pull up a list of species in that genus.  Click on any of these taxa
to add species to your list.  Deprecated names are automatically linked to the
corresponding accepted name.  Your species list is shown in the third column.
You may remove names from this list by clicking on them.

Save List: When you are finished, click on any
of the buttons at the bottom of the page.  "Create List" takes you back to the
standard creation form, where you will be able to enter date, location, notes,
etc. before saving the list.

Reports: The plain text report gives you a
simple list of taxa with no formatting.  Rich text can be used to import the
list into Microsoft Word with all the formatting intact.  Spreadsheet produces
a CSV file, with name, author, and citation columns.  Common names are not
available yet.  (Click on "back" button in browser to return to this
form.)

  <% end %>
<% end %>

<% if can_do_ajax? %>
  <%= javascript_include_tag 'prototype' %>
  <%= javascript_include_tag 'controls' %>
  <%= javascript_include_tag 'effects' %>
  <%= javascript_include_tag 'darvin' %>
<% end %>

<% @title = "Darvin's Special" %>

<%= @title %>

<% if !@js %>

This page will not work if javascript is disabled.

<% else if true %>

This page will not work on your browser, sorry!

<% else %>

  Genera
  Species
  Selected

   <%= form_tag({:action => 'create_darvin'}, {}) %>
    <%= submit_tag('Create List') %>
    <%= submit_tag('Show as Plain Text') %>
    <%= submit_tag('Show as Rich Text') %>
    <%= submit_tag('Show as Spreadsheet') %>
    <%= hidden_field_tag('results', @names.join("\n")) %>
   </form>

<%= javascript_tag %(
  var GENERA  = [#{@genera.map  {|n| "'#{n}'"}.join(",")}];
  var SPECIES = [#{@species.map {|n| "'#{n}'"}.join(",")}];
  var NAMES   = [];
  darvin_initialize_names();
  darvin_draw("genera", GENERA);
  darvin_draw("names", NAMES);
) %>

Create List: Click on a genus in the first
column to pull up a list of species in that genus.  Click on any of these taxa
to add species to your list.  Deprecated names are automatically linked to the
corresponding accepted name.  Your species list is shown in the third column.
You may remove names from this list by clicking on them.

Save List: When you are finished, click on any
of the buttons at the bottom of the page.  "Create List" takes you back to the
standard creation form, where you will be able to enter date, location, notes,
etc. before saving the list.

Reports: The plain text report gives you a
simple list of taxa with no formatting.  Rich text can be used to import the
list into Microsoft Word with all the formatting intact.  Spreadsheet produces
a CSV file, with name, author, and citation columns.  Common names are not
available yet.  (Click on "back" button in browser to return to this
form.)

  <% end %>
<% end %>


fixes #79

fixes #79

Al limitar el tamaño de los nombres de los espacios del desplegable, se había olvidado poner en los espacios públicos (*) detrás

git-svn-id: 268669d3058f191005ae665964cd19b71efa10c4@15798 3f47a204-8049-4147-aab0-d444c64e7564

<% array_spaces = Space.compone_array_spaces(current_user)

	-%>

Space:

			<% form_tag("/spaces/show", {:name=>'form',:style => "display: inline;", :method => 'get'}) do %>
					<%if @space%>
						<select id="space_id" name="space[id]" class="elegido" onchange="change_space()" selected="<%=@space.name%>">
							<%for arraycin in array_spaces%>
								<%if arraycin[1]==@space.name%>
									<option value="<%=arraycin[1]%>"  selected="selected"><%if Space.find_by_name(arraycin[0]).public == true && @space.id !=1 %><%=name_format(arraycin[0],13,"(*)")%><%else%> <%=name_format(arraycin[0],15,"")%><%end%> </option>
								<%else%>
									<option value="<%=arraycin[1]%>" class="noelegido"><%if Space.find_by_name(arraycin[0]).public == true && @space.id !=1 %><%=name_format(arraycin[0],13,"(*)")%><%else%> <%=name_format(arraycin[0],15,"")%><%end%></option>
								<%end%>
							<%end%>
						</select>
					<%else%>
						<%= select("space", "id", array_spaces,{ :include_blank=>false }, { :onchange => "change_space()" })%>
					<%end%>
			<% end -%>

<% array_spaces = Space.compone_array_spaces(current_user)

	-%>

Space:

			<% form_tag("/spaces/show", {:name=>'form',:style => "display: inline;", :method => 'get'}) do %>
					<%if @space%>
						<select id="space_id" name="space[id]" class="elegido" onchange="change_space()" selected="<%=@space.name%>">
							<%for arraycin in array_spaces%>
								<%if arraycin[1]==@space.name%>
									<option value="<%=arraycin[1]%>"  selected="selected"><%=name_format(arraycin[0],15,"")%></option>
								<%else%>
									<option value="<%=arraycin[1]%>" class="noelegido"><%=name_format(arraycin[0],15,"")%></option>
								<%end%>
							<%end%>
						</select>
					<%else%>
						<%= select("space", "id", array_spaces,{ :include_blank=>false }, { :onchange => "change_space()" })%>
					<%end%>
			<% end -%>


made account view nicer and cleaner

made account view nicer and cleaner

Account <%= @account.title %>

    Title
    Value Date
    Credit
    Debit

  <% for booking in @account.bookings %>

    <%= booking.title%>
    <%= link_to h(booking.value_date.strftime("%d.%m.%Y")), :controller => :bookings, :action => :show, :id => booking  unless booking.value_date.nil? %>
    <%= booking.amount if booking.credit_account == @account %>
    <%= booking.amount if booking.debit_account == @account %>

  <% end %>

    Saldo
    <%= @account.saldo if @account.saldo >= 0%>
    <%= -@account.saldo if @account.saldo < 0%>

<%= link_to 'Edit', :action => 'edit', :id => @account %> |
<%= link_to 'Back', :action => 'list' %>

Account <%= @account.title %>

    Title
    Value Date
    Credit
    Debit

  <% for booking in @account.bookings %>

    <%= booking.title%>
    <%= link_to h(booking.value_date), :controller => :bookings, :action => :show, :id => booking %>
    <%= booking.amount if booking.credit_account == @account %>
    <%= booking.amount if booking.debit_account == @account %>

  <% end %>

    Saldo
    <%= @account.saldo if @account.saldo >= 0%>
    <%= -@account.saldo if @account.saldo < 0%>

<%= link_to 'Edit', :action => 'edit', :id => @account %> |
<%= link_to 'Back', :action => 'list' %>


Changes to show view. Added right side menu

<%content_for("left") do-%>
<%= render :partial => "layouts/nav_bar", :locals => {:category => @article.class.to_s.pluralize, :property => @article.title} -%>

<%= link_to @article.title-%>

<%= @article.body -%>

<%= link_to 'Edit', :action => 'edit', :id => @article %> |
<%= link_to 'Articles list', :action => 'list' %>
<%end-%>
<%content_for("right") do-%>

<%if @recent_articles-%>

Recent articles

    <%for article in @recent_articles -%>

<%= link_to truncate(article.title,30), :id => article.id-%>

    <%end-%>

<%= link_to "Show all", :action => 'list'-%>
<%end-%>

Properties

Title: <%= @article.title-%>

Posted by: <%= @article.author.fullname-%>

Created on: <%= @article.created_at.strftime("%D")-%>

Published: <%= @article.published == true ? "Yes" : "No"-%>

Tags: <%= @article.tags-%>

<%end-%>

<%content_for("left") do-%>
<% for column in Article.content_columns %>

  <%= column.human_name %>: <%=h @article.send(column.name) %>

<% end %>

<%= link_to 'Edit', :action => 'edit', :id => @article %> |
<%= link_to 'Back', :action => 'list' %>
<%end-%>
<%content_for("right") do-%>
<%end-%>


$design_mode added to index.rhtml

$design_mode added to index.rhtml

<% # 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>
<html<% unless @content_for_html5_manifest.blank? %> manifest="app.manifest"<% end %>>

    <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" />
	<link rel="apple-touch-icon-precomposed" href="<%= sc_static('sproutcore-logo.png') %>"/>
	<link rel="apple-touch-startup-image" href="<%= sc_static('sproutcore-startup.png') %>">

<% # 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(' ') %>">
<% # 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 -%>
<%
  #disable main if the application is loaded in design mode
%>
<% if $design_mode %>

<%end%>


Show login failure message

Show login failure message

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

  <title>Journey</title>
  <meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
        <%= stylesheet_link_tag 'journey.css' %>
        <%= stylesheet_link_tag 'questionnaire' %>

  <%= ae_form_stylesheet %>
  <%= javascript_include_tag :defaults %>
  <%= javascript_include_tag 'jester', :plugin => 'jipe' %>
  <%= javascript_include_tag 'jipe', :plugin => 'jipe' %>
  <%= javascript_include_tag 'browserdetect.js' %>
  <% if @rss_url %>
    <link rel="alternate" title="RSS Feed" href="<%=@rss_url%>" type="application/rss+xml"/>
  <% end %>

<% if flash[:errors] or flash[:error_messages] -%>
  <% # gaaaaah -%>
  <% allerrors = [] -%>
  <% if flash[:errors]
    allerrors += flash[:errors]
  end
  if flash[:error_messages]
    allerrors += flash[:error_messages]
  end -%>

There were errors processing your request:

                <% allerrors.each do |error| -%>

<%= error %>

                <% end -%>

<% end %>

        <%= link_to(image_tag("journey2-logo.png", :border => "0"), questionnaires_url) %>

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

Warning for Internet Explorer users

Journey is known not to work well with Microsoft Internet Explorer.  Answering questionnaires will work
    fine with any browser, but other functionality, such as editing, importing, exporting, and analyzing
    questionnaires may fail.

Journey is tested and known to work with the following browsers:

Mozilla Firefox 2.0 and up

Safari 3.0 and up

Both of these browsers are available for free, and we recommend their use over Internet Explorer not
    just for this site, but in general, due to their greater track record for security, stability, and
    web standards compliance.

<%= @content_for_layout %>

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

  <title>Journey</title>
  <meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
        <%= stylesheet_link_tag 'journey.css' %>
        <%= stylesheet_link_tag 'questionnaire' %>

  <%= ae_form_stylesheet %>
  <%= javascript_include_tag :defaults %>
  <%= javascript_include_tag 'jester', :plugin => 'jipe' %>
  <%= javascript_include_tag 'jipe', :plugin => 'jipe' %>
  <%= javascript_include_tag 'browserdetect.js' %>
  <% if @rss_url %>
    <link rel="alternate" title="RSS Feed" href="<%=@rss_url%>" type="application/rss+xml"/>
  <% end %>

<% if flash[:errors] -%>

There were errors processing your request:

                <% flash[:errors].each do |error| -%>

<%= error %>

                <% end -%>

<% end %>

        <%= link_to(image_tag("journey2-logo.png", :border => "0"), questionnaires_url) %>

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

Warning for Internet Explorer users

Journey is known not to work well with Microsoft Internet Explorer.  Answering questionnaires will work
    fine with any browser, but other functionality, such as editing, importing, exporting, and analyzing
    questionnaires may fail.

Journey is tested and known to work with the following browsers:

Mozilla Firefox 2.0 and up

Safari 3.0 and up

Both of these browsers are available for free, and we recommend their use over Internet Explorer not
    just for this site, but in general, due to their greater track record for security, stability, and
    web standards compliance.

<%= @content_for_layout %>


Preliminary version info on read work view

<%= render({ :partial => '/shared/work_tabs',
             :locals => { :selected =>1,
                          :work_id => @work.id }}) %>

	  <% for page in @pages %>

<%= page.title %>

	        <% if page.xml_text %>
	          <%= xml_to_html(page.xml_text, false) %>
	        <% else %>
            <% if logged_in? && current_user.can_transcribe?(@work) %>

                  <%= link_to('Help transcribe this page!',
                              { :controller => 'transcribe',
                                :action => 'display_page',
                                :page_id => page.id,
                                :ol => 'w_rw_p_tl' }) %>

            <% else %>

No Transcription

		        <% end %>
	        <% end %>

	        <%= link_to('page',
	                    { :action => 'display_page',
	                      :page_id => page.id,
                        :ol => 'w_rw_p_pl' }) %>
			<% if page.current_version %>
				<%= page.current_version.user.display_name %>
				<%= page.current_version.created_on %>
			<% else %>

			<% end %>

	  <% end %>
      <%= will_paginate @pages %>

    <% if @article %>

<%= @article.title %>

		    <% if @article.xml_text != nil && !@article.xml_text.empty? %>
		    <%=  xml_to_html(@article.xml_text) %>
		    <% end %>

		  <%= render :partial => 'article/article_links' %>
		<% end %>

Subjects

        <%= display_categories(@collection.categories, nil) do |category|
                controller.render_to_string(:partial => '/category/category_link_for_work',
                       :locals => { :category => category })
            end %>

<%= render({ :partial => '/shared/work_tabs',
             :locals => { :selected =>1,
                          :work_id => @work.id }}) %>

	  <% for page in @pages %>

<%= page.title %>

	        <% if page.xml_text %>
	          <%= xml_to_html(page.xml_text, false) %>
	        <% else %>
            <% if logged_in? && current_user.can_transcribe?(@work) %>

                  <%= link_to('Help transcribe this page!',
                              { :controller => 'transcribe',
                                :action => 'display_page',
                                :page_id => page.id,
                                :ol => 'w_rw_p_tl' }) %>

            <% else %>

No Transcription

		        <% end %>
	        <% end %>

	        <%= link_to('page',
	                    { :action => 'display_page',
	                      :page_id => page.id,
                        :ol => 'w_rw_p_pl' }) %>

	  <% end %>
      <%= will_paginate @pages %>

    <% if @article %>

<%= @article.title %>

		    <% if @article.xml_text != nil && !@article.xml_text.empty? %>
		    <%=  xml_to_html(@article.xml_text) %>
		    <% end %>

		  <%= render :partial => 'article/article_links' %>
		<% end %>

Subjects

        <%= display_categories(@collection.categories, nil) do |category|
                controller.render_to_string(:partial => '/category/category_link_for_work',
                       :locals => { :category => category })
            end %>


ActionItem65: fixing HTML

ActionItem65: fixing HTML

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

<%= flash[:notice] %>

<%= @environment.name %>


Fix typo.

Fix typo.

<%= h(@title) %>

<img src="<%= url_for :controller => 'trace', :action => 'picture', :id => @trace.id, :display_name => @trace.user.display_name %>">

    Filename:
    <%= @trace.name %> (<%= link_to 'download', :controller => 'trace', :action => 'data', :id => @trace.id %>)

    Uploaded at:
    <%= @trace.timestamp %>

  <% if @trace.inserted? %>

    Points:
    <%= @trace.size.to_s.gsub(/(\d)(?=(\d{3})+$)/,'\1,') %>

    Start coordinate:

<%= @trace.latitude %>; <%= @trace.longitude %>
 (<%=link_to 'map', :controller => 'site', :action => 'index', :lat => @trace.latitude, :lon => @trace.longitude, :zoom => 14 %> / <%=link_to 'edit', :controller => 'site', :action => 'edit', :lat => @trace.latitude, :lon => @trace.longitude, :gpx=> @trace.id, :zoom => 14 %>)

  <% end %>

    Owner:
    <%= link_to h(@trace.user.display_name), {:controller => 'user', :action => 'view', :display_name => @trace.user.display_name} %>

    Description:
    <%= h(@trace.description) %>

    Tags:

    <% if @trace.tags %>
      <% @trace.tags.each do |tag| %>
        <%= link_to tag.tag, { :controller => 'trace', :action => 'list', :tag => tag.tag, :id => nil } %>
      <% end %>
    <% else %>
      None
    <% end %>

    <% unless @trace.public? %>
    <%= button_to 'Make this track public permanently', :controller => 'trace', :action => 'make_public', :id => @trace.id %>
    <% end %>
    <% if @trace.user.id == @user.id %>
    <%= button_to 'Edit this track', :controller => 'trace', :action => 'edit', :id => @trace.id %>
    <% end %>
    <% if @trace.user.id == @user.id %>
    <%= button_to 'Delete this track', :controller => 'trace', :action => 'delete', :id => @trace.id %>
    <% end %>

<%= h(@title) %>

<img src="<%= url_for :controller => 'trace', :action => 'picture', :id => @trace.id, :display_name => @trace.user.display_name %>">

    Filename:
    <%= @trace.name %> (<%= link_to 'download', :controller => 'trace', :action => 'data', :id => @trace.id %>)

    Uploaded at:
    <%= @trace.timestamp %>

  <% if @trace.inserted? %>

    Points:
    <%= @trace.size.to_s.gsub(/(\d)(?=(\d{3})+$)/,'\1,') %>

    Start coordinate:

<%= @trace.latitude %>; <%= @trace.longitude %>
 (<%=link_to 'map', :controller => 'site', :action => 'index', :lat => @trace.latitude, :lon => @trace.longitude, :zoom => 14 %> / <%=link_to 'edit', :controller => 'site', :action => 'edit', :lat => @trace.latitude, :lon => @trace.longitude, :gpx=> @trace.id, :zoom => 14 %>)

  <% end %>

    Owner:
    <%= link_to g(@trace.user.display_name), {:controller => 'user', :action => 'view', :display_name => @trace.user.display_name} %>

    Description:
    <%= h(@trace.description) %>

    Tags:

    <% if @trace.tags %>
      <% @trace.tags.each do |tag| %>
        <%= link_to tag.tag, { :controller => 'trace', :action => 'list', :tag => tag.tag, :id => nil } %>
      <% end %>
    <% else %>
      None
    <% end %>

    <% unless @trace.public? %>
    <%= button_to 'Make this track public permanently', :controller => 'trace', :action => 'make_public', :id => @trace.id %>
    <% end %>
    <% if @trace.user.id == @user.id %>
    <%= button_to 'Edit this track', :controller => 'trace', :action => 'edit', :id => @trace.id %>
    <% end %>
    <% if @trace.user.id == @user.id %>
    <%= button_to 'Delete this track', :controller => 'trace', :action => 'delete', :id => @trace.id %>
    <% end %>


FFでのログイン、ユーザー登録画面の乱れを修正

FFでのログイン、ユーザー登録画面の乱れを修正

git-svn-id: d766b2a131eb5d649bacb6a45bc0bcd899bdfdb3@459 c938ebee-df10-0410-95fc-be8c4b0ebdd5

<%= javascript_tag <<-END
window.onload = function() {
	document.getElementById("user_login").focus();
}
END
 %>

    <%= start_form_tag :action => 'login'  %>

        <%= form_input :text_field, "ログインID", "login", :size => 30 %>
        <%= form_input :password_field, "パスワード", "password", :size => 30 %>

        <%= submit_tag 'ログイン', :onclick => "if ($F('user_login')=='') {alert('ログインIDを入力してください。'); return false;}if ($F('user_password')=='') {alert('パスワードを入力してください。'); return false;}" %>

        <%= link_to 'ユーザー登録', :action => 'signup' %> |
        <%= link_to 'パスワードを忘れたとき', :action => 'forgot_password' %>

    <%= end_form_tag %>

小槌の特徴

<%= render(:partial => 'shared/features') %>


Move span out of <ul> in delicious sidebar.  (closes #380)

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

<% if @delicious -%>

<a href="http://<%= @delicious.title %>"><%= @delicious.title %>

    <% (@sb_config['groupdate'] ? @delicious.days : [{ :container => @delicious.items }]).each do |group| -%>
    <% if @sb_config['groupdate'] -%>
    <%= group[:date].to_s.to_date.strftime("%b %d") %>
    <% end -%>

      <% for item in group[:container] %>

        <a href="<%= item.link %>" title="<%=h item.title%>"><%=h item.title %>
        <% if @sb_config['description'] -%>

<%= @sb_config['desclink'] ? item.description_link : item.description %>
        <% end -%>

      <% end -%>

    <% end -%>

<% end -%>


Replacing 'sign up' with 'signup'

Replacing 'sign up' with 'signup'

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

Submit or Review work for <%= @assignment.name %>

Next: Click the activity you wish to perform on the assignment titled: <%= @assignment.name %>

<% if @assignment.spec_location && @assignment.spec_location.length > 0 %>
  <a href="<%= @assignment.spec_location %>" target="new">Assignment Description
<% end %>

	<%if SignUpTopic.find_by_assignment_id(@assignment.id)%>

 <%= link_to 'Signup sheet', :controller=>'sign_up_sheet', :action => 'signup_topics', :id => @participant.parent_id%>
		(Signup for a topic)

	<%end%>
	<%if @assignment.team_assignment %>

 <%= link_to 'Your team', :controller=>'student_team', :action => 'view', :id => @participant.id %>
		(View and manage your team)

	<%end%>

	    <% if @assignment.submission_allowed %>
	    	<%= link_to 'Your work', :controller => 'submitted_content', :action => 'edit', :id => @participant.id %>
	    <% else %>
	        <%= link_to 'Your work', :controller => 'submitted_content', :action => 'view', :id => @participant.id %>
        <% end %>
		(Submit and view your work)

	    <% puts "*** IN VIEW ***" %>
	    <% puts @assignment.review_allowed %>
		<% if @assignment.review_allowed or @assignment.get_current_stage == "Complete" %>
			<%= link_to "Others' work",{:controller => 'student_review', :action => 'list', :id => @participant.id} %>
		<% else %>
			Others' work
		<% end %> (Give feedback to others on their work)

<%= link_to "Your scores",{:controller => 'grades', :action => 'view_my_scores', :id => @participant.id} %>(View feedback on your work)

	<% if @assignment.get_current_stage == "Complete" -%>

<%= link_to "Take a survey",{:controller => 'survey_response', :action => 'begin_survey', :id => @assignment.id} %> (This will log you out)

	<% end %>

<%= link_to "Change your handle", {:controller => 'participants', :action => 'change_handle', :id => @participant.id} %> (Provide a different handle for this assignment)

Back

Submit or Review work for <%= @assignment.name %>

Next: Click the activity you wish to perform on the assignment titled: <%= @assignment.name %>

<% if @assignment.spec_location && @assignment.spec_location.length > 0 %>
  <a href="<%= @assignment.spec_location %>" target="new">Assignment Description
<% end %>

	<%if SignUpTopic.find_by_assignment_id(@assignment.id)%>

 <%= link_to 'Sign up sheet', :controller=>'sign_up_sheet', :action => 'signup_topics', :id => @participant.parent_id%>
		(Sign up for a topic)

	<%end%>
	<%if @assignment.team_assignment %>

 <%= link_to 'Your team', :controller=>'student_team', :action => 'view', :id => @participant.id %>
		(View and manage your team)

	<%end%>

	    <% if @assignment.submission_allowed %>
	    	<%= link_to 'Your work', :controller => 'submitted_content', :action => 'edit', :id => @participant.id %>
	    <% else %>
	        <%= link_to 'Your work', :controller => 'submitted_content', :action => 'view', :id => @participant.id %>
        <% end %>
		(Submit and view your work)

	    <% puts "*** IN VIEW ***" %>
	    <% puts @assignment.review_allowed %>
		<% if @assignment.review_allowed or @assignment.get_current_stage == "Complete" %>
			<%= link_to "Others' work",{:controller => 'student_review', :action => 'list', :id => @participant.id} %>
		<% else %>
			Others' work
		<% end %> (Give feedback to others on their work)

<%= link_to "Your scores",{:controller => 'grades', :action => 'view_my_scores', :id => @participant.id} %>(View feedback on your work)

	<% if @assignment.get_current_stage == "Complete" -%>

<%= link_to "Take a survey",{:controller => 'survey_response', :action => 'begin_survey', :id => @assignment.id} %> (This will log you out)

	<% end %>

<%= link_to "Change your handle", {:controller => 'participants', :action => 'change_handle', :id => @participant.id} %> (Provide a different handle for this assignment)

Back


Bit more help on gone postal requests.

Bit more help on gone postal requests.

<% if @incoming_message.nil? %>
    <% @title = "Send follow up to '" + h(@info_request.title) + "'" %>
<% elsif @incoming_message.recently_arrived %>
    <% @title = "New response to '" + h(@info_request.title) + "'" %>
<% else %>
    <% @title = "Response to '" + h(@info_request.title) + "'" %>
<% end %>

<%= foi_error_messages_for :incoming_message, :outgoing_message %>

<% if @gone_postal %>

What exactly is happening?

            The authority say that they need a postal
            address, not just an email, for it to be a valid FOI request

            The law, the Ministry of Justice and the Information Commissioner
            all say that an email is sufficient (more details).
            At the bottom of this page, write a reply to the authority explaining this to them.

            The authority only has a paper copy of the information.

            At the bottom of this page, write a reply to them trying to persuade them to scan it in
            (more details).

            You want to give your postal address to the authority in private.

            To do that please send a private email to <%=h(@postal_email_name)%>
            <<%=link_to h(@postal_email), "mailto:" + @postal_email%>>
            containing your postal address, and asking them to reply to this request.
            Or you could phone them.

            When you receive the paper response, please help
            others find out what it says:

Add an annotation to your request with choice quotes, or
                a summary of the response.

If you can, scan in or photograph the response, and send us
                    a copy to upload.

<% end %>

    <% if !@incoming_message.nil? %>
        <% if @is_owning_user %>
            <% if @incoming_message.recently_arrived %>

New response to your request '<%= request_link @info_request %>'

            <% else %>

Response to your request '<%= request_link @info_request %>'

            <% end %>
        <% else %>
            <% if @incoming_message.recently_arrived %>

New response to <%=h(@info_request.law_used_short)%> request '<%= request_link @info_request %>'

            <% else %>

Response to <%=h(@info_request.law_used_short)%> request '<%= request_link @info_request %>'

            <% end %>
        <% end %>

        <% if @incoming_message.nil? %>
            <%= render :partial => 'correspondence', :locals => { :info_request_event => @info_request.get_last_outgoing_event, :incoming_message => nil } %>
        <% else %>
            <%= render :partial => 'correspondence', :locals => { :info_request_event => nil, :incoming_message => @incoming_message } %>
        <% end %>
    <% end %>

    <%= render :partial => 'followup', :locals => { :incoming_message => @incoming_message } %>

<% if @incoming_message.nil? %>
    <% @title = "Send follow up to '" + h(@info_request.title) + "'" %>
<% elsif @incoming_message.recently_arrived %>
    <% @title = "New response to '" + h(@info_request.title) + "'" %>
<% else %>
    <% @title = "Response to '" + h(@info_request.title) + "'" %>
<% end %>

<%= foi_error_messages_for :incoming_message, :outgoing_message %>

<% if @gone_postal %>

What exactly is happening?

            The authority say that they need a postal
            address, not just an email, for it to be a valid FOI request

            The law, the Ministry of Justice and the Information Commissioner
            all say that an email is sufficient (more details).
            At the bottom of this page, write a reply to the authority explaining this to them.

            The authority only has a paper copy of the information.

            At the bottom of this page, write a reply to them trying to persuade them to scan it in
            (more details).

            You want to give your postal address to the authority in private.

            To do that please send a private email to <%=h(@postal_email_name)%>
            <<%=link_to h(@postal_email), "mailto:" + @postal_email%>>
            containing your postal address, and asking them to reply to this request.
            Or you could phone them.

<% end %>

    <% if !@incoming_message.nil? %>
        <% if @is_owning_user %>
            <% if @incoming_message.recently_arrived %>

New response to your request '<%= request_link @info_request %>'

            <% else %>

Response to your request '<%= request_link @info_request %>'

            <% end %>
        <% else %>
            <% if @incoming_message.recently_arrived %>

New response to <%=h(@info_request.law_used_short)%> request '<%= request_link @info_request %>'

            <% else %>

Response to <%=h(@info_request.law_used_short)%> request '<%= request_link @info_request %>'

            <% end %>
        <% end %>

        <% if @incoming_message.nil? %>
            <%= render :partial => 'correspondence', :locals => { :info_request_event => @info_request.get_last_outgoing_event, :incoming_message => nil } %>
        <% else %>
            <%= render :partial => 'correspondence', :locals => { :info_request_event => nil, :incoming_message => @incoming_message } %>
        <% end %>
    <% end %>

    <%= render :partial => 'followup', :locals => { :incoming_message => @incoming_message } %>


Another XSS vulnerability fix

Another XSS vulnerability fix

<td class="<%= name %>_named_cell_label">
    <%= cell.title %>:

  <td class="<%= name %>_named_cell_data">
    <%=h object.send(cell.name) %>

<td class="<%= name %>_named_cell_label">
    <%= cell.title %>:

  <td class="<%= name %>_named_cell_data">
    <%= object.send(cell.name) %>


ActionItem78: removing exact copy, will make a symlink

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

<%= _('Dear %s,') % @requestor %>

<%= @message %>

--
<%= _('%s environment system') % @environment %>
<%= @url %>


make custom sessions view work properly again

<% debugger %>

* session id: <%= @request.session.session_id %>
* data: <%= clone = @request.session.clone; clone[:connexion_bar] = nil; clone.inspect %>
* user: <%=

user_id = @request.session[:user_id]

def crash_avoid
  begin
    yield
  rescue Exception => e
    "[crashed #{e.inspect}]"
  end
end

if user_id
  user = Viewer.find user_id

  { :name => crash_avoid { if user.respond_to?(:viewer) && user.viewer && user.viewer.person
                 then user.viewer.name
                 else '[no person found]' end },
    :viewer_userID => crash_avoid { user.viewer.viewer_userID },
    :viewer_id => crash_avoid{ user_id },
    :person_id => crash_avoid{ user.viewer.person.id },
    :email => crash_avoid { if user.viewer.person then user.viewer.person.email end } }.inspect
else "[no user_id set]"
end
%>

* session id: <%= @request.session.instance_variable_get(:@session_id).inspect %>
* data: <%= PP.pp(@request.session.instance_variable_get(:@data),"").gsub(/\n/, "\n  ").strip %>
* user: <%=

user_id = PP.pp(@request.session.instance_variable_get(:@data),"")[:user_id]

def crash_avoid
  begin
    yield
  rescue Exception => e
    "[crashed #{e.inspect}]"
  end
end

if user_id
  user = Viewer.find user_id

  { :name => crash_avoid { if user.respond_to?(:viewer) && user.viewer && user.viewer.person
                 then user.viewer.name
                 else '[no person found]' end },
    :viewer_userID => crash_avoid { user.viewer.viewer_userID },
    :viewer_id => crash_avoid{ user_id },
    :person_id => crash_avoid{ user.viewer.person.id },
    :email => crash_avoid { if user.viewer.person then user.viewer.person.email end } }.inspect
else "[no user_id set]"
end
%>


Fixed paths on popup images

Fixed paths on popup images

git-svn-id: 8708dd68d62b776db8a38b6508980dbdc657ff30@5 22c876fd-090a-0410-8685-aeedfd4d70f8

<% rel = logged_in? ? "nil" : "lightbox" %>
<% url = logged_in? ? "#" : photo.to_url(:large) %>
<%= link_to image_tag(photo.to_url(:thumbnail), :class=>"photo", :id=>"photo_#{photo.id}"), image_path(url), :rel=>rel %>
<%= draggable_element "photo_#{photo.id}", :revert => true if logged_in? %>

<% rel = logged_in? ? "nil" : "lightbox" %>
<% url = logged_in? ? "#" : photo.to_url(:large) %>
<%= link_to image_tag(photo.to_url(:thumbnail), :class=>"photo", :id=>"photo_#{photo.id}"), url, :rel=>rel %>
<%= draggable_element "photo_#{photo.id}", :revert => true if logged_in? %>


use json to store initial student data

use json to store initial student data

<% # 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>
<html<% unless @content_for_html5_manifest.blank? %> manifest="app.manifest"<% end %>>

    <meta http-equiv="Content-type" content="text/html; charset=utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=8<%= config.chrome_frame ? ',chrome=1' : '' %>" />
    <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="<%= config.status_bar_style || 'default' %>" />
    <meta name="viewport" content="initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" />
    <link rel="apple-touch-icon<%= '-precomposed' if config.precomposed_icon %>" href="<%= sc_static(config.icon || 'sproutcore-logo.png') %>" />
	  <link rel="apple-touch-startup-image" media="screen and (orientation:portrait)" href="<%= sc_static(config.startup_image_portrait || 'sproutcore-startup-portrait.png') %>" />
	  <link rel="apple-touch-startup-image" media="screen and (orientation:landscape)" href="<%= sc_static(config.startup_image_landscape || 'sproutcore-startup-landscape.png') %>" />
	  <link rel="shortcut icon" href="<%= sc_static(config.favicon || 'favicon.ico') %>" type="image/x-icon" />

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

  <% # begin WISE4 glue -%>

  <% # End WISE4 glue -%>

<% #
   # 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(' ') %>">
<% # 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 -%>
<%
  #disable main if the application is loaded in design mode
%>
<%= @content_for_designer -%>

<% # 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>
<html<% unless @content_for_html5_manifest.blank? %> manifest="app.manifest"<% end %>>

    <meta http-equiv="Content-type" content="text/html; charset=utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=8<%= config.chrome_frame ? ',chrome=1' : '' %>" />
    <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="<%= config.status_bar_style || 'default' %>" />
    <meta name="viewport" content="initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" />
    <link rel="apple-touch-icon<%= '-precomposed' if config.precomposed_icon %>" href="<%= sc_static(config.icon || 'sproutcore-logo.png') %>" />
	  <link rel="apple-touch-startup-image" media="screen and (orientation:portrait)" href="<%= sc_static(config.startup_image_portrait || 'sproutcore-startup-portrait.png') %>" />
	  <link rel="apple-touch-startup-image" media="screen and (orientation:landscape)" href="<%= sc_static(config.startup_image_landscape || 'sproutcore-startup-landscape.png') %>" />
	  <link rel="shortcut icon" href="<%= sc_static(config.favicon || 'favicon.ico') %>" type="image/x-icon" />

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

  <% # begin WISE4 glue -%>

  <% # End WISE4 glue -%>

<% #
   # 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(' ') %>">
<% # 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 -%>

  {
    "MySystem.Link": {
      "link1": {
        "guid": "link1",
        "text": "First link",
        "startNode": "1",
        "startTerminal": "a",
        "endNode": "2",
        "endTerminal": "b",
        "color": "#FF0000"
      },
      "link2": {
        "guid": "link2",
        "text": "Second link",
        "startNode": "1",
        "startTerminal": "a",
        "endNode": "3",
        "endTerminal": "b",
        "color": "#FF0000"
      }
    },
    "MySystem.Node": {
      "1": {
        "guid": "1",
        "image": "/static/my_system/en/current/resources/clay_red_tn.png",
        "title": "A Node",
        "transformer": false,
        "inLinks": [],
        "outLinks": [
          "link1",
          "link2"
        ],
        "position": {
          "x": 160,
          "y": 160
        },
        "transformations": [
          "trans1"
        ]
      },
      "2": {
        "guid": "2",
        "image": "/static/my_system/en/current/resources/hand_tn.png",
        "title": "B Node",
        "transformer": false,
        "inLinks": [
          "link1"
        ],
        "outLinks": [],
        "position": {
          "x": 310,
          "y": 10
        }
      },
      "3": {
        "guid": "3",
        "image": "/static/my_system/en/current/resources/lightbulb_tn.png",
        "title": "Third Node",
        "transformer": false,
        "inLinks": [
          "link2"
        ],
        "outLinks": [],
        "position": {
          "x": 10,
          "y": 10
        }
      }
    },
    "MySystem.Story": {
      "1": {
        "guid": 1,
        "storyHtml": "<p>Make a system diagram to help explain how <i>both</i> the sun and people's actions affect the Earth's climate.</p><ul><li>Where does energy come from?</li><li>How does energy move?</li><li>Where does energy go?</li><li>How does energy change?</li></ul>"
      }
    },
    "MySystem.StorySentence": {
      "ss1": {
        "guid": "ss1",
        "order": 1,
        "bodyText": "First..."
      },
      "ss2": {
        "guid": "ss2",
        "order": 2,
        "bodyText": "Then..."
      },
      "ss3": {
        "guid": "ss3",
        "order": 3,
        "bodyText": "Finally..."
      }
    }
  }

<% #
   # 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 -%>
<%
  #disable main if the application is loaded in design mode
%>
<%= @content_for_designer -%>


No "no results" in empty tag view - fixes #343

<% @title_box = content_tag :h1, 'tags' %>

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

  <% if @pages.any? %>
    <%= render :partial => 'pages/list', :locals => {:heading => false} %>
  <% end %>

<% @title_box = content_tag :h1, 'tags' %>

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

  <%= render :partial => 'pages/list', :locals => {:heading => false} %>


Typo

Typo

git-svn-id: 801577a2cbccabf54a3a609152c727abd26e524a@1046 a18515e9-6cfd-0310-9624-afb4ebaee84e

Almost there!

<%= standard_flashes %>

To prove that you're not an impostor, please go to your <a href="http://metachat.org/users/<%= @bunny.username %>">MeCha profile page, and add this special code to your 'About Me' section:

<%= @bunny.secret %>

When you've done that, come back here and click:

<%= button_to("Okay, I'm done, let me in!", check_bunny_path(@bunny)) %>

Almost there!

<%= standard_flashes %>

To prove that you're not an imposter, please go to your <a href="http://metachat.org/users/<%= @bunny.username %>">MeCha profile page, and add this special code to your 'About Me' section:

<%= @bunny.secret %>

When you've done that, come back here and click:

<%= button_to("Okay, I'm done, let me in!", check_bunny_path(@bunny)) %>


update admin menu

update admin menu

Medlemstjänster

<%= link_to "Tävlingar", :controller => "/member/event" %>

	  	<% if Option.benefit? %>

<%= link_to "Förmån", :controller => "/member/benefit" %>

	  	<% end %>

<%= link_to "Spelrätter", :controller => "/member/play_right_bookings" %>

	  	<% if Option.magazine_rental? %>

<%= link_to "Tidningscirkulering", :controller => "/member/rental" %>

      <% end %>
			<% if logged_in? %>

<%= link_to "Uppdatera konto", :controller => "/member/account", :action => "update" %>

			<% end %>

Statistik

	  	<% if Option.magazine_rental? %>

<%= link_to "Alla lån", :controller => "/member/rental/show_rentals" %>

<%= link_to "Alla lån historik", :controller => "/member/rental/show_rental_histories" %>

<%= link_to "Alla medlemmar", :controller => "/member/rental/show_user_rentals"%>

<% if logged_in? && (current_user.admin? || current_user.magazine_admin?) %>

<%= link_to "Tidning prenum", :controller => "/member/rental/show_magazine_subscriptions" %>

<%= link_to "Tidning med kö", :controller => "/member/rental/show_magazines" %>

      <% end %>
<% end %>
<% if logged_in? && (current_user.admin? || current_user.magazine_admin?) %>

<%= link_to "Medlems epost", :controller => "/member/user" %>

<% end %>

<% if logged_in? && current_user.admin? %>

Administration

<%= link_to "Admin public site", :controller => "/admin/dashboard" %>

<%= link_to "Admin database", :controller => "/admin_data" %>

<%= link_to "Members fee", :controller => "/admin_db/user", :action => "receive_payment"%>

<%= link_to "Login as user", :controller => "/admin_db/user", :action => "change_user"%>

<% end %>

Medlemstjänster

<%= link_to "Tävlingar", :controller => "/member/event" %>

	  	<% if Option.benefit? %>

<%= link_to "Förmån", :controller => "/member/benefit" %>

	  	<% end %>

<%= link_to "Spelrätter", :controller => "/member/play_right_bookings" %>

	  	<% if Option.magazine_rental? %>

<%= link_to "Tidningscirkulering", :controller => "/member/rental" %>

      <% end %>
			<% if logged_in? %>

<%= link_to "Uppdatera konto", :controller => "/member/account", :action => "update" %>

			<% end %>

Statistik

	  	<% if Option.magazine_rental? %>

<%= link_to "Alla lån", :controller => "/member/rental/show_rentals" %>

<%= link_to "Alla lån historik", :controller => "/member/rental/show_rental_histories" %>

<%= link_to "Alla medlemmar", :controller => "/member/rental/show_user_rentals"%>

<% if logged_in? && (current_user.admin? || current_user.magazine_admin?) %>

<%= link_to "Tidning prenum", :controller => "/member/rental/show_magazine_subscriptions" %>

<%= link_to "Tidning med kö", :controller => "/member/rental/show_magazines" %>

      <% end %>
<% end %>
<% if logged_in? && (current_user.admin? || current_user.magazine_admin?) %>

<%= link_to "Medlems epost", :controller => "/member/user" %>

<% end %>

<% if logged_in? && current_user.admin? %>

Administration

<%= link_to "Admin public site", :controller => "/admin/dashboard" %>

<%= link_to "Admin database", :controller => "/admin_data" %>

<%= link_to "Members fee", :controller => "/admin_db/user", :action => "receive_payment"%>

<%= link_to "Login as user", :controller => "/admin_db/user", :action => "change_user"%>

<%= link_to "Users", :controller => "/admin_db/user" %>

	  	<% if Option.magazine_rental? %>

<%= link_to "Magazine numbers", :controller => "/admin_db/magazine_number" %>

<%= link_to "Magazine items", :controller => "/admin_db/magazine_item" %>

<%= link_to "Magazine subscriptions", :controller => "/admin_db/magazine_subscription" %>

<%= link_to "Rentals", :controller => "/admin_db/rental" %>

<%= link_to "Rental queues", :controller => "/admin_db/rental_queue" %>

<%= link_to "Rental subscriptions", :controller => "/admin_db/rental_subscription" %>

		  <% end %>

<% end %>


Klass should come before format and mode in form for new templates.

<%= form_tag( documents_path ) %>
<%= hidden_field 'node', 'parent_id', :value=>@node.parent_zip  %>

<input type="submit" onclick="$('loader').style.visibility = 'visible';" value='<%= _('validate') %>'/>

<input type='hidden' name='node[klass]' value='Template'/>

<%= _('name') %>
<input  id='node_name' type='text' name='node[name]'/>

<%= _('class scope') %>
<%= select('node', 'c_klass', Node.classes_for_form, {:include_blank => true} ) %>

<%= _('mode') %>
<input  id='node_c_mode' type='text' name='node[c_mode]'/>

<%= _('format') %>
<input  id='node_format' type='text' name='node[c_format]' value='html'/>

<%= _('summary') %>
<textarea id='node_v_summary' rows='3' name='node[v_summary]'></textarea>

</form>

<%= form_tag( documents_path ) %>
<%= hidden_field 'node', 'parent_id', :value=>@node.parent_zip  %>

<input type="submit" onclick="$('loader').style.visibility = 'visible';" value='<%= _('validate') %>'/>

<input type='hidden' name='node[klass]' value='Template'/>

<%= _('name') %>
<input  id='node_name' type='text' name='node[name]'/>

<%= _('format') %>
<input  id='node_format' type='text' name='node[c_format]' value='html'/>

<%= _('mode') %>
<input  id='node_c_mode' type='text' name='node[c_mode]'/>

<%= _('class scope') %>
<%= select('node', 'c_klass', Node.classes_for_form, {:include_blank => true} ) %>

<%= _('summary') %>
<textarea id='node_v_summary' rows='3' name='node[v_summary]'></textarea>

</form>