ActionItem388: removing annoying popup

ActionItem388: removing annoying popup

git-svn-id: 43659daf80e124e0b603d67096418e58e4f21099@1789 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" />

    <%= javascript_include_tag 'default-config' %>
    <%= javascript_include_tag :defaults %>
    <%# javascript_include_tag 'animator' %>
    <%= javascript_include_tag 'menu' %>
    <%= javascript_include_tag 'auto-open-menu' %>
    <%= include_lightbox_header %>
    <%= javascript_include_tag 'cms' if @controller.controller_name == 'cms' %>
    <%= theme_javascript %>

    <%#
     stylesheet_import is better then stylesheet_link_tag because the stylesheet
     must be loaded before the page show.
    %>
    <%=
      # Load the principal css files:
      stylesheet_import( %w( common help menu article button search blocks forms login-box )
                         ) + "\n" +
      stylesheet_import( %w( common help menu article button search blocks forms login-box ),
                         :themed_source => true ) + "\n" +
      # Load the boxes's css file if each exists:
      import_blocks_stylesheets +
      # Load the controller's css file if it exists:
      stylesheet_import( "controller_"+ @controller.controller_name() ) + "\n" +
      stylesheet_import( "controller_"+ @controller.controller_name(), :themed_source => true )
    %>

    <%# FIXME: for unknow reason the @import url(.../article.css) above dont work for class .post_comment_box.opened/closed %>
    <%= stylesheet_link_tag 'article' %>

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

  <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. Click the question mark icon on the top-right corner to deactivate this help window.').inspect %> >

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

        <%= flash[:notice] %>
        <%= javascript_tag(
          visual_effect( :appear,    'notice', :duration => 2, :queue => :end ) +
          visual_effect( :highlight, 'notice', :duration => 3, :queue => :end ) +
          visual_effect( :fade,      'notice', :duration => 2, :queue => :end )
        ) %>

    <% end %>

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

BETA

        <%= _("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.") % @environment.name %>

        <%= _("This bar helps you find information following two paths or dimensions. First dimension is composed of categories, which you'll find in the colored tabs in the top. Second dimension has content types, and you'll find them in the animated bar on your right.") % @environment.name %>

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

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

        <a href="#" id="btShowHelp" class="icon-help32on help-on"
           title="<%= _('Turn help on/off') %>"
           onclick="mouseHelpOnOff(); return false"><%= _('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 %>

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

        Communication libre pour une société libre

        <%= _('Developed by Colivre') %>

        Free Technologies Cooperative

      <%= language_chooser %>

      <%= footer %>

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

<%=
      _('Your web browser is obsolete!') +'

'+
      _('This website will not look as good as it could.
         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' %>


Remove about

Remove about

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.

    <% 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, "", 35)), request_url(event.info_request)%>
                <%=h time_ago_in_words(event.described_at).gsub("about ", "") %> ago

            <% end %>

More successful requests...

    <% end %>

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.

    <% 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, "", 35)), request_url(event.info_request)%>
                <%=h time_ago_in_words(event.described_at)%> ago

            <% end %>

More successful requests...

    <% end %>


fix statefield crash

fix statefield crash

<% readonly = can_not_edit?(statefield) ? {:disabled => "disabled"} : {} %>
<%=select(statefield.question_table, statefield.question_column, State.US_STATES,
            {:include_blank => true},
            {:class => statefield.css_class, :onFocus => "Highlight(this)",
            :onBlur => "UnHighlight(this)", :onChange => "set_dirty();"}.merge(readonly)) %>

<% readonly = can_not_edit?(state_field) ? {:disabled => "disabled"} : {} %>
<%=select(statefield.question_table, statefield.question_column, State::NAMES, {:include_blank => true},
            {:class => statefield.css_class, :onFocus => "Highlight(this)",
            :onBlur => "UnHighlight(this)", :onChange => "set_dirty();"}.merge(readonly)) %>


Fix login box layout

Fix login box layout

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

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

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

<% if flash[:errors] -%>

There were errors processing your request:

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

<%= error %>

                <% end -%>

<% end %>

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

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

Warning for Internet Explorer users

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

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

Mozilla Firefox 2.0 and up

Safari 3.0 and up

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

<%= @content_for_layout %>


Make the component ID actually come from config

Signup for Acme Projects

<% if @call && !@call.errors.empty? %>

Could not complete signup. Please correct the following problems:

    <% @call.errors.each do |error| %>

<%= error.message %>

    <% end %>

<% end %>

<% if @flash %>

<%= @flash %>

<% end %>

<form method="post" action="<%= chargify.base_uri %>/signups">
  <%= chargify.direct.secure_parameters(
    :data => {
      :redirect_uri => "http://localhost:9292/verify"
    }
  ).to_form_inputs %>
  <fieldset>
    <legend>Select Plan</legend>

      <input type="radio" name="signup[product][handle]" id="signup_product_handle_basic" value="basic" <%= 'checked' if product_params[:handle] == 'basic' %>/>Basic

      <input type="radio" name="signup[product][handle]" id="signup_product_handle_pro" value="pro" <%= 'checked' if product_params[:handle] == 'pro' %>/>Pro

  </fieldset>

  <% if config['component_id'] %>
    <fieldset>
      <legend>Widgets</legend>

        How Many Widgets?

        <select name="signup[components][<%= config['component_id'] %>]" id="signup_widgets">
          <option value="">Please Select</option>
          <option value="1">1</option>
          <option value="2">2</option>
          <option value="3">3</option>
          <option value="4">4</option>
        </select>

    </fieldset>
  <% end %>

  <fieldset>
    <legend>Coupon</legend>

      Coupon Code

      <input type="text" name="signup[coupon_code]" id="signup_coupon_code" value="<%= h(coupon_code) %>" />

  </fieldset>

  <fieldset>
    <legend>About You</legend>

      First Name

      <input type="text" name="signup[customer][first_name]" id="signup_customer_first_name" value="<%= h(customer_params[:first_name]) %>" />

      Last Name

      <input type="text" name="signup[customer][last_name]" id="signup_customer_last_name" value="<%= h(customer_params[:last_name]) %>"/>

      Email

      <input type="text" name="signup[customer][email]" id="signup_customer_email" value="<%= h(customer_params[:email]) %>"/>

  </fieldset>

  <fieldset>
    <legend>Payment Profile</legend>

      First Name on Card

      <input type="text" name="signup[payment_profile][first_name]" id="signup_payment_profile_first_name" value="<%= h(payment_profile_params[:first_name]) %>" />

      Last Name on Card

      <input type="text" name="signup[payment_profile][last_name]" id="signup_payment_profile_last_name" value="<%= h(payment_profile_params[:last_name]) %>" />

      Card Number

      <input type="text" name="signup[payment_profile][card_number]" id="signup_payment_profile_card_number" value="<%= h(payment_profile_params[:card_number]) %>" />

      Expiration Month / Year

      <select name="signup[payment_profile][expiration_month]" id="signup_payment_profile_expiration_month">
        <% for i in 1..12 do %>
        <option value="<%= i %>"<%= ' selected' if payment_profile_params[:expiration_month] == i.to_s %>><%= "%02d" % i.to_s %></option>
        <% end %>
      </select>
      /
      <select name="signup[payment_profile][expiration_year]" id="signup_payment_profile_expiration_year">
        <% t = Time.now.year; for i in t..(t+10) %>
        <option value="<%= i %>"<%= ' selected' if payment_profile_params[:expiration_year] == i.to_s %>><%= i %></option>
        <% end %>
      </select>

  </fieldset>

    <input type="submit" value="Sign Up" />
    or
    Go Back

</form>

Signup for Acme Projects

<% if @call && !@call.errors.empty? %>

Could not complete signup. Please correct the following problems:

    <% @call.errors.each do |error| %>

<%= error.message %>

    <% end %>

<% end %>

<% if @flash %>

<%= @flash %>

<% end %>

