Added path64-argument which is base64-encoded path. Fixed possible memory leak with unclosed file.

<%
  #Support for the PHP-version... Comes handy when converting PHP to Ruby...
  if !_get["path"]
    trans = {
      "picture" => "path"
    }

    if _get["edgesize"]
      _get["rounded_corners"] = (_get["edgesize"].to_f / 3.0).to_i
    end

    if _get["edgeborder"]
      if _get["edgeborder"].length == 6
        _get["border_color"] = "##{_get["edgeborder"]}"
      else
        _get["border_color"] = _get["edbeborder"]
      end
    end

    if _get["edgeborder"]
      _get["border"] = 1
    end

    trans.each do |key, val|
      _get[val] = _get[key] if _get[key]
    end
  end

  #Base64-encoding of path.
  if _get["path64"]
    require "base64"
    _get["path"] = Base64.decode64(_get["path64"])
  end

	idstr = Digest::MD5.hexdigest("#{_get["path"]}_#{_get["smartsize"].to_i}_#{_get["width"].to_i}_#{_get["height"].to_i}_#{_get["maxwidth"].to_i}_#{_get["maxheight"].to_i}_#{_get["rounded_corners"].to_i}_#{_get["border"].to_i}_#{_get["border_color"]}")

	if !_get["path"] or !File.exists?(_get["path"])
    print "File does not exist: '#{_get["path"]}'.\n"
    exit
  end

	time_orig = File.mtime(_get["path"])

	tmp_use = false
	tmp_write = false
	if Knj::CONFIG["webscripts_image"]
		tmp_use = true
		tmp_path = "#{Knj::CONFIG["webscripts_image"]["tmp_path"]}/#{idstr}"
		tmp_exists = File.exists?(tmp_path)
		tmp_write = true if !tmp_exists

		if !tmp_write and tmp_exists
			time_cache = File.mtime(tmp_path)

			if time_orig > time_cache
				tmp_write = true
			end
		end
	end

	if _get["force"] == "true" or _get["force"] == "1"
    force = true
  else
    force = false
  end

	notchanged = false

	if _httpsession.handler.modified_since and time_cache and _httpsession.handler.modified_since.utc.to_s == time_cache.utc.to_s
    notchanged = true
  elsif _httpsession.handler.modified_since and _httpsession.handler.modified_since.utc.to_s == time_orig.utc.to_s
    notchanged = true
  end

  if notchanged and !force
    _httpsession.resp.status = 304
    exit
  end

	if !tmp_use or tmp_write or force
    blob_cont = nil
    Knj::Process_meta.new("debug_err" => true) do |subproc|
      subproc.static("Object", "require", "rubygems")
      subproc.static("Object", "require", "#{File.dirname(Knj::Os.realpath(__FILE__))}/../../knjrbfw.rb")
      subproc.static("Object", "require", "knj/autoload")
      subproc.static("Dir", "chdir", File.dirname(__FILE__))

      list_proxy = subproc.proxy_from_static("Magick::Image", "read", _get["path"])
      pic = subproc.proxy_from_call(list_proxy, "first")
      #pic = Magick::Image.read(_get["path"]).first

      if !pic
        print "Could not open image from '#{_get["path"]}'."
        exit
      end

      pic._pm_send_noret("format=", "png")

      pic_columns = pic.columns
      pic_rows = pic.rows

      width = pic_columns
      height = pic_rows

      height = _get["height"].to_i if _get["height"]
      width = _get["width"].to_i if _get["width"]

      if _get["smartsize"]
        if pic_columns > pic_rows
          width = _get["smartsize"].to_i
          height = (pic_rows.to_f / (pic_columns.to_f / width.to_f)).to_i
        else
          height = _get["smartsize"].to_i
          width = (pic_columns.to_f / (pic_rows.to_f / height.to_f)).to_i
        end
      end

      if _get["maxwidth"]
        maxwidth = _get["maxwidth"].to_i

        if width > maxwidth
          height = (pic_rows.to_f / (pic_columns.to_f / maxwidth.to_f)).to_i
          width = maxwidth
        end
      end

      if _get["maxheight"]
        maxheight = _get["maxheight"].to_i

        if height > maxheight
          width = (pic_columns.to_f / (pic_rows.to_f / maxheight.to_f)).to_i
          height = maxheight
        end
      end

      if _get["width"] and _get["height"]
        width = _get["width"].to_i
        height = _get["height"].to_i
      end

      if height != pic_rows or width != pic_columns
        pic = subproc.proxy_from_call(pic, "resize_to_fit", width.to_i, height.to_i)
        #pic = pic.resize_to_fit(width.to_i, height.to_i)
      end

      if _get["rounded_corners"]
        args = {:img => pic, :radius => _get["rounded_corners"].to_i}

        if _get["border"] and _get["border_color"]
          args[:border] = _get["border"].to_i
          args[:border_color] = _get["border_color"]
        end

        #Spawn arguments-hash for Knj::Image.rounded_corners in subprocess.
        proxy_hash = subproc.new("{}", args)

        #Call rounded_corners with the proxy-hash.
        subproc.static_noret("Knj::Image", "rounded_corners", proxy_hash)
        #Knj::Image.rounded_corners(args)
      end

      blob_cont = pic.to_blob
    end
	end

	if tmp_write and blob_cont
    File.open(tmp_path, "w") do |fp|
      fp.write(blob_cont)
    end
	end

	if tmp_use and !force
    _kas.header("Last-Modified", "#{time_orig.httpdate} GMT") if time_orig
		_kas.header("Content-Type", "image/png")
		_httpsession.force_content(File.read(tmp_path))
	else
    _kas.header("Last-Modified", "#{time_orig.httpdate} GMT") if time_orig
		_kas.header("Content-Type", "image/png")
		_httpsession.force_content(blob_cont)
	end
%>

<%
  #Support for the PHP-version... Comes handy when converting PHP to Ruby...
  if !_get["path"]
    trans = {
      "picture" => "path"
    }

    if _get["edgesize"]
      _get["rounded_corners"] = (_get["edgesize"].to_f / 3.0).to_i
    end

    if _get["edgeborder"]
      if _get["edgeborder"].length == 6
        _get["border_color"] = "##{_get["edgeborder"]}"
      else
        _get["border_color"] = _get["edbeborder"]
      end
    end

    if _get["edgeborder"]
      _get["border"] = 1
    end

    trans.each do |key, val|
      _get[val] = _get[key] if _get[key]
    end
  end

	idstr = Digest::MD5.hexdigest("#{_get["path"]}_#{_get["smartsize"].to_i}_#{_get["width"].to_i}_#{_get["height"].to_i}_#{_get["maxwidth"].to_i}_#{_get["maxheight"].to_i}_#{_get["rounded_corners"].to_i}_#{_get["border"].to_i}_#{_get["border_color"]}")

	if !_get["path"] or !File.exists?(_get["path"])
    print "File does not exist: '#{_get["path"]}'.\n"
    exit
  end

	time_orig = File.mtime(_get["path"])

	tmp_use = false
	tmp_write = false
	if Knj::CONFIG["webscripts_image"]
		tmp_use = true
		tmp_path = "#{Knj::CONFIG["webscripts_image"]["tmp_path"]}/#{idstr}"
		tmp_exists = File.exists?(tmp_path)
		tmp_write = true if !tmp_exists

		if !tmp_write and tmp_exists
			time_cache = File.mtime(tmp_path)

			if time_orig > time_cache
				tmp_write = true
			end
		end
	end

	if _get["force"] == "true" or _get["force"] == "1"
    force = true
  else
    force = false
  end

	notchanged = false

	if _httpsession.handler.modified_since and time_cache and _httpsession.handler.modified_since.utc.to_s == time_cache.utc.to_s
    notchanged = true
  elsif _httpsession.handler.modified_since and _httpsession.handler.modified_since.utc.to_s == time_orig.utc.to_s
    notchanged = true
  end

  if notchanged and !force
    _httpsession.resp.status = 304
    exit
  end

	if !tmp_use or tmp_write or force
    blob_cont = nil
    Knj::Process_meta.new("debug_err" => true) do |subproc|
      subproc.static("Object", "require", "rubygems")
      subproc.static("Object", "require", "#{File.dirname(Knj::Os.realpath(__FILE__))}/../../knjrbfw.rb")
      subproc.static("Object", "require", "knj/autoload")
      subproc.static("Dir", "chdir", File.dirname(__FILE__))

      list_proxy = subproc.proxy_from_static("Magick::Image", "read", _get["path"])
      pic = subproc.proxy_from_call(list_proxy, "first")
      #pic = Magick::Image.read(_get["path"]).first

      if !pic
        print "Could not open image from '#{_get["path"]}'."
        exit
      end

      pic._pm_send_noret("format=", "png")

      pic_columns = pic.columns
      pic_rows = pic.rows

      width = pic_columns
      height = pic_rows

      height = _get["height"].to_i if _get["height"]
      width = _get["width"].to_i if _get["width"]

      if _get["smartsize"]
        if pic_columns > pic_rows
          width = _get["smartsize"].to_i
          height = (pic_rows.to_f / (pic_columns.to_f / width.to_f)).to_i
        else
          height = _get["smartsize"].to_i
          width = (pic_columns.to_f / (pic_rows.to_f / height.to_f)).to_i
        end
      end

      if _get["maxwidth"]
        maxwidth = _get["maxwidth"].to_i

        if width > maxwidth
          height = (pic_rows.to_f / (pic_columns.to_f / maxwidth.to_f)).to_i
          width = maxwidth
        end
      end

      if _get["maxheight"]
        maxheight = _get["maxheight"].to_i

        if height > maxheight
          width = (pic_columns.to_f / (pic_rows.to_f / maxheight.to_f)).to_i
          height = maxheight
        end
      end

      if _get["width"] and _get["height"]
        width = _get["width"].to_i
        height = _get["height"].to_i
      end

      if height != pic_rows or width != pic_columns
        pic = subproc.proxy_from_call(pic, "resize_to_fit", width.to_i, height.to_i)
        #pic = pic.resize_to_fit(width.to_i, height.to_i)
      end

      if _get["rounded_corners"]
        args = {:img => pic, :radius => _get["rounded_corners"].to_i}

        if _get["border"] and _get["border_color"]
          args[:border] = _get["border"].to_i
          args[:border_color] = _get["border_color"]
        end

        #Spawn arguments-hash for Knj::Image.rounded_corners in subprocess.
        proxy_hash = subproc.new("{}", args)

        #Call rounded_corners with the proxy-hash.
        subproc.static_noret("Knj::Image", "rounded_corners", proxy_hash)
        #Knj::Image.rounded_corners(args)
      end

      blob_cont = pic.to_blob
    end
	end

	if tmp_write and blob_cont
    File.open(tmp_path, "w") do |fp|
      fp.write(blob_cont)
    end
	end

	if tmp_use and !force
    _kas.header("Last-Modified", "#{time_orig.httpdate} GMT") if time_orig
		_kas.header("Content-Type", "image/png")
		_httpsession.force_content(File.new(tmp_path))
	else
    _kas.header("Last-Modified", "#{time_orig.httpdate} GMT") if time_orig
		_kas.header("Content-Type", "image/png")
		_httpsession.force_content(blob_cont)
	end
