removed old type id, etc from view form

removed old type id, etc from view form

<%= error_messages_for 'view' %>

<%
  @clients = current_user.projects.collect{ |p| [p.customer.name, p.customer.id] }.uniq.sort
  @projects = current_user.projects.collect {|p| [p.name + " / " + p.customer.name, p.id]}
  @users = User.find(:all, :order => "name", :conditions => ["company_id = ?", current_user.company_id]).collect {|c| [ c.name, c.id.to_s ] }
  @milestones = Milestone.find(:all, :order => "due_at", :conditions => ["project_id IN(#{current_project_ids}) AND completed_at IS NULL"]).collect {|c| [ c.name + " / " + c.project.name, c.id.to_s ] }
%>

<%=_ 'Name' %><%= text_field :view, :name  %>

<%=_ 'Tags' %><%= text_field :view, :filter_tags  %>

  <% if @clients.size > 0 %>
  <%=_ 'Client' %><select name="view[filter_customer_id]" id="view_filter_customer_id">
      <% @clients = [[_("[Any Client]"), "0"]] + @clients  %>
      <%= options_for_select @clients, @view.filter_customer_id %>
    </select>

  <% end %>

  <%#= observe_field 'view_filter_customer_id', { :url => { :controller => 'views', :action => 'get_projects' }, :update => 'view_filter_project_id', :with => 'customer_id', :loading => "Element.show('loading');", :complete => "Element.hide('loading');" } %>

  <%=_ 'Project' %><select name="view[filter_project_id]" id="view_filter_project_id">
      <% if @projects.size > 0 %>
      <% @projects = [[_("[Any Project]"), "0"]] + @projects %>
      <% else %>
      <% @projects = [[_("[Any Project]"), "0"]] + @projects %>
      <% end %>

      <%= options_for_select @projects, @view.filter_project_id %>
    </select>

  <%#= observe_field 'view_filter_project_id', { :url => { :controller => 'views', :action => 'get_milestones' }, :update => 'view_filter_milestone_id', :with => 'project_id', :loading => "Element.show('loading');", :complete => "Element.hide('loading');" } %>

  <%#= observe_field 'view_filter_project_id', { :url => { :controller => 'views', :action => 'get_owners' }, :update => 'view_filter_user_id', :with => 'project_id', :loading => "Element.show('loading');", :complete => "Element.hide('loading');" } %>

  <% if @milestones.size > 0 %>
  <%=_ 'Milestone' %><select name="view[filter_milestone_id]" id="view_filter_milestone_id">
      <% @milestones = [[_("[Any Milestone]"), "0"]] + @milestones  %>
      <%= options_for_select @milestones, @view.filter_milestone_id.to_s %>
    </select>

  <% end %>

  <% if @users.size > 0 %>
  <%=_ 'User' %><select name="view[filter_user_id]" id="view_filter_user_id">
      <% @users = [[_("[Any User]"), "0"],[_("[Active User]"),"-2"],[_("[Unassigned]"), "-1"]] + @users  %>
      <%= options_for_select @users, @view.filter_user_id.to_s %>
    </select>

  <% end %>

  <%=_ 'Status' %><%= select 'view', 'filter_status', [[_('[Any Status]'), '-1'],[_('Open'),0],[_('In Progress'),1],[_('Closed'),2],[_('Won\'t Fix'),3],[_('Invalid'),4],[_('Duplicate'),5], [_('Archived'), -2]], :selected => @view.filter_status %>

	    <%
	       properties = Property.all_for_company(current_user.company)
	       properties.each do |p|
	    -%>
	    <label for="<%= p.filter_name %>"><%= p %>
	    <select name="view[properties][]" id="<%= p.filter_name %>">
	      <option value="" class="select_default">
		<%= "[#{_('Any %s', p.name)}]" %>
	      </option>
	      <% p.property_values.each do |pv| -%>
	        <option value="<%= pv.id %>" <%= @view.property_values.index(pv) ? "selected" : ""  %>>
		  <%= pv %>
		</option>
	      <% end -%>
	    </select>
	    <% end -%>

  <%=_ 'Group By' %>
          <select name="view[auto_group]" id="view_auto_group">
              <option value="0" class="select_default"><%= _("[No Grouping]") %></option>

              <%
                 @group_by = [[_("Tags"), "1"],[_("Clients"), "2"],[_("Projects"), "3"],[_("Milestones"), "4"],[_("Projects / Milestones"), "10"],[_("Users"), "5"],[_("Task Type"), "6"],[_("Status"), "7"],[_("Priority"), "9"],[_("Severity"), "8"]]
              %>
              <%= options_for_select @group_by, @view.auto_group.to_s %>
            </select>

  <%=_ 'Sort By' %>

            <select name="view[sort]" id="view_sort">
              <option value="0" class="select_default"><%= _("[Default Sorting]") %></option>
              <%
                 @sort = [[_("Due Date"), "1"],[_("Age"), "2"],[_("Name"), "3"], [_("Recent"), "4"] ]
              %>
              <%= options_for_select @sort, @view.sort.to_s %>
            </select>

	    <%=_ "Colors" %>
            <select name="view[colors]" id="colors">
              <option value="0" class="select_default"><%= _("[Default colors]") %></option>
	      <% options = Property.all_with_colors(current_user.company).map { |p| [ p.name, p.id.to_s ] } %>
              <%= options_for_select(options, @view.colors.to_s) %>
            </select>

	    <%=_ "Icons" %>
            <select name="view[icons]" id="icons">
              <option value="0" class="select_default"><%= _("[Default icons]") %></option>
	      <% options = Property.all_with_icons(current_user.company).map { |p| [ p.name, p.id.to_s ] } %>
              <%= options_for_select(options, @view.icons.to_s) %>
            </select>

  <%=_ 'Hide Waiting Tasks' %><input type="checkbox" name="view[hide_deferred]" id="view_hide_deferred" value="1" <%= @view.hide_deferred.to_i > 0 ? "checked" : "" %>>

  <%=_ 'Hide Task Dependencies' %><input type="checkbox" name="view[hide_dependencies]" id="view_hide_dependencies" value="1" <%= @view.hide_dependencies.to_i > 0 ? "checked" : "" %>>

  <%=_ 'Shared' %><input type="checkbox" name="view[shared]" id="view_shared" value="1" <%= @view.shared.to_i > 0 ? "checked" : "" %>>

