[ClockingIT @ Force refresh of selected users for watchers]

<%= error_messages_for 'task' %>
<%

  perms = {}

  ['comment', 'edit', 'reassign', 'prioritize', 'close', 'milestone'].each do |p|
    if @task.project_id.to_i == 0 || session[:user].can?( @task.project, p )
      perms[p] = {}
    else
      perms[p] = { :disabled => 'disabled' }
    end
  end

%>

      <fieldset id="task_information" style="padding-right:0.5em;"><legend><%=_ 'Information' %></legend>
        <%=_ 'Summary' %>
        <%= text_field 'task', 'name', { :size => 47, :style => "width:80%;"}.merge( perms['edit'] )  %>

        <%=_ 'Tags' %>
        <%= text_field 'task', 'set_tags', { :size => 47, :value => @task.tags.collect{|t| t.name}.join(', '), :autocomplete => "off", :style => "width:80%;" }.merge( perms['edit'] ) %>

        <%=_ 'Description' %>
        <%= text_area 'task', 'description', { :rows => 20, :style => "width:80%;" }.merge( perms['edit'] )  %>

        <%=_ 'Comment' %>
        <%= text_area_tag 'comment', {}, { :rows => 10, :style => "width:80%;" }.merge( perms['comment'] )  %>

        <%=_ 'Attach file' %>
        <%= file_field_tag 'task_file', { :size => 35, :class => "file" }.merge( perms['comment'] ) %>

      </fieldset>
<% unless @tags.nil? %>

<% end %>

          <% if @task.project_id > 0
               selected_project = @task.project_id
             elsif session[:filter_project].to_i > 0
               selected_project = session[:filter_project].to_i
             else
               selected_project = User.find(session[:user].id).projects.find(:first, :order => 'name').id
             end

            %>
      <fieldset id="task_project_selection" style="padding-right:0;">
        <legend><%=_ 'Target' %></legend>
          <%=_ 'Project' %>

          <select name="task[project_id]" id="task_project_id" <%= "disabled=\"disabled\"" unless perms['reassign'].empty? %>>
          <% @clients = Customer.find(:all, :conditions => ["company_id = ?", session[:user].company_id], :order => "name") %>
          <% @clients.each do |c| %>
          <% @client_projects = User.find(session[:user].id).projects.find(:all, :conditions => ["customer_id = #{c.id} AND completed_at IS NULL"], :order => "name" ) %>
            <% if @client_projects.size > 0 %>
            <option value="" disabled="disabled" class="select_heading"><%= c.name %></option>
              <% @client_projects.each do |p| %>
                 <option value="<%=p.id%>" class="select_item"<%= " selected" if p.id == selected_project%>><%= p.name %></option>
              <% end %>
           <% end %>

          <% end %>

           </select>

          <%=_ 'Milestone' %>
          <% unless @task.id.nil? %>
            <%= select 'task', 'milestone_id', [[_("[None]"), "0"]] + Milestone.find(:all, :order => 'name', :conditions => ['company_id = ? AND project_id = ? AND completed_at IS NULL', session[:user].company.id, selected_project] ).collect {|c| [ c.name, c.id ] }, {}, perms['milestone'] %>

          <% else %>
            <%= select'task', 'milestone_id', [[_("[None]"), "0"]] + Milestone.find(:all, :order => 'name', :conditions => ['company_id = ? AND project_id = ? AND completed_at IS NULL', session[:user].company.id, selected_project] ).collect {|c| [ c.name, c.id ] }, {:selected => session[:filter_milestone] ? session[:filter_milestone].to_i : 0}, perms['milestone'] %>

          <% end %>

<%

users = Project.find(selected_project).users.find(:all, :order => 'name' )

resource_string = "<select id=\"task_users\" name=\"users[]\" #{"disabled=\"disabled\"" if @task.project && !session[:user].can?( @task.project, 'reassign' )}><option value=\"\">[#{_('Unassigned')}]</option>" + users.collect{|us| "<option value=\"#{us.id}\">#{us.name}</option>"}.join('') + "</select>"
resource_string = resource_string.split(/\n/).join('').gsub(/'/, "\\\\\'")

owner_string = ''
num = 0
unless @task.users.empty?
  @task.users.each do |u|
    owner_string << "
#{_('Assigned To')}" if num == 0
    owner_string << "
" if num != 0
    owner_string <<  "<select name=\"users[]\" id=\"task_users\" #{"disabled=\"disabled\"" if @task.project && !session[:user].can?( @task.project, 'reassign' )}><option value=\"\">[#{_('No one')}]</option>" + users.collect{|us| "<option value=\"#{us.id}\" #{(u.id == us.id ? "selected=\"selected\"" : '')}>#{us.name}</option>"}.join('').gsub(/'/,"\\\\\'") + "</select>" #, perms['reassign'] )

    if( perms['reassign'].keys.size == 0 )
      owner_string << "" if num == 0
      owner_string << "" if num != 0
    end
    owner_string << "
"
    num = num + 1
  end
  owner_string = owner_string.split(/\n/).join('')