%>


Make tags links

Make tags links

<% @title = "Public authority - " + h(@public_body.name) %>

<%=@title%>

<%
   columns = PublicBody.content_columns
   columns.delete_if {|c| ['last_edit_comment'].include?(c.name)}

   for column in columns %>
  <%= column.human_name %>:
  <% if column.name == 'home_page' and !column.name.empty? %>
    <%= link_to(h(@public_body.send(column.name)), @public_body.send(column.name))  %>
  <% elsif column.name == 'request_email' and !column.name.empty? %>
    <%= link_to(h(@public_body.send(column.name)), "mailto:" + @public_body.send(column.name))  %>
  <% else %>
      <%=h @public_body.send(column.name) %>
  <% end %>

<% end %>
Calculated home page:
<% if !@public_body.calculated_home_page.nil? %>
    <%= link_to(h(@public_body.calculated_home_page), @public_body.calculated_home_page) %>
<% else %>
    *unknown*
<% end %>

Tags: <%= @public_body.public_body_tags.map { |t|
        link_to(h(t.name), list_public_bodies_url(:tag => t.name)) +
        ' (admin)' }.join(' ') %>

    <%= link_to 'Public page', main_url(public_body_url(@public_body)) %>
    | <%= link_to 'Edit', '../edit/' + @public_body.id.to_s %>

History

<%
    history_columns = PublicBody.content_columns
    history_columns.delete_if {|c| ['created_at', 'updated_at', 'first_letter'].include?(c.name)}
    for column in history_columns %>
  <%= column.human_name %>
<% end %>
Updated at

<% for historic_public_body in @public_body.versions.reverse %>
      <tr class="<%= cycle('odd', 'even') %>">
    <% for column in history_columns %>
      <%
        value = h(historic_public_body.send(column.name))
        if column.name == 'last_edit_comment'
            value = historic_public_body.last_edit_comment_for_html_display
        end
        # Highlight entries which have changed since previous version
        changed = (not ['version', 'last_edit_editor', 'last_edit_comment'].include?(column.name)) && ((historic_public_body.send(column.name) != @public_body.versions[historic_public_body.version - 2].send(column.name)) || (historic_public_body.version == 1)) %>
      <td <%= changed ? ' class="entry_changed" ': '' %> >
      <%=value%>

    <% end %>
      <%=h historic_public_body.updated_at %>

<% end %>

Requests

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

Track things

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

<% @title = "Public authority - " + h(@public_body.name) %>

<%=@title%>

<%
   columns = PublicBody.content_columns
   columns.delete_if {|c| ['last_edit_comment'].include?(c.name)}

   for column in columns %>
  <%= column.human_name %>:
  <% if column.name == 'home_page' and !column.name.empty? %>
    <%= link_to(h(@public_body.send(column.name)), @public_body.send(column.name))  %>
  <% elsif column.name == 'request_email' and !column.name.empty? %>
    <%= link_to(h(@public_body.send(column.name)), "mailto:" + @public_body.send(column.name))  %>
  <% else %>
      <%=h @public_body.send(column.name) %>
  <% end %>

<% end %>
Calculated home page:
<% if !@public_body.calculated_home_page.nil? %>
    <%= link_to(h(@public_body.calculated_home_page), @public_body.calculated_home_page) %>
<% else %>
    *unknown*
<% end %>

Tags: <%=h @public_body.tag_string %>

    <%= link_to 'Public page', main_url(public_body_url(@public_body)) %>
    | <%= link_to 'Edit', '../edit/' + @public_body.id.to_s %>

History

<%
    history_columns = PublicBody.content_columns
    history_columns.delete_if {|c| ['created_at', 'updated_at', 'first_letter'].include?(c.name)}
    for column in history_columns %>
  <%= column.human_name %>
<% end %>
Updated at

<% for historic_public_body in @public_body.versions.reverse %>
      <tr class="<%= cycle('odd', 'even') %>">
    <% for column in history_columns %>
      <%
        value = h(historic_public_body.send(column.name))
        if column.name == 'last_edit_comment'
            value = historic_public_body.last_edit_comment_for_html_display
        end
        # Highlight entries which have changed since previous version
        changed = (not ['version', 'last_edit_editor', 'last_edit_comment'].include?(column.name)) && ((historic_public_body.send(column.name) != @public_body.versions[historic_public_body.version - 2].send(column.name)) || (historic_public_body.version == 1)) %>
      <td <%= changed ? ' class="entry_changed" ': '' %> >
      <%=value%>

    <% end %>
      <%=h historic_public_body.updated_at %>

<% end %>

Requests

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

Track things

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


Removing verbose button text

Removing verbose button text

<%= __('Removing friend: %s') % @friend.name %>

<%= profile_image @friend, :thumb, :class => 'friend_picture' %>

<%= __('Are you sure you want to remove %s from your friends list?') % @friend.name %>

<%= __('Note that %s will still have you as a friend, unless he/she also wants to remove you from his/her friend list.') % @friend.name %>

<% form_tag do %>
  <%= hidden_field_tag(:confirmation, 1) %>

  <%= submit_button(:ok, __("Yes") % @friend.name) %>
  <%= button(:cancel, _("No"), :action => 'index') %>
<% end %>

<%= __('Removing friend: %s') % @friend.name %>

<%= profile_image @friend, :thumb, :class => 'friend_picture' %>

<%= __('Are you sure you want to remove %s from your friends list?') % @friend.name %>

<%= __('Note that %s will still have you as a friend, unless he/she also wants to remove you from his/her friend list.') % @friend.name %>

<% form_tag do %>
  <%= hidden_field_tag(:confirmation, 1) %>

  <%= submit_button(:ok, __("Yes, I want to remove %s from my friend list") % @friend.name) %>
  <%= button(:cancel, _("No, I don't want"), :action => 'index') %>
<% end %>


better class on ul

better class on ul

<%
   audio_versions = get_service_type('audio')
   # Don't show _anything_ if audio is empty.
   unless ( audio_versions.empty?)
%>

<%= ServiceTypeValue[:audio].display_name %> via:

<%= render(:partial => "fulltext_element",
           :collection => audio_versions,
           :locals => {:li_class => 'audiolink'});
%>

  <% if service_type_in_progress?('audio') %>

      <%= render(:partial => "background_progress",
                   :locals => { :svc_types => [ServiceTypeValue[:audio]]} ) %>

  <% end %>

<%end%>


fixed bug: in a subform, if show_blank_record is false, the last association would not be removable because the
params[:record][attr] wouldn't exist. it's a problem like with unchecked checkboxes, and the solution is similar.

git-svn-id: b2ff2946fad280430023ee7ead77858f96a610fa@584 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.new_record? ? 99999999999 : 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 -%> (<%= link_to_visibility_toggle(:default_visible => !column.collapsed) -%>)

<div <%= 'style="display: none;"' if column.collapsed -%>>
<%= hidden_field_tag "record[#{column.name}]" %>

  <% @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] -%>
    <% if @record.errors.count -%>

      <td colspan="<%= active_scaffold_config_for(@record.class).subform.columns.length + 1 %>">
        <%= error_messages_for :record %>

    <% end %>
    <tr class="association-record <%= 'association-record-new' if @record.new_record? -%>">
      <% scope = column.plural_association? ? "[#{column.name}][#{@record.id || generate_temporary_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)
associated = associated.sort_by {|r| r.new_record? ? 99999999999 : 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 -%> (<%= link_to_visibility_toggle(:default_visible => !column.collapsed) -%>)

<div <%= 'style="display: none;"' if column.collapsed -%>>

  <% @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] -%>
    <% if @record.errors.count -%>

      <td colspan="<%= active_scaffold_config_for(@record.class).subform.columns.length + 1 %>">
        <%= error_messages_for :record %>

    <% end %>
    <tr class="association-record <%= 'association-record-new' if @record.new_record? -%>">
      <% scope = column.plural_association? ? "[#{column.name}][#{@record.id || generate_temporary_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 -%>


Fix photo URL

Fix photo URL

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

<%=@title%>

<% if @admin_user.profile_photo %>

        <% form_tag '../clear_profile_photo/' + @admin_user.id.to_s, :multipart => true do %>
            <img src="<%= main_url(get_profile_photo_url(:url_name => @admin_user.url_name)) %>">

            <%= submit_tag "Clear photo" %>
        <% end %>

<% end %>

Id: <%= @admin_user.id%>

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

<% end %>

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

Track things

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

Post redirects

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

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

<% end %>

Requests

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

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

<%=@title%>

<% if @admin_user.profile_photo %>

        <% form_tag '../clear_profile_photo/' + @admin_user.id.to_s, :multipart => true do %>
            <img src="<%= get_profile_photo_url(:url_name => @admin_user.url_name) %>">

            <%= submit_tag "Clear photo" %>
        <% end %>

<% end %>

Id: <%= @admin_user.id%>

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

<% end %>

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

Track things

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

Post redirects

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

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

<% end %>

Requests

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


Fix HTML validation.