<%= error_messages_for 'view' %>

<%
  @clients = current_user.projects.collect{ |p| [p.customer.name, p.customer.id] }.uniq.sort
  @projects = current_user.projects.collect {|p| [p.name + " / " + p.customer.name, p.id]}
  @users = User.find(:all, :order => "name", :conditions => ["company_id = ?", current_user.company_id]).collect {|c| [ c.name, c.id.to_s ] }
  @milestones = Milestone.find(:all, :order => "due_at", :conditions => ["project_id IN(#{current_project_ids}) AND completed_at IS NULL"]).collect {|c| [ c.name + " / " + c.project.name, c.id.to_s ] }
%>

<%=_ 'Name' %><%= text_field :view, :name  %>

<%=_ 'Tags' %><%= text_field :view, :filter_tags  %>

  <% if @clients.size > 0 %>
  <%=_ 'Client' %><select name="view[filter_customer_id]" id="view_filter_customer_id">
      <% @clients = [[_("[Any Client]"), "0"]] + @clients  %>
      <%= options_for_select @clients, @view.filter_customer_id %>
    </select>

  <% end %>

  <%#= observe_field 'view_filter_customer_id', { :url => { :controller => 'views', :action => 'get_projects' }, :update => 'view_filter_project_id', :with => 'customer_id', :loading => "Element.show('loading');", :complete => "Element.hide('loading');" } %>

  <%=_ 'Project' %><select name="view[filter_project_id]" id="view_filter_project_id">
      <% if @projects.size > 0 %>
      <% @projects = [[_("[Any Project]"), "0"]] + @projects %>
      <% else %>
      <% @projects = [[_("[Any Project]"), "0"]] + @projects %>
      <% end %>

      <%= options_for_select @projects, @view.filter_project_id %>
    </select>

  <%#= observe_field 'view_filter_project_id', { :url => { :controller => 'views', :action => 'get_milestones' }, :update => 'view_filter_milestone_id', :with => 'project_id', :loading => "Element.show('loading');", :complete => "Element.hide('loading');" } %>

  <%#= observe_field 'view_filter_project_id', { :url => { :controller => 'views', :action => 'get_owners' }, :update => 'view_filter_user_id', :with => 'project_id', :loading => "Element.show('loading');", :complete => "Element.hide('loading');" } %>

  <% if @milestones.size > 0 %>
  <%=_ 'Milestone' %><select name="view[filter_milestone_id]" id="view_filter_milestone_id">
      <% @milestones = [[_("[Any Milestone]"), "0"]] + @milestones  %>
      <%= options_for_select @milestones, @view.filter_milestone_id.to_s %>
    </select>

  <% end %>

  <% if @users.size > 0 %>
  <%=_ 'User' %><select name="view[filter_user_id]" id="view_filter_user_id">
      <% @users = [[_("[Any User]"), "0"],[_("[Active User]"),"-2"],[_("[Unassigned]"), "-1"]] + @users  %>
      <%= options_for_select @users, @view.filter_user_id.to_s %>
    </select>

  <% end %>

  <%=_ 'Type' %><%= select 'view', 'filter_type_id', [[_('[Any Type]'), '-1'],[_('Task'),0],[_('New Feature'),1],[_('Defect'),2],[_('Improvement'),3]], :selected => @view.filter_type_id %>

  <%=_ 'Severity' %><%= select 'view', 'filter_severity', [[_('[Any Severity]'), '-10'],[_('Blocker'),3],[_('Critical'),2],[_('Major'),1],[_('Normal'),0],[_('Minor'),-1],[_('Trivial'),-2]], :selected => @view.filter_severity %>

  <%=_ 'Priority' %><%= select 'view', 'filter_priority', [[_('[Any Priority]'), '-10'],[_('Critical'),3],[_('Urgent'),2],[_('High'),1],[_('Normal'),0],[_('Low'),-1],[_('Lowest'),-2]], :selected => @view.filter_priority %>

  <%=_ 'Status' %><%= select 'view', 'filter_status', [[_('[Any Status]'), '-1'],[_('Open'),0],[_('In Progress'),1],[_('Closed'),2],[_('Won\'t Fix'),3],[_('Invalid'),4],[_('Duplicate'),5], [_('Archived'), -2]], :selected => @view.filter_status %>

  <%=_ 'Group By' %>
          <select name="view[auto_group]" id="view_auto_group">
              <option value="0" class="select_default"><%= _("[No Grouping]") %></option>

              <%
                 @group_by = [[_("Tags"), "1"],[_("Clients"), "2"],[_("Projects"), "3"],[_("Milestones"), "4"],[_("Projects / Milestones"), "10"],[_("Users"), "5"],[_("Task Type"), "6"],[_("Status"), "7"],[_("Priority"), "9"],[_("Severity"), "8"]]
              %>
              <%= options_for_select @group_by, @view.auto_group.to_s %>
            </select>

  <%=_ 'Sort By' %>

            <select name="view[sort]" id="view_sort">
              <option value="0" class="select_default"><%= _("[Default Sorting]") %></option>
              <%
                 @sort = [[_("Due Date"), "1"],[_("Age"), "2"],[_("Name"), "3"], [_("Recent"), "4"] ]
              %>
              <%= options_for_select @sort, @view.sort.to_s %>
            </select>

	    <%=_ "Colors" %>
            <select name="view[colors]" id="colors">
              <option value="0" class="select_default"><%= _("[Default colors]") %></option>
	      <% options = Property.all_with_colors(current_user.company).map { |p| [ p.name, p.id.to_s ] } %>
              <%= options_for_select(options, @view.colors.to_s) %>
            </select>

	    <%=_ "Icons" %>
            <select name="view[icons]" id="icons">
              <option value="0" class="select_default"><%= _("[Default icons]") %></option>
	      <% options = Property.all_with_icons(current_user.company).map { |p| [ p.name, p.id.to_s ] } %>
              <%= options_for_select(options, @view.icons.to_s) %>
            </select>

	    <%
	       properties = Property.all_for_company(current_user.company)
	       properties.each do |p|
	    -%>
	    <label for="<%= p.filter_name %>"><%= p %>
	    <select name="view[properties][]" id="<%= p.filter_name %>">
	      <option value="" class="select_default">
		<%= "[#{_('Any %s', p.name)}]" %>
	      </option>
	      <% p.property_values.each do |pv| -%>
	        <option value="<%= pv.id %>" <%= @view.property_values.index(pv) ? "selected" : ""  %>>
		  <%= pv %>
		</option>
	      <% end -%>
	    </select>
	    <% end -%>

  <%=_ 'Hide Waiting Tasks' %><input type="checkbox" name="view[hide_deferred]" id="view_hide_deferred" value="1" <%= @view.hide_deferred.to_i > 0 ? "checked" : "" %>>

  <%=_ 'Hide Task Dependencies' %><input type="checkbox" name="view[hide_dependencies]" id="view_hide_dependencies" value="1" <%= @view.hide_dependencies.to_i > 0 ? "checked" : "" %>>

  <%=_ 'Shared' %><input type="checkbox" name="view[shared]" id="view_shared" value="1" <%= @view.shared.to_i > 0 ? "checked" : "" %>>


