ActionItem879: Enterprises cannot create articles

Only if the CMS is disabled

<%
  # AddThis Button
  if block_given? and File.exists?( RAILS_ROOT + '/config/web2.0.yml')
    opts = YAML.load_file( RAILS_ROOT + '/config/web2.0.yml' )
    if opts['addthis']
      opts = opts['addthis']
%>

<a href="http://www.addthis.com/bookmark.php" id="bt_addThis" target="_blank" onmouseover="return addthis_open(this, '', '[URL]', '<%= escape_javascript( @environment.name()+' :: '+@page.title ) %>')" onmouseout="addthis_close()" onclick="return addthis_sendto()">

<% end; end %>

  <%= article_title(@page, :no_link => true) %>

  <% if logged_in?  && current_user.person.has_permission?('post_content', profile) %>

      <%= link_to content_tag( 'span', label_for_edit_article(@page) ),
          { :controller => 'cms', :action => 'edit', :id => @page },
          :class => 'button with-text icon-edit' %>
      <% if !(profile.kind_of?(Enterprise) && environment.enabled?('disable_cms')) %>
        <%= link_to content_tag( 'span', _('Delete') ),
            { :controller => 'cms', :action => 'destroy', :id => @page },
            :class => 'button with-text icon-delete' %>
        <% if profile.kind_of?(Person) %>
          <%= link_to content_tag( 'span', _('Spread this') ),
              { :controller => 'cms', :action => 'publish', :id => @page },
              :class => 'button with-text icon-spread' %>
        <% end %>
        <%= lightbox_button(:new, label_for_new_article(@page), :controller => 'cms', :action => 'new', :parent_id => (@page.folder? ? @page : (@page.parent.nil? ? nil : @page.parent))) %>
      <% end %>

  <% end %>

<% if !@page.tags.empty? %>

    <%= _("This article's tags:") %>
    <%= @page.tags.map { |t| link_to(t, :controller => 'profile', :profile => @profile.identifier, :action => 'tag', :id => t.name ) }.join("\n") %>

<% end %>

<% if @page.parent && !@page.parent.path.blank? %>

  <%= link_to_document(@page.parent, _('Up')) %>

<% end %>

<% if profile.enterprise? and !profile.enabled? and !profile.blocks.select {|b| b.class == DisabledEnterpriseMessageBlock}.any? %>

    <%= environment.message_for_disabled_enterprise %>

<% end %>

  <%= article_to_html(@page) %>

<% if ! @page.categories.empty? %>

<%= _('Categories') %>

    <%= @page.categories.map {|item| link_to_category(item, false) }.join(", ") %>

<% end %>

  <% if @page.accept_comments? %>
  <h3 <%= 'class="no-comments-yet"' if @comments.size == 0 %>>
    <%= number_of_comments(@page) %>

  <%= render :partial => 'comment', :collection => @comments %>
  <%= render :partial => 'comment_form' %>
  <% end %>

<%
  # AddThis Button
  if block_given? and File.exists?( RAILS_ROOT + '/config/web2.0.yml')
    opts = YAML.load_file( RAILS_ROOT + '/config/web2.0.yml' )
    if opts['addthis']
      opts = opts['addthis']
%>

<a href="http://www.addthis.com/bookmark.php" id="bt_addThis" target="_blank" onmouseover="return addthis_open(this, '', '[URL]', '<%= escape_javascript( @environment.name()+' :: '+@page.title ) %>')" onmouseout="addthis_close()" onclick="return addthis_sendto()">

<% end; end %>

  <%= article_title(@page, :no_link => true) %>

  <% if logged_in?  && current_user.person.has_permission?('post_content', profile) %>

      <%= link_to content_tag( 'span', label_for_edit_article(@page) ),
          { :controller => 'cms', :action => 'edit', :id => @page },
          :class => 'button with-text icon-edit' %>
      <% if !profile.kind_of?(Enterprise) %>
        <%= link_to content_tag( 'span', _('Delete') ),
            { :controller => 'cms', :action => 'destroy', :id => @page },
            :class => 'button with-text icon-delete' %>
        <% if profile.kind_of?(Person) %>
          <%= link_to content_tag( 'span', _('Spread this') ),
              { :controller => 'cms', :action => 'publish', :id => @page },
              :class => 'button with-text icon-spread' %>
        <% end %>
        <%= lightbox_button(:new, label_for_new_article(@page), :controller => 'cms', :action => 'new', :parent_id => (@page.folder? ? @page : (@page.parent.nil? ? nil : @page.parent))) %>
      <% end %>

  <% end %>

<% if !@page.tags.empty? %>

    <%= _("This article's tags:") %>
    <%= @page.tags.map { |t| link_to(t, :controller => 'profile', :profile => @profile.identifier, :action => 'tag', :id => t.name ) }.join("\n") %>

<% end %>

<% if @page.parent && !@page.parent.path.blank? %>

  <%= link_to_document(@page.parent, _('Up')) %>

<% end %>

<% if profile.enterprise? and !profile.enabled? and !profile.blocks.select {|b| b.class == DisabledEnterpriseMessageBlock}.any? %>

    <%= environment.message_for_disabled_enterprise %>

<% end %>

  <%= article_to_html(@page) %>

<% if ! @page.categories.empty? %>

<%= _('Categories') %>

    <%= @page.categories.map {|item| link_to_category(item, false) }.join(", ") %>

<% end %>

  <% if @page.accept_comments? %>
  <h3 <%= 'class="no-comments-yet"' if @comments.size == 0 %>>
    <%= number_of_comments(@page) %>

  <%= render :partial => 'comment', :collection => @comments %>
  <%= render :partial => 'comment_form' %>
  <% end %>


ActionItem70: adding a link to the home page

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

  <%= link_to Noosfero::PROJECT, :controller => 'home' %>

  <% @environment.display_categories.each do |item| %>
    <li id='category<%= item.display_color %>' <%= 'class="active"' if (@category && (@category.top_ancestor == item)) %> >
      <%= (@category && (@category.top_ancestor == item)) ? @category.full_name : item.name %>

        <% item.children.each do |child| %>

<%= link_to(content_tag('span', child.name), :controller => 'category', :action => 'view', :path => child.explode_path) %>

        <% end %>

  <% end %>

  <% @environment.display_categories.each do |item| %>
    <li id='category<%= item.display_color %>' <%= 'class="active"' if (@category && (@category.top_ancestor == item)) %> >
      <%= item.name %>

        <% item.children.each do |child| %>

<%= link_to(content_tag('span', child.name), :controller => 'category', :action => 'view', :path => child.explode_path) %>

        <% end %>

  <% end %>


deleted obsolete playlist template

deleted obsolete playlist template

[playlist]
NumberOfEntries=1
File1=<%= url_for :controller => 'file', :action => 'stream', :id => @file, :only_path => false %>
Version=2


Move the title to the correct location.

Move the title to the correct location.

As I just copied and pasted the link_to_revision method from the
application helper, it was still looking for 'text' to be the actual
caption of the link.

Instead, give it exactly what text we want to use.

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

<% link_to("Return to diff overview", {:controller => 'repositories', :action => 'revision', :id => project, :rev => @rev}, :title => "Return to overview") if params[:rev] %>
<% link_to("Return to diff overview", {:controller => 'repositories', :action => 'revision', :id => project, :rev => @rev_to}, :title => "Return to overview") if params[:rev_to] %>

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

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