Fix HTML validation.

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

        <title>
        <% if @title %>
            <%=@title%> - WhatDoTheyKnow
        <% else %>
            WhatDoTheyKnow - file and browse Freedom of Information (FOI) requests
        <% end %>
        </title>

        <%= stylesheet_link_tag 'main', :title => "Main", :rel => "stylesheet"  %>
        <%= stylesheet_link_tag 'yucky-green', :title => "Yucky Green", :rel => "alternate stylesheet" %>

        <% if @feed_autodetect %>
            <% for feed in @feed_autodetect %>
                <link rel="alternate" type="application/atom+xml" title="<%=h feed[:title] %>" href="<%=h feed[:url]%>">
            <% end %>
        <% end %>

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

Close

DENIED

Sorry to interrupt, but democracy needs your help!

On the 16th of May 2008 the High Court ruled that MPs’ expenses must be published under the Freedom of Information Act.

This Thursday, MPs are voting to change the law to keep their expenses secret after all,
    just before publication was due and after spending nearly a million of your pounds and seven months
    compiling the data.

Your MP may not even know about this proposal (it was sneaked out under
    the Heathrow runway announcement). Please take a few minutes to alert
    them to this attack on Parliamentary transparency and ask them to vote
    against the measure.

The outcome of this vote will be prominently displayed on every MP’s page until after the next General Election.

What can you do?

    <form action="http://foiorder2009.writetothem.com/" method="get">

Write to your MP to protest. Enter your postcode to do so online: <input type="text" name="pc" value="" size="8">
    <input type="submit" value="Go">

Join this Facebook group.

Blog about it, call a local newspaper (find one), text, email, and instant
    message your friends to let them know that about this campaign.

    </form>

Read more detail about mySociety’s thoughts on this issue.

Close

            WhatDoTheyKnow?

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

Make request

<%= link_to "View requests", request_list_url(:view => 'successful') %>

<%= link_to "View authorities", list_public_bodies_default %>

			<% if @user %>

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

			<% end %>

<%= link_to "Help", about_url %>

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

			<% if @user %>
				Hello, <%=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 %>">
            <%= yield :layout %>

        Contact WhatDoTheyKnow.com
        |
        Built by mySociety ...
        and you
        |
        Dedicated to Chris Lightfoot

<% if MySociety::Config.get("DOMAIN", '127.0.0.1:3000') == 'www.whatdotheyknow.com'  %>

<% end %>

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

        <title>
        <% if @title %>
            <%=@title%> - WhatDoTheyKnow
        <% else %>
            WhatDoTheyKnow - file and browse Freedom of Information (FOI) requests
        <% end %>
        </title>

        <%= stylesheet_link_tag 'main', :title => "Main", :rel => "stylesheet"  %>
        <%= stylesheet_link_tag 'yucky-green', :title => "Yucky Green", :rel => "alternate stylesheet" %>

        <% if @feed_autodetect %>
            <% for feed in @feed_autodetect %>
                <link rel="alternate" type="application/atom+xml" title="<%=h feed[:title] %>" href="<%=h feed[:url]%>">
            <% end %>
        <% end %>

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

Close

DENIED

Sorry to interrupt, but democracy needs your help!

On the 16th of May 2008 the High Court ruled that MPs’ expenses must be published under the Freedom of Information Act.

This Thursday, MPs are voting to change the law to keep their expenses secret after all,
    just before publication was due and after spending nearly a million of your pounds and seven months
    compiling the data.

Your MP may not even know about this proposal (it was sneaked out under
    the Heathrow runway announcement). Please take a few minutes to alert
    them to this attack on Parliamentary transparency and ask them to vote
    against the measure.

The outcome of this vote will be prominently displayed on every MP’s page until after the next General Election.

What can you do?

    <form action="http://foiorder2009.writetothem.com/" method="get">

Write to your MP to protest. Enter your postcode to do so online: <input type="text" name="pc" value="" size="8">
    <input type="submit" value="Go">

Join this Facebook group.

Blog about it, call a local newspaper (find one), text, email, and instant
    message your friends to let them know that about this campaign.

Read more detail about mySociety’s thoughts on this issue.

Close

            WhatDoTheyKnow?

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

Make request

<%= link_to "View requests", request_list_url(:view => 'successful') %>

<%= link_to "View authorities", list_public_bodies_default %>

			<% if @user %>

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

			<% end %>

<%= link_to "Help", about_url %>

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

			<% if @user %>
				Hello, <%=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 %>">
            <%= yield :layout %>

        Contact WhatDoTheyKnow.com
        |
        Built by mySociety ...
        and you
        |
        Dedicated to Chris Lightfoot

<% if MySociety::Config.get("DOMAIN", '127.0.0.1:3000') == 'www.whatdotheyknow.com'  %>

<% end %>


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

<% if flash[:notice] || flash[:notice].to_s != ""%>

<%= h flash[:notice]%>

<% end %>

支出

		<%= render :partial => 'flow', :collection => @expense_flows %>

収入

		<%= render :partial => 'flow', :collection => @income_flows %>

        支出合計
        <%= number_with_delimiter(@expense_flows.sum)%>

          収入合計
          <%= number_with_delimiter(@income_flows.sum)%>

    <%= pie_graph(@expense_flows.select{|f| f.percentage }, :percentage, :name, :flow, nil, 'left_pie') %>

    <%= pie_graph(@income_flows.select{|f| f.percentage }, :percentage, :name, :flow, nil, 'right_pie') %>

    <div class="<%= @profit >= 0 ? "profit" : "loss" %>">
      <%= @profit >= 0 ? "利益" : "損失" %>合計
      <%= number_with_delimiter(@profit.abs)%>円

        資産減少

	  <%= render :partial => 'flow', :collection => @asset_minus_flows %>

        資産増加

	  <%= render :partial => 'flow', :collection => @asset_plus_flows %>

        減少合計
        <%= number_with_delimiter(@asset_minus_flows.sum)%>

        増加合計
        <%= number_with_delimiter(@asset_plus_flows.sum)%>

<% if flash[:notice] || flash[:notice].to_s != ""%>

<%= h flash[:notice]%>

<% end %>

支出

		<%= render :partial => 'flow', :collection => @expense_flows %>

収入

		<%= render :partial => 'flow', :collection => @income_flows %>

        支出合計
        <%= number_with_delimiter(@expense_flows.sum)%>

          収入合計
          <%= number_with_delimiter(@income_flows.sum)%>

    <%= pie_graph(@expense_flows.select{|f| f.percentage }, :percentage, :name, :flow, nil, 'left_pie') %>

    <%= pie_graph(@income_flows.select{|f| f.percentage }, :percentage, :name, :flow, nil, 'right_pie') %>

    <div class="<%= @profit >= 0 ? "profit" : "loss" %>">
      <%= @profit >= 0 ? "利益" : "損失" %>合計
      <%= number_with_delimiter(@profit.abs)%>円

        資産減少

	  <%= render :partial => 'flow', :collection => @asset_minus_flows %>

        資産増加

	  <%= render :partial => 'flow', :collection => @asset_plus_flows %>

        減少合計
        -<%= number_with_delimiter(@asset_minus_flows.sum)%>

        増加合計
        +<%= number_with_delimiter(@asset_plus_flows.sum)%>


30 a bit much too

30 a bit much too

<% view_cache :ttl => 5.minutes do %>

Make or explore Freedom of Information requests

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

           First, type in the name of the UK public authority you'd

like information from. By law, they have to respond
           (why?).

           <%= text_field_tag 'query', params[:query], { :size => 30 } %>
           <%= hidden_field_tag 'bodies', 1 %>
           <%= submit_tag "Search" %>

           e.g. <%=link_to 'Liverpool', search_url('liverpool', 'bodies')%>, <%=link_to 'MRSA', search_url('mrsa', 'bodies')%>, <%=link_to 'Treasury', search_url('treasury', 'bodies')%>

           OR, search for information others have requested using WhatDoTheyKnow.com

    <% end %>

    <% if @popular_bodies.size > 0 %>

            <% for popular_body in @popular_bodies %>

<%=public_body_link(popular_body)%>
                <%=h popular_body.info_requests.count%> requests

            <% end%>

                <%= link_to "More authorities...", list_public_bodies_default %>

    <% end %>

    <% if @successful_request_events.size > 0 %>

            <% for event in @successful_request_events %>

<%=link_to h(excerpt(event.info_request.title, "", 30)), request_url(event.info_request)%>
                <%=h time_ago_in_words(event.described_at).gsub("about ", "") %> ago

            <% end %>

More successful requests...

    <% end %>

<% end %>

<% view_cache :ttl => 5.minutes do %>

Make or explore Freedom of Information requests

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

           First, type in the name of the UK public authority you'd

like information from. By law, they have to respond
           (why?).

           <%= text_field_tag 'query', params[:query], { :size => 30 } %>
           <%= hidden_field_tag 'bodies', 1 %>
           <%= submit_tag "Search" %>

           e.g. <%=link_to 'Liverpool', search_url('liverpool', 'bodies')%>, <%=link_to 'MRSA', search_url('mrsa', 'bodies')%>, <%=link_to 'Treasury', search_url('treasury', 'bodies')%>

           OR, search for information others have requested using WhatDoTheyKnow.com

    <% end %>

    <% if @popular_bodies.size > 0 %>

            <% for popular_body in @popular_bodies %>

<%=public_body_link(popular_body)%>
                <%=h popular_body.info_requests.count%> requests

            <% end%>

                <%= link_to "More authorities...", list_public_bodies_default %>

    <% end %>

    <% if @successful_request_events.size > 0 %>

            <% for event in @successful_request_events %>

<%=link_to h(excerpt(event.info_request.title, "", 32)), request_url(event.info_request)%>
                <%=h time_ago_in_words(event.described_at).gsub("about ", "") %> ago

            <% end %>

More successful requests...

    <% end %>

<% end %>


Update projects list to calculate work done correctly

<div id="<%=@project.dom_id%>" class="project-block">

      <%= link_to image_tag("application_form_edit.png", :border => 0, :title => _("Edit %s", @project.name), :class => "tooltip"), :controller => 'projects', :action => 'edit', :id => @project %>
      <% if @project.user_id == current_user.id || current_user.admin > 0%>
      <%= link_to(image_tag("delete.png", :border => 0, :title => _("Delete %s", @project.name), :class => "tooltip"), { :controller => 'projects', :action => 'destroy', :id => @project}, :confirm => _("Are you sure?")) %>
      <% end %>