Maybe too verbose, but you do need to see the body and user of a request for annotation events, as they often represent the whole request.

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

        <% if not event.incoming_message.nil? %>
            <%= link_to highlight_words(info_request.title, @highlight_words), incoming_message_url(event.incoming_message) %>
        <% elsif not event.outgoing_message.nil? and event.event_type == 'followup_sent' %>
            <%= link_to highlight_words(info_request.title, @highlight_words), outgoing_message_url(event.outgoing_message) %>
        <% elsif not event.comment.nil? %>
            <%= link_to highlight_words(info_request.title, @highlight_words), comment_url(event.comment) %>
        <% else %>
            <%= link_to highlight_words(info_request.title, @highlight_words), request_url(info_request) %>
        <% end %>

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

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

        <%= info_request.display_status %>

        <% if event.event_type == 'sent' %>
            Request sent to <%= public_body_link(info_request.public_body) %>
            by <%= user_link(info_request.user) %>
        <% elsif event.event_type == 'followup_sent' %>
            Follow up sent to <%= public_body_link(info_request.public_body) %>
            by <%= user_link(info_request.user) %>
        <% elsif event.event_type == 'response' %>
            <% if event.calculated_state.nil? %>
                Response
            <% else %>
                <%=event.display_status %>
            <% end %>
            by <%= public_body_link(info_request.public_body) %>
            to <%= user_link(info_request.user) %>
        <% elsif event.event_type == 'comment' %>
            Annotation by <%= user_link(event.comment.user) %>
            on request to <%= public_body_link(info_request.public_body) %>
            by <%= user_link(info_request.user) %>
        <% else %>
            <% raise "unknown event type indexed " + event.event_type %>
        <% end %>
        on <%= simple_date(event.created_at) %>.

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

        <% if not event.incoming_message.nil? %>
            <%= link_to highlight_words(info_request.title, @highlight_words), incoming_message_url(event.incoming_message) %>
        <% elsif not event.outgoing_message.nil? and event.event_type == 'followup_sent' %>
            <%= link_to highlight_words(info_request.title, @highlight_words), outgoing_message_url(event.outgoing_message) %>
        <% elsif not event.comment.nil? %>
            <%= link_to highlight_words(info_request.title, @highlight_words), comment_url(event.comment) %>
        <% else %>
            <%= link_to highlight_words(info_request.title, @highlight_words), request_url(info_request) %>
        <% end %>

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

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

        <%= info_request.display_status %>

        <% if event.event_type == 'sent' %>
            Request sent to <%= public_body_link(info_request.public_body) %>
            by <%= user_link(info_request.user) %>
        <% elsif event.event_type == 'followup_sent' %>
            Follow up sent to <%= public_body_link(info_request.public_body) %>
            by <%= user_link(info_request.user) %>
        <% elsif event.event_type == 'response' %>
            <% if event.calculated_state.nil? %>
                Response
            <% else %>
                <%=event.display_status %>
            <% end %>
            by <%= public_body_link(info_request.public_body) %>
            to <%= user_link(info_request.user) %>
        <% elsif event.event_type == 'comment' %>
            Annotation by <%= user_link(event.comment.user) %>
        <% else %>
            <% raise "unknown event type indexed " + event.event_type %>
        <% end %>
        on <%= simple_date(event.created_at) %>.