<form method="post" action="<%= chargify.base_uri %>/signups">
  <%= chargify.direct.secure_parameters(
    :data => {
      :redirect_uri => "http://localhost:9292/verify"
    }
  ).to_form_inputs %>
  <fieldset>
    <legend>Select Plan</legend>

      <input type="radio" name="signup[product][handle]" id="signup_product_handle_basic" value="basic" <%= 'checked' if product_params[:handle] == 'basic' %>/>Basic

      <input type="radio" name="signup[product][handle]" id="signup_product_handle_pro" value="pro" <%= 'checked' if product_params[:handle] == 'pro' %>/>Pro

  </fieldset>

  <% if config['component_id'] %>
    <fieldset>
      <legend>Widgets</legend>

        How Many Widgets?

        <select name="signup[components][11]" id="signup_widgets">
          <option value="">Please Select</option>
          <option value="1">1</option>
          <option value="2">2</option>
          <option value="3">3</option>
          <option value="4">4</option>
        </select>

    </fieldset>
  <% end %>

  <fieldset>
    <legend>Coupon</legend>

      Coupon Code

      <input type="text" name="signup[coupon_code]" id="signup_coupon_code" value="<%= h(coupon_code) %>" />

  </fieldset>

  <fieldset>
    <legend>About You</legend>

      First Name

      <input type="text" name="signup[customer][first_name]" id="signup_customer_first_name" value="<%= h(customer_params[:first_name]) %>" />

      Last Name

      <input type="text" name="signup[customer][last_name]" id="signup_customer_last_name" value="<%= h(customer_params[:last_name]) %>"/>

      Email

      <input type="text" name="signup[customer][email]" id="signup_customer_email" value="<%= h(customer_params[:email]) %>"/>

  </fieldset>

  <fieldset>
    <legend>Payment Profile</legend>

      First Name on Card

      <input type="text" name="signup[payment_profile][first_name]" id="signup_payment_profile_first_name" value="<%= h(payment_profile_params[:first_name]) %>" />

      Last Name on Card

      <input type="text" name="signup[payment_profile][last_name]" id="signup_payment_profile_last_name" value="<%= h(payment_profile_params[:last_name]) %>" />

      Card Number

      <input type="text" name="signup[payment_profile][card_number]" id="signup_payment_profile_card_number" value="<%= h(payment_profile_params[:card_number]) %>" />

      Expiration Month / Year

      <select name="signup[payment_profile][expiration_month]" id="signup_payment_profile_expiration_month">
        <% for i in 1..12 do %>
        <option value="<%= i %>"<%= ' selected' if payment_profile_params[:expiration_month] == i.to_s %>><%= "%02d" % i.to_s %></option>
        <% end %>
      </select>
      /
      <select name="signup[payment_profile][expiration_year]" id="signup_payment_profile_expiration_year">
        <% t = Time.now.year; for i in t..(t+10) %>
        <option value="<%= i %>"<%= ' selected' if payment_profile_params[:expiration_year] == i.to_s %>><%= i %></option>
        <% end %>
      </select>

  </fieldset>

    <input type="submit" value="Sign Up" />
    or
    Go Back

</form>


default sorting column now does not have a 'reset' stage. it just cycles between ASC and DESC.

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

<%
sorting = active_scaffold_config.list.user.sorting
sorting_stages = ['reset', 'ASC', 'DESC']
default_sorting = active_scaffold_config.list.sorting
default_sorting_stages = ['ASC', 'DESC']
-%>
<% active_scaffold_config.list.columns.each do |column| -%>
  <%
  stages = default_sorting.sorts_on?(column) ? default_sorting_stages : sorting_stages
  column_sort_direction = stages.after(sorting.direction_of(column)) || 'ASC'
  sort_params = params_for(:action => :update_table, :page => 1,
                           :sort => column.name, :sort_direction => column_sort_direction)
  column_header_id = active_scaffold_column_header_id(column)
  -%>
  <th id="<%= column_header_id %>" <%= "class=\"sorted #{sorting.direction_of(column).downcase}\"" if sorting.sorts_on? column %>>
  <% if column.sortable? -%>
    <% href = url_for(sort_params) -%>
    <%= link_to_remote column.label,
      { :url => sort_params,
        :before => "addActiveScaffoldPageToHistory('#{href}', '#{controller_id}')",
        :loading => "Element.addClassName('#{column_header_id}','loading');",
        :update => active_scaffold_content_id },
      { :href => href } %>
   <% else -%>

<%= column.label %>

   <% end -%>

<% end -%>

<% sorting = active_scaffold_config.list.user.sorting -%>
<% active_scaffold_config.list.columns.each do |column| -%>
  <% column_sort_direction = ['reset', 'ASC', 'DESC'].after(sorting.direction_of(column)) || 'ASC' -%>
  <% sort_params = params_for(:action => :update_table, :page => 1,
                              :sort => column.name, :sort_direction => column_sort_direction) -%>
  <% column_header_id = active_scaffold_column_header_id(column) -%>
  <th id="<%= column_header_id %>" <%= "class=\"sorted #{sorting.direction_of(column).downcase}\"" if sorting.sorts_on? column %>>
  <% if column.sortable? -%>
    <% href = url_for(sort_params) -%>
    <%= link_to_remote column.label,
      { :url => sort_params,
        :before => "addActiveScaffoldPageToHistory('#{href}', '#{controller_id}')",
        :loading => "Element.addClassName('#{column_header_id}','loading');",
        :update => active_scaffold_content_id },
      { :href => href } %>
   <% else -%>

<%= column.label %>

   <% end -%>

<% end -%>


Require bugfix.

Require bugfix.

<%
  #Register appserver.
  begin
    appsrv = _hb
  rescue NameError
    appsrv = _kas
  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

  #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

    require "ruby_process"
    Ruby_process::Cproxy.run do |data|
      subproc = data[:subproc]
      subproc.static(:Object, :require, "rubygems")
      subproc.static(:Object, :require, "#{Knj.knjrbfw_path}/../knjrbfw.rb")
      subproc.static(:Object, :require, "RMagick")
      subproc.static(:Dir, :chdir, File.dirname(__FILE__))

      pic = subproc.static("Magick::Image", :read, _get["path"]).first

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

      pic.format = "png"

      pic_columns = pic.columns.__rp_marshal
      pic_rows = pic.rows.__rp_marshal

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

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

      pic.write(tmp_path) if tmp_write or force
    end
	end

	appsrv.header("Last-Modified", "#{time_orig.httpdate} GMT") if time_orig
  appsrv.header("Content-Type", "image/png")
  _httpsession.force_fileread(tmp_path)
%>

<%
  #Register appserver.
  begin
    appsrv = _hb
  rescue NameError
    appsrv = _kas
  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

  #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
    Ruby_process::Cproxy.run do |data|
      subproc = data[:subproc]
      subproc.static(:Object, :require, "rubygems")
      subproc.static(:Object, :require, "#{Knj.knjrbfw_path}/../knjrbfw.rb")
      subproc.static(:Object, :require, "RMagick")
      subproc.static(:Dir, :chdir, File.dirname(__FILE__))

      pic = subproc.static("Magick::Image", :read, _get["path"]).first

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

      pic.format = "png"

      pic_columns = pic.columns.__rp_marshal
      pic_rows = pic.rows.__rp_marshal

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

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

      pic.write(tmp_path) if tmp_write or force
    end
	end

	appsrv.header("Last-Modified", "#{time_orig.httpdate} GMT") if time_orig
  appsrv.header("Content-Type", "image/png")
  _httpsession.force_fileread(tmp_path)
%>


added options to include TA role

added options to include TA role

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

<%= link_to 'Copy '+model.downcase , :controller => controller, :action=>'copy', :id => node.node_object_id %>

<% if is_available(session[:user],owner_id) || (session[:user].role_id == 6 && is_available(User.find(Ta.get_my_instructor(session[:user].id)),owner_id))%>

<%= link_to 'Edit '+model.downcase, :controller => controller, :action=>'edit', :id => node.node_object_id %>

<%= link_to 'Delete '+model.downcase,  :controller => controller, :action=>'delete', :id => node.node_object_id %>

  <% if Object.const_get(model).find(node.node_object_id).private %>

<%= link_to 'Make Public',  :controller => controller, :action=>'toggle_access', :id => node.node_object_id %>

  <% else %>

<%= link_to 'Make Private', :controller => controller, :action=>'toggle_access', :id => node.node_object_id %>

  <% end %>
<% end %>

<%= link_to 'Copy '+model.downcase , :controller => controller, :action=>'copy', :id => node.node_object_id %>

<% if is_available(session[:user],owner_id || Ta.get_my_instructor(session[:user].id)==owner_id)%>

<%= link_to 'Edit '+model.downcase, :controller => controller, :action=>'edit', :id => node.node_object_id %>

<%= link_to 'Delete '+model.downcase,  :controller => controller, :action=>'delete', :id => node.node_object_id %>

  <% if Object.const_get(model).find(node.node_object_id).private %>

<%= link_to 'Make Public',  :controller => controller, :action=>'toggle_access', :id => node.node_object_id %>

  <% else %>

<%= link_to 'Make Private', :controller => controller, :action=>'toggle_access', :id => node.node_object_id %>

  <% end %>
<% end %>


Fix the DD's class in pending-fixed examples

<dd class="spec <%= status %>">
	<%= h(example.description) %>
  <div class="failure" id="failure-<%= counter %>">

Expected pending
        <%= h(example.metadata[:execution_result][:pending_message]) %>
        to fail. No Error was raised.

%     format_backtrace(exception.backtrace, example).each do |backtrace_info|
	        <%= backtrace_info %>

%     end

    <%= extra %>

% unless log_messages.nil? || log_messages.empty?

<%= log_messages.join("\n") %>

% end


Fixing typo

Fixing typo

<% if profile.person? %>

<%= _('Invite your friends') %>

<% else %>

<%= _('Invite your friends to join %s') % profile.name %>

<% end %>

<%= render :partial => 'invite/select_address_book' %>

<% unless profile.person? %>

<%= _('Invite other registered users') %>

<%= _('You can also search for your friends\' profiles and invite them to join this community.') %>

  <% form_tag :action => 'invite_registered_friend' do %>
    <% search_action = url_for(:action => 'search_friend') %>
    <%= token_input_field_tag(:q, 'search-friends', search_action,
                              { :hint_text => _('Type in your friend\'s ') + search_friend_fields,
                                :focus => false }) %>

    <%= render :partial => 'invite/personalize_invitation_mail', :locals => {:mail_template => @mail_template } %>

    <% button_bar do %>
      <%= submit_button('save', _('Invite'))%>
      <%= button('cancel', _('Cancel'), profile.url)%>
    <% end %>
  <% end %>