<% end %>

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

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

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

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

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

<% link_to(text, {:controller => 'repositories', :action => 'revision', :id => project, :rev => @rev}, :caption => "Return to overview") if params[:rev] %>
<% link_to(text, {:controller => 'repositories', :action => 'revision', :id => project, :rev => @rev_to}, :caption => "Return to overview") if params[:rev_to] %>

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

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

<% end %>

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

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

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

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


Translate due headers for Due Tasks widget

<% 0.upto(4) do |i| %>
  <% unless @tasks[i].nil? %>

<%= _(schedule_header(i)) %>

    <% @tasks[i].each_with_index do |t,j| %>
      <% if j == @widget.number %>
        <div id="<%=@widget.dom_id%>_<%=i%>_toggle" style="display:none;">
      <% end %>
      <%= render :partial => "tasks/task_row", :locals => {:task => t} %>
    <% end %>

    <% if @tasks[i] && @tasks[i].size > @widget.number %>

      <div id="<%=@widget.dom_id%>_<%=i%>_link" style="margin-left:8px;text-align:right;"><a href="#" onclick="Element.show('<%=@widget.dom_id%>_<%=i%>_toggle');Element.hide('<%=@widget.dom_id%>_<%=i%>_link');return false;" ><%= _('%d more', @tasks[i].size - @widget.number)%>

    <% end %>

  <% end %>
<% end %>

<% 0.upto(4) do |i| %>
  <% unless @tasks[i].nil? %>

<%= schedule_header(i) %>

    <% @tasks[i].each_with_index do |t,j| %>
      <% if j == @widget.number %>
        <div id="<%=@widget.dom_id%>_<%=i%>_toggle" style="display:none;">
      <% end %>
      <%= render :partial => "tasks/task_row", :locals => {:task => t} %>
    <% end %>

    <% if @tasks[i] && @tasks[i].size > @widget.number %>

      <div id="<%=@widget.dom_id%>_<%=i%>_link" style="margin-left:8px;text-align:right;"><a href="#" onclick="Element.show('<%=@widget.dom_id%>_<%=i%>_toggle');Element.hide('<%=@widget.dom_id%>_<%=i%>_link');return false;" ><%= _('%d more', @tasks[i].size - @widget.number)%>

    <% end %>

  <% end %>
<% end %>


fixes #1783 - small steps - just show country for now