Update global template to use new-world ae_users stuff

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

<% if @site_template -%>

<% else -%>

<% end -%>

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

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

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

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

<% if not @hide_chrome -%>

<%= page_title %>

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

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

          <% end -%>

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

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

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

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

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

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

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

Administration »

		  «

<%= link_to "Events", events_path %>

  		    <% if @context -%>

<%= link_to "Attendees", :controller => "agenda", :action => "attendees" %>

		    <% end -%>

<%= link_to "Locations", locations_path %>

<%= link_to "Site Templates", site_templates_path %>

<%= link_to "Schedules", schedules_path %>

            <% end -%>

          	<% if logged_in? -%>
				<%= render :partial => "auth/mini_auth_form" %>
			<% else -%>

Log in

				<%= link_to "Click here to log into this site.", :controller => "auth", :action => "login" %>
			<% end -%>

<% end -%>

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

There were some errors processing your request:

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

<%= msg%>

      <% end -%>

<% end -%>

  <%= @content_for_layout %>

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

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

<% if @site_template -%>

<% else -%>

<% end -%>

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

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

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

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

<% if not @hide_chrome -%>

<%= page_title %>

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

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

          <% end -%>

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

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

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

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

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

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

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

Administration »

		  «

<%= link_to "Events", events_path %>

  		    <% if @context -%>

<%= link_to "Attendees", :controller => "agenda", :action => "attendees" %>

		    <% end -%>

<%= link_to "Locations", locations_path %>

<%= link_to "Site Templates", site_templates_path %>

<%= link_to "Schedules", schedules_path %>

            <% end -%>

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

<% end -%>

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

There were some errors processing your request:

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

<%= msg%>

      <% end -%>

<% end -%>

  <%= @content_for_layout %>

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


(RR) CCRB-160:  6 or more projects don't display correctly

git-svn-id: 50a8ad97cae5d6ab203d2d535a9b32cd3858a8ac@568 c04ce798-636b-4ca8-9149-0f9336831111

<% @rss_feeds = { 'All projects' => {:controller => 'projects', :action => 'index', :format => 'rss'} } -%>
<% @projects.each { |p| @rss_feeds["#{p.name} builds"] = project_url(:controller => 'projects', :action => 'show', :id => p, :format => 'rss')} -%>

<div id="projects">
  <% @projects.each do |project| -%>
    <%= render :partial => 'project', :locals => {:project => project }%>
  <% end -%>

  <%= render :partial => 'no_projects' if @projects.empty? %>
</div>

<%= periodically_call_remote :url => { :action => 'index', :format => 'js'}, :method => 'get',
                                       :frequency => Configuration.dashboard_refresh_interval %>