<% end %>

<% if profile.person? %>

<%= _('Invite your friends') %>

<% else %>

<%= _('Invite your friends to join %s') % profile.name %>

<% end %>

<%= render :partial => 'invite/select_address_book' %>

<% unless profile.person? %>

<%= _('Invite others registered users') %>

<%= _('You can also search for your friends\' profiles and invite them to join this community.') %>

  <% form_tag :action => 'invite_registered_friend' do %>
    <% search_action = url_for(:action => 'search_friend') %>
    <%= token_input_field_tag(:q, 'search-friends', search_action,
                              { :hint_text => _('Type in your friend\'s ') + search_friend_fields,
                                :focus => false }) %>

    <%= render :partial => 'invite/personalize_invitation_mail', :locals => {:mail_template => @mail_template } %>

    <% button_bar do %>
      <%= submit_button('save', _('Invite'))%>
      <%= button('cancel', _('Cancel'), profile.url)%>
    <% end %>
  <% end %>
<% end %>


Give full URl in email

Give full URl in email

<%
        # Construct the main text of the mail
        main_text = ''
        for track_thing, alert_results in @email_about_things
            main_text += track_thing.params[:title_in_email] + "\n"
            main_text += ("=" * track_thing.params[:title_in_email].size) + "\n\n"
            for result in alert_results.reverse
                if result.class.to_s == "InfoRequestEvent"
                    event = result

                    if not @highlighting.nil? and @highlighting['InfoRequestEvent'][event.id].size > 0
                        extract = @highlighting['InfoRequestEvent'][event.id].values.join(" ")
                    elsif not event.outgoing_message.nil?
                        extract = excerpt(event.outgoing_message.body_without_salutation, "", 150)
                    elsif not event.incoming_message.nil?
                        extract = excerpt(event.incoming_message.get_body_for_quoting, "", 150)
                    else
                        extract = excerpt(info_request.initial_request_text, "", 150)
                    end
                    extract.gsub!(/\s+/, ' ')

                    if event.event_type == 'response'
                        url = main_url(incoming_message_url(event.incoming_message))
                        main_text += event.info_request.public_body.name + " sent a response to " + event.info_request.user.name
                    elsif event.event_type == 'followup_sent'
                        url = main_url(outgoing_message_url(event.outgoing_message))
                        main_text += event.info_request.user.name + " sent a follow up message to " + event.info_request.public_body.name
                    elsif event.event_type == 'sent'
                        # this is unlikely to happen in real life, but happens in the test code
                        url = main_url(request_url(event.info_request))+"#outgoing-"+event.outgoing_message.id.to_s
                        main_text += event.info_request.user.name + " sent a request to " + event.info_request.public_body.name
                    else
                        raise "unknown type in event_digest " + event.event_type
                    end
                    main_text += " (" + simple_date(event.created_at) + ")\n"
                    main_text += MySociety::Format.wrap_email_body('"' + extract + '"').gsub(/\n+$/, "") + "\n"
                    main_text += url + "\n"

                    main_text += "\n"
                else
                    raise "need to add other types to TrackMailer.event_digest"
                end
            end
            main_text += "\n"
        end

        #STDERR.puts main_text
        #STDERR.puts @unsubscribe_url
%><%=main_text%>Alter your subscription
=======================

Please click on the link below to cancel or alter these emails.
<%=@unsubscribe_url%>

-- the WhatDoTheyKnow team

<%
        # Construct the main text of the mail
        main_text = ''
        for track_thing, alert_results in @email_about_things
            main_text += track_thing.params[:title_in_email] + "\n"
            main_text += ("=" * track_thing.params[:title_in_email].size) + "\n\n"
            for result in alert_results.reverse
                if result.class.to_s == "InfoRequestEvent"
                    event = result

                    if not @highlighting.nil? and @highlighting['InfoRequestEvent'][event.id].size > 0
                        extract = @highlighting['InfoRequestEvent'][event.id].values.join(" ")
                    elsif not event.outgoing_message.nil?
                        extract = excerpt(event.outgoing_message.body_without_salutation, "", 150)
                    elsif not event.incoming_message.nil?
                        extract = excerpt(event.incoming_message.get_body_for_quoting, "", 150)
                    else
                        extract = excerpt(info_request.initial_request_text, "", 150)
                    end
                    extract.gsub!(/\s+/, ' ')

                    if event.event_type == 'response'
                        url = incoming_message_url(event.incoming_message)
                        main_text += event.info_request.public_body.name + " sent a response to " + event.info_request.user.name
                    elsif event.event_type == 'followup_sent'
                        url = outgoing_message_url(event.outgoing_message)
                        main_text += event.info_request.user.name + " sent a follow up message to " + event.info_request.public_body.name
                    elsif event.event_type == 'sent'
                        # this is unlikely to happen in real life, but happens in the test code
                        url = main_url(request_url(event.info_request))+"#outgoing-"+event.outgoing_message.id.to_s
                        main_text += event.info_request.user.name + " sent a request to " + event.info_request.public_body.name
                    else
                        raise "unknown type in event_digest " + event.event_type
                    end
                    main_text += " (" + simple_date(event.created_at) + ")\n"
                    main_text += MySociety::Format.wrap_email_body('"' + extract + '"').gsub(/\n+$/, "") + "\n"
                    main_text += url + "\n"

                    main_text += "\n"
                else
                    raise "need to add other types to TrackMailer.event_digest"
                end
            end
            main_text += "\n"
        end

        #STDERR.puts main_text
        #STDERR.puts @unsubscribe_url
%><%=main_text%>Alter your subscription
=======================

Please click on the link below to cancel or alter these emails.
<%=@unsubscribe_url%>

-- the WhatDoTheyKnow team


xhtml bugfix

xhtml bugfix

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

<% for article in @articles -%>
  <%= render_partial "article", article %>

<%=link_to_comments(article)%>

<% end -%>


Paginate user searches

Paginate user searches

<% @show_tips = @xapian_requests.nil? || (@total_hits == 0) %>

<% @include_request_link_in_authority_listing = true %>

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

<% if @query.nil? %>
    <% @title = _("Search Freedom of Information requests, public authorities and users") %>
<% elsif @total_hits == 0 %>
    <% @title = _('There were no requests matching your query.') %>
<% else %>
    <% @title = _("Results page {{page_number}}", :page_number => @page.to_s) %>
<% end%>

  <% if @query.nil? %>

<%= _("Search") %>

  <% else %>

<%= _("Search results") %>

  <% end%>

  <% if @advanced %>

<%= _('To use the advanced search, combine phrases and labels as described in the search tips below.') %>

      <% form_tag(advanced_search_url, :method => "get") do %>

           <%= text_field_tag :query, @query, { :size => 60 } %>
           <%= hidden_field_tag 'sortby', @inputted_sortby %>
           <% if @bodies %>
               <%= hidden_field_tag 'bodies', 1 %>
           <% end %>
           <%= submit_tag _("Search") %>
                 <%= link_to _('Simple search'), search_redirect_path %>

      <% end %>

  <% else %>
    <% form_tag(request.url, {:method => "get", :id => "search_form"}) do %>

        <%= text_field_tag 'query', params[:query], { :size => 40 } %>
        <%= hidden_field_tag 'sortby', @inputted_sortby %>
        <% if @bodies %>
          <%= hidden_field_tag 'bodies', 1 %>
        <% end %>
        <%= submit_tag _("Search") %>
        <%= link_to(_("Advanced search"), advanced_search_url) %>

<%= _("Showing") %>

          <% labels = [
            ["requests", _("requests")],
            ["users", _("users")],
            ["bodies", _("authorities")],
            ["all", _("everything")]]%>
          <% for variety, label in labels %>
            <% if @variety_postfix != variety %>
              <% if variety != "users" %>
              <%=  link_to label, search_url([params[:query], @common_query], variety, @sort_postfix)  %>
              <% else %>
              <%=  link_to label, search_url(params[:query], variety, @sort_postfix) %>
              <% end %>
            <% else %>
              <%= label %>
            <% end %>
            <%= "|" unless variety == labels.last[0]%>
          <% end %>

        <% if false %>
          <%-# Commented out for now as tags are of limited use when users can't see them.  This will change in the future! -%>
          <% if @variety_postfix != "users" %>

              <%= label_tag(:query, _("Tags (separated by a space):")) %><%= text_field_tag(:tags, params[:tags], { :size => 20 }) %>
              <% for tag in InfoRequest.get_tags %>
                <%= tag.name_and_value %>
              <% end %>

          <% end %>
        <% end %>

      <% if @variety_postfix == "requests" %>

<%= _("Restrict to") %>

             <% [["successful", _("successful requests")],
                ["unsuccessful", _("unsuccessful requests")],
                ["awaiting", _("unresolved requests")],
                ["internal_review", _("internal reviews")]].each_with_index do |item, index|
               status, title = item %>

               <%= check_box_tag "latest_status[]", status, params[:latest_status].nil? ? false : params[:latest_status].include?(status), :id => "latest_status_#{index}" %>
               <%= label_tag("latest_status_#{index}", title) %>

            <% end %>