<%= "#{h(@project.name)}" %>

    <% if @project.users.size > 0 %>

<%= _('Members') %>

<%= @project.users.collect{|u| " ["project_id=? AND completed_at IS NULL",@project.id])}\"  >#{h(u.name)}"}.join(", ") %>

    <% end %>

<%= _('Created') %>

<%= tz.utc_to_local(@project.created_at).strftime("#{current_user.time_format} #{current_user.date_format}") %>

<%= _('Tasks') %>

<%= @project.tasks.count(:conditions => ["completed_at IS NULL"]) %> <%=_ 'Open' %> / <%= @project.tasks.count %> <%= _ 'Total' %>

    <% done = @project.tasks.sum('work_logs.duration', :conditions => ['completed_at IS NULL'], :include => :work_logs )
       total = @project.tasks.sum('duration', :conditions => ["completed_at IS NULL"])
       completed = @project.tasks.sum('work_logs.duration', :conditions => ['completed_at IS NOT NULL'], :include => :work_logs )
       completed_total = @project.tasks.sum('duration', :conditions => ["completed_at IS NOT NULL"])
       total ||= 0
       done ||= 0
       completed ||= 0
       completed_total ||= 0

       done = done / 60
       completed = completed / 60

    %>

<%= _('Remaining Work') %>

      <% if total - done < 0 %>
      -<%= format_duration(-(total-done), current_user.duration_format, current_user.workday_duration, current_user.days_per_week) %>
      <% else %>
      <%= format_duration(total-done, current_user.duration_format, current_user.workday_duration, current_user.days_per_week) %>
      <% end %>
      [<%= format_duration(total, current_user.duration_format, current_user.workday_duration, current_user.days_per_week) %> <%= _ 'Estimated' %>]

<%= _('Work Done') %>

<%= format_duration(completed, current_user.duration_format, current_user.workday_duration, current_user.days_per_week) %> [<%= format_duration(completed_total, current_user.duration_format, current_user.workday_duration, current_user.days_per_week) %> <%= _ 'Estimated' %>]

<%= @project.description %>

<div id="<%=@project.dom_id%>" class="project-block">

      <%= link_to image_tag("application_form_edit.png", :border => 0, :title => _("Edit %s", @project.name), :class => "tooltip"), :controller => 'projects', :action => 'edit', :id => @project %>
      <% if @project.user_id == current_user.id || current_user.admin > 0%>
      <%= link_to(image_tag("delete.png", :border => 0, :title => _("Delete %s", @project.name), :class => "tooltip"), { :controller => 'projects', :action => 'destroy', :id => @project}, :confirm => _("Are you sure?")) %>
      <% end %>

<%= "#{h(@project.name)}" %>

    <% if @project.users.size > 0 %>

<%= _('Members') %>

<%= @project.users.collect{|u| " ["project_id=? AND completed_at IS NULL",@project.id])}\"  >#{h(u.name)}"}.join(", ") %>

    <% end %>

<%= _('Created') %>

<%= tz.utc_to_local(@project.created_at).strftime("#{current_user.time_format} #{current_user.date_format}") %>

<%= _('Tasks') %>

<%= @project.tasks.count(:conditions => ["completed_at IS NULL"]) %> <%=_ 'Open' %> / <%= @project.tasks.count %> <%= _ 'Total' %>

    <% done = @project.tasks.sum('work_logs.duration', :conditions => ['completed_at IS NULL'], :include => :work_logs )
       total = @project.tasks.sum('duration', :conditions => ["completed_at IS NULL"])
       completed = @project.tasks.sum('work_logs.duration', :conditions => ['completed_at IS NOT NULL'], :include => :work_logs )
       completed_total = @project.tasks.sum('duration', :conditions => ["completed_at IS NOT NULL"])
       total ||= 0
       done ||= 0
       completed ||= 0
       completed_total ||= 0
    %>

<%= _('Remaining Work') %>

      <% if total - done < 0 %>
      -<%= format_duration(-(total-done), current_user.duration_format, current_user.workday_duration, current_user.days_per_week) %>
      <% else %>
      <%= format_duration(total-done, current_user.duration_format, current_user.workday_duration, current_user.days_per_week) %>
      <% end %>
      [<%= format_duration(total, current_user.duration_format, current_user.workday_duration, current_user.days_per_week) %> <%= _ 'Estimated' %>]

<%= _('Work Done') %>

<%= format_duration(completed, current_user.duration_format, current_user.workday_duration, current_user.days_per_week) %> [<%= format_duration(completed_total, current_user.duration_format, current_user.workday_duration, current_user.days_per_week) %> <%= _ 'Estimated' %>]

<%= @project.description %>


Add an explicit message when no results are found for a given source.

<% @results.each do |source| %>

Results from <%= link_to source[:source], source[:url] %>

<% if source[:results] %>
<% if source[:results].empty? %>

No results found

<% else %>
<% source[:results].each do |result| %>

<%= link_to_function result[:description], "setPosition(#{result[:lat]}, #{result[:lon]}, #{result[:zoom]})" %>

<% end %>
<% end %>
<% else %>

<%= source[:error] %>

<% end %>
<% end %>

<% @results.each do |source| %>

Results from <%= link_to source[:source], source[:url] %>

<% if source[:results] %>
<% source[:results].each do |result| %>

<%= link_to_function result[:description], "setPosition(#{result[:lat]}, #{result[:lon]}, #{result[:zoom]})" %>

<% end %>
<% else %>

<%= source[:error] %>

<% end %>
<% end %>


Properly escape HTML when displaying safe_mail_from

<%
if !info_request_event.nil? && info_request_event.event_type == 'response'
    incoming_message = info_request_event.incoming_message
end

# XXX disable this caching for now until we invalidate it properly - maybe do
# it at a higher level anyway.
# cache against all the parameters that there are to this partial
#cache_name = ""
#if !info_request_event.nil?
#    cache_name = cache_name + "correspondence/" + info_request_event.id.to_s
#end
#if !incoming_message.nil?
#    cache_name = cache_name + "/incoming_message/" + incoming_message.id.to_s
#end
#if !@collapse_quotes.nil? && !@collapse_quotes
#    cache_name = cache_name + "/collapse/false"
#else
#    cache_name = cache_name + "/collapse/true" # default is true
#end
## yeuch, must be nicer way of telling cache just to use this cache_name, than
## putting it falsely in list action
#cache(:controller => 'request', :action => 'list', :extra => cache_name) do

if not incoming_message.nil?
%>
    <div class="correspondence" id="incoming-<%=incoming_message.id.to_s%>">

            <% if !incoming_message.safe_mail_from.nil? && incoming_message.safe_mail_from.strip != @info_request.public_body.name.strip %>
                <%=h incoming_message.safe_mail_from %>

            <% end %>
            <% if incoming_message.safe_mail_from.nil? || (incoming_message.mail_from_domain == @info_request.public_body.request_email_domain) %>
                <%=h @info_request.public_body.name %>

            <% end %>

<%= simple_date(incoming_message.sent_at) %>

        <%= render :partial => 'bubble', :locals => { :incoming_message => incoming_message, :body => incoming_message.get_body_for_html_display(@collapse_quotes), :attachments => incoming_message.get_attachments_for_display }  %>

            <% if !@user.nil? && @user.admin_page_links? %>
                <%= link_to "Admin", admin_url("request/show_raw_email/" + incoming_message.raw_email_id.to_s) %> |
            <% end %>
            <%= link_to "Link to this", incoming_message_url(incoming_message) %> |
            <%= link_to "Reply to this message", show_response_url(:id => incoming_message.info_request.id, :incoming_message_id => incoming_message.id) + "#followup" %>

<%
elsif info_request_event.event_type == 'sent' || info_request_event.event_type == 'followup_sent'
    outgoing_message = info_request_event.outgoing_message
    %>
    <div class="correspondence" id="outgoing-<%=outgoing_message.id.to_s%>">

        <%=h @info_request.user.name %>

<%= simple_date(info_request_event.created_at) %>

        <%= render :partial => 'bubble', :locals => { :body => outgoing_message.get_body_for_html_display(), :attachments => nil }  %>

            <% if outgoing_message.status == 'ready' %>
                 Warning: This message has not yet been sent for an unknown reason.
            <% end %>

            <%= link_to "Link to this", outgoing_message_url(outgoing_message) %> |
            <%= link_to "Send follow up", show_response_no_followup_url(:id => outgoing_message.info_request.id, :incoming_message_id => nil) + "#followup" %>

<% elsif [ 'resent', 'followup_resent' ].include?(info_request_event.event_type) %>

            <%= simple_date(info_request_event.created_at) %>

            Sent
            <% if info_request_event.outgoing_message.message_type == 'initial_request' %>
                request
            <% elsif info_request_event.outgoing_message.message_type == 'followup' %>
                a follow up
            <% else %>
                <% raise "unknown message_type" %>
            <% end %>

            to <%= public_body_link(@info_request.public_body) %> again<% if not info_request_event.same_email_as_previous_send? %>, using a new contact address<% end %>.

<% elsif info_request_event.event_type == 'comment'
    comment = info_request_event.comment
%>
    <%= render :partial => 'comment/single_comment', :locals => { :comment => comment } %>
<%
end

%>

<% # end %>

<%
if !info_request_event.nil? && info_request_event.event_type == 'response'
    incoming_message = info_request_event.incoming_message
end

# XXX disable this caching for now until we invalidate it properly - maybe do
# it at a higher level anyway.
# cache against all the parameters that there are to this partial
#cache_name = ""
#if !info_request_event.nil?
#    cache_name = cache_name + "correspondence/" + info_request_event.id.to_s
#end
#if !incoming_message.nil?
#    cache_name = cache_name + "/incoming_message/" + incoming_message.id.to_s
#end
#if !@collapse_quotes.nil? && !@collapse_quotes
#    cache_name = cache_name + "/collapse/false"
#else
#    cache_name = cache_name + "/collapse/true" # default is true
#end
## yeuch, must be nicer way of telling cache just to use this cache_name, than
## putting it falsely in list action
#cache(:controller => 'request', :action => 'list', :extra => cache_name) do