else
  owner_string = "<select name=\"users[]\" id=\"task_users\" #{"disabled=\"disabled\"" if @task.project && !session[:user].can?( @task.project, 'reassign' )}><option value=\"\">[#{_('No one')}]</option>" + users.collect{|us| "<option value=\"#{us.id}\" #{"selected" if (us.id == session[:user].id && @task.created_at.nil?) }>#{us.name}</option>"}.join('') + "</select>" #, perms['reassign']
  owner_string = owner_string.split(/\n/).join('').gsub(/'/, "\\\\\'")

  if perms['reassign'].keys.size == 0
    owner_string = "
#{_('Assigned To')}#{owner_string}"
    owner_string << "
"
  end
  num = num + 1
end

%>

       <%= owner_string %>

      <%=_ 'Requested By' %>
      <%= text_field 'task', 'requested_by', {:size => 12}.merge(perms['edit']) %>

      </fieldset>

      <fieldset id="task_attr" style="padding-right:0;">
        <legend><%=_ 'Attributes' %></legend>
      <%=_ 'Type' %>
        <%= select 'task', 'type_id', [[_('Task'),0],[_('New Feature'),1],[_('Defect'),2],[_('Improvement'),3]], {:selected => @task.type_id}, perms['prioritize']  %>

        <%=_ 'Priority' %>
        <%= select 'task', 'priority', [[_('Critical'),3],[_('Urgent'),2],[_('High'),1],[_('Normal'),0],[_('Low'),-1],[_('Lowest'),-2]], {:selected => @task.priority}, perms['prioritize']  %>

      <%=_ 'Severity' %>
        <%= select 'task', 'severity_id', [[_('Blocker'),3],[_('Critical'),2],[_('Major'),1],[_('Normal'),0],[_('Minor'),-1],[_('Trivial'),-2]], {:selected => @task.severity_id}, perms['prioritize']  %>

      <% if session[:user].option_tracktime.to_i == 1%>
       <%=_ 'Time Estimate' %>
      <%= text_field 'task', 'duration', {:size => 12, :value => (@task.duration.to_i > 0 ? worked_nice(@task.duration) : ""), :class => 'tooltip', :title => '2w 3d 1h'}.merge(perms['prioritize']) %>

      <%=_ 'Due Date' %>
        <% if perms['prioritize'].empty? %>
          <% if( (session[:user].locale || 'en_US') == 'en_US' )
               date_tooltip = _("Enter task due date, or click calendar button.
For recurring tasks, try:
every day
every thursday
every last friday
every 14 days
every 3rd monday (of a month)")
             else
               date_tooltip = _("Enter task due date, or click calendar button.")
             end %>
          <% if @task.repeat && @task.repeat.length > 0 %>
          <%= calendar_field 'task', 'due_at', { :class => 'date tooltip', :field_title => date_tooltip, :button_title => _('Show Calendar'), :value => @task.repeat_summary },
          { :ifFormat => session[:user].date_format, :firstDay => 1, :range => [2006, 2010], :step => 1, :showOthers => true } %>
          <% else %>
          <%= calendar_field 'task', 'due_at', { :class => 'date tooltip', :field_title => date_tooltip, :button_title => _('Show Calendar') },
          { :ifFormat => session[:user].date_format, :firstDay => 1, :range => [2006, 2010], :step => 1, :showOthers => true } %>
          <% end %>

        <% else %>
          <% if @task.repeat && @task.repeat.length > 0 %>
        <%= text_field 'task', 'due_at', {:size => 12, :value => @task.repeat_summary}.merge(perms['prioritize']) %>

          <% else %>
        <%= text_field 'task', 'due_at', {:size => 12}.merge(perms['prioritize']) %>

          <% end %>
        <% end %>

<% else %>
    <%= hidden_field_tag "task[duration]", "1h" %>
    <%= hidden_field_tag "task[due_at]", "" %>
<% end %>
      </fieldset>

      <fieldset id="task_dependencies" style="padding-right:0;">
        <legend><%=_ "Dependencies"%></legend>

        <%=_ 'Depends on'%> #
        <% if perms['prioritize'].empty? %>
        <input name="dependencies[]" size="12" type="text" id="dependencies_input" title="<%=_("Enter task numbers, separated by commas. Type text to search.")%>" class="tooltip" >

        <%= auto_complete_field 'dependencies_input', { :url => { :action => 'dependency_targets' }, :min_chars => 1, :frequency => 0.5, :indicator => 'loading', :select => 'complete_value', :tokens => ',' } %>
        <% else %>
        <input name="dependencies[]" size="12" type="text" disabled="disabled">
        <% end %>

        <% @task.dependencies.each do |d| %>

        <div id="dep_<%=d.id%>" style="clear:both;">

<% if d.done? %><% else %><% end %><%= link_to_task(d) %>

        <% if perms['prioritize'].empty? %>

<a href="#" onclick="javascript:new Element.remove('dep_<%=d.id%>'); false;" ><img src="/images/delete.png" border="0" title="<%=_ 'Remove dependency'%>" class="tooltip">

        <% end %>
        <input name="dependencies[]" type="hidden" value="<%=d.task_num%>">

        <% end %>

      </fieldset>

<% unless @task.dependants.empty? %>

      <fieldset id="task_dependants" style="padding-right:0;">
        <legend><%=_ "Depended on by"%></legend>

        <% @task.dependants.each do |d| %>

        <div id="dep_<%=d.id%>" style="clear:both;">

<% if d.done? %><% else %><% end %><%= link_to_task(d) %>

        <% end %>

      </fieldset>

<% end %>

      <fieldset id="task_notify" style="padding-right:0;">
        <legend><%=_ 'Notification' %></legend>
        <% users = Project.find(selected_project).users.find(:all, :order => 'name' )

        <% watchers = @task.watchers.collect {|t| t.id } %>
        <label for="watchers[]" class="tooltip" title="<%=_ "Additional people to be notified on task changes
in addition to creator and asignee.

Ctrl-click to toggle." %>"><%=_ 'To:' %>
        <%= select_tag "watchers[]", users.collect {|u| "<option value=\"#{u.id}\" #{(watchers.include?(u.id) ? 'selected=\"selected\"' : '')} >#{u.name}</option>"}.join(''), {:multiple => true, :size => 8, :class => 'tooltip', :title => 'Additional people to be notified on task changes
in addition to creator and asignee.

Ctrl-click to toggle.'}.merge(perms['edit']) %>

        Cc:
        <%= text_area 'task', 'notify_emails', { :cols => 15, :rows => 3, :class => 'tooltip', :title => 'Comma-separated list of emails to notify'}.merge(perms['edit']) %>

      </fieldset>

      <% if @task.attachments.size > 0 %>
      <fieldset id="task_attachments">
        <legend><%=_ "Attachments" %></legend>

        <% for file in @task.attachments %>
        <%= link_to h(file.name), {:controller => 'project_files', :action => 'download', :id => file.id} %> (<%=human_size(file.file_size)%>)
        <%= link_to _('[Delete]'), {:controller => 'project_files', :action => 'destroy', :id => file.id}, :confirm => _("Really delete %s?", file.name) %>

        <% end %>
      </fieldset>
      <% end %>

<%= error_messages_for 'task' %>
<%

  perms = {}

  ['comment', 'edit', 'reassign', 'prioritize', 'close', 'milestone'].each do |p|
    if @task.project_id.to_i == 0 || session[:user].can?( @task.project, p )
      perms[p] = {}
    else
      perms[p] = { :disabled => 'disabled' }
    end
  end

%>

      <fieldset id="task_information" style="padding-right:0.5em;"><legend><%=_ 'Information' %></legend>
        <%=_ 'Summary' %>
        <%= text_field 'task', 'name', { :size => 47, :style => "width:80%;"}.merge( perms['edit'] )  %>

        <%=_ 'Tags' %>
        <%= text_field 'task', 'set_tags', { :size => 47, :value => @task.tags.collect{|t| t.name}.join(', '), :autocomplete => "off", :style => "width:80%;" }.merge( perms['edit'] ) %>

        <%=_ 'Description' %>
        <%= text_area 'task', 'description', { :rows => 20, :style => "width:80%;" }.merge( perms['edit'] )  %>

        <%=_ 'Comment' %>
        <%= text_area_tag 'comment', {}, { :rows => 10, :style => "width:80%;" }.merge( perms['comment'] )  %>

        <%=_ 'Attach file' %>
        <%= file_field_tag 'task_file', { :size => 35, :class => "file" }.merge( perms['comment'] ) %>

      </fieldset>
<% unless @tags.nil? %>

<% end %>

          <% if @task.project_id > 0
               selected_project = @task.project_id
             elsif session[:filter_project].to_i > 0
               selected_project = session[:filter_project].to_i
             else
               selected_project = User.find(session[:user].id).projects.find(:first, :order => 'name').id
             end

            %>
      <fieldset id="task_project_selection" style="padding-right:0;">
        <legend><%=_ 'Target' %></legend>
          <%=_ 'Project' %>

          <select name="task[project_id]" id="task_project_id" <%= "disabled=\"disabled\"" unless perms['reassign'].empty? %>>
          <% @clients = Customer.find(:all, :conditions => ["company_id = ?", session[:user].company_id], :order => "name") %>
          <% @clients.each do |c| %>
          <% @client_projects = User.find(session[:user].id).projects.find(:all, :conditions => ["customer_id = #{c.id} AND completed_at IS NULL"], :order => "name" ) %>
            <% if @client_projects.size > 0 %>
            <option value="" disabled="disabled" class="select_heading"><%= c.name %></option>
              <% @client_projects.each do |p| %>
                 <option value="<%=p.id%>" class="select_item"<%= " selected" if p.id == selected_project%>><%= p.name %></option>
              <% end %>
           <% end %>

          <% end %>

           </select>

          <%=_ 'Milestone' %>
          <% unless @task.id.nil? %>
            <%= select 'task', 'milestone_id', [[_("[None]"), "0"]] + Milestone.find(:all, :order => 'name', :conditions => ['company_id = ? AND project_id = ? AND completed_at IS NULL', session[:user].company.id, selected_project] ).collect {|c| [ c.name, c.id ] }, {}, perms['milestone'] %>

          <% else %>
            <%= select'task', 'milestone_id', [[_("[None]"), "0"]] + Milestone.find(:all, :order => 'name', :conditions => ['company_id = ? AND project_id = ? AND completed_at IS NULL', session[:user].company.id, selected_project] ).collect {|c| [ c.name, c.id ] }, {:selected => session[:filter_milestone] ? session[:filter_milestone].to_i : 0}, perms['milestone'] %>

          <% end %>

<%

users = Project.find(selected_project).users.find(:all, :order => 'name' )

resource_string = "<select id=\"task_users\" name=\"users[]\" #{"disabled=\"disabled\"" if @task.project && !session[:user].can?( @task.project, 'reassign' )}><option value=\"\">[#{_('Unassigned')}]</option>" + users.collect{|us| "<option value=\"#{us.id}\">#{us.name}</option>"}.join('') + "</select>"
resource_string = resource_string.split(/\n/).join('').gsub(/'/, "\\\\\'")

owner_string = ''
num = 0
unless @task.users.empty?
  @task.users.each do |u|
    owner_string << "
#{_('Assigned To')}" if num == 0
    owner_string << "
" if num != 0
    owner_string <<  "<select name=\"users[]\" id=\"task_users\" #{"disabled=\"disabled\"" if @task.project && !session[:user].can?( @task.project, 'reassign' )}><option value=\"\">[#{_('No one')}]</option>" + users.collect{|us| "<option value=\"#{us.id}\" #{(u.id == us.id ? "selected=\"selected\"" : '')}>#{us.name}</option>"}.join('').gsub(/'/,"\\\\\'") + "</select>" #, perms['reassign'] )

    if( perms['reassign'].keys.size == 0 )
      owner_string << "" if num == 0
      owner_string << "" if num != 0
    end
    owner_string << "
"
    num = num + 1
  end
  owner_string = owner_string.split(/\n/).join('')
else
  owner_string = "<select name=\"users[]\" id=\"task_users\" #{"disabled=\"disabled\"" if @task.project && !session[:user].can?( @task.project, 'reassign' )}><option value=\"\">[#{_('No one')}]</option>" + users.collect{|us| "<option value=\"#{us.id}\" #{"selected" if (us.id == session[:user].id && @task.created_at.nil?) }>#{us.name}</option>"}.join('') + "</select>" #, perms['reassign']
  owner_string = owner_string.split(/\n/).join('').gsub(/'/, "\\\\\'")

  if perms['reassign'].keys.size == 0
    owner_string = "
#{_('Assigned To')}#{owner_string}"
    owner_string << "
"
  end
  num = num + 1
end

%>

       <%= owner_string %>

      <%=_ 'Requested By' %>
      <%= text_field 'task', 'requested_by', {:size => 12}.merge(perms['edit']) %>

      </fieldset>

      <fieldset id="task_attr" style="padding-right:0;">
        <legend><%=_ 'Attributes' %></legend>
      <%=_ 'Type' %>
        <%= select 'task', 'type_id', [[_('Task'),0],[_('New Feature'),1],[_('Defect'),2],[_('Improvement'),3]], {:selected => @task.type_id}, perms['prioritize']  %>

        <%=_ 'Priority' %>
        <%= select 'task', 'priority', [[_('Critical'),3],[_('Urgent'),2],[_('High'),1],[_('Normal'),0],[_('Low'),-1],[_('Lowest'),-2]], {:selected => @task.priority}, perms['prioritize']  %>

      <%=_ 'Severity' %>
        <%= select 'task', 'severity_id', [[_('Blocker'),3],[_('Critical'),2],[_('Major'),1],[_('Normal'),0],[_('Minor'),-1],[_('Trivial'),-2]], {:selected => @task.severity_id}, perms['prioritize']  %>

      <% if session[:user].option_tracktime.to_i == 1%>
       <%=_ 'Time Estimate' %>
      <%= text_field 'task', 'duration', {:size => 12, :value => (@task.duration.to_i > 0 ? worked_nice(@task.duration) : ""), :class => 'tooltip', :title => '2w 3d 1h'}.merge(perms['prioritize']) %>

      <%=_ 'Due Date' %>
        <% if perms['prioritize'].empty? %>
          <% if( (session[:user].locale || 'en_US') == 'en_US' )
               date_tooltip = _("Enter task due date, or click calendar button.
For recurring tasks, try:
every day
every thursday
every last friday
every 14 days
every 3rd monday (of a month)")
             else
               date_tooltip = _("Enter task due date, or click calendar button.")
             end %>
          <% if @task.repeat && @task.repeat.length > 0 %>
          <%= calendar_field 'task', 'due_at', { :class => 'date tooltip', :field_title => date_tooltip, :button_title => _('Show Calendar'), :value => @task.repeat_summary },
          { :ifFormat => session[:user].date_format, :firstDay => 1, :range => [2006, 2010], :step => 1, :showOthers => true } %>
          <% else %>
          <%= calendar_field 'task', 'due_at', { :class => 'date tooltip', :field_title => date_tooltip, :button_title => _('Show Calendar') },
          { :ifFormat => session[:user].date_format, :firstDay => 1, :range => [2006, 2010], :step => 1, :showOthers => true } %>
          <% end %>

        <% else %>
          <% if @task.repeat && @task.repeat.length > 0 %>
        <%= text_field 'task', 'due_at', {:size => 12, :value => @task.repeat_summary}.merge(perms['prioritize']) %>

          <% else %>
        <%= text_field 'task', 'due_at', {:size => 12}.merge(perms['prioritize']) %>

          <% end %>
        <% end %>

<% else %>
    <%= hidden_field_tag "task[duration]", "1h" %>
    <%= hidden_field_tag "task[due_at]", "" %>
<% end %>
      </fieldset>

      <fieldset id="task_dependencies" style="padding-right:0;">
        <legend><%=_ "Dependencies"%></legend>

        <%=_ 'Depends on'%> #
        <% if perms['prioritize'].empty? %>
        <input name="dependencies[]" size="12" type="text" id="dependencies_input" title="<%=_("Enter task numbers, separated by commas. Type text to search.")%>" class="tooltip" >

        <%= auto_complete_field 'dependencies_input', { :url => { :action => 'dependency_targets' }, :min_chars => 1, :frequency => 0.5, :indicator => 'loading', :select => 'complete_value', :tokens => ',' } %>
        <% else %>
        <input name="dependencies[]" size="12" type="text" disabled="disabled">
        <% end %>

        <% @task.dependencies.each do |d| %>

        <div id="dep_<%=d.id%>" style="clear:both;">

<% if d.done? %><% else %><% end %><%= link_to_task(d) %>

        <% if perms['prioritize'].empty? %>

<a href="#" onclick="javascript:new Element.remove('dep_<%=d.id%>'); false;" ><img src="/images/delete.png" border="0" title="<%=_ 'Remove dependency'%>" class="tooltip">

        <% end %>
        <input name="dependencies[]" type="hidden" value="<%=d.task_num%>">

        <% end %>

      </fieldset>

<% unless @task.dependants.empty? %>

      <fieldset id="task_dependants" style="padding-right:0;">
        <legend><%=_ "Depended on by"%></legend>

        <% @task.dependants.each do |d| %>

        <div id="dep_<%=d.id%>" style="clear:both;">

<% if d.done? %><% else %><% end %><%= link_to_task(d) %>

        <% end %>

      </fieldset>

<% end %>

      <fieldset id="task_notify" style="padding-right:0;">
        <legend><%=_ 'Notification' %></legend>

        <% watchers = @task.watchers.collect {|t| t.id } %>
        <label for="watchers[]" class="tooltip" title="<%=_ "Additional people to be notified on task changes
in addition to creator and asignee.

Ctrl-click to toggle." %>"><%=_ 'To:' %>
        <%= select_tag "watchers[]", users.collect {|u| "<option value=#{u.id} #{(watchers.include?(u.id) ? 'selected=\"selected\"' : '')} >#{u.name}</option>"}.join(''), {:multiple => true, :size => 8, :class => 'tooltip', :title => 'Additional people to be notified on task changes
in addition to creator and asignee.

Ctrl-click to toggle.'}.merge(perms['edit']) %>

        Cc:
        <%= text_area 'task', 'notify_emails', { :cols => 15, :rows => 3, :class => 'tooltip', :title => 'Comma-separated list of emails to notify'}.merge(perms['edit']) %>

      </fieldset>

      <% if @task.attachments.size > 0 %>
      <fieldset id="task_attachments">
        <legend><%=_ "Attachments" %></legend>

        <% for file in @task.attachments %>
        <%= link_to h(file.name), {:controller => 'project_files', :action => 'download', :id => file.id} %> (<%=human_size(file.file_size)%>)
        <%= link_to _('[Delete]'), {:controller => 'project_files', :action => 'destroy', :id => file.id}, :confirm => _("Really delete %s?", file.name) %>

        <% end %>
      </fieldset>
      <% end %>


subforms now use the configured association.options[:order], when
available. they only sort by id as a backup routine.

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

<%
parent_record = @record
associated = column.singular_association? ? [parent_record.send(column.name)].compact : parent_record.send(column.name)
associated = associated.sort_by {|r| r.id} unless column.association.options.has_key?(:order)

show_blank_record = (column.plural_association? or (column.singular_association? and associated.empty?))
show_blank_record = false if column.through_association?
show_blank_record = false unless column.association.klass.authorized_for?(:action => :create)

-%>

<%= column.label -%>

  <% @record = column.association.klass.new -%>
  <%= render :partial => 'form_association_header', :locals => {:parent_record => parent_record} %>

  <tbody id="<%= sub_form_list_id(:association => column.name) %>">
    <% associated.each_index do |index| %>
    <% @record = associated[index] -%>

      <% scope = column.plural_association? ? "[#{column.name}][#{@record.id}]" : "[#{column.name}]" -%>
      <%= render :partial => 'form_association_record', :locals => {:scope => scope, :parent_record => parent_record} %>

    <% end -%>

    <% if show_blank_record -%>
    <% @record = column.association.klass.new -%>

      <% scope = column.plural_association? ? "[#{column.name}][#{generate_temporary_id}]" : "[#{column.name}]" -%>
      <%= render :partial => 'form_association_record', :locals => {:scope => scope, :parent_record => parent_record} %>

    <% end -%>

<%= render :partial => 'form_association_footer', :locals => {:parent_record => parent_record, :column => column, :associated => associated} -%>

<% @record = parent_record -%>

<%
parent_record = @record
associated = column.singular_association? ? [parent_record.send(column.name)].compact : parent_record.send(column.name).sort_by {|r| r.id}

show_blank_record = (column.plural_association? or (column.singular_association? and associated.empty?))
show_blank_record = false if column.through_association?
show_blank_record = false unless column.association.klass.authorized_for?(:action => :create)

-%>

<%= column.label -%>

  <% @record = column.association.klass.new -%>
  <%= render :partial => 'form_association_header', :locals => {:parent_record => parent_record} %>

  <tbody id="<%= sub_form_list_id(:association => column.name) %>">
    <% associated.each_index do |index| %>
    <% @record = associated[index] -%>

      <% scope = column.plural_association? ? "[#{column.name}][#{@record.id}]" : "[#{column.name}]" -%>
      <%= render :partial => 'form_association_record', :locals => {:scope => scope, :parent_record => parent_record} %>

    <% end -%>

    <% if show_blank_record -%>
    <% @record = column.association.klass.new -%>

      <% scope = column.plural_association? ? "[#{column.name}][#{generate_temporary_id}]" : "[#{column.name}]" -%>
      <%= render :partial => 'form_association_record', :locals => {:scope => scope, :parent_record => parent_record} %>

    <% end -%>

<%= render :partial => 'form_association_footer', :locals => {:parent_record => parent_record, :column => column, :associated => associated} -%>

<% @record = parent_record -%>


In the case of metareviews we can't use the reviewee. In this type of response, the reviewee is the person who submitted the review. Instead we have to use the person who submitted the content. An additional attribute should probably be added to each response type: content_provider. This would always contain the correct person for the content. I will investigate this in the near future.

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

<%= @header %> <%= @title %> for <%= @map.assignment.name %>

<% if !(@map.instance_of? TeammateReviewResponseMap) %>
  <% if @map.instance_of? MetareviewResponseMap
        reviewee = @map.review_mapping.reviewee
     else
        reviewee = @map.reviewee
     end %>

  <%= render :partial => 'submitted_content/main', :locals => {:participant => reviewee, :stage =>  @assignment.get_current_stage()} %>

<% end %>
<%= @map.show_review() %>

<%= form_tag :action => @next_action, :id => @modified_object %>
<% i = 0
   @questions.each{
    | question | %>
    <%= question.txt %>

    <% if controller.action_name != 'new' %>
        <input id=responses_<%=i%>_comments name=responses[<%=i%>][comment] size=70 type=text value="<%= @review_scores[i].comments.gsub(/\"/,'"')%>" />
    <% else %>
        <input id=responses_<%=i%>_comments name=responses[<%=i%>][comment] size=70 type=text />
    <% end %>
    <% if question.true_false? %>
      <select id=responses_<%=i%>_score name=responses[<%=i%>][score]>
         <%if controller.action_name != 'new' %>
           <option value="<%=@min%>" <%if @min==@review_scores[i].score%>selected="selected"<%end%> ><%=@min%></option>
           <option value="<%=@max%>" <%if @max==@review_scores[i].score%>selected="selected"<%end%> ><%=@max%></option>
         <%else%>
           <option value="<%=@min%>"><%=@min%></option>
           <option value="<%=@max%>"><%=@max%></option>
         <%end%>
      </select>
  <% else %>
      <select id=responses_<%=i%>_score name=responses[<%=i%>][score]>
          <% for j in @min..@max %>
	        <%if controller.action_name != 'new' %>
            	<option value="<%=j%>"<% if j==@review_scores[i].score%> selected="selected"<%end%> ><%=j%></option>
            <%else%>
		        <option value="<%=j%>" ><%=j%></option>
	        <% end %>
          <% end %>
      </select>
  <% end %>
  <%if question.question_advices.size > 0%>
      <%= render :partial => 'advice', :locals => {:i => i, :advice_list => question.question_advices} %>
  <% else %>

  <% end %>

  <% i+=1
   } %>

	Additional Comments

	<textarea cols="70" rows="5" id=review_comments name=review[comments]><% if controller.action_name != 'new' and @response.additional_comment != nil %><%=@response.additional_comment.strip%><% end %></textarea>

<%= submit_tag "Save "+@title, :name=>"save" %>
<%= hidden_field_tag('return', @return) %>
</form>
<%= @map.show_feedback() %>
Back

<%= @header %> <%= @title %> for <%= @map.assignment.name %>

<% if !(@map.instance_of? TeammateReviewResponseMap) %>
  <%= render :partial => 'submitted_content/main', :locals => {:participant => @map.reviewee, :stage =>  @assignment.get_current_stage()} %>

<% end %>
<%= @map.show_review() %>

<%= form_tag :action => @next_action, :id => @modified_object %>
<% i = 0
   @questions.each{
    | question | %>
    <%= question.txt %>

    <% if controller.action_name != 'new' %>
        <input id=responses_<%=i%>_comments name=responses[<%=i%>][comment] size=70 type=text value="<%= @review_scores[i].comments.gsub(/\"/,'"')%>" />
    <% else %>
        <input id=responses_<%=i%>_comments name=responses[<%=i%>][comment] size=70 type=text />
    <% end %>
    <% if question.true_false? %>
      <select id=responses_<%=i%>_score name=responses[<%=i%>][score]>
         <%if controller.action_name != 'new' %>
           <option value="<%=@min%>" <%if @min==@review_scores[i].score%>selected="selected"<%end%> ><%=@min%></option>
           <option value="<%=@max%>" <%if @max==@review_scores[i].score%>selected="selected"<%end%> ><%=@max%></option>
         <%else%>
           <option value="<%=@min%>"><%=@min%></option>
           <option value="<%=@max%>"><%=@max%></option>
         <%end%>
      </select>
  <% else %>
      <select id=responses_<%=i%>_score name=responses[<%=i%>][score]>
          <% for j in @min..@max %>
	        <%if controller.action_name != 'new' %>
            	<option value="<%=j%>"<% if j==@review_scores[i].score%> selected="selected"<%end%> ><%=j%></option>
            <%else%>
		        <option value="<%=j%>" ><%=j%></option>
	        <% end %>
          <% end %>
      </select>
  <% end %>
  <%if question.question_advices.size > 0%>
      <%= render :partial => 'advice', :locals => {:i => i, :advice_list => question.question_advices} %>
  <% else %>

  <% end %>

  <% i+=1
   } %>

	Additional Comments

	<textarea cols="70" rows="5" id=review_comments name=review[comments]><% if controller.action_name != 'new' and @response.additional_comment != nil %><%=@response.additional_comment.strip%><% end %></textarea>

<%= submit_tag "Save "+@title, :name=>"save" %>
<%= hidden_field_tag('return', @return) %>
</form>
<%= @map.show_feedback() %>
Back


精算一覧ができなくなったので臨時対応。

精算一覧ができなくなったので臨時対応。

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

    <% if flash[:notice] %>

<%= flash[:notice]%>

    <% end %>

        精算日
        精算データ名
        精算対象口座
        対象取引数
        精算額
        登録日時
        詳細

      <% for s in @settlements %>
	    <% unless s.result_entry %>

		  請求(ID:<%= s.id%>のデータが破損しています。精算取引がありません。管理者に連絡してください。

		<% else %>

          <%= format_date s.result_entry.deal.date %>
          <%= s.name %>
          <%= s.account.name %>
          <%= s.target_entries.size %>
          <%= number_with_delimiter s.target_sum.abs %>
          <%= format_datetime s.created_at %>
          <%= link_to '詳細', :action => 'view', :id => s.id %>

		<% end %>
      <% end %>

    <% if flash[:notice] %>

<%= flash[:notice]%>

    <% end %>

        精算日
        精算データ名
        精算対象口座
        対象取引数
        精算額
        登録日時
        詳細

      <% for s in @settlements %>

          <%= format_date s.result_entry.deal.date %>
          <%= s.name %>
          <%= s.account.name %>
          <%= s.target_entries.size %>
          <%= number_with_delimiter s.target_sum.abs %>
          <%= format_datetime s.created_at %>
          <%= link_to '詳細', :action => 'view', :id => s.id %>

      <% end %>


fix wording in _live_version_alert

fix wording in _live_version_alert

      Change to the live version now!

      If you are here to request a token for the Protected Planet API, please
      use the live version, available here.

      This will ensure that you always receive the latest data, and the best performance.

      Change now to the live version!

      If you are here to request a token for the Protected Planet API, please
      use the live version, available here.

      This will ensure that you receive always the latest data, and best performance.


Update the style: on its own, it's too stark, but smaller it is better.

Otherwise it catches the eye too readily. Perhaps it needs to be moved
to the header or something. I'm uncertain.

<%= l(:label_revision) %> <%= format_revision(@rev_to) + ':' if @rev_to %><%= format_revision(@rev) %> <%=h @path %>

Return to <%= link_to 'revision overview', {:action => 'revision', :rev => @rev, :controller => 'repositories'} if @rev %><%= link_to 'revision overview', {:action => 'revision', :rev => @rev_to, :controller => 'repositories'} if @rev_to %>.

<% form_tag({:path => to_path_param(@path)}, :method => 'get') do %>
  <%= hidden_field_tag('rev', params[:rev]) if params[:rev] %>
  <%= hidden_field_tag('rev_to', params[:rev_to]) if params[:rev_to] %>

<%= l(:label_view_diff) %>
  <%= select_tag 'type', options_for_select([[l(:label_diff_inline), "inline"], [l(:label_diff_side_by_side), "sbs"]], @diff_type), :onchange => "if (this.value != '') {this.form.submit()}" %>

<% end %>

<% cache(@cache_key) do -%>
<%= render :partial => 'common/diff', :locals => {:diff => @diff, :diff_type => @diff_type} %>
<% end -%>

<% other_formats_links do |f| %>
	<%= f.link_to 'Diff', :url => params, :caption => 'Unified diff' %>
<% end %>

<% html_title(with_leading_slash(@path), 'Diff') -%>

<% content_for :header_tags do %>
<%= stylesheet_link_tag "scm" %>
<% end %>

<%= l(:label_revision) %> <%= format_revision(@rev_to) + ':' if @rev_to %><%= format_revision(@rev) %> <%=h @path %>

(Return to <%= link_to 'revision overview', {:action => 'revision', :rev => @rev, :controller => 'repositories'} if @rev %><%= link_to 'revision overview', {:action => 'revision', :rev => @rev_to, :controller => 'repositories'} if @rev_to %>.)

<% form_tag({:path => to_path_param(@path)}, :method => 'get') do %>
  <%= hidden_field_tag('rev', params[:rev]) if params[:rev] %>
  <%= hidden_field_tag('rev_to', params[:rev_to]) if params[:rev_to] %>

<%= l(:label_view_diff) %>
  <%= select_tag 'type', options_for_select([[l(:label_diff_inline), "inline"], [l(:label_diff_side_by_side), "sbs"]], @diff_type), :onchange => "if (this.value != '') {this.form.submit()}" %>

<% end %>

<% cache(@cache_key) do -%>
<%= render :partial => 'common/diff', :locals => {:diff => @diff, :diff_type => @diff_type} %>
<% end -%>

<% other_formats_links do |f| %>
	<%= f.link_to 'Diff', :url => params, :caption => 'Unified diff' %>
<% end %>

<% html_title(with_leading_slash(@path), 'Diff') -%>

<% content_for :header_tags do %>
<%= stylesheet_link_tag "scm" %>
<% end %>


Restore old trailing whitespace so no need for any change to translation files.

  <% if (incoming_message.nil? || !incoming_message.valid_to_reply_to?)
        # TRANSLATORS: This phrase completes the following sentences:
        # Request an internal review from...
        # Send a public follow up message to...
        # Send a public reply to...
        # Don't want to address your message to... ?
        name_for_followup = _("the main FOI contact at {{public_body}}", :public_body => h(OutgoingMailer.name_for_followup(@info_request, nil)))
     else
        name_for_followup = h(OutgoingMailer.name_for_followup(@info_request, incoming_message))
     end %>
    <% if @internal_review %>

<%= _('Request an internal review from {{person_or_body}}', :person_or_body => name_for_followup) %>

    <% elsif incoming_message.nil? || !incoming_message.valid_to_reply_to? %>

<%= _('Send a public follow up message to {{person_or_body}}', :person_or_body => name_for_followup) %>

    <% else %>

<%= _('Send a public reply to {{person_or_body}}', :person_or_body => name_for_followup) %>

    <% end %>
<% if @info_request.who_can_followup_to(incoming_message).count > 0 %>

  <%= _("Don't want to address your message to {{person_or_body}}?  You can also write to:", :person_or_body => name_for_followup) %>

<% @info_request.who_can_followup_to(incoming_message).each do |name, email, id|  %>
   <% if id.nil? && !incoming_message.nil? && incoming_message.valid_to_reply_to? %>

<%= link_to(_("the main FOI contact address for {{public_body}}", :public_body => name), show_response_no_followup_url(:id => @info_request.id, :incoming_message_id => nil)) %>

   <% else %>
     <% if !id.nil? %>
      <% if @info_request.public_body.request_email == email %>
       <% if !incoming_message.nil? %>

<%= link_to(_("the main FOI contact address for {{public_body}}", :public_body => name), show_response_no_followup_url(:id => @info_request.id, :incoming_message_id => nil)) %>

       <% end %>
      <% else %>

<%= link_to name, show_response_url(:id => @info_request.id, :incoming_message_id => id)%>

      <% end %>
     <% else %>

<%= link_to(_("the main FOI contact address for {{public_body}}", :public_body => name), show_response_no_followup_url(:id => @info_request.id, :incoming_message_id => nil)) %>

     <% end %>
   <% end %>

<% end %>

<% end %>
    <% if @info_request.allow_new_responses_from == 'nobody' %>

<%= _('Follow ups and new responses to this request have been stopped to prevent spam. Please contact us if you are {{user_link}} and need to send a follow up.',:user_link=>user_link(@info_request.user), :url=>help_contact_path) %>

    <% else %>
        <% if @internal_review %>

            <%= raw(_('If you are dissatisfied by the response you got from
            the public authority, you have the right to
            complain (details).') % "http://foiwiki.com/foiwiki/index.php/Internal_reviews") %>

        <% end %>

    <%= _('Please only write messages directly relating to your request {{request_link}}. If you would like to ask for information that was not in your original request, then file a new request.', :request_link=>request_link(@info_request), :new_request_link => new_request_to_body_url(:url_name => @info_request.public_body.url_name)) %>

        <% status = @info_request.calculate_status %>
        <% if status == 'waiting_response_overdue' %>

<%= _('The response to your request has been delayed.  You can say that,
            by law, the authority should normally have responded
            promptly and') %>
            <% if @info_request.public_body.is_school? %>
            <%= _('in term time') %>
            <% end %>
            <%= _('by {{date}}',:date=>simple_date(@info_request.date_response_required_by)) %>
            (<%= raw(_('details') % ["#{help_requesting_path}#quickly_response"]) %>).

        <% elsif status == 'waiting_response_very_overdue' %>

            <%= _('The response to your request is long overdue.   You can say that, by
            law, under all circumstances, the authority should have responded
            by now') %> (<%= raw(_('details') % ["#{help_requesting_path}#quickly_response"]) %>).

        <% end %>

        <% form_for(:outgoing_message, @outgoing_message, :html => { :id => 'followup_form' }, :url => incoming_message.nil? ? show_response_no_followup_url(:id => @info_request.id) : show_response_url(:id => @info_request.id, :incoming_message_id => incoming_message.id)) do |o| %>

                <%= o.text_area :body, :rows => 15, :cols => 55 %>

            <% if @internal_review %>
                <%= hidden_field_tag "outgoing_message[what_doing]", "internal_review" %>
            <% else %>

<%= _('What are you doing?') %>

                <% if !@outgoing_message.errors[:what_doing_dummy].nil? %>

                <% else %>

                <% end %>

                        <%= radio_button "outgoing_message", "what_doing", "internal_review", :id => "internal_review" %>
                        <%= _('I am requesting an internal review') %>
            <%= raw(_('what\'s that?') % ["/help/unhappy"]) %>

                        <%= radio_button "outgoing_message", "what_doing", "normal_sort", :id => "sort_normal" %>
                        <%= _('Anything else, such as clarifying, prompting, thanking') %>

            <% end %>

            <% if @internal_review %>

<%= _('Edit and add more details to the message above,
                explaining why you are dissatisfied with their response.') %>

            <% end %>

                <%= hidden_field_tag 'submitted_followup', 1 %>
                <%= hidden_field_tag(:preview, 1 ) %>
                <% if @internal_review_pass_on %>
                    <%= hidden_field_tag(:internal_review, 1 ) %>
                <% end %>
                <%= submit_tag _("Preview your message") %>

        <% end %>

            <% if not @is_owning_user %>
            (You will be asked to sign in as <%= user_link(@info_request.user) %>)
            <% end %>

    <% end %>


ActionItem391: removing standard footer

ActionItem391: removing standard footer

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

  <%= _('A Ynternet.org project') %>

  Communication libre pour une société libre

  <%= _('Sponsored by Loterie Romande') %>

  lottery games in Switzerland

<%= language_chooser %>

<%= footer %>


increased font size on download

increased font size on download

<% @title = 'LivePipe™ : Download & Contribute' %>
<%= header 'Download & Contribute' %>
<% paragraph do %>You can clone the latest version of LivePipe UI from GitHub with the following command:<% end %>
<% css do %>git clone git://github.com/saucytiger/livepipe-ui.git<% end %>

Download Latest Tarball

GitHub Repository

Documentation Repository

<% paragraph 'Submitting Tickets & Patches' do %>LivePipe UI uses Lighthouse as its issue tracker. You have to register first to open a new ticket. Please keep the title concise, and use appropriate text formatting for the body of the ticket. Please submit patches as attachments, or check your changes into your clone on GitHub and create a push request. The ticket system is for bug reports and feature requests only.<% end %>

<% paragraph 'Discussion Groups' do %><% end %>

LivePipe UI Core - Patches, releases and development of LivePipe UI. Do not post support questions.

LivePipe UI Users - Support, general questions, announcements and general discussion.

<% @title = 'LivePipe™ : Download & Contribute' %>
<%= header 'Download & Contribute' %>
<% paragraph do %>You can clone the latest version of LivePipe UI from GitHub with the following command:<% end %>
<% css do %>git clone git://github.com/saucytiger/livepipe-ui.git<% end %>

GitHub Repository

Documentation Repository

Download Latest Tarball

<% paragraph 'Submitting Tickets & Patches' do %>LivePipe UI uses Lighthouse as its issue tracker. You have to register first to open a new ticket. Please keep the title concise, and use appropriate text formatting for the body of the ticket. Please submit patches as attachments, or check your changes into your clone on GitHub and create a push request. The ticket system is for bug reports and feature requests only.<% end %>

<% paragraph 'Discussion Groups' do %><% end %>

LivePipe UI Core - Patches, releases and development of LivePipe UI. Do not post support questions.

LivePipe UI Users - Support, general questions, announcements and general discussion.


ActionItem1165: check for user before using it

<% if @wizard && user %>

<%= _('Hello %s, now you can choose yours groups') % user.identifier %>

<% else %>
<%= search_page_title( __('Communities'), { :query => @query,
                                      :category => @category ? @category.name : nil,
                                      :total_results => @total_results,
                                      :region => @region ? @region.name : nil,
                                      :distance => @radius } ) %>
<% end %>

<%= search_page_link_to_all( { :asset => params[:asset],
                               :category => @category }) %>
<%= render :partial => 'search_form', :locals => { :form_title => @query.blank? ? _('Search') : _("Refine your search"), :simple_search => true } %>

<% if @wizard %>

<%= __('Choose the communities you want to join and/or create your own.') %>

<% end %>

  <%# FIXME ARMENGUE %>
  <%= display_results(false) %>

  <%= pagination_links @results.values.first %>

<% if logged_in? %>
  <% button_bar do %>
    <%# FIXME shouldn't the user create the community in the current environment instead of going to its home environment? %>
    <%= button(:add, __('New community'), user.url.merge(:controller => 'memberships', :action => 'new_community', :wizard => @wizard)) %>
  <% end %>
<% end %>

<% if @wizard %>
  <%= render :partial => 'account/wizard_steps' %>
<% end %>

<% if @wizard %>

<%= _('Hello %s, now you can choose yours groups') % user.identifier %>

<% else %>
<%= search_page_title( __('Communities'), { :query => @query,
                                      :category => @category ? @category.name : nil,
                                      :total_results => @total_results,
                                      :region => @region ? @region.name : nil,
                                      :distance => @radius } ) %>
<% end %>

<%= search_page_link_to_all( { :asset => params[:asset],
                               :category => @category }) %>
<%= render :partial => 'search_form', :locals => { :form_title => @query.blank? ? _('Search') : _("Refine your search"), :simple_search => true } %>

<% if @wizard %>

<%= __('Choose the communities you want to join and/or create your own.') %>

<% end %>

  <%# FIXME ARMENGUE %>
  <%= display_results(false) %>

  <%= pagination_links @results.values.first %>

<% if logged_in? %>
  <% button_bar do %>
    <%# FIXME shouldn't the user create the community in the current environment instead of going to its home environment? %>
    <%= button(:add, __('New community'), user.url.merge(:controller => 'memberships', :action => 'new_community', :wizard => @wizard)) %>
  <% end %>
<% end %>

<% if @wizard %>
  <%= render :partial => 'account/wizard_steps' %>
<% end %>


added bookmarklet

added bookmarklet

  <title>The Best of ... on Hacker News</title>
  <meta name="description" content="The best comments on Hacker News, charts, PDF export.">
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

permalink

bookmarklet

button

info

            <form action="" method="POST" id="target">
              The best
              <select name="limit" id="limit">
                <option value="10">10</option>
                <option value="25">25</option>
                <option value="50">50</option>
                <option value="75">75</option>
                <option value="100" selected>100</option>
              </select>
              comments by <input type="text" id="username" name="username">
              <input class="not-field" name="show-html" type="submit" onclick="hn.generateChart(); return false;" value="Show" />
              <input class="not-field" name="show-pdf" type="button" onclick="$('#target').submit();" value="PDF eBook" />
            </form>

      powered by
      hnsearch and
      pdfcrowd |
      source |
      feedback: redpill27@gmail.com

      <input readonly="readonly" type="text" value="" size="60";/>

        Drag the button below to your browsers toolbar. When you are
        on a user's account page, simply click the button to see
        his/her best comments.

          HN Best of

      <textarea rows="5" cols="80" readonly="readonly">
        ..
      </textarea>

      <% if (c.error !== undefined) { %>
        <%= c.error %>
      <% } %>

        This page requires JavaScript enabled.

Distribution of Comments

        The markers are clickable, the size is proportional to the comment length.

  <title>The Best of ... on Hacker News</title>
  <meta name="description" content="The best comments on Hacker News, charts, PDF export.">
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

            <form action="" method="POST" id="target">
              The best
              <select name="limit" id="limit">
                <option value="10">10</option>
                <option value="25">25</option>
                <option value="50">50</option>
                <option value="75">75</option>
                <option value="100" selected>100</option>
              </select>
              comments by <input type="text" id="username" name="username">
              <input class="not-field" name="show-html" type="submit" onclick="hn.generateChart(); return false;" value="Show" />
              <input class="not-field" name="show-pdf" type="button" onclick="$('#target').submit();" value="PDF eBook" />
            </form>

            permalink |
            button |
            about

      powered by
      hnsearch and
      pdfcrowd |
      source |
      feedback: redpill27@gmail.com

      <input class="perm-visible" readonly="readonly" type="text" value="" size="60";/>

      <input class="perm-visible" readonly="readonly" type="text" value="" size="60";/>

      <textarea rows="5" cols="80" readonly="readonly">
        ..
      </textarea>

      <% if (c.error !== undefined) { %>
        <%= c.error %>
      <% } %>

        This page requires JavaScript enabled.

Distribution of Comments

        The markers are clickable, the size is proportional to the comment length.


ActionItem841: fixing "my networks" block for communities

<%= link_to(n_( 'One article published', '%s articles published', owner.articles.count) %
  content_tag('b', owner.articles.count), owner.public_profile_url.merge(:action => 'sitemap') ) %>

  <% members = owner.members.size %>

<%= link_to(n_( 'One member', '%s members', members) %
  content_tag('b', members), owner.public_profile_url.merge(:action => 'members') ) %>

<%= link_to(n_('One tag', '%s tags', owner.tags.size) %
  content_tag('b', owner.tags.size), owner.public_profile_url.merge(:action => 'tags')) %>

<%= link_to(n_( 'One article published', '%s articles published', owner.articles.count) %
  content_tag('b', owner.articles.count), owner.public_profile_url.merge(:action => 'sitemap') ) %>

<%= link_to(n_( 'One member', '%s members', owner.members.count) %
  content_tag('b', owner.members.count), owner.public_profile_url.merge(:action => 'members') ) %>

<%= link_to(n_('One tag', '%s tags', owner.tags.size) %
  content_tag('b', owner.tags.size), owner.public_profile_url.merge(:action => 'tags')) %>


arreglado para que se active bien la cuenta en el sir

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

<%= @name %>,

Thank you for registering in SIR. To confirm your email address, please visit the following url:

http://sir.dit.upm.es/activate/<%= @hash %>

<%= @name %>,

Thank you for registering in SIR. To confirm your email address, please visit the following url:

http://sir.dit.upm.es:80/activate/<%= @hash %>


Include IE7.js if IE5/6

Include IE7.js if IE5/6

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

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

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

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

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

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

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

<% if session[:project] && session[:project].customer.css && session[:project].customer.css.length > 0 %>

<% elsif !@internal.nil? && !@internal.css.nil? && @internal.css.length > 0 %>

<% end %>

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

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

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

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

                  <% else %>

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

                  <% end %>
                <% end %>

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

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

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

Add New Widget

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

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

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

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

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

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

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

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

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

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

		    <% end %>

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

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

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

                  <% else %>

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

                  <% end %>
                <% end %>

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

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

                <% else %>

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

                <% end %>

                <% if current_user.option_tracktime.to_i == 1%>
                  <% if controller.controller_name == "reports"  %>

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

                  <% else %>

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

                  <% end %>
                <% end %>

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

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

                <% else %>

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

                <% end %>

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

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

                <% else %>

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

                <% end %>

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

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

                <% else %>

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

                <% end %>

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

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

                <% else %>

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

                <% end %>

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

<%= link_to "#{_('New Task')}", {:controller => 'tasks', :action => 'new'}, :class => "active" %>
                <% else %>

<%= link_to "#{_('New Task')}", :controller => 'tasks', :action => 'new' %>
                <% end %>

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

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

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

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

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

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

                <% else %>

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

                <% end %>

                <% if current_user.admin > 0 %>

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

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

                  <% else %>

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

                <% end %>
                <% end %>

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

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

                <% else %>

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

                <% end %>

                <% end %>

<%=_ 'Search' %> <%= text_field_tag 'query', "", {:size => 10, :style => "font-size:9px;"}%>

                <% end %>

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

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

          <% end %>
          <% end %>

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

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

          <%= @content_for_layout %>

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

<%=_ 'Views' %>

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

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

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

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

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

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

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

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

                   <% end %>

<%=_ 'Notes'%>

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

          <% for page in current_pages %>

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

          <% end %>

    Clocking IT v0.99.2 - <%=_ 'Feedback? Suggestions? Ideas? Bugs?'%> <%=_ 'Let me know'%> <%= link_to "[Admin]", :controller => "admin", :action => "index" if current_user.admin == 10 %>

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

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


Undo change I accidently made.

Undo change I accidently made.

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

<% @page_heading = 'Articles' %>

Creating article

  <%= start_form_tag({ :action => "new" }, :id => "article_form", :enctype => "multipart/form-data") %>

    <%= render_partial "form" %>

    <%= save("Save this article") %> or <%= cancel %>

  <%= end_form_tag %>

  <%= observe_form "article_form",
        :frequency => 2,
        :update => "preview",
        :complete => "Element.show('preview')",
        :url => { :action => "preview" } %>

<% @page_heading = 'Articles' %>

Creating article

  <%= start_form_tag({ :action => "new" }, :id => "contact_form", :enctype => "multipart/form-data") %>

    <%= render_partial "form" %>

    <%= save("Save this article") %> or <%= cancel %>

  <%= end_form_tag %>

  <%= observe_form "article_form",
        :frequency => 2,
        :update => "preview",
        :complete => "Element.show('preview')",
        :url => { :action => "preview" } %>


Fix quotes.

Fix quotes.

<%= l(:label_revision) %> <%= format_revision(@rev_to) + ':' if @rev_to %><%= format_revision(@rev) %> <%=h @path %>

<%= link_to 'Return to diff overview', url: => params.merge(:action => 'diff') %>

<% form_tag({:path => to_path_param(@path)}, :method => 'get') do %>
  <%= hidden_field_tag('rev', params[:rev]) if params[:rev] %>
  <%= hidden_field_tag('rev_to', params[:rev_to]) if params[:rev_to] %>

<%= l(:label_view_diff) %>
  <%= select_tag 'type', options_for_select([[l(:label_diff_inline), "inline"], [l(:label_diff_side_by_side), "sbs"]], @diff_type), :onchange => "if (this.value != '') {this.form.submit()}" %>

<% end %>

<% cache(@cache_key) do -%>
<%= render :partial => 'common/diff', :locals => {:diff => @diff, :diff_type => @diff_type} %>
<% end -%>

<% other_formats_links do |f| %>
	<%= f.link_to 'Diff', :url => params, :caption => 'Unified diff' %>
<% end %>

<% html_title(with_leading_slash(@path), 'Diff') -%>

<% content_for :header_tags do %>
<%= stylesheet_link_tag "scm" %>
<% end %>

<%= l(:label_revision) %> <%= format_revision(@rev_to) + ':' if @rev_to %><%= format_revision(@rev) %> <%=h @path %>

<%= link_to "Return to diff overview", url: => params.merge(:action => "diff") %>

<% form_tag({:path => to_path_param(@path)}, :method => 'get') do %>
  <%= hidden_field_tag('rev', params[:rev]) if params[:rev] %>
  <%= hidden_field_tag('rev_to', params[:rev_to]) if params[:rev_to] %>

<%= l(:label_view_diff) %>
  <%= select_tag 'type', options_for_select([[l(:label_diff_inline), "inline"], [l(:label_diff_side_by_side), "sbs"]], @diff_type), :onchange => "if (this.value != '') {this.form.submit()}" %>

<% end %>

<% cache(@cache_key) do -%>
<%= render :partial => 'common/diff', :locals => {:diff => @diff, :diff_type => @diff_type} %>
<% end -%>

<% other_formats_links do |f| %>
	<%= f.link_to 'Diff', :url => params, :caption => 'Unified diff' %>
<% end %>

<% html_title(with_leading_slash(@path), 'Diff') -%>

<% content_for :header_tags do %>
<%= stylesheet_link_tag "scm" %>
<% end %>


ActionItem1181: allowing 5 years old people to register

<% @person ||= @profile %>

<%= required labelled_form_field(_('Full name'), text_field(:profile_data, :name)) %>

<% optional_field(@person, 'nickname') do %>
  <%= f.text_field(:nickname, :maxlength => 16, :size => 30) %>

    <%= _('A short name by which you like to be known. Will be used in friends listings, community member listings etc.') %>

<% end %>

<%= optional_field(@person, 'preferred_domain', select_preferred_domain(:profile_data)) %>
<%= optional_field(@person, 'contact_information', f.text_field(:contact_information)) %>
<%= optional_field(@person, 'contact_phone', labelled_form_field(_('Home phone'), text_field(:profile_data, :contact_phone))) %>
<%= optional_field(@person, 'cell_phone', f.text_field(:cell_phone)) %>
<%= optional_field(@person, 'comercial_phone', f.text_field(:comercial_phone)) %>
<%= optional_field(@person, 'sex', f.radio_group(:profile_data, :sex, [ ['male',_('Male')], ['female',_('Female')] ])) %>
<%= optional_field(@person, 'birth_date', labelled_form_field(_('Birth date'), '
' + pick_date(:profile_data, :birth_date, {:start_year => (Date.today.year - 100), :end_year => (Date.today.year - 5)}) + '
')) %>
<%= optional_field(@person, 'nationality', f.text_field(:nationality)) %>
<%= optional_field(@person, 'country', select_country(_('Country'), 'profile_data', 'country', {:class => 'type-select'})) %>
<%= optional_field(@person, 'state', f.text_field(:state)) %>
<%= optional_field(@person, 'city', f.text_field(:city)) %>
<%= optional_field(@person, 'zip_code', labelled_form_field(_('ZIP code'), text_field(:profile_data, :zip_code))) %>
<%= optional_field(@person, 'address', labelled_form_field(_('Address (street and number)'), text_field(:profile_data, :address))) %>

<% optional_field(@person, 'schooling') do %>

    <%= _('Schooling') %>

      <%= select_schooling('profile_data', 'schooling', {:class => 'select-schooling'}) %>
      <%= select_schooling_status('profile_data', 'schooling_status', {:class => 'select-schooling'}) %>

<% end %>

<%= optional_field(@person, 'formation', select_area(_('Formation'), 'profile_data', 'formation', {:class => 'type-select-full-line'})) %>

<span id='profile_data_custom_formation_span' <%= "style='display:none'" if ! ['Others', nil].include?(@person.formation) %> >
  <%= optional_field(@person, 'custom_formation', f.text_field(:custom_formation)) %>

<%= observe_field 'profile_data_formation', :function =>'toggle_text_field("profile_data_formation", "profile_data_custom_formation_span")' %>

<%= optional_field(@person, 'area_of_study', select_area(_('Area of study'), 'profile_data', 'area_of_study', {:class => 'type-select-full-line'})) %>

<span id='profile_data_custom_area_of_study_span' <%= "style='display:none'" if ! ['Others', nil].include?(@person.area_of_study) %> >
  <%= optional_field(@person, 'custom_area_of_study', f.text_field(:custom_area_of_study)) %>

<%= observe_field 'profile_data_area_of_study', :function =>'toggle_text_field("profile_data_area_of_study", "profile_data_custom_area_of_study_span")' %>

<%= optional_field(@person, 'professional_activity', f.text_field(:professional_activity)) %>
<%= optional_field(@person, 'organization', f.text_field(:organization)) %>
<%= optional_field(@person, 'organization_website', f.text_field(:organization_website)) %>

<% @person ||= @profile %>

<%= required labelled_form_field(_('Full name'), text_field(:profile_data, :name)) %>

<% optional_field(@person, 'nickname') do %>
  <%= f.text_field(:nickname, :maxlength => 16, :size => 30) %>

    <%= _('A short name by which you like to be known. Will be used in friends listings, community member listings etc.') %>

<% end %>

<%= optional_field(@person, 'preferred_domain', select_preferred_domain(:profile_data)) %>
<%= optional_field(@person, 'contact_information', f.text_field(:contact_information)) %>
<%= optional_field(@person, 'contact_phone', labelled_form_field(_('Home phone'), text_field(:profile_data, :contact_phone))) %>
<%= optional_field(@person, 'cell_phone', f.text_field(:cell_phone)) %>
<%= optional_field(@person, 'comercial_phone', f.text_field(:comercial_phone)) %>
<%= optional_field(@person, 'sex', f.radio_group(:profile_data, :sex, [ ['male',_('Male')], ['female',_('Female')] ])) %>
<%= optional_field(@person, 'birth_date', labelled_form_field(_('Birth date'), '
' + pick_date(:profile_data, :birth_date, {:start_year => (Date.today.year - 100), :end_year => (Date.today.year - 10)}) + '
')) %>
<%= optional_field(@person, 'nationality', f.text_field(:nationality)) %>
<%= optional_field(@person, 'country', select_country(_('Country'), 'profile_data', 'country', {:class => 'type-select'})) %>
<%= optional_field(@person, 'state', f.text_field(:state)) %>
<%= optional_field(@person, 'city', f.text_field(:city)) %>
<%= optional_field(@person, 'zip_code', labelled_form_field(_('ZIP code'), text_field(:profile_data, :zip_code))) %>
<%= optional_field(@person, 'address', labelled_form_field(_('Address (street and number)'), text_field(:profile_data, :address))) %>

<% optional_field(@person, 'schooling') do %>

    <%= _('Schooling') %>

      <%= select_schooling('profile_data', 'schooling', {:class => 'select-schooling'}) %>
      <%= select_schooling_status('profile_data', 'schooling_status', {:class => 'select-schooling'}) %>

<% end %>

<%= optional_field(@person, 'formation', select_area(_('Formation'), 'profile_data', 'formation', {:class => 'type-select-full-line'})) %>

<span id='profile_data_custom_formation_span' <%= "style='display:none'" if ! ['Others', nil].include?(@person.formation) %> >
  <%= optional_field(@person, 'custom_formation', f.text_field(:custom_formation)) %>

<%= observe_field 'profile_data_formation', :function =>'toggle_text_field("profile_data_formation", "profile_data_custom_formation_span")' %>

<%= optional_field(@person, 'area_of_study', select_area(_('Area of study'), 'profile_data', 'area_of_study', {:class => 'type-select-full-line'})) %>

<span id='profile_data_custom_area_of_study_span' <%= "style='display:none'" if ! ['Others', nil].include?(@person.area_of_study) %> >
  <%= optional_field(@person, 'custom_area_of_study', f.text_field(:custom_area_of_study)) %>

<%= observe_field 'profile_data_area_of_study', :function =>'toggle_text_field("profile_data_area_of_study", "profile_data_custom_area_of_study_span")' %>

<%= optional_field(@person, 'professional_activity', f.text_field(:professional_activity)) %>
<%= optional_field(@person, 'organization', f.text_field(:organization)) %>
<%= optional_field(@person, 'organization_website', f.text_field(:organization_website)) %>


dynamically generate homepage link in header

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

        <% if @profile_photo_javascript %>

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

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

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

        <%= stylesheet_link_tag 'main', :title => "Main", :rel => "stylesheet"  %>

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

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

<% # code for popup advert for a campaign etc.
=begin

=end
%>

<% # code for popup advert for a campaign etc.
=begin

Close

    [ message goes here ]

Close

=end
%>

            <%= link_to site_name, frontpage_url %>

            <%= _('Make and explore Freedom of Information requests') %>

		a site by mysociety.org

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

               <%= text_field_tag 'query', params[:query], { :size => 40, :id => "navigation_search_query" } %>
               <%= submit_tag _("Search") %>

        <% end %>

<%= link_to _("Make request"), frontpage_url %>

<%= link_to _("View requests"), request_list_successful_url %>

<%= link_to _("View authorities"), list_public_bodies_default %>

			<% if @user %>

<%=link_to _("My requests"), user_url(@user) %>

			<% end %>

<%= link_to _("Read blog"), blog_url %>

<%= link_to _("Help"), help_about_url %>

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

			<% if @user %>
				<%= _('Hello, {{username}}!', :username => h(@user.name))%>
				(<%= link_to _("Sign out"), signout_url(:r => request.request_uri) %>)
			<% else %>
			        <%= _('Hello!') %>
				(<%= link_to _("Sign in or sign up"), signin_url(:r => request.request_uri) %>)
			<% end %>

		<% end %>

            <% if flash[:notice] %>

<%= flash[:notice] %>

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

<%= flash[:error] %>

            <% end %>

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

        <%= link_to _("Contact {{site_name}}", :site_name => site_name), help_contact_url %>
	<%= render :partial => 'general/credits' %>

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

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

        <% if @profile_photo_javascript %>

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

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

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

        <%= stylesheet_link_tag 'main', :title => "Main", :rel => "stylesheet"  %>

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

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

<% # code for popup advert for a campaign etc.
=begin

=end
%>

<% # code for popup advert for a campaign etc.
=begin

Close

    [ message goes here ]

Close

=end
%>

            <%= site_name %>

            <%= _('Make and explore Freedom of Information requests') %>

		a site by mysociety.org

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

               <%= text_field_tag 'query', params[:query], { :size => 40, :id => "navigation_search_query" } %>
               <%= submit_tag _("Search") %>

        <% end %>

<%= link_to _("Make request"), frontpage_url %>

<%= link_to _("View requests"), request_list_successful_url %>

<%= link_to _("View authorities"), list_public_bodies_default %>

			<% if @user %>

<%=link_to _("My requests"), user_url(@user) %>

			<% end %>

<%= link_to _("Read blog"), blog_url %>

<%= link_to _("Help"), help_about_url %>

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

			<% if @user %>
				<%= _('Hello, {{username}}!', :username => h(@user.name))%>
				(<%= link_to _("Sign out"), signout_url(:r => request.request_uri) %>)
			<% else %>
			        <%= _('Hello!') %>
				(<%= link_to _("Sign in or sign up"), signin_url(:r => request.request_uri) %>)
			<% end %>

		<% end %>

            <% if flash[:notice] %>

<%= flash[:notice] %>

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

<%= flash[:error] %>

            <% end %>

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

        <%= link_to _("Contact {{site_name}}", :site_name => site_name), help_contact_url %>
	<%= render :partial => 'general/credits' %>

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


ActionItem630: added a create community button

in the community search page

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

<%= search_page_title( __('Communities'), { :query => @query,
                                      :category => @category ? @category.name : nil,
                                      :total_results => @total_results,
                                      :region => @region ? @region.name : nil,
                                      :distance => @radius } ) %>

<%= render :partial => 'search_form', :locals => { :form_title => @query.blank? ? _('Search') : _("Refine your search"), :simple_search => true } %>

<%# FIXME ARMENGUE %>
<%= display_results(false) %>

<%= pagination_links @results.values.first %>

<% if logged_in? %>
  <% button_bar do %>
    <%= button(:add, _('New community'), :controller => 'memberships', :action => 'new_community', :profile => current_user.person.identifier) %>
  <% end %>
<% end %>

<br style="clear:both" />

<%= search_page_title( __('Communities'), { :query => @query,
                                      :category => @category ? @category.name : nil,
                                      :total_results => @total_results,
                                      :region => @region ? @region.name : nil,
                                      :distance => @radius } ) %>

<%= render :partial => 'search_form', :locals => { :form_title => @query.blank? ? _('Search') : _("Refine your search"), :simple_search => true } %>

<%# FIXME ARMENGUE %>
<%= display_results(false) %>

<%= pagination_links @results.values.first %>

<br style="clear:both" />


Restructure block for requesting plugin's contents

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

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

    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <meta name="description" content="<%= @environment.name %>" />
    <link rel="shortcut icon" href="<%= image_path(theme_favicon) %>" type="image/x-icon" />
    <%= noosfero_javascript %>
    <%= stylesheet_link_tag noosfero_stylesheets, :cache => 'cache' %>
    <%= stylesheet_link_tag template_stylesheet_path %>
    <%= stylesheet_link_tag icon_theme_stylesheet_path %>
    <%= stylesheet_link_tag jquery_ui_theme_stylesheet_path %>
    <%
      plugins_stylesheets = @plugins.select(&:stylesheet?).map { |plugin| plugin.class.public_path('style.css') }
    %>
    <%= stylesheet_link_tag(plugins_stylesheets, :cache => 'cache/plugins-' + Digest::MD5.hexdigest(plugins_stylesheets.to_s)) unless plugins_stylesheets.empty? %>
    <%= stylesheet_link_tag theme_stylesheet_path %>

    <%# Add custom tags/styles/etc via content_for %>
    <%= yield :head %>
    <%= javascript_tag('render_all_jquery_ui_widgets()') %>
    <%
      plugins_javascripts = @plugins.map { |plugin| plugin.js_files.map { |js| plugin.class.public_path(js) } }.flatten
    %>
    <%= javascript_include_tag(plugins_javascripts, :cache => 'cache/plugins-' + Digest::MD5.hexdigest(plugins_javascripts.to_s)) unless plugins_javascripts.empty? %>
    <%=
      @plugins.dispatch(:head_ending).collect do |content|
        content.respond_to?(:call) ? content.call : content
      end.join("\n")
    %>

  <body class="<%=
    # Identify the current controller and action for the CSS:
    " controller-"+ @controller.controller_name() +
    " action-"+ @controller.controller_name() +"-"+ @controller.action_name() +
    " template-"+ ( profile.nil? ? "default" : profile.layout_template ) +
    (!profile.nil? && profile.is_on_homepage?(request.path,@page) ? " profile-homepage" : "")
    %>" >

    <%= _("Go to the content") %>
    <%=
      @plugins.dispatch(:body_beginning).collect do |content|
        content.respond_to?(:call) ? content.call : content
      end.join("\n")
    %>

        <%= theme_header %>

            <%= usermenu_logged_in %>

              <%= _("%s") % thickbox_inline_popup_link('' + _('Login') + '', login_url, 'inlineLoginBox', :id => 'link_login') %>
              <%= @plugins.dispatch(:alternative_authentication_link).collect { |content| instance_eval(&content) }.join("") %>

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

              <% unless @plugins.dispatch(:allow_user_registration).include?(false) %>
              <%= _("or %s") % link_to('' + _('Sign up') + '', :controller => 'account', :action => 'signup')%>
              <% end %>

          <form action="/search" class="search_form" method="get" class="clean">
            <input name="query" size="15" title="<%=_('Search...')%>" onfocus="this.form.className='focused';" onblur="this.form.className=''" />

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

            <%= javascript_tag 'jQuery("#user form input").hint();' %>
          </form>

          <%= theme_site_title %>

            <%= theme_extra_navigation %>

        <div id="content" class="<%= controller.send(:content_classes) rescue '' %>">
          <%= controller.send(:before_contents) rescue '' %>

            <%= insert_boxes(yield) %>

    <%= render_environment_features(:logged_in) %>

      <%= theme_footer %>

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

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

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

    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <meta name="description" content="<%= @environment.name %>" />
    <link rel="shortcut icon" href="<%= image_path(theme_favicon) %>" type="image/x-icon" />
    <%= noosfero_javascript %>
    <%= stylesheet_link_tag noosfero_stylesheets, :cache => 'cache' %>
    <%= stylesheet_link_tag template_stylesheet_path %>
    <%= stylesheet_link_tag icon_theme_stylesheet_path %>
    <%= stylesheet_link_tag jquery_ui_theme_stylesheet_path %>
    <%
      plugins_stylesheets = @plugins.select(&:stylesheet?).map { |plugin| plugin.class.public_path('style.css') }
    %>
    <%= stylesheet_link_tag(plugins_stylesheets, :cache => 'cache/plugins-' + Digest::MD5.hexdigest(plugins_stylesheets.to_s)) unless plugins_stylesheets.empty? %>
    <%= stylesheet_link_tag theme_stylesheet_path %>

    <%# Add custom tags/styles/etc via content_for %>
    <%= yield :head %>
    <%= javascript_tag('render_all_jquery_ui_widgets()') %>
    <%
      plugins_javascripts = @plugins.map { |plugin| plugin.js_files.map { |js| plugin.class.public_path(js) } }.flatten
    %>
    <%= javascript_include_tag(plugins_javascripts, :cache => 'cache/plugins-' + Digest::MD5.hexdigest(plugins_javascripts.to_s)) unless plugins_javascripts.empty? %>
    <%=
      @plugins.dispatch(:head_ending).collect do |content|
        content.respond_to?(:call) ? content.call : content
      end.join("\n")
    %>

  <body class="<%=
    # Identify the current controller and action for the CSS:
    " controller-"+ @controller.controller_name() +
    " action-"+ @controller.controller_name() +"-"+ @controller.action_name() +
    " template-"+ ( profile.nil? ? "default" : profile.layout_template ) +
    (!profile.nil? && profile.is_on_homepage?(request.path,@page) ? " profile-homepage" : "")
    %>" >

    <%= _("Go to the content") %>
    <%=
      @plugins.dispatch(:body_beginning).collect do |content|
        content.respond_to?(:call) ? content.call : content
      end.join("\n")
    %>

        <%= theme_header %>

            <%= usermenu_logged_in %>

              <%= _("%s") % thickbox_inline_popup_link('' + _('Login') + '', login_url, 'inlineLoginBox', :id => 'link_login') %>
              <%= @plugins.dispatch(:alternative_authentication_link).collect { |content| instance_eval(&content) }.join("") %>

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

              <% unless @plugins.dispatch(:allow_user_registration).include?(false) %>
              <%= _("or %s") % link_to('' + _('Sign up') + '', :controller => 'account', :action => 'signup')%>
              <% end %>

          <form action="/search" class="search_form" method="get" class="clean">
            <input name="query" size="15" title="<%=_('Search...')%>" onfocus="this.form.className='focused';" onblur="this.form.className=''" />

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

            <%= javascript_tag 'jQuery("#user form input").hint();' %>
          </form>

          <%= theme_site_title %>

            <%= theme_extra_navigation %>

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

            <%= insert_boxes(yield) %>

    <%= render_environment_features(:logged_in) %>

      <%= theme_footer %>

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


better dont show spinner unless its genre is book

<%
   search_providers = get_service_type('search_inside')
%>

  <%
      # We don't show this block until ALL possible search inside tools
      # have been found. Too hard to deal with AJAX update of a DIV
      # that has a text input box in it otherwise.
      if ( search_providers.length > 0 &&
         ! service_type_in_progress?('search_inside') ) %>

Search inside this <%= @user_request.referent.type_of_thing %>

    <% # We don't show the search box unless we have a search provider AND
        # we're completely done loading search providers. Too hard
        # to deal with AJAX updating of search providers without
        # interrupting user. %>

    <form target="_blank" action="<%= url_for(:controller=>'link_router', :action=>'index') %>">

      via
    <% if search_providers.length > 1 %>
      <select name="id">
      <% search_providers.each do |st| %>
        <option value="<%= st.id %>"><%= st.view_data[:display_text] %></option>
      <% end %>
      </select>
    <% else  %>
      <input type="hidden" name="id" value="<%= search_providers[0].id %>">
      <%= search_providers[0].view_data[:display_text] %>:
    <% end %>

    <input name="query" type="text" /> <input value="search" type="submit">
    </form>

<%end%>

  <%
  if ( @user_request.referent.format == 'book' && service_type_in_progress?('search_inside')) %>

      <% if @force_bg_progress_spinner %>
          <%=
          image_tag('spinner.gif') %>
           Looking for tools to search inside this <%= @user_request.referent.type_of_thing %>.
      <% else %>
        Search inside this <%= @user_request.referent.type_of_thing %> tools may be available. <%= link_to "Find available tools", {:action => "background_status", :"umlaut.request_id" => @user_request.id, :"umlaut.skip_resolve_menu" => params['umlaut.skip_resolve_menu']} %>
      <% end %>

      <% unless @force_bg_progress_spinner == false # Not just nil, but false  %>

    <% end %>

  <% end %>

<%
   search_providers = get_service_type('search_inside')
%>

  <%
      # We don't show this block until ALL possible search inside tools
      # have been found. Too hard to deal with AJAX update of a DIV
      # that has a text input box in it otherwise.
      if ( search_providers.length > 0 &&
         ! service_type_in_progress?('search_inside') ) %>

Search inside this <%= @user_request.referent.type_of_thing %>

    <% # We don't show the search box unless we have a search provider AND
        # we're completely done loading search providers. Too hard
        # to deal with AJAX updating of search providers without
        # interrupting user. %>

    <form target="_blank" action="<%= url_for(:controller=>'link_router', :action=>'index') %>">

      via
    <% if search_providers.length > 1 %>
      <select name="id">
      <% search_providers.each do |st| %>
        <option value="<%= st.id %>"><%= st.view_data[:display_text] %></option>
      <% end %>
      </select>
    <% else  %>
      <input type="hidden" name="id" value="<%= search_providers[0].id %>">
      <%= search_providers[0].view_data[:display_text] %>:
    <% end %>

    <input name="query" type="text" /> <input value="search" type="submit">
    </form>

<%end%>

  <% if ( @user_request.referent.metadata['genre'] == 'book' && service_type_in_progress?('search_inside')) %>

      <% if @force_bg_progress_spinner %>
          <%=
          image_tag('spinner.gif') %>
           Looking for tools to search inside this <%= @user_request.referent.type_of_thing %>.
      <% else %>
        Search inside this <%= @user_request.referent.type_of_thing %> tools may be available. <%= link_to "Find available tools", {:action => "background_status", :"umlaut.request_id" => @user_request.id, :"umlaut.skip_resolve_menu" => params['umlaut.skip_resolve_menu']} %>
      <% end %>

      <% unless @force_bg_progress_spinner == false # Not just nil, but false  %>

    <% end %>

  <% end %>