<%= _("Search in") %>

            <% [["sent", _("messages from users")],
              ["response", _("messages from authorities")],
              ["comment", _("comments")]].each_with_index do |item, index|
              variety, title = item %>

              <%= check_box_tag "request_variety[]", variety, params[:request_variety].nil? ? true : params[:request_variety].include?(variety), :id => "request_variety_#{index}" %>
              <%= label_tag("request_variety_#{index}", title) %>

            <% end %>

            <%= _("Made between") %>
            <%= text_field_tag(:request_date_after, params[:request_date_after], {:class => "use-datepicker", :size => 10}) %>
             <%= _("and") %>
            <%= text_field_tag(:request_date_before, params[:request_date_before], {:class => "use-datepicker", :size => 10}) %>

      <% end %>

        <%= submit_tag _("Filter") if @variety_postfix == "requests"%>

    <% end # Search form%>

  <% end # if @advanced %>

  <% if !@query.nil? %>

      <%=link_to_unless @sortby == 'relevant', _("Show most relevant results first"), search_url(@query, @variety_postfix, 'relevant') %>
      |
      <%=link_to_unless @sortby == 'newest', _("Newest results first"), search_url(@query, @variety_postfix, 'newest') %>
      <% if @sortby == 'described' %>
      | <%= _('Recently described results first') %>
      <% end %>

  <% end %>

<% if @track_thing  && (@xapian_bodies_hits > 0 || @xapian_users_hits > 0 || @total_hits == 0)%>

<%= _('Track this search')%>

    <%= render :partial => 'track/tracking_links', :locals => { :track_thing => @track_thing, :own_request => false, :location => 'main' } %>

<% end %>

<% if @total_hits == 0 %>

<%=@title %>

<% end %>

<% if not @query.nil? %>

      <% if @xapian_bodies_hits > 0 %>
        <% if @xapian_bodies_hits == 1 && @page == 1 %>

<%= _('One public authority found') %>

        <% else %>

<%= _('Public authorities {{start_count}} to {{end_count}} of {{total_count}}', :start_count => ((@page-1)*@bodies_per_page+1).to_s, :end_count => [@page*@bodies_per_page, @xapian_bodies.matches_estimated].min.to_s, :total_count => @xapian_bodies.matches_estimated.to_s) %>

        <% end %>

          <% for result in @xapian_bodies.results %>
            <%= render :partial => 'public_body/body_listing_single', :locals => { :public_body => result[:model] }  %>
          <% end %>

        <%= will_paginate WillPaginate::Collection.new(@page, @bodies_per_page, @xapian_bodies.matches_estimated) %>
      <% elsif @bodies && !@query.nil? && @xapian_bodies.results.size == 0 && @page == 1 %>

<%= _('No public authorities found') %>

        <% if @spelling_correction %>

<%= _('Did you mean: {{correction}}', :correction => search_link(@spelling_correction, @postfix)) %>

        <% end %>

<%= _('Browse all or ask us to add one.') % [list_public_bodies_default, help_requesting_path + '#missing_body'] %>

      <% end %>

      <% if @xapian_users_hits > 0 %>
        <% if @xapian_users_hits == 1 && @page == 1 %>

<%= _("One person found") %>

        <% else %>

<%= _("People {{start_count}} to {{end_count}} of {{total_count}}", :start_count => ((@page-1)*@users_per_page+1).to_s, :end_count =>  [@page*@users_per_page, @xapian_users.matches_estimated].min.to_s, :total_count =>  @xapian_users.matches_estimated.to_s) %>

        <% end %>

          <% for result in @xapian_users.results %>
            <%= render :partial => 'user/user_listing_single', :locals => { :display_user => result[:model] } %>
          <% end %>

        <%= will_paginate WillPaginate::Collection.new(@page, @users_per_page, @xapian_users.matches_estimated) %>

      <% end %>

      <% if @xapian_requests_hits > 0 %>
        <% if @xapian_requests_hits == 1 && @page == 1 %>

<%= _("One FOI request found") %>

        <% else %>

<%= _("FOI requests {{start_count}} to {{end_count}} of {{total_count}}", :start_count => ((@page-1)*@requests_per_page+1).to_s, :end_count => [@page*@requests_per_page, @xapian_requests.matches_estimated].min.to_s, :total_count =>  @xapian_requests.matches_estimated.to_s) %>

        <% end %>

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

        <%= will_paginate WillPaginate::Collection.new(@page, @requests_per_page, @xapian_requests.matches_estimated) %>
      <% end %>

<% end %>

<% if @advanced %>
  <%= render :partial => 'general/advanced_search_tips' %>
<% end %>

<% @show_tips = @xapian_requests.nil? || (@total_hits == 0) %>

<% @include_request_link_in_authority_listing = true %>

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

<% if @query.nil? %>
    <% @title = _("Search Freedom of Information requests, public authorities and users") %>
<% elsif @total_hits == 0 %>
    <% @title = _('There were no requests matching your query.') %>
<% else %>
    <% @title = _("Results page {{page_number}}", :page_number => @page.to_s) %>
<% end%>

  <% if @query.nil? %>

<%= _("Search") %>

  <% else %>

<%= _("Search results") %>

  <% end%>

  <% if @advanced %>

<%= _('To use the advanced search, combine phrases and labels as described in the search tips below.') %>

      <% form_tag(advanced_search_url, :method => "get") do %>

           <%= text_field_tag :query, @query, { :size => 60 } %>
           <%= hidden_field_tag 'sortby', @inputted_sortby %>
           <% if @bodies %>
               <%= hidden_field_tag 'bodies', 1 %>
           <% end %>
           <%= submit_tag _("Search") %>
                 <%= link_to _('Simple search'), search_redirect_path %>

      <% end %>

  <% else %>
    <% form_tag(request.url, {:method => "get", :id => "search_form"}) do %>

        <%= text_field_tag 'query', params[:query], { :size => 40 } %>
        <%= hidden_field_tag 'sortby', @inputted_sortby %>
        <% if @bodies %>
          <%= hidden_field_tag 'bodies', 1 %>
        <% end %>
        <%= submit_tag _("Search") %>
        <%= link_to(_("Advanced search"), advanced_search_url) %>

<%= _("Showing") %>

          <% labels = [
            ["requests", _("requests")],
            ["users", _("users")],
            ["bodies", _("authorities")],
            ["all", _("everything")]]%>
          <% for variety, label in labels %>
            <% if @variety_postfix != variety %>
              <% if variety != "users" %>
              <%=  link_to label, search_url([params[:query], @common_query], variety, @sort_postfix)  %>
              <% else %>
              <%=  link_to label, search_url(params[:query], variety, @sort_postfix) %>
              <% end %>
            <% else %>
              <%= label %>
            <% end %>
            <%= "|" unless variety == labels.last[0]%>
          <% end %>

        <% if false %>
          <%-# Commented out for now as tags are of limited use when users can't see them.  This will change in the future! -%>
          <% if @variety_postfix != "users" %>

              <%= label_tag(:query, _("Tags (separated by a space):")) %><%= text_field_tag(:tags, params[:tags], { :size => 20 }) %>
              <% for tag in InfoRequest.get_tags %>
                <%= tag.name_and_value %>
              <% end %>

          <% end %>
        <% end %>

      <% if @variety_postfix == "requests" %>

<%= _("Restrict to") %>

             <% [["successful", _("successful requests")],
                ["unsuccessful", _("unsuccessful requests")],
                ["awaiting", _("unresolved requests")],
                ["internal_review", _("internal reviews")]].each_with_index do |item, index|
               status, title = item %>

               <%= check_box_tag "latest_status[]", status, params[:latest_status].nil? ? false : params[:latest_status].include?(status), :id => "latest_status_#{index}" %>
               <%= label_tag("latest_status_#{index}", title) %>

            <% end %>

<%= _("Search in") %>

            <% [["sent", _("messages from users")],
              ["response", _("messages from authorities")],
              ["comment", _("comments")]].each_with_index do |item, index|
              variety, title = item %>

              <%= check_box_tag "request_variety[]", variety, params[:request_variety].nil? ? true : params[:request_variety].include?(variety), :id => "request_variety_#{index}" %>
              <%= label_tag("request_variety_#{index}", title) %>

            <% end %>

            <%= _("Made between") %>
            <%= text_field_tag(:request_date_after, params[:request_date_after], {:class => "use-datepicker", :size => 10}) %>
             <%= _("and") %>
            <%= text_field_tag(:request_date_before, params[:request_date_before], {:class => "use-datepicker", :size => 10}) %>

      <% end %>

        <%= submit_tag _("Filter") if @variety_postfix == "requests"%>

    <% end # Search form%>

  <% end # if @advanced %>

  <% if !@query.nil? %>

      <%=link_to_unless @sortby == 'relevant', _("Show most relevant results first"), search_url(@query, @variety_postfix, 'relevant') %>
      |
      <%=link_to_unless @sortby == 'newest', _("Newest results first"), search_url(@query, @variety_postfix, 'newest') %>
      <% if @sortby == 'described' %>
      | <%= _('Recently described results first') %>
      <% end %>

  <% end %>

<% if @track_thing  && (@xapian_bodies_hits > 0 || @xapian_users_hits > 0 || @total_hits == 0)%>

<%= _('Track this search')%>

    <%= render :partial => 'track/tracking_links', :locals => { :track_thing => @track_thing, :own_request => false, :location => 'main' } %>