if not incoming_message.nil?
%>
    <div class="correspondence" id="incoming-<%=incoming_message.id.to_s%>">

            <% if !incoming_message.safe_mail_from.nil? && incoming_message.safe_mail_from.strip != @info_request.public_body.name.strip %>
                <%= incoming_message.safe_mail_from %>

            <% end %>
            <% if incoming_message.safe_mail_from.nil? || (incoming_message.mail_from_domain == @info_request.public_body.request_email_domain) %>
                <%=h @info_request.public_body.name %>

            <% end %>

<%= simple_date(incoming_message.sent_at) %>

        <%= render :partial => 'bubble', :locals => { :incoming_message => incoming_message, :body => incoming_message.get_body_for_html_display(@collapse_quotes), :attachments => incoming_message.get_attachments_for_display }  %>

            <% if !@user.nil? && @user.admin_page_links? %>
                <%= link_to "Admin", admin_url("request/show_raw_email/" + incoming_message.raw_email_id.to_s) %> |
            <% end %>
            <%= link_to "Link to this", incoming_message_url(incoming_message) %> |
            <%= link_to "Reply to this message", show_response_url(:id => incoming_message.info_request.id, :incoming_message_id => incoming_message.id) + "#followup" %>

<%
elsif info_request_event.event_type == 'sent' || info_request_event.event_type == 'followup_sent'
    outgoing_message = info_request_event.outgoing_message
    %>
    <div class="correspondence" id="outgoing-<%=outgoing_message.id.to_s%>">

        <%=h @info_request.user.name %>

<%= simple_date(info_request_event.created_at) %>

        <%= render :partial => 'bubble', :locals => { :body => outgoing_message.get_body_for_html_display(), :attachments => nil }  %>

            <% if outgoing_message.status == 'ready' %>
                 Warning: This message has not yet been sent for an unknown reason.
            <% end %>

            <%= link_to "Link to this", outgoing_message_url(outgoing_message) %> |
            <%= link_to "Send follow up", show_response_no_followup_url(:id => outgoing_message.info_request.id, :incoming_message_id => nil) + "#followup" %>

<% elsif [ 'resent', 'followup_resent' ].include?(info_request_event.event_type) %>

            <%= simple_date(info_request_event.created_at) %>

            Sent
            <% if info_request_event.outgoing_message.message_type == 'initial_request' %>
                request
            <% elsif info_request_event.outgoing_message.message_type == 'followup' %>
                a follow up
            <% else %>
                <% raise "unknown message_type" %>
            <% end %>

            to <%= public_body_link(@info_request.public_body) %> again<% if not info_request_event.same_email_as_previous_send? %>, using a new contact address<% end %>.

<% elsif info_request_event.event_type == 'comment'
    comment = info_request_event.comment
%>
    <%= render :partial => 'comment/single_comment', :locals => { :comment => comment } %>
<%
end

%>

<% # end %>


Fix for product search view's title

Fix for product search view's title

<%= search_page_title( @titles[:products], @category ) %>

  <% if !@empty_query %>
    <% button_bar do %>
      <%= display_map_list_button %>
    <% end %>
    <%= facets_menu(:products, @facets) %>
  <% end %>

  <%= render :partial => 'search_form', :locals => { :hint => _('Type the product, service, city or qualifier desired') } %>
  <%= render :partial => 'results_header' %>

  <%= display_results(true) %>
  <% if params[:display] != 'map' %>
    <%= pagination_links @results[:products] %>
  <% end %>

<%= _('Products and Services') %>

  <% if !@empty_query %>
    <% button_bar do %>
      <%= display_map_list_button %>
    <% end %>
    <%= facets_menu(:products, @facets) %>
  <% end %>

  <%= render :partial => 'search_form', :locals => { :hint => _('Type the product, service, city or qualifier desired') } %>
  <%= render :partial => 'results_header' %>

  <%= display_results(true) %>
  <% if params[:display] != 'map' %>
    <%= pagination_links @results[:products] %>
  <% end %>


Fix selected project in QuickAdd

Fix selected project in QuickAdd

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

%>

<% form_remote_tag :url => { :action => 'create_ajax' } ,
       :loading => "Element.show('loading');",
       :complete => "Element.hide('loading');",
       :html => { :id => 'quick-add-form' } do
%>

      <%=_ 'Summary' %>
<%= text_field 'task', 'name', { :size => 17, :maxlength => 200 }.merge( perms['edit'] )  %>

      <% if @task.project_id > 0
           selected_project = @task.project_id
         elsif session[:last_project_id].to_i > 0 && Project.exists?(session[:last_project_id])
           selected_project = session[:last_project_id].to_i
         elsif session[:filter_project].to_i > 0 && Project.exists?(session[:filter_project])
           selected_project = session[:filter_project].to_i
         else
           selected_project = current_user.projects.find(:first, :order => 'name').id
         end

         selected_project = current_user.projects.find(selected_project).id rescue current_user.projects.find(:first, :order => 'name').id
      %>

      <%=_ 'Project' %>

      <select name="task[project_id]" id="task_project_id" <%= "disabled=\"disabled\"" unless perms['reassign'].empty? %>>
      <% @clients = Customer.find(:all, :conditions => ["company_id = ?", current_user.company_id], :order => "name") %>
      <% @clients.each do |c| %>
        <% @client_projects = current_user.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', current_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', current_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' )
num = 0

resource_string = "<select id=\"task_users\" name=\"users[]\" #{"disabled=\"disabled\"" if @task.project && !current_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 = ''
owner_string = "<select name=\"users[]\" id=\"task_users\" #{"disabled=\"disabled\"" if @task.project && !current_user.can?( @task.project, 'reassign' )}><option value=\"\">[#{_('No one')}]</option>" + users.collect{|us| "<option value=\"#{us.id}\" #{"selected" if (us.id == current_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

%>

      <%= owner_string %>

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

      <%=_ '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']  %>

    <%=_ 'Description' %>
<%= text_area 'task', 'description', { :rows => 2, :cols => 17 }.merge( perms['edit'] )  %>

    <%=_ '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 %>