<% @rss_feeds = { 'All projects' => {:controller => 'projects', :action => 'index', :format => 'rss'} } -%>
<% @projects.each { |p| @rss_feeds["#{p.name} builds"] = project_url(:controller => 'projects', :action => 'show', :id => p, :format => 'rss')} -%>

  <% if @projects.length <= 5 %>
    <% @projects.each do |project| -%>
      <%= render :partial => 'project', :locals => {:project => project }%>
    <% end -%>
  <% else %>

      <% @projects.each do |project| -%>
        <%= render :partial => 'project', :locals => {:project => project }%>
      <% end -%>

  <% end %>

  <%= render :partial => 'no_projects' if @projects.empty? %>

<%= periodically_call_remote :url => { :action => 'index', :format => 'js'}, :method => 'get',
                                       :frequency => Configuration.dashboard_refresh_interval %>


adding complete reference for css to make the plugin works properly in production mode

<div id="display_content">
</div>

<script type="text/javascript" >

jQuery_1_8_3("#display_content").jstree({
   plugins : ["themes","json_data", "checkbox"],
   checkbox : {
     real_checkboxes : true,
     real_checkboxes_names : function (n) { return [("block[checked_nodes[" + n.attr('node_id') + "]]"), 1]; }
   },
   themes : {"theme" : "classic", "icons" : true, "url": "/plugins/display_content/javascripts/jstree/themes/classic/style.css"},
   json_data : {
     ajax : {
         url : '<%= url_for @block.url_params %>',
         async: true,
         data : function (m) {
           return m.attr ? {"id" : m.attr("node_id")} : {};
         }
       }
   }
});

</script>

<div id="display_content">
</div>

<script type="text/javascript" >

jQuery_1_8_3("#display_content").jstree({
   plugins : ["themes","json_data", "checkbox"],
   checkbox : {
     real_checkboxes : true,
     real_checkboxes_names : function (n) { return [("block[checked_nodes[" + n.attr('node_id') + "]]"), 1]; }
   },
   themes : {"themes" : "classic", "icons" : true, "dots": false},
   json_data : {
     ajax : {
         url : '<%= url_for @block.url_params %>',
         async: true,
         data : function (m) {
           return m.attr ? {"id" : m.attr("node_id")} : {};
         }
       }
   }
});

</script>


show indication of current record of funds form

      Parent

      <%= f.select :parent_id, @tree_list %>

      Title

      <%= f.text_field :title %>

      Default text area character length

      <%= f.text_field :default_text_area_length %>

      <%= f.check_box :hidden %>
      Hide this event group and its sub elements

      <%= f.check_box :show_mpdtool %>
      Show link to mpdtool on acceptance page

      <%= f.check_box :allows_multiple_applications_with_same_form %>
      Allow multiple applications that use the same form

      <%= f.check_box :show_dates_as_distance %>
      Show dates as words ex "5 hours ago"

      Long description (this should should fit in a sentence like "you are applying for ..." for example "a 2007 summer project")

      <%= f.text_field :long_desc %>

      Outgoing email

      <%= f.text_field :outgoing_email %>

      <%= f.check_box :has_your_campuses %>
      Has Your Campuses Page

      <%= f.check_box :automatic_acceptance %>
      Automatically accept an application on submission if no references are required.

Upload a logo: <%= f.file_field :uploaded_data %>

Upload a logo for the key login screen: <%= f.file_field :key_logo_uploaded_data %>

Record of Funds Form: <%= f.file_field :record_of_funds_uploaded_data %>
        currently: <%= @event_group.get_record_of_funds_form.present? ?
         link_to(@event_group.get_record_of_funds_form.filename, @event_group.get_record_of_funds_form.public_filename) :
         "not set" %>

          <%= f.check_box :forward_to_cas %> Forward straight to CAS login - don't show the PAT landing page but send directly to CAS login

      <% if @event_group && @event_group.has_logo? -%>

<%= check_box_tag :delete_logo %>Delete logo?

      <% end %>

      Title - If set, this replaces the default title "<%= Pat::CONFIG[:title] %>" in the top left of the PAT.

      <%= f.text_field :pat_title %>

      Cost Item Instructions - If set, this replaces the default instructions on the costing page.

      <%= f.text_area :cost_item_instructions, :rows => 2 %>

      Cost Item Line - If set, this replaces the default line on a cost item ("I will support raise for this item").

      <%= f.text_field :cost_item_phrase %>

      Slug - This enables a url <%= request.protocol %><%= request.host %><%= (":" + request.port.to_s) if request.port != 80 %>/register/<slug> that scopes this event group and starts the application form

     <%= request.protocol %><%= request.host %><%= (":" + request.port.to_s) if request.port != 80 && request.port != 443 %>/register/<%= f.text_field :slug %> <%- if @event_group && @event_group.slug.present? %> <%= link_to "Current slug url", request.protocol + request.host + ((":" + request.port.to_s) if request.port != 80 && request.port != 443).to_s + "/register/" + @event_group.slug %><% end %>

      <%= f.check_box :hide_profile_cost_item_link %> Hide profile cost item link - hide the link to create profile cost items

      Submit text:

      <%= f.text_area :submit_text, :rows => 2 %>

  <% unless @event_group.nil? || @event_group.new_record? %>