<% end %>

<% if @total_hits == 0 %>

<%=@title %>

<% end %>

<% if not @query.nil? %>

      <% if @xapian_bodies_hits > 0 %>
        <% if @xapian_bodies_hits == 1 && @page == 1 %>

<%= _('One public authority found') %>

        <% else %>

<%= _('Public authorities {{start_count}} to {{end_count}} of {{total_count}}', :start_count => ((@page-1)*@bodies_per_page+1).to_s, :end_count => [@page*@bodies_per_page, @xapian_bodies.matches_estimated].min.to_s, :total_count => @xapian_bodies.matches_estimated.to_s) %>

        <% end %>

          <% for result in @xapian_bodies.results %>
            <%= render :partial => 'public_body/body_listing_single', :locals => { :public_body => result[:model] }  %>
          <% end %>

        <%= will_paginate WillPaginate::Collection.new(@page, @bodies_per_page, @xapian_bodies.matches_estimated) %>
      <% elsif @bodies && !@query.nil? && @xapian_bodies.results.size == 0 && @page == 1 %>

<%= _('No public authorities found') %>

        <% if @spelling_correction %>

<%= _('Did you mean: {{correction}}', :correction => search_link(@spelling_correction, @postfix)) %>

        <% end %>

<%= _('Browse all or ask us to add one.') % [list_public_bodies_default, help_requesting_path + '#missing_body'] %>

      <% end %>

      <% if @xapian_users_hits > 0 %>
        <% if @xapian_users_hits == 1 && @page == 1 %>

<%= _("One person found") %>

        <% else %>

<%= _("People {{start_count}} to {{end_count}} of {{total_count}}", :start_count => ((@page-1)*@users_per_page+1).to_s, :end_count =>  [@page*@users_per_page, @xapian_users.matches_estimated].min.to_s, :total_count =>  @xapian_users.matches_estimated.to_s) %>

        <% end %>

          <% for result in @xapian_users.results %>
            <%= render :partial => 'user/user_listing_single', :locals => { :display_user => result[:model] } %>
          <% end %>

      <% end %>

      <% if @xapian_requests_hits > 0 %>
        <% if @xapian_requests_hits == 1 && @page == 1 %>

<%= _("One FOI request found") %>

        <% else %>

<%= _("FOI requests {{start_count}} to {{end_count}} of {{total_count}}", :start_count => ((@page-1)*@requests_per_page+1).to_s, :end_count => [@page*@requests_per_page, @xapian_requests.matches_estimated].min.to_s, :total_count =>  @xapian_requests.matches_estimated.to_s) %>

        <% end %>

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

        <%= will_paginate WillPaginate::Collection.new(@page, @requests_per_page, @xapian_requests.matches_estimated) %>
      <% end %>

<% end %>

<% if @advanced %>
  <%= render :partial => 'general/advanced_search_tips' %>
<% end %>


Update help notice now alerts finished.

Update help notice now alerts finished.

Hello! This site really isn't nearly finished yet, but it
    works and so we wanted to start sharing it with you.
    Things still to do:

 Finish designing the site - this appearance is just placeholder.

 Add things you tell us you want.

As always, if you want mySociety to do more stuff like this, please
    volunteer,
    donate,
    or commission us!

Hello! This site really isn't nearly finished yet, but it
    works and so we wanted to start sharing it with you.
    Things still to do:

 Finish designing the site - the current appearance is in flux.

 RSS feeds and email alerts based on search terms.

 Add things you tell us you want.

As always, if you want mySociety to do more stuff like this, please
    volunteer,
    donate,
    or commission us!


Oops.

Oops.

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

<%=@title%>

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

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))) %>
    <% else %>
    <%=h post_redirect.send(column) %>
    <% end %>
  <% end %>

<% end %>

Requests

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


Simplify the "not allowed" message.  Closes #171.

<%= _('Sorry, but only {{user_name}} is allowed to do that.', :user_name => h(@reason_params[:user_name])) %>

<%= @reason_params[:web] %>, please
<%= link_to _('sign out'), signout_url(:r => request.request_uri) %>,
<%= _('and sign in as ')%><%= h(@reason_params[:user_name]) %>.


Don't include the old admin stylesheet in this sparkly new world

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

      <meta http-equiv="content-type" content="text/html;charset=UTF-8" >
      <title><%= site_name %> admin<%= @title ? ":" : "" %> <%=@title%></title>

      <%= javascript_include_tag '/javascripts/jquery-1.7.2.min.js', '/adminbootstraptheme/javascripts/jquery-ui.min.js', '/adminbootstraptheme/javascripts/bootstrap-collapse', '/adminbootstraptheme/javascripts/bootstrap-tab', '/adminbootstraptheme/javascripts/admin' %>
      <%= stylesheet_link_tag 'admin-theme/jquery-ui-1.8.15.custom.css', :rel => 'stylesheet'%>
      <%= stylesheet_link_tag "/adminbootstraptheme/stylesheets/admin", :title => "Main", :rel => "stylesheet" %>

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

                      <%= link_to 'Summary', admin_general_index_path %>

                      <%= link_to 'Timeline', admin_timeline_path %>

                      <%= link_to 'Stats', admin_stats_path %>

                      <%= link_to 'Debug', admin_debug_path %>

                      <%= link_to 'Authorities', admin_body_list_path %>

                      <%= link_to 'Requests', admin_request_list_path %>

                      <%= link_to 'Users', admin_user_list_path %>

                      <%= link_to 'Tracks', admin_track_list_path %>

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

        <% if flash[:error] %>

                <%= flash[:error] %>

        <% end %>

        <% if flash[:notice] %>

                <%= flash[:notice] %>

        <% end %>

        <%= yield  %>

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

      <meta http-equiv="content-type" content="text/html;charset=UTF-8" >
      <title><%= site_name %> admin<%= @title ? ":" : "" %> <%=@title%></title>

      <%= javascript_include_tag '/javascripts/jquery-1.7.2.min.js', '/adminbootstraptheme/javascripts/jquery-ui.min.js', '/adminbootstraptheme/javascripts/bootstrap-collapse', '/adminbootstraptheme/javascripts/bootstrap-tab', '/adminbootstraptheme/javascripts/admin' %>
      <%= stylesheet_link_tag 'admin-theme/jquery-ui-1.8.15.custom.css', :rel => 'stylesheet'%>
      <%= stylesheet_link_tag 'admin', :title => "Main", :rel => "stylesheet"  %>
      <%= stylesheet_link_tag "/adminbootstraptheme/stylesheets/admin", :title => "Main", :rel => "stylesheet" %>

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

                      <%= link_to 'Summary', admin_general_index_path %>

                      <%= link_to 'Timeline', admin_timeline_path %>

                      <%= link_to 'Stats', admin_stats_path %>

                      <%= link_to 'Debug', admin_debug_path %>

                      <%= link_to 'Authorities', admin_body_list_path %>

                      <%= link_to 'Requests', admin_request_list_path %>

                      <%= link_to 'Users', admin_user_list_path %>

                      <%= link_to 'Tracks', admin_track_list_path %>

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

        <% if flash[:error] %>

                <%= flash[:error] %>

        <% end %>

        <% if flash[:notice] %>

                <%= flash[:notice] %>

        <% end %>

        <%= yield  %>


instructor spacing for diff

instructor spacing for diff

'<%= @assignment.title %>' AutoGrade results for '<%= @student.display_name %>'

Course: <%= @course.title %> (<%= @course.term.semester%>)

<%= link_to "Back to turn-in for #{@student.display_name}", :controller => '/instructor/turnins', :course => @course, :assignment => @assignment, :student => nil, :id => @student, :action => 'view_student' %>

AutoGrade Results

<% if @display_turnin.id == @current_turnin.id %>

These are the AutoGrade results for the student's most recent turn-in set.

<% else %>

This is NOT the student's final turn-in set.  You most likely do not want to consider this in grading.

<% end %>

Output diff key:

Extra text, not appearing in expected output.

Text missing from the expected output.

Text that is in the same position, but is different form expected output.

	<% if @display_turnin.safe_for_autograde? %>

<%= image_tag 'flag_green' %><%= link_to 'Re-run the I/O checks for this turn-in set.', :course => @course, :assignment => @assignment, :student => @student, :action => 'io_retest' %>

    <% else %>

The AutoGrade I/O tests can not be run, one or more of the Java files contain unsafe statements.   You should manually review the code to determine if it is safe, and if not download the files, remove the unsafe statements and grade manually.

    <% end %>

    <% for check in @assignment.io_checks %>

<%= image_tag 'map' %> I/O Check: '<%= check.name %>'

	         Test Input
	         Expected Output
	         Diff Output (<%= link_to_function( "toggle raw/diff", "Element.toggle('student_check_#{check.id}_diff');Element.toggle('student_check_#{check.id}_raw');" ) %>)

		       <% unless @student_io_check[check.id].nil? %>
		       :: Match Percentage <%= sprintf( "%.2f", @student_io_check[check.id].match_percent ) %>%

		         <% if 100 - @student_io_check[check.id].match_percent < check.tolerance %>
		           <%= image_tag 'accept' %>Pass
		         <% else %>
		           <%= image_tag 'cancel' %>Failure
		         <% end %>

		       <% end %>

			 <%= check.input.to_html %>

			     <%= check.output.to_html %>

			  <div id="student_check_<%=check.id%>_diff">
				 <% if @student_io_check[check.id].nil? %>
				   <%= image_tag 'flag_red' %>No output found for this test.
				 <% else %>
		  		    <%= @student_io_check[check.id].diff_report.non_span_space_convert %>
				 <% end %>