<% if current_user.option_tracktime.to_i == 1%>
       <%=_ 'Estimate' %>

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

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

    <%=_ 'Due Date' %>

    <% if perms['prioritize'].empty? %>
       <% if( (current_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 => current_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 => current_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 %>

<% unless @tags.nil? %>

<% end %>

<%= submit_tag _("Create"), :class => "nolabel" %> <%= _'or'%> <%= _'Cancel' %>
<%= check_box_tag 'notify', '1', (current_user.send_notifications > 0) %><%=_ 'Send notification emails'%>

<% end %>

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

%>

<% form_remote_tag :url => { :action => 'create_ajax' } ,
       :loading => "Element.show('loading');",
       :complete => "Element.hide('loading');",
       :html => { :id => 'quick-add-form' } do
%>

      <%=_ 'Summary' %>
<%= text_field 'task', 'name', { :size => 17, :maxlength => 200 }.merge( perms['edit'] )  %>

      <% if @task.project_id > 0
            selected_project = @task.project_id
         elsif session[:last_project_id].to_i > 0 && Project.exists?(session[:last_project_id])
            selected_project = session[:last_project_id].to_i
         elsif session[:filter_project].to_i > 0 && Project.exists?(session[:filter_project])
            selected_project = session[:filter_project].to_i
         else
            selected_project = current_user.projects.find(:first, :order => 'name').id
         end

         @project = current_user.projects.find(selected_project) rescue current_user.projects.find(:first,:order => 'name').id
	 selected_project = @project.id

      %>
      <%=_ 'Project' %>

      <select name="task[project_id]" id="task_project_id" <%= "disabled=\"disabled\"" unless perms['reassign'].empty? %>>
      <% @clients = Customer.find(:all, :conditions => ["company_id = ?", current_user.company_id], :order => "name") %>
      <% @clients.each do |c| %>
        <% @client_projects = current_user.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', current_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', current_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' )
num = 0

resource_string = "<select id=\"task_users\" name=\"users[]\" #{"disabled=\"disabled\"" if @task.project && !current_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 = ''
owner_string = "<select name=\"users[]\" id=\"task_users\" #{"disabled=\"disabled\"" if @task.project && !current_user.can?( @task.project, 'reassign' )}><option value=\"\">[#{_('No one')}]</option>" + users.collect{|us| "<option value=\"#{us.id}\" #{"selected" if (us.id == current_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

%>

      <%= owner_string %>

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

      <%=_ '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']  %>

    <%=_ 'Description' %>
<%= text_area 'task', 'description', { :rows => 2, :cols => 17 }.merge( perms['edit'] )  %>

    <%=_ '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 %>

<% if current_user.option_tracktime.to_i == 1%>
       <%=_ 'Estimate' %>

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

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

    <%=_ 'Due Date' %>

    <% if perms['prioritize'].empty? %>
       <% if( (current_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 => current_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 => current_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 %>

<% unless @tags.nil? %>

<% end %>

<%= submit_tag _("Create"), :class => "nolabel" %> <%= _'or'%> <%= _'Cancel' %>
<%= check_box_tag 'notify', '1', (current_user.send_notifications > 0) %><%=_ 'Send notification emails'%>

<% end %>


link from member object to the member page

<% if member.member.visible %>

  <%= link_to member.member.id.to_s, :controller => member.member_type, :id => member.member.id %>
  <%= h(member.member_type) %>
  <%= h(member.member_role) %>

<% end %>

<% if member.member.visible %>

  <%= h(member.member.id.to_s) %>
  <%= h(member.member_type) %>
  <%= h(member.member_role) %>

<% end %>


ActionItem3: fixing help string

ActionItem3: fixing help string

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

<%= _('Enable/Disable features') %>

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

<%= help_textile _('Here you can enable or disable several features of your virtual community. Each feature represents some funcionality that your virtual community can use you enable it.') %>

<%= _('Enable/Disable features') %>

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

<%= help_textile _('
Here you can enable or disable several features of your virtual community. Each feature represents some funcionality that your virtual community can use you enable it.
') %>


add in two missing words

add in two missing words

      <%- (1..5).each do |i| -%>

<%= image_tag "/images/login_pic#{i}.png" %>

      <% end %>

          Welcome to the Project Application Tool (PAT).  This site is used by Power to Change
          ministries to help you apply for the various mission trips that are available.  You
          can save your applicaiton to be finished at a later time and your reference requests
          are sent right from this tool.

          The site uses a single sign on called The Key.  Please sign up for an account with the email
          that you will use to communicate with Power to Change on the status of your mission trip.

          Thank you!  If you have any questions on how to use this site, please contact

          <%= mail_to "projects@p2c.com" %>

            <% link_to brand_link(CASClient::Frameworks::Rails::Filter.login_url(controller)) do %>
              <%= image_tag "/images/logo_thekey.png" %>
            <% end %>

            <%= link_to "Login with TheKey", brand_link(CASClient::Frameworks::Rails::Filter.login_url(controller)), :id => "login_link" %>

            or

            <%= link_to "Create an account", "https://thekey.me/cas/service/selfservice?target=signup&service=https%3A//pat.powertochange.org/security/login", :id => "create_link" %>

      <%- (1..5).each do |i| -%>

<%= image_tag "/images/login_pic#{i}.png" %>

      <% end %>

          Welcome to the Project Application Tool (PAT).  This site is used by Power to Change
          ministries to help you apply for the various mission trips that are available.  You
          can save your applicaiton to be finished at a later time and your reference requests
          are sent right from this tool.

          The site uses a single sign on called The Key.  Please sign up for an account email
          that you will use to communicate with Power to Change on the status of your mission trip.

          Thank you!  If you have any questions on how to use this site, please contact

          <%= mail_to "projects@p2c.com" %>

            <% link_to brand_link(CASClient::Frameworks::Rails::Filter.login_url(controller)) do %>
              <%= image_tag "/images/logo_thekey.png" %>
            <% end %>

            <%= link_to "Login with TheKey", brand_link(CASClient::Frameworks::Rails::Filter.login_url(controller)), :id => "login_link" %>

            or

            <%= link_to "Create an account", "https://thekey.me/cas/service/selfservice?target=signup&service=https%3A//pat.powertochange.org/security/login", :id => "create_link" %>


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

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

  <title><%= SITE_TITLE %></title>
  <meta http-equiv="content-type" content="text/html; charset=utf-8" />
  <link rel="stylesheet" href="/stylesheets/1.css" type="text/css" media="screen,projection" />
  <%= javascript_include_tag :defaults %>
  <%= yield :head %>

			  <%= form_tag({:controller => 'people', :action => 'search'}, {:method => 'get'}) %>
			    Type a name and hit enter:

				  <input name="quick_name" id="search_name" onfocus="if(this.value == 'People Search') this.value = ''" onblur="if(this.value == '') this.value = 'People Search'"/>
				</form>

<%= SITE_TITLE %>[beta]
 <%=h SITE_SIMPLE_URL %> (not dot com :-)

Visit <%= link_to VISITOR_SIMPLE_URL, VISITOR_URL %> for news, ministry info, sermon audio, etc.

				    <% if @logged_in %>

				        Signed in: <%= link_to @logged_in.name, '/' %>
				        (<%= link_to 'sign out', {:controller => 'account', :action => 'sign_out'}, :style => 'padding-left:5px;padding-right:5px;' %>)

				    <% end %>

<%= link_to 'Profile', {:controller => 'people', :action => 'index'}, :class => (params[:controller] == 'people' and @person == @logged_in ? 'active' : nil) %>

<%= link_to 'Directory', {:controller => 'people', :action => 'search'}, :class => (params[:controller] == 'people' and params[:action] == 'search' ? 'active' : nil) %>

<%= link_to 'Groups', {:controller => 'groups', :action => 'index'}, :class => (params[:controller] == 'groups' ? 'active' : nil) %>

<%= link_to 'Shares', {:controller => 'shares', :action => 'index'}, :class => (['shares', 'pictures', 'verses', 'recipes'].include?(params[:controller]) ? 'active' : nil) %>

<%= link_to 'Publications', {:controller => 'publications', :action => 'index'}, :class => (params[:controller] == 'publications' ? 'active' : nil) %>

        <% if subnav = yield(:subnav) or flash[:notice] %>

            <%= subnav %>
            <% if flash[:notice] %>
<%= flash[:notice] %><% end %>

        <% end %>

		<% if wide = yield(:wide) %>

	  	  <%= wide %>

		<% end %>

		<% if sidebar = yield(:sidebar) %>

    		<%= sidebar %>

		<% end %>

		<div id="contentnorightbar" <% if sidebar.to_s.empty? %>style="margin-left:0px;padding-left:0px;"<% end %>>
		  <%= yield %>

      © <%= Date.today.year %>, <%= CHURCH_NAME %> |
      Template design by Six Shooter Media.

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

  <title><%= SITE_TITLE %></title>
  <meta http-equiv="content-type" content="text/html; charset=utf-8" />
  <link rel="stylesheet" href="/stylesheets/1.css" type="text/css" media="screen,projection" />
  <%= javascript_include_tag :defaults %>
  <%= yield :head %>

			  <%= form_tag({:controller => 'people', :action => 'search'}, {:method => 'get'}) %>
			    Type a name and hit enter:

				  <input name="quick_name" id="search_name" onfocus="if(this.value == 'People Search') this.value = ''" onblur="if(this.value == '') this.value = 'People Search'"/>
				</form>

<%= SITE_TITLE %>[beta]
 <%=h SITE_SIMPLE_URL %> (not dot com :-)

Visit <%= link_to VISITOR_SIMPLE_URL, VISITOR_URL %> for news, ministry info, sermon audio, etc.

				    <% if @logged_in %>

<%= link_to 'sign out', :controller => 'account', :action => 'sign_out' %>

				    <% end %>

<%= link_to 'Profile', {:controller => 'people', :action => 'index'}, :class => (params[:controller] == 'people' and @person == @logged_in ? 'active' : nil) %>

<%= link_to 'Directory', {:controller => 'people', :action => 'search'}, :class => (params[:controller] == 'people' and params[:action] == 'search' ? 'active' : nil) %>

<%= link_to 'Groups', {:controller => 'groups', :action => 'index'}, :class => (params[:controller] == 'groups' ? 'active' : nil) %>

<%= link_to 'Shares', {:controller => 'shares', :action => 'index'}, :class => (['shares', 'pictures', 'verses', 'recipes'].include?(params[:controller]) ? 'active' : nil) %>

<%= link_to 'Publications', {:controller => 'publications', :action => 'index'}, :class => (params[:controller] == 'publications' ? 'active' : nil) %>

        <% if subnav = yield(:subnav) or flash[:notice] %>

            <%= subnav %>
            <% if flash[:notice] %>
<%= flash[:notice] %><% end %>

        <% end %>

		<% if wide = yield(:wide) %>

	  	  <%= wide %>

		<% end %>

		<% if sidebar = yield(:sidebar) %>

    		<%= sidebar %>

		<% end %>

		<div id="contentnorightbar" <% if sidebar.to_s.empty? %>style="margin-left:0px;padding-left:0px;"<% end %>>
		  <%= yield %>

      © <%= Date.today.year %>, <%= CHURCH_NAME %> |
      Template design by Six Shooter Media.


Changed sorting on racer results page.

Changed sorting on racer results page.

git-svn-id: 96bd6241e080dd4199045f7177cf3384e2eaed71@810 2d86388d-c40f-0410-ad6a-a69da6a65d20

<% @page_title = "Results: #{@racer.name}" %>

<%= @racer.name %>

		Race
		Category
		Date

	<%- for result in @event_results.sort {|x, y| y.race.standings.event.date <=> x.race.standings.event.date } -%>
	<tr class="<%= cycle("even", "odd") %>">
	  <%= result.place %>
	  <%= link_to(result.race.standings.full_name, :controller => 'results', :action => 'event', :id => result.race.standings.event.id, :anchor => result.race.id) %>
	  <%= result.race.name %>
	  <%= result.race.standings.event.date.strftime("%D") %>

	<%- end -%>

<% for result in @competition_results.sort {|x, y| y.race.standings.event.date <=> x.race.standings.event.date } %>

		<%= result.place.to_i.ordinalize %> — <%= result.race.standings.full_name %>

		Race
		Category
		Date
		Points

	<% for score in result.scores.sort {|x, y| y.source_result.race.standings.event.date <=> x.source_result.race.standings.event.date } %>
	<tr class="<%= cycle("even", "odd") %>">
		<%= score.source_result.place %>

			<%= link_to(score.source_result.race.standings.full_name, :controller => 'results', :action => 'event', :id => score.source_result.race.standings.event.id, :anchor => score.source_result.race.id) unless score.source_result.race.standings.event.is_a?(Competition) %>
			<%= link_to(score.source_result.race.standings.full_name, :controller => 'results', :action => 'competition', :competition_id => score.source_result.race.standings.event.id, :racer_id => @racer.id) if score.source_result.race.standings.event.is_a?(Competition)%>
		<%= score.source_result.race.name %>
		<%= score.source_result.race.standings.event.date.strftime("%D") %>
		<%= number_with_precision(score.points, 1) %>

	<% end %>

		TOTAL<%= number_with_precision(result.points, 1) %>

<% end %>

<% @page_title = "Results: #{@racer.name}" %>

<%= @racer.name %>

		Race
		Category
		Date

	<%- for result in @event_results.sort_by {|result| result.race.standings.event.date } -%>
	<tr class="<%= cycle("even", "odd") %>">
	  <%= result.place %>
	  <%= link_to(result.race.standings.full_name, :controller => 'results', :action => 'event', :id => result.race.standings.event.id, :anchor => result.race.id) %>
	  <%= result.race.name %>
	  <%= result.race.standings.event.date.strftime("%D") %>

	<%- end -%>

<% for result in @competition_results %>

		<%= result.place.to_i.ordinalize %> — <%= result.race.standings.full_name %>

		Race
		Category
		Date
		Points

	<% for score in result.scores %>
	<tr class="<%= cycle("even", "odd") %>">
		<%= score.source_result.place %>

			<%= link_to(score.source_result.race.standings.full_name, :controller => 'results', :action => 'event', :id => score.source_result.race.standings.event.id, :anchor => score.source_result.race.id) unless score.source_result.race.standings.event.is_a?(Competition) %>
			<%= link_to(score.source_result.race.standings.full_name, :controller => 'results', :action => 'competition', :competition_id => score.source_result.race.standings.event.id, :racer_id => @racer.id) if score.source_result.race.standings.event.is_a?(Competition)%>
		<%= score.source_result.race.name %>
		<%= score.source_result.race.standings.event.date.strftime("%D") %>
		<%= number_with_precision(score.points, 1) %>

	<% end %>

		TOTAL<%= number_with_precision(result.points, 1) %>

<% end %>


Fix bug #468 http://code.google.com/p/activescaffold/issues/detail?id=468 Use active_scaffold_input_options to set labels' for attribute

<% scope ||= nil %>

    <label for="<%= active_scaffold_input_options(column, scope)[:id] %>"><%= column.label %>

    <%= active_scaffold_input_for column, scope %>
    <% if column.description -%>
      <%= column.description %>
    <% end -%>

<% scope ||= nil %>

    <label for="<%= "record_#{column.name}" %>"><%= column.label %>

    <%= active_scaffold_input_for column, scope %>
    <% if column.description -%>
      <%= column.description %>
    <% end -%>


Translate activity log on render

Translate activity log on render

<% date_format = current_user.time_format %>

    <% if log.log_type == EventLog::TASK_COMMENT && (log.user_id.to_i == current_user.id || current_user.admin?)%>
    <%= link_to("#{tz.utc_to_local(log.started_at).strftime(date_format)}", { :controller => 'tasks', :action => 'edit_log', :id => log }) %>

    <% else %>
    <%= "#{tz.utc_to_local(log.started_at).strftime(date_format)}"%><% if log.duration > 0 %> - <%= "#{tz.utc_to_local(log.ended_at).strftime(date_format)}"%>
<% end %>
    <% end %>
  <%= link_to "#{worked_nice(log.duration/60)}", { :controller => 'tasks', :action => 'edit_log', :id => log } if (log.duration > 0 && ((log.user && log.user.id == current_user.id) || current_user.admin?) )%>

  <% if log.task_id.to_i > 0 %>

  <%= image_tag('accept.png', :alt => "Complete") if log.log_type == EventLog::TASK_COMPLETED %>
  <%= image_tag('cancel.png', :alt => "Reverted") if log.log_type == EventLog::TASK_REVERTED %>
  <%= image_tag('add.png', :alt => "New Task") if log.task.type_id != 2 && log.task.type_id != 1 && log.log_type == EventLog::TASK_CREATED %>
  <%= image_tag('bug_add.png', :alt => "New Defect") if log.task.type_id == 2 && log.log_type == EventLog::TASK_CREATED %>
  <%= image_tag('application_add.png', :alt => "New Feature") if log.task.type_id == 1 && log.log_type ==  EventLog::TASK_CREATED %>
  <%= image_tag('application_form_edit.png', :alt => "Edit") if log.log_type == EventLog::TASK_MODIFIED %>
  <%= image_tag('comment_add.png', :alt => "New Comment") if log.log_type == EventLog::TASK_COMMENT %>
  <%= image_tag('time_add.png', :alt => "Work done") if log.log_type == EventLog::TASK_WORK_ADDED %>
  <%= image_tag('folder_add.png', :alt => "Archived") if log.log_type == EventLog::TASK_ARCHIVED %>
  <%= image_tag('folder_go.png', :alt => "Archived") if log.log_type == EventLog::TASK_RESTORED %>

  <% else %>

  <%= image_tag('page_add.png', :alt => "Page added") if log.log_type == EventLog::PAGE_CREATED %>
  <%= image_tag('page_delete.png', :alt => "Page deleted") if log.log_type == EventLog::PAGE_DELETED %>
  <%= image_tag('page_edit.png', :alt => "Page modified") if log.log_type == EventLog::PAGE_MODIFIED %>
  <%= image_tag('delete.png', :alt => "Task Deleted") if log.log_type == EventLog::TASK_DELETED %>

  <%= image_tag('package.png', :alt => "Commit") if log.log_type == EventLog::SCM_COMMIT %>

  <% end %>

<% if log.task %>
<%= link_to_task log.task %>
<% elsif log.scm_changeset_id.to_i > 0 %>
<%= "" + log.scm_changeset.issue_num + " " + link_to(h(log.scm_changeset.name), {:controller => 'scm', :action => 'edit', :id => log.scm_changeset_id}) -%>

<%= "#{log.scm_changeset.full_name} " %>

<% end %>
    <%= "
" if (log.task_id.to_i > 0) %>
            <%= "#{log.task.full_name} " if log.task_id.to_i > 0 %>
            <%= "[#{log.user.name}]" if log.user %>
            <%= "[#{log.event_log.user}]" if log.user.nil? && log.event_log.user %>
            <%= "[#{log.scm_changeset.author}]" if log.scm_changeset && !log.user %>

<%= avatar_for log.user, 25 if log.user %>

<% if log.body && log.body.length > 0 %>
       <%= x = wrap_text( log.body.gsub(/- ([^<]+)<\/strong>/) {|m| "- #{_($1)}"}, 100).gsub(/\n/, "
") if log.body %>
<% end %>

<% date_format = current_user.time_format %>

    <% if log.log_type == EventLog::TASK_COMMENT && (log.user_id.to_i == current_user.id || current_user.admin?)%>
    <%= link_to("#{tz.utc_to_local(log.started_at).strftime(date_format)}", { :controller => 'tasks', :action => 'edit_log', :id => log }) %>

    <% else %>
    <%= "#{tz.utc_to_local(log.started_at).strftime(date_format)}"%><% if log.duration > 0 %> - <%= "#{tz.utc_to_local(log.ended_at).strftime(date_format)}"%>
<% end %>
    <% end %>
  <%= link_to "#{worked_nice(log.duration/60)}", { :controller => 'tasks', :action => 'edit_log', :id => log } if (log.duration > 0 && ((log.user && log.user.id == current_user.id) || current_user.admin?) )%>

  <% if log.task_id.to_i > 0 %>

  <%= image_tag('accept.png', :alt => "Complete") if log.log_type == EventLog::TASK_COMPLETED %>
  <%= image_tag('cancel.png', :alt => "Reverted") if log.log_type == EventLog::TASK_REVERTED %>
  <%= image_tag('add.png', :alt => "New Task") if log.task.type_id != 2 && log.task.type_id != 1 && log.log_type == EventLog::TASK_CREATED %>
  <%= image_tag('bug_add.png', :alt => "New Defect") if log.task.type_id == 2 && log.log_type == EventLog::TASK_CREATED %>
  <%= image_tag('application_add.png', :alt => "New Feature") if log.task.type_id == 1 && log.log_type ==  EventLog::TASK_CREATED %>
  <%= image_tag('application_form_edit.png', :alt => "Edit") if log.log_type == EventLog::TASK_MODIFIED %>
  <%= image_tag('comment_add.png', :alt => "New Comment") if log.log_type == EventLog::TASK_COMMENT %>
  <%= image_tag('time_add.png', :alt => "Work done") if log.log_type == EventLog::TASK_WORK_ADDED %>
  <%= image_tag('folder_add.png', :alt => "Archived") if log.log_type == EventLog::TASK_ARCHIVED %>
  <%= image_tag('folder_go.png', :alt => "Archived") if log.log_type == EventLog::TASK_RESTORED %>

  <% else %>

  <%= image_tag('page_add.png', :alt => "Page added") if log.log_type == EventLog::PAGE_CREATED %>
  <%= image_tag('page_delete.png', :alt => "Page deleted") if log.log_type == EventLog::PAGE_DELETED %>
  <%= image_tag('page_edit.png', :alt => "Page modified") if log.log_type == EventLog::PAGE_MODIFIED %>
  <%= image_tag('delete.png', :alt => "Task Deleted") if log.log_type == EventLog::TASK_DELETED %>

  <%= image_tag('package.png', :alt => "Commit") if log.log_type == EventLog::SCM_COMMIT %>

  <% end %>

<% if log.task %>
<%= link_to_task log.task %>
<% elsif log.scm_changeset_id.to_i > 0 %>
<%= "" + log.scm_changeset.issue_num + " " + link_to(h(log.scm_changeset.name), {:controller => 'scm', :action => 'edit', :id => log.scm_changeset_id}) -%>

<%= "#{log.scm_changeset.full_name} " %>

<% end %>
    <%= "
" if (log.task_id.to_i > 0) %>
            <%= "#{log.task.full_name} " if log.task_id.to_i > 0 %>
            <%= "[#{log.user.name}]" if log.user %>
            <%= "[#{log.event_log.user}]" if log.user.nil? && log.event_log.user %>
            <%= "[#{log.scm_changeset.author}]" if log.scm_changeset && !log.user %>

<%= avatar_for log.user, 25 if log.user %>

<% if log.body && log.body.length > 0 %>
      <%= x = wrap_text(log.body, 100).gsub(/\n/, "
") if log.body %>
<% end %>


Sort the tags for the databrowser output.

<% unless tag_details.tags.empty? %>

    Tags:

        <%= render :partial => "tag", :collection => tag_details.tags.sort %>

<% end %>

<% unless tag_details.tags_as_hash.empty? %>

    Tags:

        <%= render :partial => "tag", :collection => tag_details.tags_as_hash %>

<% end %>


Fixing bug in onResize body event

Fixing bug in onResize body event

(ActionItem1753)

<!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>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="description" content="<%= @environment.name %>" />
    <meta name="keywords" content="Noosfero, Community, Open Source" />
    <link rel="shortcut icon" href="<%= image_path('/designs/themes/' + current_theme + '/favicon.ico') %>" type="image/x-icon" />
    <%= yield(:feeds) %>

    <%= noosfero_javascript %>
    <%= theme_javascript %>

    <%=
      # Load the principal css files:
      stylesheet_link_tag(noosfero_stylesheets, :cache => 'cache') +
      stylesheet_import( %w( common help menu article button search blocks forms login-box ),
                         :themed_source => true ) + "\n" +
      import_blocks_stylesheets(:themed_source => true) + "\n" +
      # Load the controller's css file if it exists:
      import_controller_stylesheets(:themed_source => true)
    %>
    <%= stylesheet_link_tag template_stylesheet_path %>
    <%= stylesheet_link_tag icon_theme_stylesheet_path %>
    <%= stylesheet_link_tag jquery_ui_theme_stylesheet_path %>

    <%# Add custom tags/styles/etc via content_for %>
    <%= yield :head %>
    <%= javascript_tag('render_all_jquery_ui_widgets()') %>

  <body class='noosfero category<%= category_color %><%=
    # Identify the current controller and action for the CSS:
    " controller-"+ @controller.controller_name() +
    " action_"+ @controller.controller_name() +"_"+ @controller.action_name()
    %>' onload='noosfero_init();'
    onresize="registerDocumentSize()">

      <%= _('Go to content') %>

BETA

          <%= link_to ""+ @environment.name() +"",
                      @environment.top_url,
                        :id=>"menu_link_to_envhome",
                        :title=>@environment.name  %>
          <% unless environment.enabled?(:disable_categories) %>
            <% cache(environment.id.to_s +  '_categories_menu') do %>
              <%= render :file => 'shared/categories_menu' %>
            <% end %>
          <% end %>
          <%= render :file => 'shared/assets_menu' %>

           <%= language_chooser(:element => 'dropdown') %>

          <%= render :file => 'shared/user_menu' %>

        <a href="/doc" id="btShowHelp" class="icon-help32on help-on icon-help-on"
           title="<%= _('Manual') %>"><%= _('Manual') %>

          <%= insert_boxes(yield) %>

      <%= theme_footer %>

    <%# if you need to add HTML stuff to the layout, include it in
    app/views/shared/noosfero_layout_features.rhtml! %>
    <%= noosfero_layout_features %>


fixed ein typo with tag.

fixed ein typo with tag.

<%= render :partial => "layouts/header" -%>

    <%= render :partial => "layouts/navigation"-%>

      <%= link_to "ILUG-BOM", :controller => 'articles', :action => 'home' -%>

      Indian GNU/Linux Users Group of Mumbai

      <%= @content_for_left-%>

	<%= @content_for_right-%>

<%= render :partial => "layouts/footer" -%>

<%= render :partial => "layouts/header" -%>

    <%= render :partial => "layouts/navigation"-%>
  </div

      <%= link_to "ILUG-BOM", :controller => 'articles', :action => 'home' -%>

      Indian GNU/Linux Users Group of Mumbai

      <%= @content_for_left-%>

	<%= @content_for_right-%>

<%= render :partial => "layouts/footer" -%>


ActionItem152: i18n of top bar help message

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

    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title>
      <%= @environment.name() %>
      <%- if @category -%>
        → <%= @category.full_name -%>
      <%- end -%>
    </title>
    <meta name="description" content="FIXME: Descriptions of Noosfero" />
    <meta name="keywords" content="Noosfero, Community, Open Source" />
    <%#
     stylesheet_import is better then stylesheet_link_tag because the stylesheet
     must be loaded before the page show.
    %>
    <%= stylesheet_import %w( common help menu button search blocks forms login-box ) %>
    <%= import_blocks_stylesheets %>
    <%=
      # Load the controller's css file if it exists:
      css = "controller_"+ @controller.controller_name() +".css"
      stylesheet_link_tag( css ) if File.exists?( "public/stylesheets/"+css )
    %>

    <%# FIXME %>
    <%= stylesheet_link_tag '/designs/templates/default/stylesheets/style.css' %>
    <%= stylesheet_link_tag '/designs/icons/default/style.css' %>

    <%= javascript_include_tag(:defaults) %>
    <%= javascript_include_tag 'menu' %>
    <%= javascript_include_tag 'auto-open-menu' %>
    <%= include_lightbox_header %>
    <%# cms stuff %>
    <% if params[:controller] == 'cms' %>
      <%= javascript_include_tag 'cms' %>
    <% end %>

  <body class='noosfero category<%= category_color %><%=
    # Identify the current controller and action for the CSS:
    " controller_"+ @controller.controller_name() +
    " action_"+ @controller.controller_name() +"_"+ @controller.action_name()
    %>' onload='noosfero_init();'
    help=<%= _('Pass the mouse over page elements to get help on them').inspect %> >

    <% unless flash[:notice].nil? %>

        <%= flash[:notice] %>
        <%= javascript_tag(visual_effect(:fade, "notice", :duration => 15)) %>

    <% end %>

      <%= _('Go to content') %>

      <% if @category -%>
        <%= @category.full_name(" → ") %>
      <% end -%>
      <%= javascript_tag(visual_effect(:fade, "path_category", :duration => 10)) %>

BETA

          <%= _(<<-CODE

                This is %s's shortcuts bar. Using it you have access to the
                main features of the environment and you find the information
                of your interest more quickly.

                This bar helps you find information following two paths or
                dimensions. First dimension are
                categories, which you'll find in the colored tabs in
                the bar. Second dimensions are content types, and
                you'll find them in the animated bar on your right.

          CODE
               ) % @environment.name %>

          <%= render :file => 'shared/categories_menu' %>

          <%= render :file => 'shared/user_menu' %>
          <%=
          lightbox_link_to ''+ _('Search'),
                           { :controller => 'search', :action => 'popup' }, :id => 'open_search'
          %>

        <a href="#" id="btShowHelp" class="icon-help32on"
           title="<%= _('Turn help on/off') %>"
           onclick="mouseHelpOnOff()"><%= _('Help') %>

          <% if @controller.send(:boxes_editor?) %>
            <%= yield %>
            <%= display_boxes_editor(@controller.boxes_holder) %>
          <% else %>
            <% if uses_design_blocks?  %>
              <%= display_boxes(@controller.boxes_holder, yield) %>
            <% else %>
              <%= yield %>
            <% end %>
          <% end %>

        <%= render :file => 'shared/language_chooser' %>

      <%= footer %>

    <%= javascript_include_tag 'show-mouse-help' %>
    <%= javascript_include_tag 'noosfero-show-help' %>

<%=
      _('Hey! Your web browser is really old!') +'

'+
      _('This great website will be not so good on that.
         Don\'t you want to use Firefox? That is a great web browser, free,
         and made by people of all the world parts.')
      %>

      <%= _('Get Firefox Now!') %>

    <%= javascript_include_tag 'better-browser-promotion' %>

    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title>
      <%= @environment.name() %>
      <%- if @category -%>
        → <%= @category.full_name -%>
      <%- end -%>
    </title>
    <meta name="description" content="FIXME: Descriptions of Noosfero" />
    <meta name="keywords" content="Noosfero, Community, Open Source" />
    <%#
     stylesheet_import is better then stylesheet_link_tag because the stylesheet
     must be loaded before the page show.
    %>
    <%= stylesheet_import %w( common help menu button search blocks forms login-box ) %>
    <%= import_blocks_stylesheets %>
    <%=
      # Load the controller's css file if it exists:
      css = "controller_"+ @controller.controller_name() +".css"
      stylesheet_link_tag( css ) if File.exists?( "public/stylesheets/"+css )
    %>

    <%# FIXME %>
    <%= stylesheet_link_tag '/designs/templates/default/stylesheets/style.css' %>
    <%= stylesheet_link_tag '/designs/icons/default/style.css' %>

    <%= javascript_include_tag(:defaults) %>
    <%= javascript_include_tag 'menu' %>
    <%= javascript_include_tag 'auto-open-menu' %>
    <%= include_lightbox_header %>
    <%# cms stuff %>
    <% if params[:controller] == 'cms' %>
      <%= javascript_include_tag 'cms' %>
    <% end %>

  <body class='noosfero category<%= category_color %><%=
    # Identify the current controller and action for the CSS:
    " controller_"+ @controller.controller_name() +
    " action_"+ @controller.controller_name() +"_"+ @controller.action_name()
    %>' onload='noosfero_init();'
    help="Passe o mouse sobre os elementos da página para ver a ajuda.">

    <% unless flash[:notice].nil? %>

        <%= flash[:notice] %>
        <%= javascript_tag(visual_effect(:fade, "notice", :duration => 15)) %>

    <% end %>

      <%= _('Go to content') %>

      <% if @category -%>
        <%= @category.full_name(" → ") %>
      <% end -%>
      <%= javascript_tag(visual_effect(:fade, "path_category", :duration => 10)) %>

BETA

          Esta é a barra de atalhos do <%= @environment.name() %>.
          Atravêz dela você acessa as principais funcionalidades do ambiente
          e encontra mais rapidamente as informações do seu interesse.

          Essa barra te ajuda a encontrar informações por dois caminhos
          ou dimensões. A primeira dimensão são as categorias
          que você encontra nas abas coloridas da barra. A segunda dimensão
          são os tipos de conteúdo que você encontra na aba animada
          da direita.

          <%= render :file => 'shared/categories_menu' %>

          <%= render :file => 'shared/user_menu' %>
          <%=
          lightbox_link_to ''+ _('Search'),
                           { :controller => 'search', :action => 'popup' }, :id => 'open_search'
          %>

        <a href="#" id="btShowHelp" class="icon-help32on"
           title="<%= _('Turn help on/off') %>"
           onclick="mouseHelpOnOff()"><%= _('Help') %>

          <% if @controller.send(:boxes_editor?) %>
            <%= yield %>
            <%= display_boxes_editor(@controller.boxes_holder) %>
          <% else %>
            <% if uses_design_blocks?  %>
              <%= display_boxes(@controller.boxes_holder, yield) %>
            <% else %>
              <%= yield %>
            <% end %>
          <% end %>

        <%= render :file => 'shared/language_chooser' %>

      <%= footer %>

    <%= javascript_include_tag 'show-mouse-help' %>
    <%= javascript_include_tag 'noosfero-show-help' %>

<%=
      _('Hey! Your web browser is really old!') +'

'+
      _('This great website will be not so good on that.
         Don\'t you want to use Firefox? That is a great web browser, free,
         and made by people of all the world parts.')
      %>

      <%= _('Get Firefox Now!') %>

    <%= javascript_include_tag 'better-browser-promotion' %>