Eventgroup Coordinators: <%= @event_group.eventgroup_coordinators_names %> <%= link_to 'Manage Coordinators', { :controller => :eventgroup_coordinators, :action => :list, :id => @event_group.id }, :target => :blank %> (Opens in new window)

Note: Eventgroup Coordinators for all parent EventGroups are automatically considered coordinators for this group.

  <% end %>

      Parent

      <%= f.select :parent_id, @tree_list %>

      Title

      <%= f.text_field :title %>

      Default text area character length

      <%= f.text_field :default_text_area_length %>

      <%= f.check_box :hidden %>
      Hide this event group and its sub elements

      <%= f.check_box :show_mpdtool %>
      Show link to mpdtool on acceptance page

      <%= f.check_box :allows_multiple_applications_with_same_form %>
      Allow multiple applications that use the same form

      <%= f.check_box :show_dates_as_distance %>
      Show dates as words ex "5 hours ago"

      Long description (this should should fit in a sentence like "you are applying for ..." for example "a 2007 summer project")

      <%= f.text_field :long_desc %>

      Outgoing email

      <%= f.text_field :outgoing_email %>

      <%= f.check_box :has_your_campuses %>
      Has Your Campuses Page

      <%= f.check_box :automatic_acceptance %>
      Automatically accept an application on submission if no references are required.

Upload a logo: <%= f.file_field :uploaded_data %>

Upload a logo for the key login screen: <%= f.file_field :key_logo_uploaded_data %>

Record of Funds Form: <%= f.file_field :record_of_funds_uploaded_data %>

          <%= f.check_box :forward_to_cas %> Forward straight to CAS login - don't show the PAT landing page but send directly to CAS login

      <% if @event_group && @event_group.has_logo? -%>

<%= check_box_tag :delete_logo %>Delete logo?

      <% end %>

      Title - If set, this replaces the default title "<%= Pat::CONFIG[:title] %>" in the top left of the PAT.

      <%= f.text_field :pat_title %>

      Cost Item Instructions - If set, this replaces the default instructions on the costing page.

      <%= f.text_area :cost_item_instructions, :rows => 2 %>

      Cost Item Line - If set, this replaces the default line on a cost item ("I will support raise for this item").

      <%= f.text_field :cost_item_phrase %>

      Slug - This enables a url <%= request.protocol %><%= request.host %><%= (":" + request.port.to_s) if request.port != 80 %>/register/<slug> that scopes this event group and starts the application form

     <%= request.protocol %><%= request.host %><%= (":" + request.port.to_s) if request.port != 80 && request.port != 443 %>/register/<%= f.text_field :slug %> <%- if @event_group && @event_group.slug.present? %> <%= link_to "Current slug url", request.protocol + request.host + ((":" + request.port.to_s) if request.port != 80 && request.port != 443).to_s + "/register/" + @event_group.slug %><% end %>

      <%= f.check_box :hide_profile_cost_item_link %> Hide profile cost item link - hide the link to create profile cost items

      Submit text:

      <%= f.text_area :submit_text, :rows => 2 %>

  <% unless @event_group.nil? || @event_group.new_record? %>

Eventgroup Coordinators: <%= @event_group.eventgroup_coordinators_names %> <%= link_to 'Manage Coordinators', { :controller => :eventgroup_coordinators, :action => :list, :id => @event_group.id }, :target => :blank %> (Opens in new window)

Note: Eventgroup Coordinators for all parent EventGroups are automatically considered coordinators for this group.

  <% end %>


Martin wants to see number of locations in show_user even if zero.

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

<%
  id   = @show_user.id
  name = @show_user.unique_text_name

  @title = :show_user_title.t(:user => name)

  links = {
    :comments => url_for(:controller => 'comment',
                              :action => 'show_comments_by_user', :id => id),
    :comments_for => url_for(:controller => 'comment',
                              :action => 'show_comments_for_user', :id => id),
    :images => url_for(:controller => 'image', :action => 'images_by_user',
                              :id => id),
    :location_descriptions_authors => url_for(:controller => 'location',
                              :action => 'location_descriptions_by_author', :id => id),
    :location_descriptions_editors => url_for(:controller => 'location',
                              :action => 'location_descriptions_by_editor', :id => id),
    :locations => url_for(:controller => 'location',
                              :action => 'locations_by_user', :id => id),
    :locations_versions => url_for(:controller => 'location',
                              :action => 'locations_by_editor', :id => id),
    :name_descriptions_authors => url_for(:controller => 'name',
                              :action => 'name_descriptions_by_author', :id => id),
    :name_descriptions_editors => url_for(:controller => 'name',
                              :action => 'name_descriptions_by_editor', :id => id),
    :names => url_for(:controller => 'name', :action => 'names_by_user',
                              :id => id),
    :names_versions => url_for(:controller => 'name', :action => 'names_by_editor',
                              :id => id),
    :observations => url_for(:controller => 'observer',
                              :action => 'observations_by_user', :id => id),
    :species_lists => url_for(:controller => 'species_list',
                              :action => 'species_lists_by_user', :id => id),
  }

  new_tab_set do
    add_tab(:show_user_contributors.t, :controller => 'observer',
            :action => 'users_by_contribution')
    if @show_user == @user
      add_tab(:show_user_your_observations.t, links[:observations])
      add_tab(:show_user_comments_for_you.t, links[:comments_for])
      add_tab(:show_user_your_notifications.t, :controller => "interest",
              :action => "list_interests")
      add_tab(:show_user_edit_profile.t, :controller => "account",
              :action => "profile")
      add_tab(:app_preferences.t, :controller => "account", :action => "prefs")
    else
      add_tab(:show_user_observations_by.t(:name => name), links[:observations])
      add_tab(:show_user_comments_for.t(:name => name), links[:comments_for])
      add_tab(:show_user_email_to.t(:name => name), :controller => "observer",
              :action => "ask_user_question", :id => id)
    end
  end

  if is_in_admin_mode?
    new_tab_set do
      add_tab(:change_user_bonuses.t, :controller => "observer",
              :action => "change_user_bonuses", :id => @show_user.id)
      add_tab(:user_alert_create_alert.t, :controller => "account",
              :action => "create_alert", :id => @show_user.id)
      add_tab(:DESTROY.t, :controller => "account", :action => "destroy_user",
              :id => @show_user.id)
    end
  end

  draw_prev_next_tabs(@show_user)