Viewing Diff Output.

			  <div id="student_check_<%=check.id%>_raw" style="display:none;">
				 <% if @student_io_check[check.id].nil? %>
				   <%= image_tag 'flag_red' %>No output found for this test.
				 <% else %>
		  		    <%= @student_io_check[check.id].output.to_html %>
				 <% end %>

Viewing Raw Output.

    <% end %>

'<%= @assignment.title %>' AutoGrade results for '<%= @student.display_name %>'

Course: <%= @course.title %> (<%= @course.term.semester%>)

<%= link_to "Back to turn-in for #{@student.display_name}", :controller => '/instructor/turnins', :course => @course, :assignment => @assignment, :student => nil, :id => @student, :action => 'view_student' %>

AutoGrade Results

<% if @display_turnin.id == @current_turnin.id %>

These are the AutoGrade results for the student's most recent turn-in set.

<% else %>

This is NOT the student's final turn-in set.  You most likely do not want to consider this in grading.

<% end %>

Output diff key:

Extra text, not appearing in expected output.

Text missing from the expected output.

Text that is in the same position, but is different form expected output.

	<% if @display_turnin.safe_for_autograde? %>

<%= image_tag 'flag_green' %><%= link_to 'Re-run the I/O checks for this turn-in set.', :course => @course, :assignment => @assignment, :student => @student, :action => 'io_retest' %>

    <% else %>

The AutoGrade I/O tests can not be run, one or more of the Java files contain unsafe statements.   You should manually review the code to determine if it is safe, and if not download the files, remove the unsafe statements and grade manually.

    <% end %>

    <% for check in @assignment.io_checks %>

<%= image_tag 'map' %> I/O Check: '<%= check.name %>'

	         Test Input
	         Expected Output
	         Diff Output (<%= link_to_function( "toggle raw/diff", "Element.toggle('student_check_#{check.id}_diff');Element.toggle('student_check_#{check.id}_raw');" ) %>)

		       <% unless @student_io_check[check.id].nil? %>
		       :: Match Percentage <%= sprintf( "%.2f", @student_io_check[check.id].match_percent ) %>%

		         <% if 100 - @student_io_check[check.id].match_percent < check.tolerance %>
		           <%= image_tag 'accept' %>Pass
		         <% else %>
		           <%= image_tag 'cancel' %>Failure
		         <% end %>

		       <% end %>

			 <%= check.input.to_html %>

			     <%= check.output.to_html %>

			  <div id="student_check_<%=check.id%>_diff">
				 <% if @student_io_check[check.id].nil? %>
				   <%= image_tag 'flag_red' %>No output found for this test.
				 <% else %>
		  		    <%= @student_io_check[check.id].diff_report.newline_to_break %>
				 <% end %>

Viewing Diff Output.

			  <div id="student_check_<%=check.id%>_raw" style="display:none;">
				 <% if @student_io_check[check.id].nil? %>
				   <%= image_tag 'flag_red' %>No output found for this test.
				 <% else %>
		  		    <%= @student_io_check[check.id].output.to_html %>
				 <% end %>

Viewing Raw Output.

    <% end %>


Fix link to milestone

Fix link to milestone

Signed-off-by: James Urquhart <d092eb11f6d4ecd368c05e395455102ecf3e697d@gmail.com>

<%
  if @logged_user.is_admin?
      @page_actions = [{:title => :add_project, :url=> new_project_path}]
  end
%>
<% if @logged_user.member_of_owner? and !Company.owner.hide_welcome_info %>

<%= :welcome_to_new_account.l %>

<%= :welcome_to_new_account_info.l_with_args(:user => h(@logged_user.display_name), :url => "#{AppConfig.site_url}") %>

   <% new_account_steps(@logged_user).each do |step| %>

<%= step[:del] ? "#{step[:title]}" : "#{step[:title]}" %>

<%= step[:del] ? "#{step[:content]}" : "#{step[:content]}" %>

   <% end %>
  <% if @logged_user.is_admin %>

<%= link_to :hide_welcome_info.l, {:controller => 'administration', :action => 'hide_welcome_info'}, :method => :post %>

  <% end %>

<% end %>

<% if @late_milestones.length > 0 or !@calendar_milestones.empty? %>

<%= :milestones_summary.l_with_args :adjetives => [!@late_milestones.empty? ? :late.l : nil,
                           !@calendar_milestones.empty? ? :upcoming.l : nil].compact.to_sentence %>

<% if @late_milestones.length > 0 %>

<%= :late_milestones.l %>

<% @late_milestones.each do |milestone| %>

<% unless milestone.assigned_to.nil? %><%= h milestone.assigned_to.object_name %>: <% end %><%= :milestone_in.l_with_args(:milestone => link_to(h(milestone.name), milestone_path(:id => milestone.id, :active_project => milestone.project)), :project => link_to(h(milestone.project.name), project_path(:id => milestone.project.id))) %> (<%= :milestone_days_late.l_with_args(:days => milestone.days_late) %>)

<% end %>

<% end %>

<% unless @calendar_milestones.empty? %>

<%= :due_in_next_n_days.l_with_args(:num => 14) %>

  <%= now = @time_now.to_date
      prev_month = now.month
      days_calendar now, now + 14.days, 'dayCal' do |date|
        if date == now
          calendar_block(:today.l, @calendar_milestones["#{date.month}-#{date.day}"], 'today', true)
        else
          if date.month != prev_month
            prev_month = date.month
            calendar_block(date.strftime("%b %d"), @calendar_milestones["#{date.month}-#{date.day}"], 'day')
          else
            calendar_block(date.day, @calendar_milestones["#{date.month}-#{date.day}"], 'day')
          end
        end
      end %>
<% end %>

<% end %>

<% cache "user#{@logged_user.id}_dblog" do %>
<% if @activity_log.length > 0 %>

    <%= :details.l %>
    <%= :project.l %>
	<%= render :partial => 'layouts/application_logs', :collection => @activity_log, :locals => {:show_project_column => true} %>

<% else %>
<%= :no_recent_activities.l %>
<% end %>
<% end %>

<%
  if @logged_user.is_admin?
      @page_actions = [{:title => :add_project, :url=> new_project_path}]
  end
%>
<% if @logged_user.member_of_owner? and !Company.owner.hide_welcome_info %>

<%= :welcome_to_new_account.l %>

<%= :welcome_to_new_account_info.l_with_args(:user => h(@logged_user.display_name), :url => "#{AppConfig.site_url}") %>

   <% new_account_steps(@logged_user).each do |step| %>

<%= step[:del] ? "#{step[:title]}" : "#{step[:title]}" %>

<%= step[:del] ? "#{step[:content]}" : "#{step[:content]}" %>

   <% end %>
  <% if @logged_user.is_admin %>

<%= link_to :hide_welcome_info.l, {:controller => 'administration', :action => 'hide_welcome_info'}, :method => :post %>

  <% end %>

<% end %>

<% if @late_milestones.length > 0 or !@calendar_milestones.empty? %>

<%= :milestones_summary.l_with_args :adjetives => [!@late_milestones.empty? ? :late.l : nil,
                           !@calendar_milestones.empty? ? :upcoming.l : nil].compact.to_sentence %>

<% if @late_milestones.length > 0 %>

<%= :late_milestones.l %>

<% @late_milestones.each do |milestone| %>

<% unless milestone.assigned_to.nil? %><%= h milestone.assigned_to.object_name %>: <% end %><%= :milestone_in.l_with_args(:milestone => link_to(h(milestone.name), milestone_path(:id => milestone.id, :active_project => milestone.project)), :project => link_to(h(milestone.project.name), project_path(:active_project => milestone.project.id))) %> (<%= :milestone_days_late.l_with_args(:days => milestone.days_late) %>)

<% end %>

<% end %>

<% unless @calendar_milestones.empty? %>

<%= :due_in_next_n_days.l_with_args(:num => 14) %>

  <%= now = @time_now.to_date
      prev_month = now.month
      days_calendar now, now + 14.days, 'dayCal' do |date|
        if date == now
          calendar_block(:today.l, @calendar_milestones["#{date.month}-#{date.day}"], 'today', true)
        else
          if date.month != prev_month
            prev_month = date.month
            calendar_block(date.strftime("%b %d"), @calendar_milestones["#{date.month}-#{date.day}"], 'day')
          else
            calendar_block(date.day, @calendar_milestones["#{date.month}-#{date.day}"], 'day')
          end
        end
      end %>
<% end %>

<% end %>

<% cache "user#{@logged_user.id}_dblog" do %>
<% if @activity_log.length > 0 %>

    <%= :details.l %>
    <%= :project.l %>
	<%= render :partial => 'layouts/application_logs', :collection => @activity_log, :locals => {:show_project_column => true} %>

<% else %>
<%= :no_recent_activities.l %>
<% end %>
<% end %>


remove historic message

remove historic message

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

        <% if @profile_photo_javascript %>

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

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

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

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

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

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

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