<% # this partial should be rendered with a local variable, such as
   # render :partial => 'profile/show', :locals => {:profile => @user.profiles.public}
   # in case it is not,
   #profile ||= Profile.new -%>

  <%=
    [ content_tag(:strong, [h(profile.first_name), h(profile.middle_name), h(profile.last_name)].join(' ')),
      h(profile.organization),
      h(profile.place)
    ].select{|i|i.any?}.join('
')
  %>
  <%= member_since_line(profile) if profile.user %>
  <% unless profile.phone_numbers.empty? -%>
    <% profile.phone_numbers.each do |phone_number| -%>
      <div class='small_icon <%=phone_number.icon%>_16'>
        <%= I18n.t(:phone_number)%> (<%= h(I18n.t(phone_number.phone_number_type.to_sym)) %>): <%= h(phone_number.phone_number) %>

    <% end -%>
  <% end -%>
  <% unless profile.email_addresses.empty? -%>
    <% profile.email_addresses.each do |email_address| -%>
      <div class='small_icon <%=email_address.icon%>_16'>
        <%= I18n.t(:email_address)%> (<%= h(I18n.t(email_address.email_type.to_sym)) %>): <%= h(email_address.email_address) %>

    <% end -%>
  <% end -%>
  <% if profile.country_id -%>

    <%= I18n.t(:location)%>:
    <%= h(profile.geo_location.geo_country.name) %>

  <% end -%>
  <% unless profile.im_addresses.empty? -%>
    <% profile.im_addresses.each do |im| -%>
      <div class='small_icon <%=im.icon -%>_16'>
        <%= I18n.t(:instant_messaging) -%> (<%= h(im.im_type) %>):
        <%= im.im_address %>

    <% end -%>
  <% end -%>
  <% unless profile.websites.empty? -%>
    <% profile.websites.each do |website| -%>
      <div class='small_icon <%=website.icon -%>_16'>
        <%= I18n.t(:website) -%>:
        <a target="_blank" href="<%= website.site_url %>">
          <%= h(website.site_title.length > 0 ? website.site_title : website.site_url) %>

    <% end -%>
  <% end -%>
  <% unless profile.notes.empty? -%>
    <% profile.notes.each do |note| -%>
      <div class='small_icon <%=note.icon -%>_16'>
        <%= note.note_type ? I18n.t(note.note_type.to_sym) : I18n.t(:about_me) -%>:
        <%=h note.body %>

    <% end -%>
  <% end -%>

<% # this partial should be rendered with a local variable, such as
   # render :partial => 'profile/show', :locals => {:profile => @user.profiles.public}
   # in case it is not,
   #profile ||= Profile.new -%>

  <%=
    [ content_tag(:strong, [h(profile.first_name), h(profile.middle_name), h(profile.last_name)].join(' ')),
      h(profile.organization),
      h(profile.place)
    ].select{|i|i.any?}.join('
')
  %>
  <%= member_since_line(profile) if profile.user %>
  <% unless profile.phone_numbers.empty? -%>
    <% profile.phone_numbers.each do |phone_number| -%>
      <div class='small_icon <%=phone_number.icon%>_16'>
        <%= I18n.t(:phone_number)%> (<%= h(I18n.t(phone_number.phone_number_type.to_sym)) %>): <%= h(phone_number.phone_number) %>

    <% end -%>
  <% end -%>
  <% unless profile.email_addresses.empty? -%>
    <% profile.email_addresses.each do |email_address| -%>
      <div class='small_icon <%=email_address.icon%>_16'>
        <%= I18n.t(:email_address)%> (<%= h(I18n.t(email_address.email_type.to_sym)) %>): <%= h(email_address.email_address) %>

    <% end -%>
  <% end -%>
  <% profile.locations.each do |location| -%>
    <div class='small_icon <%=location.icon%>_16'>
    <%= I18n.t(:location)%>:
    <%= h(location.country_name) %>

  <% end -%>
  <% unless profile.im_addresses.empty? -%>
    <% profile.im_addresses.each do |im| -%>
      <div class='small_icon <%=im.icon -%>_16'>
        <%= I18n.t(:instant_messaging) -%> (<%= h(im.im_type) %>):
        <%= im.im_address %>

    <% end -%>
  <% end -%>
  <% unless profile.websites.empty? -%>
    <% profile.websites.each do |website| -%>
      <div class='small_icon <%=website.icon -%>_16'>
        <%= I18n.t(:website) -%>:
        <a target="_blank" href="<%= website.site_url %>">
          <%= h(website.site_title.length > 0 ? website.site_title : website.site_url) %>

    <% end -%>
  <% end -%>
  <% unless profile.notes.empty? -%>
    <% profile.notes.each do |note| -%>
      <div class='small_icon <%=note.icon -%>_16'>
        <%= note.note_type ? I18n.t(note.note_type.to_sym) : I18n.t(:about_me) -%>:
        <%=h note.body %>

    <% end -%>
  <% end -%>


ActionItem1041: using name instead of identifier

<% if profile.enterprise? && !profile.enabled? && !profile.blocks.select {|b| b.class == DisabledEnterpriseMessageBlock}.any? %>

    <%= environment.message_for_disabled_enterprise %>

<% end %>

<% cache_timeout(profile.identifier + '-profile', 30.minutes.from_now) do %>

<%= _("%s's profile") % profile.name %>

  <%= render :partial => partial_for_class(profile.class) %>

      <%= _('Content') %>

      <%= _('Content published:') %>

      <%= link_to _('Site map'), :controller => 'profile', :action => 'sitemap' %>

      <%= _('Tags:') %>

      <%= tag_cloud @tags, :id, { :action => 'tag' }, :max_size => 18, :min_size => 10%>

<% end %>

<% if profile.enterprise? && !profile.enabled? && !profile.blocks.select {|b| b.class == DisabledEnterpriseMessageBlock}.any? %>

    <%= environment.message_for_disabled_enterprise %>

<% end %>

<% cache_timeout(profile.identifier + '-profile', 30.minutes.from_now) do %>

<%= _("%s's profile") % profile.identifier %>

  <%= render :partial => partial_for_class(profile.class) %>

      <%= _('Content') %>

      <%= _('Content published:') %>

      <%= link_to _('Site map'), :controller => 'profile', :action => 'sitemap' %>

      <%= _('Tags:') %>

      <%= tag_cloud @tags, :id, { :action => 'tag' }, :max_size => 18, :min_size => 10%>

<% end %>


Wrap string in translation lookup

Wrap string in translation lookup

      <%=_ 'Search Results' %>

  <form action="<%=request.url%>" method="post">
    <input type="checkbox" name="completed_projects" value="1" <%= "checked=\"checked\"" if session[:completed_projects].to_i == 1%> onclick="javascript:document.forms[1].submit();"/><%= _'Include completed projects' %>
  </form>

<% if @tasks.size > 0 %>

      <%=_ 'Tasks' %>

<% for task in @tasks %>
<%= render :partial => 'tasks/task_row', :locals => {:task => task } %>
<% end %>

<% end %>

<% if @logs.size > 0 %>

      <%=_ 'Activities' %>

<% for log in @logs %>
<%= render :partial => 'search_log', :locals => {:log => log } %>
<% end %>

<% end %>

<% if @posts.size > 0 %>

    <%=_ 'Forum Posts' %>

<% for @post in @posts %>
<%= render :partial => 'search_post' %>
<% end %>

<% end %>

<% if @wiki_pages.size > 0 %>

    <%=_ 'Wiki' %>

<% for @page in @wiki_pages %>
<%= render :partial => 'search_wiki' %>
<% end %>

<% end %>

<% if @shouts.size > 0 %>

    <%=_ 'Chat' %>

<% for @shout in @shouts %>
<%= render :partial => 'search_shout', :locals => {:last => nil } %>
<% end %>

<% end %>

      <%=_ 'Search Results' %>

  <form action="<%=request.url%>" method="post">
    <input type="checkbox" name="completed_projects" value="1" <%= "checked=\"checked\"" if session[:completed_projects].to_i == 1%> onclick="javascript:document.forms[1].submit();"/> Include completed projects
  </form>

<% if @tasks.size > 0 %>

      <%=_ 'Tasks' %>

<% for task in @tasks %>
<%= render :partial => 'tasks/task_row', :locals => {:task => task } %>
<% end %>

<% end %>

<% if @logs.size > 0 %>

      <%=_ 'Activities' %>

<% for log in @logs %>
<%= render :partial => 'search_log', :locals => {:log => log } %>
<% end %>

<% end %>

<% if @posts.size > 0 %>

    <%=_ 'Forum Posts' %>

<% for @post in @posts %>
<%= render :partial => 'search_post' %>
<% end %>

<% end %>

<% if @wiki_pages.size > 0 %>

    <%=_ 'Wiki' %>

<% for @page in @wiki_pages %>
<%= render :partial => 'search_wiki' %>
<% end %>

<% end %>

<% if @shouts.size > 0 %>

    <%=_ 'Chat' %>

<% for @shout in @shouts %>
<%= render :partial => 'search_shout', :locals => {:last => nil } %>
<% end %>

<% end %>


Remove view_cache to keep up with changes on develop

<%# TODO: Cache for 5 minutes %>

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

      <%= render :partial => "frontpage_new_request" %>

      <%= render :partial => "frontpage_search_box" %>

      <%= render :partial => "frontpage_bodies_list" %>
      <%= render :partial => "frontpage_requests_list" %>

Supporting Organisations

      <% link_to "http://www.openforum.com.au/" do %>
        <%= image_tag "/alavetelitheme/images/openforum_logo.png", :id => "openforum_logo", :size => "66x45" %>
      <% end %>
      <% link_to "http://au.okfn.org/" do %>
        <%= image_tag "/alavetelitheme/images/okfa_logo.png", :id => "okfa_logo", :size => "188x45" %>
      <% end %>
      <% link_to "http://cpd.org.au/" do %>
        <%= image_tag "/alavetelitheme/images/cpd_logo.png", :id => "cpd_logo", :size => "110x45" %>
      <% end %>
      <% link_to "http://www.getup.org.au/" do %>
        <%= image_tag "/alavetelitheme/images/getup_logo.png", :id => "getup_logo", :size => "86x40" %>
      <% end %>
      <% link_to "http://www.crikey.com.au/" do %>
        <%= image_tag "/alavetelitheme/images/crikey_logo.png", :id => "crikey_logo", :size => "101x35" %>
      <% end %>
      <% link_to "http://newmatilda.com/" do %>
        <%= image_tag "/alavetelitheme/images/newmatilda_logo.png", :id => "newmatilda_logo", :size => "199x28" %>
      <% end %>
      <% link_to "https://www.efa.org.au/" do %>
        <%= image_tag "/alavetelitheme/images/efa_logo.png", :id => "efa_logo", :size => "174x45" %>
      <% end %>
      <% link_to "http://transparency.org.au/" do %>
        <%= image_tag "/alavetelitheme/images/tia_logo.png", :id => "tia_logo", :size => "143x45" %>
      <% end %>
      <% link_to "http://www.mysociety.org/" do %>
        <%= image_tag "/alavetelitheme/images/mysociety_logo.png", :id => "mysociety_logo", :size => "120x25" %>
      <% end %>
      <% link_to "http://opennorth.ca/" do %>
        <%= image_tag "/alavetelitheme/images/opennorth_logo.png", :id => "opennorth_logo", :size => "151x50" %>
      <% end %>
      <% link_to "http://open.org.nz" do %>
        <%= image_tag "/alavetelitheme/images/opennz_logo.png", :id => "opennz_logo", :size => "203x50" %>
      <% end %>
      <% link_to "http://www.ausgoal.gov.au/" do %>
        <%= image_tag "/alavetelitheme/images/ausgoal_logo.png", :id => "ausgoal_logo", :size => "139x35" %>
      <% end %>
      <% link_to "http://www.newdemocracy.com.au/" do %>
        <%= image_tag "/alavetelitheme/images/newdemocracy_logo.png", :id => "newdemocracy_logo", :size => "200x19" %>
      <% end %>

      <%= link_to "Find out more...", help_credits_path(:anchor => "supporting") %>

<% view_cache :ttl => 5.minutes.to_i, :tag => I18n.locale do %>

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

      <%= render :partial => "frontpage_new_request" %>

      <%= render :partial => "frontpage_search_box" %>

      <%= render :partial => "frontpage_bodies_list" %>
      <%= render :partial => "frontpage_requests_list" %>

Supporting Organisations

      <% link_to "http://www.openforum.com.au/" do %>
        <%= image_tag "/alavetelitheme/images/openforum_logo.png", :id => "openforum_logo", :size => "66x45" %>
      <% end %>
      <% link_to "http://au.okfn.org/" do %>
        <%= image_tag "/alavetelitheme/images/okfa_logo.png", :id => "okfa_logo", :size => "188x45" %>
      <% end %>
      <% link_to "http://cpd.org.au/" do %>
        <%= image_tag "/alavetelitheme/images/cpd_logo.png", :id => "cpd_logo", :size => "110x45" %>
      <% end %>
      <% link_to "http://www.getup.org.au/" do %>
        <%= image_tag "/alavetelitheme/images/getup_logo.png", :id => "getup_logo", :size => "86x40" %>
      <% end %>
      <% link_to "http://www.crikey.com.au/" do %>
        <%= image_tag "/alavetelitheme/images/crikey_logo.png", :id => "crikey_logo", :size => "101x35" %>
      <% end %>
      <% link_to "http://newmatilda.com/" do %>
        <%= image_tag "/alavetelitheme/images/newmatilda_logo.png", :id => "newmatilda_logo", :size => "199x28" %>
      <% end %>
      <% link_to "https://www.efa.org.au/" do %>
        <%= image_tag "/alavetelitheme/images/efa_logo.png", :id => "efa_logo", :size => "174x45" %>
      <% end %>
      <% link_to "http://transparency.org.au/" do %>
        <%= image_tag "/alavetelitheme/images/tia_logo.png", :id => "tia_logo", :size => "143x45" %>
      <% end %>
      <% link_to "http://www.mysociety.org/" do %>
        <%= image_tag "/alavetelitheme/images/mysociety_logo.png", :id => "mysociety_logo", :size => "120x25" %>
      <% end %>
      <% link_to "http://opennorth.ca/" do %>
        <%= image_tag "/alavetelitheme/images/opennorth_logo.png", :id => "opennorth_logo", :size => "151x50" %>
      <% end %>
      <% link_to "http://open.org.nz" do %>
        <%= image_tag "/alavetelitheme/images/opennz_logo.png", :id => "opennz_logo", :size => "203x50" %>
      <% end %>
      <% link_to "http://www.ausgoal.gov.au/" do %>
        <%= image_tag "/alavetelitheme/images/ausgoal_logo.png", :id => "ausgoal_logo", :size => "139x35" %>
      <% end %>
      <% link_to "http://www.newdemocracy.com.au/" do %>
        <%= image_tag "/alavetelitheme/images/newdemocracy_logo.png", :id => "newdemocracy_logo", :size => "200x19" %>
      <% end %>

      <%= link_to "Find out more...", help_credits_path(:anchor => "supporting") %>

<% end %>


Fix crash by using method name

Fix crash by using method name

<% extra_content = [] %>
<% extra_content_list = [] %>

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

<% if @categories %>
  <%= breadcrumb(@category) if params[:level] %>

      <%= content_tag('li', link_to(_('Homepage'), profile.url), :class => 'catalog-categories-link') %>
      <%= content_tag('li', link_to(_('Catalog start'), profile.catalog_url), :class => 'catalog-categories-link') %>
      <% if @categories.present? %>
        <% @categories.each do |category| %>
          <%= category_link(category) %>
          <%= category_sub_links(category) %>
        <% end %>
      <% elsif @category.present? %>
        <%= content_tag('li', _('There are no sub-categories for %s') % @category.name, :id => 'catalog-categories-notice') %>
      <% else %>
        <%= content_tag('li', _('There are no categories available.'), :id => 'catalog-categories-notice') %>
      <% end %>

<% end %>

<ul id="product-list" class="<%="l-sidebar-left-content" if @categories %>">
  <% @products.each do |product| %>
    <% extra_content = @plugins.dispatch(:catalog_item_extras, product).collect { |content| instance_eval(&content) } %>
    <% extra_content_list = @plugins.dispatch(:catalog_list_item_extras, product).collect { |content| instance_eval(&content) } %>

    <% status = [] %>
    <% status << 'not-available' if !product.available %>
    <% status << 'highlighted' if product.highlighted %>

    <li id="product-<%= product.id %>" class="product <%= status.join(' ') %>">

          <% if product.highlighted? %>
            <%= link_to image_tag(themed_path('/images/star.png'), :class => 'star', :alt => _('Highlighted product')), product_path(product) %>
          <% end %>
          <% if product.image %>

              <%= link_to_product product, :class => 'product-big', :style => "background-image: url(#{product.default_image(:big)})" %>
              <%= link_to content_tag(:span, _('Zoom in')), product.default_image(:big).gsub('_big',''), :class => 'zoomify-image' %>

          <% else %>

<%= _('No image') %>

          <% end %>

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

<%= link_to_product product %>

          <% unless product.discount.blank? or product.discount == 0 %>

              <%= _('from ') + price_span(product.price) %>
              <%= _('by ') %>

          <% end %>
          <% unless product.price.blank? or product.price == 0 %>

              <%= price_span product.price_with_discount, :class => "product-price #{'with-discount' unless product.discount}" %>
              <%= _(' / ') + (product.unit ? product.unit.singular : _('unit')) %>

          <% end %>

        <% if product.description %>

            <%= _('description') %>

<%= product.description %>

        <% end %>

        <% if product.price_described? %>

            <%= _('price composition') %>

                <% product.inputs.relevant_to_price.each do |i| %>

<%= i.product_category.name %>

                    <%= price_span i.cost, :class => 'search-product-input-price' %>

                <% end %>
                <% product.price_details.each do |i| %>

<%= i.name %>

                    <%= price_span i.price, :class => 'search-product-input-price' %>

                <% end %>

        <% end %>

        <% if product.inputs.count > 0 %>

            <%= _('inputs and raw materials') %>

                <% product.inputs.each do |i| %>

                    <%= _('%{amount_used} %{unit} of') % {:amount_used => i.amount_used, :unit => i.unit.singular} + ' ' if i.has_all_price_details? %>
                    <%= i.product_category.name %>

                <% end %>

        <% end %>

        <% unless product.qualifiers.blank? %>

            <%= _('qualifiers') if product.product_qualifiers.count > 0 %>

<%= render :partial => 'shared/product/qualifiers', :locals => {:product => product} %>

        <% end %>

        <% extra_content_list.map do |content| %>

<%= content %>

        <% end %>

<%= _('product unavailable') unless product.available %>

  <% end %>

<%= pagination_links @products, :params => {:controller => :catalog, :action => :index, :profile => profile.identifier} %>

<%= add_zoom_to_images %>

<% extra_content = [] %>
<% extra_content_list = [] %>

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

<% if @categories %>
  <%= breadcrumb(@category) if params[:level] %>

      <%= content_tag('li', link_to(_('Homepage'), profile.url), :class => 'catalog-categories-link') %>
      <%= content_tag('li', link_to(_('Catalog start'), profile.catalog_url), :class => 'catalog-categories-link') %>
      <% if @categories.present? %>
        <% @categories.each do |category| %>
          <%= category_link(category) %>
          <%= category_sub_links(category) %>
        <% end %>
      <% elsif @category.present? %>
        <%= content_tag('li', _('There are no sub-categories for %s') % @category.name, :id => 'catalog-categories-notice') %>
      <% else %>
        <%= content_tag('li', _('There are no categories available.'), :id => 'catalog-categories-notice') %>
      <% end %>

<% end %>

<ul id="product-list" class="<%="l-sidebar-left-content" if @categories %>">
  <% @products.each do |product| %>
    <% extra_content = @plugins.dispatch(:catalog_item_extras, product).collect { |content| instance_eval(&content) } %>
    <% extra_content_list = @plugins.dispatch(:catalog_list_item_extras, product).collect { |content| instance_eval(&content) } %>

    <% status = [] %>
    <% status << 'not-available' if !product.available %>
    <% status << 'highlighted' if product.highlighted %>

    <li id="product-<%= product.id %>" class="product <%= status.join(' ') %>">

          <% if product.highlighted? %>
            <%= link_to image_tag(themed_path('/images/star.png'), :class => 'star', :alt => _('Highlighted product')), product_path(product) %>
          <% end %>
          <% if product.image %>

              <%= link_to_product product, :class => 'product-big', :style => "background-image: url(#{product.default_image(:big)})" %>
              <%= link_to content_tag(:span, _('Zoom in')), product.default_image(:big).gsub('_big',''), :class => 'zoomify-image' %>

          <% else %>

<%= _('No image') %>

          <% end %>

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

<%= link_to_product product %>

          <% unless product.discount.blank? or product.discount == 0 %>

              <%= _('from ') + price_span(product.price) %>
              <%= _('by ') %>

          <% end %>
          <% unless product.price.blank? or product.price == 0 %>

              <%= price_span product.price_with_discount, :class => "product-price #{'with-discount' unless product.discount}" %>
              <%= _(' / ') + (product.unit ? product.unit.singular : _('unit')) %>

          <% end %>

        <% if product.description %>

            <%= _('description') %>

<%= product.description %>

        <% end %>

        <% if product.price_described? %>

            <%= _('price composition') %>

                <% product.inputs.relevant_to_price.each do |i| %>

<%= i.product_category.name %>

                    <%= price_span i.cost, :class => 'search-product-input-price' %>

                <% end %>
                <% product.price_details.each do |i| %>

<%= i.production_cost.name %>

                    <%= price_span i.price, :class => 'search-product-input-price' %>

                <% end %>

        <% end %>

        <% if product.inputs.count > 0 %>

            <%= _('inputs and raw materials') %>

                <% product.inputs.each do |i| %>

                    <%= _('%{amount_used} %{unit} of') % {:amount_used => i.amount_used, :unit => i.unit.singular} + ' ' if i.has_all_price_details? %>
                    <%= i.product_category.name %>

                <% end %>

        <% end %>

        <% unless product.qualifiers.blank? %>

            <%= _('qualifiers') if product.product_qualifiers.count > 0 %>

<%= render :partial => 'shared/product/qualifiers', :locals => {:product => product} %>

        <% end %>

        <% extra_content_list.map do |content| %>

<%= content %>

        <% end %>

<%= _('product unavailable') unless product.available %>

  <% end %>

<%= pagination_links @products, :params => {:controller => :catalog, :action => :index, :profile => profile.identifier} %>

<%= add_zoom_to_images %>


USe 72 columns when editing textile text

<%= required_fields_message %>

<%# TODO add Textile help here %>

<%= required labelled_form_field(_('Title'), text_field(:article, 'name', :size => '72')) %>

<%= render :partial => 'translatable' %>
<%= render :partial => 'shared/lead_and_body' %>

<%= required_fields_message %>

<%# TODO add Textile help here %>

<%= required labelled_form_field(_('Title'), text_field(:article, 'name', :size => '64')) %>

<%= render :partial => 'translatable' %>
<%= render :partial => 'shared/lead_and_body' %>


Make the "warning, this is permanent" message a bit less ugly (the button is red, anyway)

<% form_tag '../redeliver_incoming', :class => "form form-inline" do %>

      id or url_title of request:
      <% if @info_requests && @info_requests.size == 1 %>
        <%= text_field_tag 'url_title', @info_requests[0].url_title, { :size => 20 } %>
      <% else %>
        <%= text_field_tag 'url_title', "", { :size => 20 } %>
      <% end %>
      <%= hidden_field_tag 'redeliver_incoming_message_id', incoming_message.id %>
      <%= submit_tag "Redeliver to another request", :class => "btn btn-warning" %>

<% end %>

<%= link_to 'Generate FOI officer upload URL', "../generate_upload_url/#{incoming_message.info_request.id}?incoming_message_id=#{incoming_message.id}", :class => "btn" %>

<% form_tag '../destroy_incoming', :class => "form form-inline" do %>
  <%= hidden_field_tag 'incoming_message_id', incoming_message.id %>
  <%= submit_tag "Destroy message", :class => "btn btn-danger" %>
  Warning, this is permanent!
<% end %>

<% form_tag '../redeliver_incoming', :class => "form form-inline" do %>

      id or url_title of request:
      <% if @info_requests && @info_requests.size == 1 %>
        <%= text_field_tag 'url_title', @info_requests[0].url_title, { :size => 20 } %>
      <% else %>
        <%= text_field_tag 'url_title', "", { :size => 20 } %>
      <% end %>
      <%= hidden_field_tag 'redeliver_incoming_message_id', incoming_message.id %>
      <%= submit_tag "Redeliver to another request", :class => "btn btn-warning" %>

<% end %>

<%= link_to 'Generate FOI officer upload URL', "../generate_upload_url/#{incoming_message.info_request.id}?incoming_message_id=#{incoming_message.id}", :class => "btn" %>

<% form_tag '../destroy_incoming', :class => "form form-inline" do %>
  <%= hidden_field_tag 'incoming_message_id', incoming_message.id %>

    Warning, this is permanent!

  <%= submit_tag "Destroy message", :class => "btn btn-danger" %>
<% end %>


added technorati script

added technorati script

git-svn-id: 70ab0960c3db1cbf656efd6df54a8f3de72dc710@29 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" />
	<link rel="stylesheet" href="/stylesheets/base.css" type="text/css" />
	<link rel="alternate" type="application/rss+xml"  title="Recent changes (RSS 2.0)"  href="/xml/rss" />
	<link rel="alternate" type="application/atom+xml"  title="Recent changes (ATOM 0.3)"  href="/xml/atom" />
	<title><%= CONFIG['blogname'] %></title>

<%= CONFIG['blogname'] %>

  <%= @content_for_layout %>

	<form action="/articles/search" method="get">
Search
<input type="text" name="q" value="" size="15" />
</form>

  	 <%= render_partial "shared/pages"  %>

     <%= render_partial "shared/projects"  %>

     <%= render_partial "shared/tools"  %>

	   <%= tadalist "http://tobi.tadalist.com/lists/feed_public/741" %>

	   <%= render_partial "shared/xml" %>

     Valid XHTML 1.0

     Valid CSS

Copyright  Tobias Luetke

    RSS and atom available


login menu debuging

login menu debuging

<% if session[:person] == nil %>

Manual

You are not signed in.
[ <%= link_to 'sign in', :controller => 'main', :action => 'index' %> ]

Sign in please

<% else %>

Manual

<%= session[:person].name %>
[ <%= link_to 'log out', { :controller => 'main', :action => 'logout' } , :confirm => 'Are you sure you want to log out?', :method => :post %> ]

<%= render :partial => 'layouts/menubar' %>

<% end %>

<% if session[:person] == nil %>

Manual

You are not signed in.
[ <%= link_to 'sign in', :controller => 'main', :action => 'index' %> ]

Not signed in

<% else %>

Manual

<%= session[:person].name %>
[ <%= link_to 'log out', { :controller => 'main', :action => 'logout' } , :confirm => 'Are you sure you want to log out?', :method => :post %> ]

<%= render :partial => 'layouts/menubar' %>

<% end %>


prevent multiple display of the same message.

<%
# insert new messages if any have been generated
for message in @messages %>
  <% next if message.sender_id == @user.id %>
  if (document.getElementById("message-<%=message.id%>") == null){
     new Insertion.Bottom('stage', '<%= escape_javascript message_content(message) %>');
  }
<% end %>

<%= scroll_conversation_script if @messages.length > 0 %>

<%= set_time_and_name_script %>

<%= render :partial => 'chat/userlist_status' %>

<%
# insert new messages if any have been generated
for message in @messages %>
  <% next if message.sender_id == @user.id %>
  new Insertion.Bottom('stage', '<%= escape_javascript message_content(message) %>');
<% end %>

<%= scroll_conversation_script if @messages.length > 0 %>

<%= set_time_and_name_script %>

<%= render :partial => 'chat/userlist_status' %>


some help content for new request

some help content for new request

<% @title = "About" %>

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

Introduction to WhatDoTheyKnow #

What is WhatDoTheyKnow for? #

To help you find out inside information about what the UK government
is doing.

How does the site work? #

You choose the public authority that you would like information from, then
write a brief note describing what you want to know. We then send your request
to the public authority. Any response they make is automatically published on the
website for you and anyone else to find and read.

Why would I bother to do this? #

You pay taxes, and then government does things with the money. All sorts of
things that affect your life, from healthcare through to national defence. Some
it does badly, some it does well. The more we find out about how government
works, the better able we are to make suggestions to improve the things that
are done badly, and to celebrate the things that are done well.

Why would the public authority bother to reply? #

Under Freedom of Information (FOI) law, they have to respond. The response
will either contain the information you want, or give a valid legal reason why
it must be kept confidential.

Who makes WhatDoTheyKnow? #

WhatDoTheyKnow is created and run by mySociety,
and was initially funded by the JRSST Charitable Trust. mySociety is a project of the
registered charity UK Citizens Online Democracy.
If you like what we're doing, then you can
make a donation.

How can I keep up with news about WhatDoTheyKnow?#

We have a blog and a twitter feed.

Next, read about making requests -->


fix bug with pages with tags and no group throwing an error

<%= content_tag("div", @error, :class => "error") if @error %>
<% if @page.tags.any? -%>
<% link_path = @page.group ? "/groups/tags/#{@page.group.name}" : "/me/search/tag" -%>
<%= @page.tags.collect{|tag| link_to tag.name, "#{link_path}/#{tag.name}" }.join(" ") %>
<%= link_to_function(image_tag('actions/pencil.png'), "Element.toggle($('tag-form')); Element.toggle($('tags'))") if current_user.may? :edit, @page %>
<% elsif current_user.may? :edit, @page -%>
<%= link_to_function('Add tags »', "Element.toggle($('tag-form')); Element.toggle($('tags'))") %>
<% end -%>

<%= content_tag("div", @error, :class => "error") if @error %>
<% if @page.tags.any? -%>
<%= @page.tags.collect{|tag| link_to tag.name, "/groups/tags/#{@page.group.name}/#{tag.name}" }.join(" ") %>
<%= link_to_function(image_tag('actions/pencil.png'), "Element.toggle($('tag-form')); Element.toggle($('tags'))") if current_user.may? :edit, @page %>
<% elsif current_user.may? :edit, @page -%>
<%= link_to_function('Add tags »', "Element.toggle($('tag-form')); Element.toggle($('tags'))") %>
<% end -%>


Move the comment field above the commit button

<% @page_title = "Ändrar #{@page}" -%>

Ändrar <%= title_link @page -%>

<% form_for :page do |page| -%>
<%= hidden_field :page, :lock_version %>
<%= hidden_field :page, :id %>

Titel
<%= page.text_field :title, :maxlength => 35, :size => 35  %>
<%= link_to_function 'Se alias',
	visual_effect(:toggle_appear, "page_alias", :duration => 0.3) %>
<%= error_message_on @page, :title %>

Lägg till alias
<% fields_for :alias do |alias_field| %>
  <%= alias_field.text_field :alias, :maxlength => 35, :size => 35 %>
  <%= submit_to_remote 'create', 'Skapa', :url => { :action => 'add_alias' },
    :update => { :success => "page_aliases", :failure => "fail" } %>
<% end %>

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

Innehåll
<%= page.text_area :content, :cols => 84, :rows => 20  %>

Kommentar
<%= page.text_field :comment, :maxlength => 74, :size => 50 %>

  <%= submit_tag 'Spara' %>
	eller
  <%= link_to 'Avbryt', page_show_url(:id => @page) %>

Sidbeskrivning
<%= page.text_area :description, :cols => 50, :rows => 3 %>

Formatering
<%= page.select :markup, markups_available %>

<%= periodically_call_remote(
  :update => 'live_message',
  :url => {
    :action       => :check_for_changes,
    :id           => @page,
    :lock_version => @page.lock_version},
  :frequency => 30) %>

<% end -%>

<% @page_title = "Ändrar #{@page}" -%>

Ändrar <%= title_link @page -%>

<% form_for :page do |page| -%>
<%= hidden_field :page, :lock_version %>
<%= hidden_field :page, :id %>

Titel
<%= page.text_field :title, :maxlength => 35, :size => 35  %>
<%= link_to_function 'Se alias',
	visual_effect(:toggle_appear, "page_alias", :duration => 0.3) %>
<%= error_message_on @page, :title %>

Lägg till alias
<% fields_for :alias do |alias_field| %>
  <%= alias_field.text_field :alias, :maxlength => 35, :size => 35 %>
  <%= submit_to_remote 'create', 'Skapa', :url => { :action => 'add_alias' },
    :update => { :success => "page_aliases", :failure => "fail" } %>
<% end %>

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

Innehåll
<%= page.text_area :content, :cols => 84, :rows => 20  %>

  <%= submit_tag 'Spara' %>
	eller
  <%= link_to 'Avbryt', page_show_url(:id => @page) %>

Kommentar
<%= page.text_field :comment, :maxlength => 74, :size => 50 %>

Sidbeskrivning
<%= page.text_area :description, :cols => 50, :rows => 3 %>

Formatering
<%= page.select :markup, markups_available %>

<%= periodically_call_remote(
  :update => 'live_message',
  :url => {
    :action       => :check_for_changes,
    :id           => @page,
    :lock_version => @page.lock_version},
  :frequency => 30) %>

<% end -%>


Wording tweak.

Wording tweak.

<% @title = 'Raw email for incoming message ' + @raw_email.incoming_message.id.to_s + ' of FOI request \'' + h(@raw_email.incoming_message.info_request.title) + "'" %>

<%=@title%>

<%=h(@raw_email.data).gsub!(/\n/, '
') %>

<% @title = 'Raw email for incoming message ' + @raw_email.incoming_message.id.to_s + ' request \'' + h(@raw_email.incoming_message.info_request.title) + "'" %>

<%=@title%>

<%=h(@raw_email.data).gsub!(/\n/, '
') %>


Fix a rounding issue causingt the logged time to be incorrect.

Integer division keeps haunting me, when will I learn?

---
id: home
title: Overview
---
<%

    num_entries = PloggyHelper.log_items.length
    logged_time_s = PloggyHelper.log_time
    logged_time = PloggyHelper.time_to_s(logged_time_s)
    tot_day_count = PloggyHelper.work_time(project_start_date, project_end_date)
    cur_day_count = PloggyHelper.work_time(project_start_date, Date.today)
    cur_day_count_s = cur_day_count.to_s + '' + PloggyHelper.sup_fix(cur_day_count) + ''
    day_perc = sprintf '%.1f', (100.0 * cur_day_count / tot_day_count)
    logged_perc = sprintf '%.1f', (100.0 * logged_time_s / (tot_day_count / 5.0 * project_hours_per_week))

%>

        <%= render 'glyph-icon', :name => 'th-list' %>
        <%= num_entries %>
        log entries

        <%= render 'glyph-icon', :name => 'user' %>
        <%= project_persons.length %>
        persons involved

        <%= render 'glyph-icon', :name => 'hourglass' %>
        <%= cur_day_count %> / <%= tot_day_count %>
        days passed (<%= day_perc %>%)

        <%= render 'glyph-icon', :name => 'time' %>
        <%= logged_time %>
        spent (<%= logged_perc %>%)

    <div class="stats-day-progress-bar light" style="width: <%= day_perc %>%;">

    <div class="stats-day-progress-bar" style="width: <%= logged_perc %>%;">

<%
    PloggyHelper.sort_log_items
    -1.downto(-5) do |i|
        if PloggyHelper.log_items.length < -i
            break
        end
        item = PloggyHelper.log_items[i]
        start_time = DateTime.parse(item[:start_time])
        end_time = (item[:end_time] == nil) ? start_time : DateTime.parse(item[:end_time])
        date = start_time.strftime('%Y-%m-%d')
        start_time_s = start_time.strftime('%H:%M')
        end_time_s = (item[:end_time] == nil) ? '...?' : end_time.strftime('%H:%M')
%>

        <%= date %>, <%= start_time_s %> - <%= end_time_s %>
        <%= PloggyHelper.time_to_s((end_time - start_time) * 1.day) %>

            <%= (item[:category].is_a? Array) ? item[:category].join(', ') : item[:category] %>
            <%= render 'glyph-icon', :name => 'tag' %>

<%= item.reps[0].compiled_content.gsub(/\n\n/, "
\n
") %>

        <%
            persons = item[:persons]
            if persons == nil
                persons = []
            elsif persons.is_a? String
                persons = [persons]
            end
            persons.each{|nick|
        %>
        <span class="person" data-nick="<%= nick %>">
            <%= project_persons[nick] %>
            <%= render 'glyph-icon', :name => 'user' %>

        <%
            }
        %>

<%
    end
%>

---
id: home
title: Overview
---
<%

    num_entries = PloggyHelper.log_items.length
    logged_time_s = PloggyHelper.log_time
    logged_time = PloggyHelper.time_to_s(logged_time_s)
    tot_day_count = PloggyHelper.work_time(project_start_date, project_end_date)
    cur_day_count = PloggyHelper.work_time(project_start_date, Date.today)
    cur_day_count_s = cur_day_count.to_s + '' + PloggyHelper.sup_fix(cur_day_count) + ''
    day_perc = sprintf '%.1f', (100.0 * cur_day_count / tot_day_count)
    logged_perc = sprintf '%.1f', (100.0 * logged_time_s / (tot_day_count / 5 * project_hours_per_week))

%>

        <%= render 'glyph-icon', :name => 'th-list' %>
        <%= num_entries %>
        log entries

        <%= render 'glyph-icon', :name => 'user' %>
        <%= project_persons.length %>
        persons involved

        <%= render 'glyph-icon', :name => 'hourglass' %>
        <%= cur_day_count %> / <%= tot_day_count %>
        days passed (<%= day_perc %>%)

        <%= render 'glyph-icon', :name => 'time' %>
        <%= logged_time %>
        spent (<%= logged_perc %>%)

    <div class="stats-day-progress-bar light" style="width: <%= day_perc %>%;">

    <div class="stats-day-progress-bar" style="width: <%= logged_perc %>%;">

<%
    PloggyHelper.sort_log_items
    -1.downto(-5) do |i|
        if PloggyHelper.log_items.length < -i
            break
        end
        item = PloggyHelper.log_items[i]
        start_time = DateTime.parse(item[:start_time])
        end_time = (item[:end_time] == nil) ? start_time : DateTime.parse(item[:end_time])
        date = start_time.strftime('%Y-%m-%d')
        start_time_s = start_time.strftime('%H:%M')
        end_time_s = (item[:end_time] == nil) ? '...?' : end_time.strftime('%H:%M')
%>

        <%= date %>, <%= start_time_s %> - <%= end_time_s %>
        <%= PloggyHelper.time_to_s((end_time - start_time) * 1.day) %>

            <%= (item[:category].is_a? Array) ? item[:category].join(', ') : item[:category] %>
            <%= render 'glyph-icon', :name => 'tag' %>

<%= item.reps[0].compiled_content.gsub(/\n\n/, "
\n
") %>

        <%
            persons = item[:persons]
            if persons == nil
                persons = []
            elsif persons.is_a? String
                persons = [persons]
            end
            persons.each{|nick|
        %>
        <span class="person" data-nick="<%= nick %>">
            <%= project_persons[nick] %>
            <%= render 'glyph-icon', :name => 'user' %>

        <%
            }
        %>

<%
    end
%>


[project @ examples/rails_openid/app/views/login: updated to reflect the fact that examples/consumer.rb is gone and RP example is integrated in this rails example]

<% if session[:username].nil? %>

  <form method="get" action="<%= url_for :controller => 'login', :action => 'submit' %>">
Type a username:
  <input type="text" name="username" />
  <input type="submit" value="Log In" />
  </form>

<% end %>

 Welcome to the Ruby OpenID example.  This code is a starting point
for developers wishing to implement an OpenID provider or relying
party.  We've used the Rails
platform to demonstrate, but the library code is not Rails specific.

To use the example provider

Enter a username in the form above.  You will be "Logged In"
    to the server, at which point you may authenticate using an OpenID
    consumer. Your OpenID URL will be displayed after you log
    in.
The server will automatically create an identity page for
    you at <%= @base_url %>user/name

Because WEBrick can only handle one thing at a time, you'll need to
    run another instance of the example on another port if you want to use
    a relying party to use with this example provider:

    script/server --port=3001

(The RP needs to be able to access the provider, so unless you're
    running this example on a public IP, you can't use the live example
    at openidenabled.com on
    your local provider.)

Point your browser to this new instance and follow the directions
    below.

To use the example relying party

Visit <a href="<%= url_for :controller => 'consumer' %>">/consumer
and enter your OpenID.

<% if session[:username].nil? %>

  <form method="get" action="<%= url_for :controller => 'login', :action => 'submit' %>">
Type a username:
  <input type="text" name="username" />
  <input type="submit" value="Log In" />
  </form>

<% end %>

Welcome to the Ruby OpenID server example.  This code is a starting point for developers wishing to implement an OpenID server on the Rails platform.

To use the example

Enter a username in the form above.  You will be "Logged In" to the server, at which point you may authenticate using an OpenID consumer. Your OpenID URL will be displayed after you log in.
The server will automatically create an identity page for you at <%= @base_url %>user/name

Run the example OpenID consumer:
ruby examples/consumer.rb

In another browser window visit http://localhost:2000/, and type your OpenID URL to verfiy your identity with this server.


Make email a hyperlink.

Make email a hyperlink.

<% @title = "FOI request - " + h(@info_request.title) %>

<%=@title%>

<% for column in InfoRequest.content_columns %>
  <%= column.human_name %>: <%=h @info_request.send(column.name) %>

<% end %>
Created by: <%= user_both_links(@info_request.user) %>

Public authority: <%= public_body_both_links(@info_request.public_body) %>

Incoming email address: <%= link_to h(@info_request.incoming_email), "mailto:" + @info_request.incoming_email %>

    <%= link_to 'Public page', main_url(request_url(@info_request)) %>
    | <%= link_to 'Edit', '../edit/' + @info_request.id.to_s %>
    | <%= link_to 'FOI officer upload URL', '../generate_upload_url/' + @info_request.id.to_s %> (see also links on incoming messages below)

Events

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

<% for info_request_event in @info_request.info_request_events.find(:all, :order => "created_at, id") %>
  <tr class="<%= cycle('odd', 'even') %>">
  <%=h info_request_event.id %>
  <% for column in InfoRequestEvent.content_columns.map { |c| c.name } %>
    <%=h info_request_event.send(column) %>
  <% end %>

<% end %>

Outgoing messages

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

<% for outgoing_message in @info_request.outgoing_messages.find(:all, :order => 'created_at') %>
  <tr class="<%= cycle('odd', 'even') %>">
  <%=h outgoing_message.id %>
  <% for column in OutgoingMessage.content_columns.map { |c| c.name } %>
    <%=h outgoing_message.send(column) %>
  <% end %>

  <% form_tag '../resend' do %>

          <%= hidden_field_tag 'outgoing_message_id', outgoing_message.id %>
          <%= submit_tag "Resend" %>

  <% end %>
  <%= link_to "Edit", '../edit_outgoing/' + outgoing_message.id.to_s %>

<% end %>

Incoming messages

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

<% for incoming_message in @info_request.incoming_messages.find(:all, :order => 'created_at') %>
  <tr class="<%= cycle('odd', 'even') %>" id="incoming-<%=incoming_message.id.to_s%>">
  <%=h incoming_message.id %>
  <% for column in IncomingMessage.content_columns.map { |c| c.name } %>
    <%=h incoming_message.send(column) %>
  <% end %>

        <% if !incoming_message.raw_email_id.nil? %>

            <%= link_to "View raw email", "../show_raw_email/" + incoming_message.raw_email_id.to_s %>

        <% end %>
        <%= render :partial => 'incoming_message_actions', :locals => { :incoming_message => incoming_message } %>

<% end %>

Annotations

  Id
  Posted by
  <% for column in Comment.content_columns %>
    <%= column.human_name %>
  <% end %>
  Actions

<% for comment in @info_request.comments %>
  <tr class="<%= cycle('odd', 'even') %>">
  <%=h comment.id %>
  <%= user_both_links(comment.user) %>
  <% for column in Comment.content_columns.map { |c| c.name } %>
    <% if column == 'body' && !comment.visible %>
        <s><%=h comment.send(column) %></s>
    <% else %>
        <%=h comment.send(column) %>
    <% end %>
  <% end %>

      <%= link_to "Edit", '../edit_comment/' + comment.id.to_s %>

<% end %>

Censor rules

<%= render :partial => 'admin_censor_rule/show', :locals => { :censor_rules => @info_request.censor_rules, :info_request => @info_request } %>

<% @title = "FOI request - " + h(@info_request.title) %>

<%=@title%>

<% for column in InfoRequest.content_columns %>
  <%= column.human_name %>: <%=h @info_request.send(column.name) %>

<% end %>
Created by: <%= user_both_links(@info_request.user) %>

Public authority: <%= public_body_both_links(@info_request.public_body) %>

Incoming email address: <%=h @info_request.incoming_email %>

    <%= link_to 'Public page', main_url(request_url(@info_request)) %>
    | <%= link_to 'Edit', '../edit/' + @info_request.id.to_s %>
    | <%= link_to 'FOI officer upload URL', '../generate_upload_url/' + @info_request.id.to_s %> (see also links on incoming messages below)

Events

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

<% for info_request_event in @info_request.info_request_events.find(:all, :order => "created_at, id") %>
  <tr class="<%= cycle('odd', 'even') %>">
  <%=h info_request_event.id %>
  <% for column in InfoRequestEvent.content_columns.map { |c| c.name } %>
    <%=h info_request_event.send(column) %>
  <% end %>

<% end %>

Outgoing messages

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

<% for outgoing_message in @info_request.outgoing_messages.find(:all, :order => 'created_at') %>
  <tr class="<%= cycle('odd', 'even') %>">
  <%=h outgoing_message.id %>
  <% for column in OutgoingMessage.content_columns.map { |c| c.name } %>
    <%=h outgoing_message.send(column) %>
  <% end %>

  <% form_tag '../resend' do %>

          <%= hidden_field_tag 'outgoing_message_id', outgoing_message.id %>
          <%= submit_tag "Resend" %>

  <% end %>
  <%= link_to "Edit", '../edit_outgoing/' + outgoing_message.id.to_s %>

<% end %>

Incoming messages

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

<% for incoming_message in @info_request.incoming_messages.find(:all, :order => 'created_at') %>
  <tr class="<%= cycle('odd', 'even') %>" id="incoming-<%=incoming_message.id.to_s%>">
  <%=h incoming_message.id %>
  <% for column in IncomingMessage.content_columns.map { |c| c.name } %>
    <%=h incoming_message.send(column) %>
  <% end %>

        <% if !incoming_message.raw_email_id.nil? %>

            <%= link_to "View raw email", "../show_raw_email/" + incoming_message.raw_email_id.to_s %>

        <% end %>
        <%= render :partial => 'incoming_message_actions', :locals => { :incoming_message => incoming_message } %>

<% end %>

Annotations

  Id
  Posted by
  <% for column in Comment.content_columns %>
    <%= column.human_name %>
  <% end %>
  Actions

<% for comment in @info_request.comments %>
  <tr class="<%= cycle('odd', 'even') %>">
  <%=h comment.id %>
  <%= user_both_links(comment.user) %>
  <% for column in Comment.content_columns.map { |c| c.name } %>
    <% if column == 'body' && !comment.visible %>
        <s><%=h comment.send(column) %></s>
    <% else %>
        <%=h comment.send(column) %>
    <% end %>
  <% end %>

      <%= link_to "Edit", '../edit_comment/' + comment.id.to_s %>

<% end %>

Censor rules

<%= render :partial => 'admin_censor_rule/show', :locals => { :censor_rules => @info_request.censor_rules, :info_request => @info_request } %>