%>

<%= if @show_user.image_id
  thumbnail(@show_user.image_id, :border => 0, :style => 'float:right',
            :votes => false)
end %>

<%= :show_user_joined.t %>: <%= @show_user.verified %>

<% if @show_user.location %>
  <%= :show_user_primary_location.t %>:
     <%= location_link(nil, @show_user.location) %>

<% end %>
<% if !@show_user.mailing_address.blank? %>
  <%= :show_user_mailing_address.t %>:
     <%= @show_user.mailing_address %>

<% end %>
<% if !@show_user.notes.empty? %>

<% end %>
<%= if !@show_user.notes.empty?
  sanitize(@show_user.notes).tpl
end %>

      <% obs_length = 0
      if @observations
        obs_length = @observations.length
      end

      if obs_length > 3 %>

          <% for obs in @observations[3,3] %>
            <%= thumbnail(obs.thumb_image, :class => 'site_stats_image',
                          :link => :show_observation, :obs => obs.id,
                          :votes => true) %>

          <% end %>

      <% end %>

          <% total = 0

          # These are roughly in decreasing order of importance.
          rows = [
            :name_descriptions_authors,
            :name_descriptions_editors,
            :names,
            :names_versions,
            :location_descriptions_authors,
            :location_descriptions_editors,
            :locations,
            :locations_versions,
            :images,
            :species_lists,
            :species_list_entries,
            :observations,
            :comments,
            :namings,
            :votes,
          ].map do |field| {
            :field  => field,
            :label  => "user_stats_#{field}".to_sym.t,
            :count  => (count = @user_data[field].to_i),
            :weight => (weight = SiteData::FIELD_WEIGHTS[field]),
            :points => count * weight,
          } end

          # Add bonuses at the bottom.
          if @show_user.bonuses
            rows += @show_user.bonuses.map do |points, reason| {
              :label  => reason.to_s.t,
              :points => points.to_i,
            } end
          end

          # Do we want to sort by points?
          # rows = rows.sort_by {|row| row[:points]}.reverse

          for row in rows
            field  = row[:field]
            label  = row[:label]
            count  = row[:count]
            weight = row[:weight]
            points = row[:points]
            url    = links[field]
            link   = url ? link_to(label, url) : label
            total += points
            if !count %>

                <%= label %>
                =
                <%= points %>

            <% elsif !label.blank? %>

                <%= link %>
                <%= count %> * <%= weight %>
                =
                <%= points %>

            <% end
          end

          if total > 0 %>

              <%= :show_user_total.t %>

              =
              <%= total %>

          <% end %>

      <% if obs_length > 0 %>

          <% for obs in @observations[0,3] %>
            <%= thumbnail(obs.thumb_image, :class => 'site_stats_image',
                          :link => :show_observation, :obs => obs.id,
                          :votes => true) %>

          <% end %>

      <% end %>