=end
%>

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

Close

    [ message goes here ]

Close

=end
%>

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

p/SOURCEp

<%= link_to "Make request", frontpage_url %>

<%= 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 "Read blog", blog_url %>

<%= 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 %>" class="controller_<%= controller.controller_name %>">
            <%= yield :layout %>

        Contact WhatDoTheyKnow
        |
        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">

        <% if @profile_photo_javascript %>

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

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

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

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

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

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

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

=end
%>

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

Close

Blimey. It looks like the Internets won – a message from WhatDoTheyKnow

Sorry to interrupt, but we thought you’d like to know that you won!

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

Tomorrow, MPs were going to vote on changing 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.

However, after a tremendous response from you, with over 7,000 members
    on our Facebook group, 4,000 messages sent to MPs, help from

    Stephen Fry, and a helpful
    4th Report of the House of Lords
    Merits of Statutory Instruments Committee,
    it appears that the vote has been cancelled –
    Guardian,
    Times,
    BBC.

As President Obama said in his inauguration speech: “And
    those of us who manage the public’s dollars will be held to account – to
    spend wisely, reform bad habits, and do our business in the light of day –

    because only then can we restore the vital trust between a people and their
    government.”

Read our victory blog post. :-)

Close

=end
%>

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

<%= link_to "Make request", frontpage_url %>

<%= 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 "Read blog", blog_url %>

<%= 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 %>" class="controller_<%= controller.controller_name %>">
            <%= yield :layout %>

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

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

<% end %>


don't link to current version

don't link to current version

<% if @asset.image? -%>
  <%= link_to(image_tag(@asset.public_filename(:preview)), @asset.public_filename) %>
<% end -%>

<%= @page.summary %>

  <%= 'created by'.t %>:
  <%= h @page.created_by.both_names %>

  <%= 'created on'.t %>:
  <%= full_time(@page.created_at) %>

  <%= 'file type'.t %>:
  <%= @asset.content_type %>

  <%= 'size'.t %>:
  <%= friendly_size(@asset.size) %>

<% if @asset.image? -%>

  <%= 'dimensions'.t %>:
  <%= "#{@asset.width}x#{@asset.height}" %>

<% end -%>

<%= link_line(
  link_to("download %s" % @asset.filename, @asset.public_filename),
  link_to_function("upload a new version", "$('upload-new').toggle()"),
  link_to_function("view versions", "$('versions').toggle()")
  ) %>

  <% @asset.versions.each do |version| -%>
  <%= link_to_unless version.version == @asset.version, "#{version.version}: #{version.filename}", version.public_filename %>
  <% end -%>

  <% form_tag page_url(@page, :action => 'update'), :multipart => true do -%>
    <%= file_field_tag 'asset' %>
    <%= submit_tag 'upload' %>
  <% end %>

<% if @asset.image? -%>
  <%= link_to(image_tag(@asset.public_filename(:preview)), @asset.public_filename) %>
<% end -%>

<%= @page.summary %>

  <%= 'created by'.t %>:
  <%= h @page.created_by.both_names %>

  <%= 'created on'.t %>:
  <%= full_time(@page.created_at) %>

  <%= 'file type'.t %>:
  <%= @asset.content_type %>

  <%= 'size'.t %>:
  <%= friendly_size(@asset.size) %>

<% if @asset.image? -%>

  <%= 'dimensions'.t %>:
  <%= "#{@asset.width}x#{@asset.height}" %>

<% end -%>

<%= link_line(
  link_to("download %s" % @asset.filename, @asset.public_filename),
  link_to_function("upload a new version", "$('upload-new').toggle()"),
  link_to_function("view versions", "$('versions').toggle()")
  ) %>

  <% @asset.versions.each do |version| -%>
  <%= link_to "#{version.version}: #{version.filename}", version.public_filename %>
  <% end -%>

  <% form_tag page_url(@page, :action => 'update'), :multipart => true do -%>
    <%= file_field_tag 'asset' %>
    <%= submit_tag 'upload' %>
  <% end %>


Small change for #197

Small change for #197

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

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

		<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
		<title>Typo Administration:  <%= controller.controller_name %></title>
		<meta http-equiv="imagetoolbar" content="no" />
		<%= stylesheet_link_tag "administration.css" %>
		<%= javascript_include_tag "prototype", "effects", "dragdrop", "controls", "typo" %>

	    <%= current_user_notice rescue nil %> |
	    <%= link_to 'Your blog »', :controller => "/" %>

<%= link_to "Typo admin - #{config_value('blog_name')}", :controller => "/admin/" %>

  	    <%= tab "General", :controller=>"/admin/general", :action => 'index' %>
  	    <%= tab "Articles", :controller=>"/admin/content", :action => 'index' %>
  	    <%= tab "Pages", :controller=>"/admin/pages", :action => 'index' %>
  	    <%= tab "Categories", :controller=>"/admin/categories", :action => 'index' %>
  	    <%= tab "Blacklist", :controller=>"/admin/blacklist", :action => 'index' %>
  	    <%= tab "Sidebar", :controller=>"/admin/sidebar", :action => 'index' %>
  	    <%= tab "Users", :controller=>"/admin/users", :action => 'index' %>

  	  <%= render_flash rescue nil %>

<%= @page_heading %>

  	    <% if not first_render =~ /general|login|signup|logout|sidebar/ %>

Things you can do

	        <%= @content_for_tasks %>
          <%= task_overview unless first_render =~ /\/list$/ %>

       <% end %>
       <%= @content_for_layout %>


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

立替費用精算依頼書

      申請日付
      所属
      申請者
      印
      上長承認	印

      日付
      目的・理由・内容等
      領収
連番
      金額

    <% sum = 0 %>
    <% payed_sum = 0 %>
    <% for entry in @settlement.target_entries %>
      <% if entry.amount < 0 %>
        <% payed_sum += (entry.amount * (-1)) %>
      <% else %>
        <% sum += entry.amount%>

        <%= format_date entry.deal.date %>
        <%= h entry.deal.summary %>

        ￥<%= number_with_delimiter(entry.amount) %>

      <% end %>
    <% end %>

      小計
      ￥<%= number_with_delimiter sum %>

      既仮払金
      ￥<%= number_with_delimiter payed_sum %>

      合計
      ￥<%= number_with_delimiter(sum - payed_sum) %>

  <%= link_to '閉じる', {}, :onClick => "window.close();" %>

立替費用精算依頼書

      申請日付
      所属
      申請者
      印
      上長承認	印

      日付
      目的・理由・内容等
      領収
連番
      金額

    <% sum = 0 %>
    <% payed_sum = 0 %>
    <% for entry in @settlement.target_entries %>
      <% if entry.amount > 0 %>
        <% payed_sum += entry.amount %>
      <% else %>
        <% sum += (entry.amount * (-1))%>

        <%= format_date entry.deal.date %>
        <%= h entry.deal.summary %>

        ￥<%= number_with_delimiter(entry.amount * (-1)) %>

      <% end %>
    <% end %>

      小計
      ￥<%= number_with_delimiter sum %>

      既仮払金
      ￥<%= number_with_delimiter payed_sum %>

      合計
      ￥<%= number_with_delimiter(sum - payed_sum) %>

  <%= link_to '閉じる', {}, :onClick => "window.close();" %>


Moved fees to right side of screen

Moved fees to right side of screen

<%= event.friendly_class_name %>: <%= event.name %>

					Name:
					<%= text_field 'event', 'name', :style => 'width: 100%;' %>

				<%- if event.is_a?(SingleDayEvent) and event.parent -%>

					Parent:

						<%= link_to event.parent.name,
							{:action => 'show', :id =>  event.parent.to_param},
							:style => 'color: red' %> (<%= event.parent.friendly_class_name %>)

				<%- end -%>

					Date:

						<%- if @event.is_a?(SingleDayEvent) -%>
						<%= text_field 'event', 'date' %>
						<%- else -%>
							<%= event.start_date.strftime('%A, %B %d, %Y') -%>
							<%- if event.start_date != event.end_date -%>
								  to

								<%= event.end_date.strftime('%A, %B %d, %Y') -%>
							<%- end -%>
						<%- end -%>

					<%= check_box 'event', 'cancelled' %> Cancelled

					Discipline:
					<%= select 'event', 'discipline', Discipline.find_all_names %>

					City:
					<%= text_field 'event', 'city' %>

					State:
					<%= text_field 'event', 'state' %>

								Promoter

								Name:
								<%= select("event",
											   "promoter_id",
											   Promoter.find(:all).sort_by{|p| p.name_or_contact_info}.collect {|p| [ p.name_or_contact_info, p.id ] },
											   { :include_blank => true}) %>
								    <%= observe_field(
											'event_promoter_id',
											:url => {:action => 'promoter_changed', :id => @event.id}, :with => 'promoter_id',
											:before => update_page {|page|
																		page.visual_effect(:fade, 'promoter_email', :duration => 0.5)
																		page.visual_effect(:fade, 'promoter_phone', :duration => 0.5)
																		page.visual_effect(:fade, 'edit_promoter_link', :duration => 0.5)
																	},
											:success => evaluate_remote_response
									) %>

								Email:
								<%= event.promoter_email %>

								Phone:
								<%= event.promoter_phone %>

									<%= link_to(
												'Edit',
												:controller => 'promoters',
												:action => 'show',
												:id => @event.promoter.id,
												:event_id => @event.id) if @event.promoter %>

									 <%= link_to(
												'New',
												:controller => 'promoters',
												:action => 'new',
												:event_id => @event.id) %>

								Sanctioned by:
								<%= select 'event', 'sanctioned_by', SANCTIONING_ORGANIZATIONS %>

					Notes:
					<%= text_field 'event', 'notes', :style => 'width: 100%;' %>

					Flyer URL:
					<%= text_field 'event', 'flyer', :style => 'width: 100%;' %>

					<%= check_box 'event', 'flyer_approved' %> Flyer Approved

					Pre-Event Fees Paid:
					<%= text_field 'event', 'pre_event_fees', :size => 9 %>

					Post-Event Fees Paid:
					<%= text_field 'event', 'post_event_fees', :size => 9 %>

					Flyer Ad Paid:
					<%= text_field 'event', 'flyer_ad_fee', :size => 9 %>

		Updated: <%= @event.updated_at.to_formatted_s(:long) unless @event.updated_at.nil? %>

			<%= submit_tag "Delete" %>
			<%= submit_tag "Save" %>


Dashboard sidebar edit

Dashboard sidebar edit

<!DOCTYPE html>

    <meta charset="utf-8">
    <link rel="alternate" type="application/rss+xml" title="EMRL Work Timeline Feed" href="http://projects.emrl.com/feeds/rss/da222717fb7b4dfc61f3ed49e3f62f4d">
    <link href="http://fonts.googleapis.com/css?family=Arimo:400,700,400italic,700italic" rel="stylesheet">
    <link href="//netdna.bootstrapcdn.com/font-awesome/3.2.1/css/font-awesome.css" rel="stylesheet">
    <link rel="alternate" type="application/rss+xml" title="RSS" href="http://projects.emrl.com/feeds/rss/da222717fb7b4dfc61f3ed49e3f62f4d" />

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

    <%= javascript_include_tag "flotr" %><% end %><%= yield :tinymce_init %>

    <%= stylesheet_link_tag "print", { :media => "print" } %><%= auto_discovery_link_tag(:rss, {:controller => 'feeds', :action => 'rss', :id => current_user.uuid }) %>
    <title>
      <%= controller.controller_name + " / " + controller.action_name %>
    </title>
      <% @internal = Customer.find(:first, :conditions => ["company_id = ? AND (name = 'Internal' or name = ?)", current_user.company_id, current_user.company.name ]) %>

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

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

                          <%= render :partial => "layouts/tabmenu" %>

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

                        [<%= tz.utc_to_local(news.created_at).strftime("#{current_user.time_format} #{current_user.date_format}") %>]

                        <%= news.body %>

                      <%= link_to_remote "#{_('')}", :url => { :controller => 'users', :action => 'update_seen_news', :id => news.id }, :success => visual_effect(:fade, "news", :duration => 0.5) %>

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

                      <%= flash['notice'] %>

                        <%= @content_for_layout %>

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

                                <%= h(current_user.name) %>

                                 •

                                  <%= "#{online_users} #{_('Online')}" %>

                                  <%= "" %>

                                <% if total_today > 0 %>

                                <%=_ 'You have worked'%> <%= distance_of_time_in_words(total_today.minutes) %>
                                <%=_ 'today.'%>
                                <% end %>

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

                                    <div class="tooltip"
                                    title="<%= _'Text entered here will be saved to you work log.automatically to your current task.'%>">
                                      <%= _'Work Log' %>

                                    <form method="post"
                                    onsubmit="return false;"
                                    id="worklog_form">
                                      <textarea name="worklog[body]"
                                      id="worklog_body"
                                      style="resize:vertical; font-size:11px; margin:0px; border:none; width:97%;" rows="7" placeholder="Text entered here will be saved automatically to your current task."><%= @current_sheet.body if @current_sheet%></textarea>
                                    </form>

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

                          <%=_ 'Task Views' %>

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

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

                      <% project_ids = current_project_ids %><% client_ids = current_projects.collect(&:customer_id).uniq.join(',')
                         client_ids = "0" if client_ids.nil? || client_ids.empty?
                         views = View.find(:all, :conditions => ["company_id = ? AND (user_id = ? or shared = 1) AND (filter_customer_id = 0 OR filter_customer_id IS NULL OR filter_customer_id IN (#{client_ids})) AND (filter_project_id = 0 OR filter_project_id IS NULL OR filter_project_id IN (#{project_ids}))", current_user.company_id, current_user.id], :order => "shared, name")
                         for view in views %>

                          <%= link_to view.name, :controller => 'views', :action => 'select', :id => view %>
                          <%= link_to _(''), :controller => 'views', :action => 'edit', :id => view if(view.user_id == current_user.id || current_user.admin?)%>

<% end %>

                        <td align="left" class="page_header_side tooltip" width="100%" colspan="2" title="<%= _'Quickly access recently edited Wikis'%>">

                            <%=_ 'Recent Wikis'%>

           						<% wikis = WikiPage.find(:all, :limit => 6, :order => "updated_at DESC") %>
				          		<% wiki_i = 0 %>
			           			<% for wiki in wikis %>

                        <td class="views_item" style="white-space:nowrap;<%= "padding-top:0.2em;" if (wiki_i == 0) %>">

									         <%= wiki.to_url_truncate(28) %>

				        				<td<%= " style=\"color: padding-top:0.2em\"" if (wiki_i == 0) %>>
        									  <%= wiki.updated_at.strftime("%m/%d") %>

                      <% wiki_i += 1 %>
          						<% end %>

              <td align="left" class="page_header_side tooltip" width="100%" colspan="2" title="<%= _'Commonly Accessed Information'%>">

                  <%=_ 'Blog'%>

  <% if current_user.company.show_messaging %>

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

          <% end %><% end %>

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

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

      <% end %>
      <%= periodically_call_remote(:url => { :controller => 'tasks', :action => 'update_sheet_info' }, :frequency => 90 ) -%>
      <%= flash_plugin(session[:channels]) %>

      <%#= query_review_output %>


removed table border - it was ugly

removed table border - it was ugly

<% if bat.weights.length == 0 %>
No weights.
<% else %>

Weight History:

  Date
  Weight
  Fed
  Notes
  Who
  <% for weight in bat.weights %>

  <%= nice_date weight.date %>
  <%= weight.weight %>g
  <%= weight.after_eating == 'y' ? 'After Eating' : 'Before Eating' %>
  <%= weight.note %>
  <%= weight.user.initials %>

  <% end %>

<%= link_to 'Graph Weights', :controller => 'bats', :action => :graph_weights, :id => bat %>

<% end %>


[Mezuro] Added span to show range comment on mouse hover.

<%= _('Metric results for: ') + @module_label %>

      Metric
      Value
      Weight
      Threshold

    <% @module_result.metric_results.each do |metric_result|  %>
      <% range = metric_result.range %>
      <% if !range.nil? %>

          <a href="#" show-metric-history="<%= MezuroPlugin::Helpers::ContentViewerHelper.format_name(metric_result) %>" data-module-name="<%= @module.name %>"><%= metric_result.metric.name %>
          <%= MezuroPlugin::Helpers::ContentViewerHelper.format_grade(metric_result.value) %>
          <%= metric_result.weight %>
          <td style="background-color: #<%= range.color[2..-1] %>">
            <span title="<%= range.comments %>" >
              <%= range.label %>

        <tr class="<%= MezuroPlugin::Helpers::ContentViewerHelper.format_name(metric_result) %>" style="display: none;">

            <div id='historical-<%= MezuroPlugin::Helpers::ContentViewerHelper.format_name(metric_result) %>'>

            <%= range.comments.nil? ? '' : range.comments %>

      <% end %>
    <% end %>

        <a href="#" show-grade-history="<%= @module_result.module.name %>" data-module-name="<%= @module.name%>" >

            <%= _('Grade:') %>
            <%= "%.02f" % @module_result.grade %>

<%= _('Metric results for: ') + @module_label %>

      Metric
      Value
      Weight
      Threshold

    <% @module_result.metric_results.each do |metric_result|  %>
      <% range = metric_result.range %>
      <% if !range.nil? %>

          <a href="#" show-metric-history="<%= MezuroPlugin::Helpers::ContentViewerHelper.format_name(metric_result) %>" data-module-name="<%= @module.name %>"><%= metric_result.metric.name %>
          <%= MezuroPlugin::Helpers::ContentViewerHelper.format_grade(metric_result.value) %>
          <%= metric_result.weight %>
          <td style="background-color: #<%= range.color[2..-1] %>"><%= range.label %>

        <tr class="<%= MezuroPlugin::Helpers::ContentViewerHelper.format_name(metric_result) %>" style="display: none;">

            <div id='historical-<%= MezuroPlugin::Helpers::ContentViewerHelper.format_name(metric_result) %>'>

            <%= range.comments.nil? ? '' : range.comments %>

      <% end %>
    <% end %>

        <a href="#" show-grade-history="<%= @module_result.module.name %>" data-module-name="<%= @module.name%>" >

            <%= _('Grade:') %>
            <%= "%.02f" % @module_result.grade %>


Adding 'Products' to menu in the noosfero theme