<%
  id   = @show_user.id
  name = @show_user.unique_text_name

  @title = :show_user_title.t(:user => name)

  links = {
    :comments => url_for(:controller => 'comment',
                              :action => 'show_comments_by_user', :id => id),
    :comments_for => url_for(:controller => 'comment',
                              :action => 'show_comments_for_user', :id => id),
    :images => url_for(:controller => 'image', :action => 'images_by_user',
                              :id => id),
    :location_descriptions_authors => url_for(:controller => 'location',
                              :action => 'location_descriptions_by_author', :id => id),
    :location_descriptions_editors => url_for(:controller => 'location',
                              :action => 'location_descriptions_by_editor', :id => id),
    :locations => url_for(:controller => 'location',
                              :action => 'locations_by_user', :id => id),
    :locations_versions => url_for(:controller => 'location',
                              :action => 'locations_by_editor', :id => id),
    :name_descriptions_authors => url_for(:controller => 'name',
                              :action => 'name_descriptions_by_author', :id => id),
    :name_descriptions_editors => url_for(:controller => 'name',
                              :action => 'name_descriptions_by_editor', :id => id),
    :names => url_for(:controller => 'name', :action => 'names_by_user',
                              :id => id),
    :names_versions => url_for(:controller => 'name', :action => 'names_by_editor',
                              :id => id),
    :observations => url_for(:controller => 'observer',
                              :action => 'observations_by_user', :id => id),
    :species_lists => url_for(:controller => 'species_list',
                              :action => 'species_lists_by_user', :id => id),
  }

  new_tab_set do
    add_tab(:show_user_contributors.t, :controller => 'observer',
            :action => 'users_by_contribution')
    if @show_user == @user
      add_tab(:show_user_your_observations.t, links[:observations])
      add_tab(:show_user_comments_for_you.t, links[:comments_for])
      add_tab(:show_user_your_notifications.t, :controller => "interest",
              :action => "list_interests")
      add_tab(:show_user_edit_profile.t, :controller => "account",
              :action => "profile")
      add_tab(:app_preferences.t, :controller => "account", :action => "prefs")
    else
      add_tab(:show_user_observations_by.t(:name => name), links[:observations])
      add_tab(:show_user_comments_for.t(:name => name), links[:comments_for])
      add_tab(:show_user_email_to.t(:name => name), :controller => "observer",
              :action => "ask_user_question", :id => id)
    end
  end

  if is_in_admin_mode?
    new_tab_set do
      add_tab(:change_user_bonuses.t, :controller => "observer",
              :action => "change_user_bonuses", :id => @show_user.id)
      add_tab(:user_alert_create_alert.t, :controller => "account",
              :action => "create_alert", :id => @show_user.id)
      add_tab(:DESTROY.t, :controller => "account", :action => "destroy_user",
              :id => @show_user.id)
    end
  end

  draw_prev_next_tabs(@show_user)
%>

<%= if @show_user.image_id
  thumbnail(@show_user.image_id, :border => 0, :style => 'float:right',
            :votes => false)
end %>

<%= :show_user_joined.t %>: <%= @show_user.verified %>

<% if @show_user.location %>
  <%= :show_user_primary_location.t %>:
     <%= location_link(nil, @show_user.location) %>

<% end %>
<% if !@show_user.mailing_address.blank? %>
  <%= :show_user_mailing_address.t %>:
     <%= @show_user.mailing_address %>

<% end %>
<% if !@show_user.notes.empty? %>

<% end %>
<%= if !@show_user.notes.empty?
  sanitize(@show_user.notes).tpl
end %>

      <% obs_length = 0
      if @observations
        obs_length = @observations.length
      end

      if obs_length > 3 %>

          <% for obs in @observations[3,3] %>
            <%= thumbnail(obs.thumb_image, :class => 'site_stats_image',
                          :link => :show_observation, :obs => obs.id,
                          :votes => true) %>

          <% end %>

      <% end %>

          <% total = 0

          # These are roughly in decreasing order of importance.
          rows = [
            :name_descriptions_authors,
            :name_descriptions_editors,
            :names,
            :names_versions,
            :location_descriptions_authors,
            :location_descriptions_editors,
            :locations,
            :locations_versions,
            :images,
            :species_lists,
            :species_list_entries,
            :observations,
            :comments,
            :namings,
            :votes,
          ].map do |field| {
            :field  => field,
            :label  => "user_stats_#{field}".to_sym.t,
            :count  => (count = @user_data[field].to_i),
            :weight => (weight = SiteData::FIELD_WEIGHTS[field]),
            :points => count * weight,
          } end

          # Add bonuses at the bottom.
          if @show_user.bonuses
            rows += @show_user.bonuses.map do |points, reason| {
              :label  => reason.to_s.t,
              :points => points.to_i,
            } end
          end

          # Do we want to sort by points?
          # rows = rows.sort_by {|row| row[:points]}.reverse

          for row in rows
            field  = row[:field]
            label  = row[:label]
            count  = row[:count]
            weight = row[:weight]
            points = row[:points]
            url    = links[field]
            link   = url ? link_to(label, url) : label
            total += points
            if !count %>

                <%= label %>
                =
                <%= points %>

            <% elsif count > 0 and !label.blank? %>

                <%= link %>
                <%= count %> * <%= weight %>
                =
                <%= points %>

            <% end
          end

          if total > 0 %>

              <%= :show_user_total.t %>

              =
              <%= total %>

          <% end %>

      <% if obs_length > 0 %>

          <% for obs in @observations[0,3] %>
            <%= thumbnail(obs.thumb_image, :class => 'site_stats_image',
                          :link => :show_observation, :obs => obs.id,
                          :votes => true) %>

          <% end %>

      <% end %>