Allow access to all zoom levels again.

Allow access to all zoom levels again.

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

<% if params['mlon'] and params['mlat'] %>
<% marker = true %>
<% mlon = params['mlon'] %>
<% mlat = params['mlat'] %>
<% lon =  params['mlon'] %>
<% lat =  params['mlat']  %>
<% zoom =  params['zoom'] || '12' %>
<script type="text/javascript">
  var mlat = <%= lat %>;
  var mlon = <%= lon %>;
</script>
<% elsif @user and params['lon'].nil? and params['lat'].nil? %>
<% lon =  @user.home_lon %>
<% lat =  @user.home_lat %>
<% zoom = '10' %>
<%else%>
<% lon =  params['lon'] || '-0.1' %>
<% lat =  params['lat'] || '51.5' %>
<% zoom =  params['zoom'] || '4' %>
<% end %>

<script type="text/javascript">
  var lat = <%= lat %>;
  var lon = <%= lon %>;
  var zoom = <%= zoom %>;
  var PI = 3.14159265358979323846;

  <% if params['scale'] and params['scale'].length > 0 then %>
  zoom = Math.log(360.0/(( <% print params['scale'].to_f() %> ) * 512.0)) / Math.log(2.0);
  <% end %>
  zoom = zoom;
  lon = lon * 20037508.34 / 180;
  lat = Math.log(Math.tan( (90 + lat) * PI / 360)) / (PI / 180);
  lat = lat * 20037508.34 / 180;
  <% if marker %>
  mlon = mlon * 20037508.34 / 180;
  mlat = Math.log(Math.tan( (90 + mlat) * PI / 360)) / (PI / 180);
  mlat = mlat * 20037508.34 / 180;
  <%end%>

</script>
<script type="text/javascript" src="/javascripts/OpenLayers.js"></script>

<script type="text/javascript">
  <!--
  var map, layer, markers;
  var ie6 = ! ( window.addEventListener || window.XMLHttpRequest );

  function init(){

    OpenLayers.Util.onImageLoadError = function() {
      this.src = "http://www.openstreetmap.org/javascripts/img/404.png";
    }
    map = new OpenLayers.Map( "map",
        {maxExtent: new OpenLayers.Bounds(-20037508.34,-20037508.34,20037508.34,20037508.34), numZoomLevels:19, maxResolution:156543, units:'meters', projection: "EPSG:41001"} );
    layer = new OpenLayers.Layer.TMS( "Mapnik", "http://tile.openstreetmap.org/", {type:'png', getURL:getTileURL} );
    map.addLayer(layer);
    layer = new OpenLayers.Layer.TMS( "Osmarender", "http://dev.openstreetmap.org/~ojw/Tiles/tile.php/", {type:'png', getURL:getTileURL} );
    map.addLayer(layer);

    //Marker stuff

    <% if marker %>
    markers = new OpenLayers.Layer.Markers("markers");
    map.addLayer(markers);

    marker = new OpenLayers.Marker(new OpenLayers.LonLat(mlon,mlat));
    markers.addMarker(marker);
    <%end%>

    map.addControl(new OpenLayers.Control.LayerSwitcher());
    map.setCenter(new OpenLayers.LonLat(lon, lat), zoom);

    map.events.register("moveend", map, updateLocation);
    document.getElementById( 'map_OpenLayers_ViewPort' ).style.position = 'absolute';
    if( ie6 ) {
      handleResize();
    }
    updateLocation();
  }

  function getTileURL( bounds ) {
    var res = this.map.getResolution();
    var x = Math.round ((bounds.left - this.maxExtent.left) / (res * this.tileSize.w));
    var y = Math.round ((this.maxExtent.top - bounds.top) / (res * this.tileSize.h));
    var z = this.map.getZoom();
    return this.url + z + "/" + x + "/" + y + "." + this.type;
  }

  function updateLocation() {
    var lonlat = map.getCenter();

    var lon_deg = (lonlat.lon / 20037508.34) * 180;
    var lat_deg = (lonlat.lat / 20037508.34) * 180;
    var PI = 3.14159265358979323846;
    lat_deg = 180/PI * (2 * Math.atan(Math.exp(lat_deg * PI / 180)) - PI / 2);
    var zoom = map.getZoom();

    updatelinks(lon_deg,lat_deg,zoom);
  }

  function getStyle( el, property ) {
    var style;
    if( el.currentStyle ) {
        style = el.currentStyle[property];
    } else if( window.getComputedStyle ) {
        style = document.defaultView.getComputedStyle(el,null).getPropertyValue(property);
    } else {
        style = el.style[property];
    }
    return style;
  }

  function handleResize() {
    var el = document.getElementById( 'map' );
    var left = getStyle( el, 'left' );
    var top = getStyle( el, 'top' );
    var bottom = getStyle( el, 'bottom' );
    var right = getStyle( el, 'right' );
    var width = el.old_width;
    if( ! width ) {
        width = getStyle( el, 'width' );
    }
    var height = el.old_height;
    if( ! height ) {
        height = getStyle( el, 'height' );
    }
    var pwidth, pheight;
    if( el.offsetParent.nodeName == 'BODY' || el.offsetParent.nodeName == 'HTML' ) {
      if( typeof( window.innerWidth ) == 'number' ) {
          pwidth = window.innerWidth;
          height = window.innerHeight;
      } else if( document.documentElement &&
          ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
          pwidth = document.documentElement.clientWidth;
          pheight = document.documentElement.clientHeight;
      } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
          pwidth = document.body.clientWidth;
          pheight = document.body.clientHeight;
      }
    } else {
      pwidth = el.offsetParent.offsetWidth;
      pheight = el.offsetParent.offsetHeight;
    }
    if( left != 'auto' && right != 'auto' && width == 'auto' ) {
      el.old_width = width;
      var new_width = (pwidth - el.offsetLeft - parseInt( right ) );
      el.style.width = new_width + 'px';
    }
    if( top != 'auto' && bottom != 'auto' && height == 'auto' ) {
      el.old_height = height;
      var new_height = (pheight - el.offsetTop - parseInt( bottom ) );
      el.style.height = new_height + 'px';
    }
    map.updateSize();
    el.style.display = 'none';
    setTimeout( function() {
        el.style.display = '';
        }, 200 );
  }

if( ie6 ) {
  window.onresize = handleResize;
}
window.onload = init;
// -->
</script>

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

<% if params['mlon'] and params['mlat'] %>
<% marker = true %>
<% mlon = params['mlon'] %>
<% mlat = params['mlat'] %>
<% lon =  params['mlon'] %>
<% lat =  params['mlat']  %>
<% zoom =  params['zoom'] || '12' %>
<script type="text/javascript">
  var mlat = <%= lat %>;
  var mlon = <%= lon %>;
</script>
<% elsif @user and params['lon'].nil? and params['lat'].nil? %>
<% lon =  @user.home_lon %>
<% lat =  @user.home_lat %>
<% zoom = '10' %>
<%else%>
<% lon =  params['lon'] || '-0.1' %>
<% lat =  params['lat'] || '51.5' %>
<% zoom =  params['zoom'] || '4' %>
<% end %>

<script type="text/javascript">
  var lat = <%= lat %>;
  var lon = <%= lon %>;
  var zoom = <%= zoom %>;
  var PI = 3.14159265358979323846;

  <% if params['scale'] and params['scale'].length > 0 then %>
  zoom = Math.log(360.0/(( <% print params['scale'].to_f() %> ) * 512.0)) / Math.log(2.0);
  <% end %>
  zoom = zoom;
  lon = lon * 20037508.34 / 180;
  lat = Math.log(Math.tan( (90 + lat) * PI / 360)) / (PI / 180);
  lat = lat * 20037508.34 / 180;
  <% if marker %>
  mlon = mlon * 20037508.34 / 180;
  mlat = Math.log(Math.tan( (90 + mlat) * PI / 360)) / (PI / 180);
  mlat = mlat * 20037508.34 / 180;
  <%end%>

</script>
<script type="text/javascript" src="/javascripts/OpenLayers.js"></script>

<script type="text/javascript">
  <!--
  var map, layer, markers;
  var ie6 = ! ( window.addEventListener || window.XMLHttpRequest );

  function init(){

    OpenLayers.Util.onImageLoadError = function() {
      this.src = "http://www.openstreetmap.org/javascripts/img/404.png";
    }
    map = new OpenLayers.Map( "map",
        {maxExtent: new OpenLayers.Bounds(-20037508.34,-20037508.34,20037508.34,20037508.34), maxZoomLevel:18, maxResolution:156543, units:'meters', projection: "EPSG:41001"} );
    layer = new OpenLayers.Layer.TMS( "Mapnik", "http://tile.openstreetmap.org/", {type:'png', getURL:getTileURL} );
    map.addLayer(layer);
    layer = new OpenLayers.Layer.TMS( "Osmarender", "http://dev.openstreetmap.org/~ojw/Tiles/tile.php/", {type:'png', getURL:getTileURL} );
    map.addLayer(layer);

    //Marker stuff

    <% if marker %>
    markers = new OpenLayers.Layer.Markers("markers");
    map.addLayer(markers);

    marker = new OpenLayers.Marker(new OpenLayers.LonLat(mlon,mlat));
    markers.addMarker(marker);
    <%end%>

    map.addControl(new OpenLayers.Control.LayerSwitcher());
    map.setCenter(new OpenLayers.LonLat(lon, lat), zoom);

    map.events.register("moveend", map, updateLocation);
    document.getElementById( 'map_OpenLayers_ViewPort' ).style.position = 'absolute';
    if( ie6 ) {
      handleResize();
    }
    updateLocation();
  }

  function getTileURL( bounds ) {
    var res = this.map.getResolution();
    var x = Math.round ((bounds.left - this.maxExtent.left) / (res * this.tileSize.w));
    var y = Math.round ((this.maxExtent.top - bounds.top) / (res * this.tileSize.h));
    var z = this.map.getZoom();
    return this.url + z + "/" + x + "/" + y + "." + this.type;
  }

  function updateLocation() {
    var lonlat = map.getCenter();

    var lon_deg = (lonlat.lon / 20037508.34) * 180;
    var lat_deg = (lonlat.lat / 20037508.34) * 180;
    var PI = 3.14159265358979323846;
    lat_deg = 180/PI * (2 * Math.atan(Math.exp(lat_deg * PI / 180)) - PI / 2);
    var zoom = map.getZoom();

    updatelinks(lon_deg,lat_deg,zoom);
  }

  function getStyle( el, property ) {
    var style;
    if( el.currentStyle ) {
        style = el.currentStyle[property];
    } else if( window.getComputedStyle ) {
        style = document.defaultView.getComputedStyle(el,null).getPropertyValue(property);
    } else {
        style = el.style[property];
    }
    return style;
  }

  function handleResize() {
    var el = document.getElementById( 'map' );
    var left = getStyle( el, 'left' );
    var top = getStyle( el, 'top' );
    var bottom = getStyle( el, 'bottom' );
    var right = getStyle( el, 'right' );
    var width = el.old_width;
    if( ! width ) {
        width = getStyle( el, 'width' );
    }
    var height = el.old_height;
    if( ! height ) {
        height = getStyle( el, 'height' );
    }
    var pwidth, pheight;
    if( el.offsetParent.nodeName == 'BODY' || el.offsetParent.nodeName == 'HTML' ) {
      if( typeof( window.innerWidth ) == 'number' ) {
          pwidth = window.innerWidth;
          height = window.innerHeight;
      } else if( document.documentElement &&
          ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
          pwidth = document.documentElement.clientWidth;
          pheight = document.documentElement.clientHeight;
      } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
          pwidth = document.body.clientWidth;
          pheight = document.body.clientHeight;
      }
    } else {
      pwidth = el.offsetParent.offsetWidth;
      pheight = el.offsetParent.offsetHeight;
    }
    if( left != 'auto' && right != 'auto' && width == 'auto' ) {
      el.old_width = width;
      var new_width = (pwidth - el.offsetLeft - parseInt( right ) );
      el.style.width = new_width + 'px';
    }
    if( top != 'auto' && bottom != 'auto' && height == 'auto' ) {
      el.old_height = height;
      var new_height = (pheight - el.offsetTop - parseInt( bottom ) );
      el.style.height = new_height + 'px';
    }
    map.updateSize();
    el.style.display = 'none';
    setTimeout( function() {
        el.style.display = '';
        }, 200 );
  }

if( ie6 ) {
  window.onresize = handleResize;
}
window.onload = init;
// -->
</script>


ActionItem166: fixing crash with unanthenticated comments

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

<div class="article-comment<%= ' comment-from-owner' if ( comment.author && (@page.profile.name == comment.author.name) ) %>">
  <% if comment.author %>
    <%= link_to content_tag( 'span', comment.author.name() ), comment.author.url,
        :class => 'comment-picture',
        :style => 'background-image:url(%s)' % profile_icon(comment.author, :minor) %>
  <% else %>
    <%# unauthenticated user: display default icon %>
    <%= content_tag('span', ' ', :class => 'comment-picture', :style => 'background-image: url(/images/icons-app/user_icon_size-minor.png)' )%>
  <% end %>

<%= comment.title %>

    <%= _('By %{author} on %{date}') % {
        :author => comment.author ? link_to(comment.author.name, comment.author.url) : content_tag('u', comment.name),
        :date => show_time(comment.created_on) } %>

    <%= comment.body %>

<div class="article-comment<%=
     ' comment-from-owner' if ( @page.profile.name == comment.author.name ) %>">
  <%= link_to content_tag( 'span', comment.author.name() ), comment.author.url,
      :class => 'comment-picture',
      :style => 'background-image:url(%s)' % profile_icon(comment.author, :minor) %>

<%= comment.title %>

    <%= _('By %{author} on %{date}') % {
        :author => link_to(
           (comment.author ? comment.author.identifier : comment.name),
            comment.author.url),
        :date => show_time(comment.created_on) } %>

    <%= comment.body %>


Added payment header for only 1 option

Added payment header for only 1 option

<%= feature_output %>

<% if message || (errors && errors.length > 0) -%>

<%= "There was an problem processing your request:".t %>

<% if errors && errors.length > 0 %>
<%= errors.full_messages.map(&:t).join("
") %>

<% end -%>
<%= message %>

<% end -%>

<%= "%s, please confirm you order and enter you payment information." / myself.name %>

<form action='' method='post' id='submit_form'>
<input type='hidden' name='update' id='shopping_form_update' value='0' />

<% if shippable %>

<%= "Order Addresses".t %> (<a href='<%= url_for address_page %>'><%= "Edit".t %>)

  <%= "Ship To:".t %>
  <%= "Bill To:".t %>

  <%= shipping_address.display("
",:address_type => options.address_type) %>
  <%= billing_address.display("
",:address_type => options.address_type) %>

<% else -%>

<%= "Bill To".t %> (<a href='<%= url_for address_page %>'><%= "Edit".t %>)

<%= billing_address.display("
",:address_type => options.address_type) %>

<% end -%>

<% if shippable && shipping_options.length == 0 %>

 <%= "There are no Shipping Carriers available to ship your order, please try again later.".t %>

<% elsif payment_processors.length == 0 %>

 <%= "There are no Payment processors available to process your order, please try again later.".t %>

<% else -%>
<% if shippable %>

<%= "Shipping Options".t %>

  <% shipping_options.each_with_index do |opt,index| %>

    <label for='shipping_<%= opt[1] %>'><input id='shipping_<%= opt[1] %>' type='radio' name='payment[shipping_category]' <%=  "checked='checked'" if payment[:shipping_category] == opt[1]  %> value="<%= opt[1] %>" onclick='document.getElementById("shopping_form_update").value=1; document.getElementById("submit_form").submit();' ><%= opt[0] %>

  <% end -%>

<% end -%>

<% if payment_processors.length > 1 %>

<%= "Payment Options".t %>

<% else -%>

<%= "Payment".t %>

<% end -%>

<%= render :partial => '/shop/processor/payment_processors', :locals => { :payment_processors => payment_processors, :admin => false, :payment => payment, :user => myself } %>

<input type='submit' value='<%= vh "Place Order".t %>'/>

<% end -%>

</form>

<%= feature_output %>

<% if message || (errors && errors.length > 0) -%>

<%= "There was an problem processing your request:".t %>

<% if errors && errors.length > 0 %>
<%= errors.full_messages.map(&:t).join("
") %>

<% end -%>
<%= message %>

<% end -%>

<%= "%s, please confirm you order and enter you payment information." / myself.name %>

<form action='' method='post' id='submit_form'>
<input type='hidden' name='update' id='shopping_form_update' value='0' />

<% if shippable %>

<%= "Order Addresses".t %> (<a href='<%= url_for address_page %>'><%= "Edit".t %>)

  <%= "Ship To:".t %>
  <%= "Bill To:".t %>

  <%= shipping_address.display("
",:address_type => options.address_type) %>
  <%= billing_address.display("
",:address_type => options.address_type) %>

<% else -%>

<%= "Bill To".t %> (<a href='<%= url_for address_page %>'><%= "Edit".t %>)

<%= billing_address.display("
",:address_type => options.address_type) %>

<% end -%>

<% if shippable && shipping_options.length == 0 %>

 <%= "There are no Shipping Carriers available to ship your order, please try again later.".t %>

<% elsif payment_processors.length == 0 %>

 <%= "There are no Payment processors available to process your order, please try again later.".t %>

<% else -%>
<% if shippable %>

<%= "Shipping Options".t %>

  <% shipping_options.each_with_index do |opt,index| %>

    <label for='shipping_<%= opt[1] %>'><input id='shipping_<%= opt[1] %>' type='radio' name='payment[shipping_category]' <%=  "checked='checked'" if payment[:shipping_category] == opt[1]  %> value="<%= opt[1] %>" onclick='document.getElementById("shopping_form_update").value=1; document.getElementById("submit_form").submit();' ><%= opt[0] %>

  <% end -%>

<% end -%>

<% if payment_processors.length > 1 %>

<%= "Payment Options".t %>

<% end -%>

<%= render :partial => '/shop/processor/payment_processors', :locals => { :payment_processors => payment_processors, :admin => false, :payment => payment, :user => myself } %>

<input type='submit' value='<%= vh "Place Order".t %>'/>

<% end -%>

</form>


Update Ring Website

Update Ring Website

        <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#myNavbar">

      </button>

Home

Download

Why?

Documentation

Ring 1.1 Documentation

Ring 1.0 Documentation

Community

Group

Resources

Team

		<form class="search" action="../doc/search.html" method="get" style="width:200px" >

				<input name="q" type="text" class="form-control" placeholder="Search for...">

				<button class="btn btn-default" type="submit">Go!</button>

			<input name="check_keywords" value="yes" type="hidden">
			<input name="area" value="default" type="hidden">
		</form>

					Download Ring

					Try Ring Online (Interactive Ring)

Innovative and practical general-purpose multi-paradigm language

        <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#myNavbar">

      </button>

Home

Download

Why?

Documentation

Community

Group

Resources

Team

		<form class="search" action="../doc/search.html" method="get" style="width:200px" >

				<input name="q" type="text" class="form-control" placeholder="Search for...">

				<button class="btn btn-default" type="submit">Go!</button>

			<input name="check_keywords" value="yes" type="hidden">
			<input name="area" value="default" type="hidden">
		</form>

					Download Ring

					Try Ring Online (Interactive Ring)

Innovative and practical general-purpose multi-paradigm language


hide Campuses tab of profile altogether if eventgroup doesn't use campuses

<% if @profile && !@profile.new_record? %>
  <% content_for "submenu" do %>
    <%= sub_menu_item 'misc', :profiles, :view, :id => @profile.id %>
    <%= sub_menu_item 'support received', :profiles, :support_received, :id => @profile.id %>
    <%= sub_menu_item 'costing', :profiles, :costing, :id => @profile.id %>
    <%= sub_menu_item 'paperwork', :profiles, :prep_items, :id => @profile.id %>
    <%= sub_menu_item 'travel', :profiles, :travel, :id => @profile.id %>
  <% end %>
<% else %>
  <% content_for "submenu" do %>
    <%= sub_menu_item 'Your Profiles', :profiles, :list %>
    <%- if @eg.has_your_campuses -%>
      <%= sub_menu_item 'Campus Info', :profiles, :campus_info %>
    <%- end -%>
    <%= sub_menu_item 'Personal Info and Crisis Info', :profiles, :crisis_info %>
  <% end %>
<% end %>

<% if @profile && !@profile.new_record? %>
  <% content_for "submenu" do %>
    <%= sub_menu_item 'misc', :profiles, :view, :id => @profile.id %>
    <%= sub_menu_item 'support received', :profiles, :support_received, :id => @profile.id %>
    <%= sub_menu_item 'costing', :profiles, :costing, :id => @profile.id %>
    <%= sub_menu_item 'paperwork', :profiles, :prep_items, :id => @profile.id %>
    <%= sub_menu_item 'travel', :profiles, :travel, :id => @profile.id %>
  <% end %>
<% else %>
  <% content_for "submenu" do %>
    <%= sub_menu_item 'Your Profiles', :profiles, :list %>
    <%= sub_menu_item 'Campus Info', :profiles, :campus_info %>
    <%= sub_menu_item 'Personal Info and Crisis Info', :profiles, :crisis_info %>
  <% end %>
<% end %>


fix an exception when a book is loaned

fix an exception when a book is loaned

<% if @item.owned_by? session[:user] %>

      <%= link_to image_tag("icons/edit.gif", :title => "edit"), edit_polymorphic_path(@item) %>
      <%= link_to image_tag("icons/delete.gif", :title => "delete"), {}, { :method => :delete, :confirm => "Are you sure you want to delete this item?" } %>

<% end %>

<%= image_tag("icons/#{h @item.type}.png") %> <%=h @item.title %>

<% if @item.owned_by? session[:user] and not @item.requests.empty? %>

		<%= calendar_date_select_includes 'silver' %>

Requested by:

		  <% @item.requests.each do |req| %>

			  <%= user_link req.borrower %>
			  <% unless @item.current_loan %>
				  <%= render :partial => 'loans/approval', :locals => { :req => req } %>
			  <% end %>

		  <% end %>

<% end %>

owner:
    <%= user_link @item.owner %>

tags:
    <%= @item.taggings.map do |t|
      link_to(h(t), tag_path(h(t.to_s)))
    end.join ', ' %>

	<% if current_user %>

distance:
		<%= distance(@item.owner.distance_from(current_user)) %>

	<% end %>
  <% default_content_for :additional_fields do %><% end %>

<% if @item.owned_by? session[:user] %>

Current Loan

	<% if @item.current_loan %>

Currently loaned to <%= user_link @item.current_loan.borrower %>.

		<% if @item.current_loan.memo %>
Memo: <%= h @item.current_loan.memo %>
<% end %>
		<%= button_to 'returned', loan_path(@item.current_loan), :method => :put %>
	<% else %>

Not currently loaned.

	<% form_tag loans_path, :method => 'post' do -%>
		<fieldset>
			<legend>loan to yourself</legend>
			<input type="hidden" name="item_id" value="<%=h @item.id %>">

Due Back:
				<%= calendar_date_select_tag 'return_date', '',
					:buttons => false,
					:format => :iso_date,
					:valid_date_check => "date > (new Date()).stripTime()" %>

Memo:	 <%= text_field_tag 'memo' %>

			<%= submit_tag 'loan' %>
		</fieldset>
	<% end %>
	<% end %>

<% elsif current_user %>
  <% if Loan.already_requested(current_user, @item) %>

You have already requested to borrow this item.

  <% else %>
    <%= button_to 'request loan', loans_path(:item_id => @item) %>
  <% end %>
<% end %>

Description

	<% default_content_for :additional_description do %><% end %>
	<%= paragraphize @item.description %>

<% if @item.owned_by? session[:user] %>

      <%= link_to image_tag("icons/edit.gif", :title => "edit"), edit_polymorphic_path(@item) %>
      <%= link_to image_tag("icons/delete.gif", :title => "delete"), {}, { :method => :delete, :confirm => "Are you sure you want to delete this item?" } %>

<% end %>

<%= image_tag("icons/#{h @item.type}.png") %> <%=h @item.title %>

<% if @item.owned_by? session[:user] and not @item.requests.empty? %>

		<%= calendar_date_select_includes 'silver' %>

Requested by:

		  <% @item.requests.each do |req| %>

			  <%= user_link req.borrower %>
			  <% unless @item.current_loan %>
				  <%= render :partial => 'loans/approval', :locals => { :req => req } %>
			  <% end %>

		  <% end %>

<% end %>

owner:
    <%= user_link @item.owner %>

tags:
    <%= @item.taggings.map do |t|
      link_to(h(t), tag_path(h(t.to_s)))
    end.join ', ' %>

	<% if current_user %>

distance:
		<%= distance(@item.owner.distance_from(current_user)) %>

	<% end %>
  <% default_content_for :additional_fields do %><% end %>

<% if @item.owned_by? session[:user] %>

Current Loan

	<% if @item.current_loan %>

Currently loaned to <%= user_link @item.current_loan.borrower %>.

		<% unless @item.current_loan.memo.empty? %>
Memo: <%= h @item.current_loan.memo %>
<% end %>
		<%= button_to 'returned', loan_path(@item.current_loan), :method => :put %>
	<% else %>

Not currently loaned.

	<% form_tag loans_path, :method => 'post' do -%>
		<fieldset>
			<legend>loan to yourself</legend>
			<input type="hidden" name="item_id" value="<%=h @item.id %>">

Due Back:
				<%= calendar_date_select_tag 'return_date', '',
					:buttons => false,
					:format => :iso_date,
					:valid_date_check => "date > (new Date()).stripTime()" %>

Memo:	 <%= text_field_tag 'memo' %>

			<%= submit_tag 'loan' %>
		</fieldset>
	<% end %>
	<% end %>

<% elsif current_user %>
  <% if Loan.already_requested(current_user, @item) %>

You have already requested to borrow this item.

  <% else %>
    <%= button_to 'request loan', loans_path(:item_id => @item) %>
  <% end %>
<% end %>

Description

	<% default_content_for :additional_description do %><% end %>
	<%= paragraphize @item.description %>


Removed Unused test link

Removed Unused test link

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

  <META http-equiv=Content-Type content="text/html; charset=UTF-8"/>
  <title>Mushroom Observer: <%= controller.action_name %></title>
  <%= css = nil
	if CSS.member?(controller.action_name)
		css = controller.action_name
	else
		unless @session['user'].nil?
        	css = @session['user'].theme
		end
	end
	unless CSS.member?(css)
		css = CSS[rand(CSS.length)]
	end
	stylesheet_link_tag 'general', css %>

		<%= @page_title || "Mushroom Observer" %>

								<%= link_to 'Introduction', :controller => 'observer',
								            :action => 'intro' %>

								<%= link_to 'New Observation', :controller => 'observer',
								            :action => 'new_observation' %>

								Observations:

								  <%= link_to 'Most Recent', :controller => 'observer',
								                        :action => 'list_observations' %>

								  <%= link_to 'By Name', :controller => 'observer',
								                        :action => 'observations_by_name' %>

								Images:

								  <%= link_to 'Most Recent', :controller => 'observer',
								                        :action => 'list_images' %>

								  <%= link_to 'By Title', :controller => 'observer',
								                        :action => 'images_by_title' %>

								<% if @session['user'].nil? %>
								Account:

								  <%= link_to 'Login', :controller => 'account',
								                        :action => 'login' %>

								  <%= link_to 'New Account', :controller => 'account',
														:action => 'signup' %>
								<% else %>
								Current user:

								  <%= h(@session['user'].login) %>

								  <%= link_to 'Preferences', :controller => 'account',
								                        :action => 'prefs' %>

								  <%= link_to 'Logout', :controller => 'account',
								                        :action => 'logout' %>
								<% end %>

									<%= link_to(sprintf('Colors from %s', css),
												:controller => 'observer', :action => 'color_themes') %>

<%= flash[:notice] %>

					<%= @content_for_layout %>

  <META http-equiv=Content-Type content="text/html; charset=UTF-8"/>
  <title>Mushroom Observer: <%= controller.action_name %></title>
  <%= css = nil
	if CSS.member?(controller.action_name)
		css = controller.action_name
	else
		unless @session['user'].nil?
        	css = @session['user'].theme
		end
	end
	unless CSS.member?(css)
		css = CSS[rand(CSS.length)]
	end
	stylesheet_link_tag 'general', css %>

		<%= @page_title || "Mushroom Observer" %>

								<%= link_to 'Introduction', :controller => 'observer',
								            :action => 'intro' %>

								<%= link_to 'New Observation', :controller => 'observer',
								            :action => 'new_observation' %>

								Observations:

								  <%= link_to 'Most Recent', :controller => 'observer',
								                        :action => 'list_observations' %>

								  <%= link_to 'By Name', :controller => 'observer',
								                        :action => 'observations_by_name' %>

								Images:

								  <%= link_to 'Most Recent', :controller => 'observer',
								                        :action => 'list_images' %>

								  <%= link_to 'By Title', :controller => 'observer',
								                        :action => 'images_by_title' %>

								<% if @session['user'].nil? %>
								Account:

								  <%= link_to 'Login', :controller => 'account',
								                        :action => 'login' %>

								  <%= link_to 'New Account', :controller => 'account',
														:action => 'signup' %>
								<% else %>
								Current user:

								  <%= h(@session['user'].login) %>

								  <%= link_to 'Preferences', :controller => 'account',
								                        :action => 'prefs' %>

								  <%= link_to 'Logout', :controller => 'account',
								                        :action => 'logout' %>
								<% end %>

								<%= link_to 'Unused', :controller => 'unused', :action => 'unused' %>

									<%= link_to(sprintf('Colors from %s', css),
												:controller => 'observer', :action => 'color_themes') %>

<%= flash[:notice] %>

					<%= @content_for_layout %>


resolve conflict

resolve conflict

Editing "<%=h @questionnaire.title%>"

<%= error_messages_for :questionnaire %>

<% ae_form_for(:questionnaire, @questionnaire, :url => questionnaire_path(@questionnaire), :html => { :method => :put }) do |f| %>
        <fieldset>
                <legend><%= link_to_function "Questionnaire properties", "$('questionnaire_properties).toggle();" %></legend>

            <%= f.text_field "title" %>
            <%= f.text_area "custom_html", :rows => 4 %>
            <%= f.text_area "custom_css", :rows => 4 %>
            Open for responses? <%= f.check_box "is_open" %>
            Allow "Finish Later"? <%= f.check_box "allow_finish_later" %>
            Allow "Amend Response"? <%= f.check_box "allow_amend_response" %>

                    <%= submit_tag "Save changes" %>

        </fieldset>
        <fieldset>
          <legend><%= link_to_function "Restrictions", "$('restrictions').toggle();" %></legend>

            <%= render :partial => "permission/show", :locals => { :item => @questionnaire } %>

        </fieldset>
<% end %>

Pages

      <%= render :partial => "pagelist", :locals => {:questionnaire => @questionnaire} %>
      <button onClick="createPage();">Create New Page</button>


quitado otro debugger en shared/lated_post

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

<%debugger%>
<%if @posts == nil%>
No post created
<%else%>
	<%@posts.each do |entry|%>
	<%=show_article(entry,entry.container)%>
	<% end -%>
<%end%>


Updated campaign table to display everyone

<% if flash[:notice] %>

        <%= flash[:notice] %> X

  <% end -%>

<% active_table_for 'campaign_table', @active_table_output,
                    :refresh_url => url_for(:action => 'display_campaign_table'),
                    :class => 'active_table',
                    :actions => [ [ 'Archive', 'archive', 'Archive the selected entries?' ],
                                  [ 'Duplicate', 'copy', 'Duplicate the selected entries? (Entries will be assigned new ID\'s)'] ],
                    :more_actions => [ [ 'Delete', 'delete','Are you sure you want to delete the selected campaigns?'], [ 'Pause', 'pause','Are you sure you want to pause the selected campaigns?'], ['Resend', 'resend'] ],
                    :update => 'campaign_table' do |t| %>
<tr <%= highlight_row 'campaign',t.id %>>
  <%= entry_checkbox "campaign",t.id %>

    <% if t.under_construction? %>
       <%= link_to t.name, :action => 'campaign' , :path => t.id  %>
    <% else -%>
       <%= t.name %>
    <% end -%>
    <%= " (#{'Archived'.t})" if t.archived? %>

  <% if t.market_segment  %>
      <%=
         case t.market_segment.segment_type
         when 'user_segment':
          'User List'.t
         when 'everyone':
          'Everyone'.t
         when 'subscription':
          t.market_segment.user_subscription.name
         else
          'Special Import'.t
         end
      %>
      <% else -%> - <% end -%>

  <span id='campaign_status_<%= t.id %>'>
           <%= render :partial => 'campaign_list_status', :locals => { :campaign =>  t } %>

  <span id='campaign_queue_size_<%= t.id %>'>
      <%= t.stat_queue_size > 0 ? t.stat_queue_size : '-' %>

  <span id='campaign_status_<%= t.id %>'>
    <span id='campaign_icon_<%= t.id %>'>
      <%= render :partial => 'campaign_list_icon', :locals => {:campaign => t } %>

    <% if t.status == 'initializing' || t.status == 'active' || t.status == 'sending' %>

    <% end -%>

    <%= t.created_at.localize(DEFAULT_DATE_FORMAT.t) %>

  <span id='campaign_sent_at_<%= t.id %>'>
    <%=  t.sent_at ? ago_format(Time.now() - t.sent_at) : '-' %>

    <% if !t.under_construction? %>
      <%= link_to theme_image_tag("icons/table_actions/document.gif"), :action => 'status', :path => t.id  %>
    <% else -%>
      -
    <% end -%>

<% end -%>

<% if flash[:notice] %>

        <%= flash[:notice] %> X

  <% end -%>

<% active_table_for 'campaign_table', @active_table_output,
                    :refresh_url => url_for(:action => 'display_campaign_table'),
                    :class => 'active_table',
                    :actions => [ [ 'Archive', 'archive', 'Archive the selected entries?' ],
                                  [ 'Duplicate', 'copy', 'Duplicate the selected entries? (Entries will be assigned new ID\'s)'] ],
                    :more_actions => [ [ 'Delete', 'delete','Are you sure you want to delete the selected campaigns?'], [ 'Pause', 'pause','Are you sure you want to pause the selected campaigns?'], ['Resend', 'resend'] ],
                    :update => 'campaign_table' do |t| %>
<tr <%= highlight_row 'campaign',t.id %>>
  <%= entry_checkbox "campaign",t.id %>

    <% if t.under_construction? %>
       <%= link_to t.name, :action => 'campaign' , :path => t.id  %>
    <% else -%>
       <%= t.name %>
    <% end -%>
    <%= " (#{'Archived'.t})" if t.archived? %>

  <% if t.market_segment  %>
      <%=
         case t.market_segment.segment_type
         when 'user_segment':
          'User List'.t
         when 'subscription':
          t.market_segment.user_subscription.name
         else
          'Special Import'.t
         end
      %>
      <% else -%> - <% end -%>

  <span id='campaign_status_<%= t.id %>'>
           <%= render :partial => 'campaign_list_status', :locals => { :campaign =>  t } %>

  <span id='campaign_queue_size_<%= t.id %>'>
      <%= t.stat_queue_size > 0 ? t.stat_queue_size : '-' %>

  <span id='campaign_status_<%= t.id %>'>
    <span id='campaign_icon_<%= t.id %>'>
      <%= render :partial => 'campaign_list_icon', :locals => {:campaign => t } %>

    <% if t.status == 'initializing' || t.status == 'active' || t.status == 'sending' %>

    <% end -%>

    <%= t.created_at.localize(DEFAULT_DATE_FORMAT.t) %>

  <span id='campaign_sent_at_<%= t.id %>'>
    <%=  t.sent_at ? ago_format(Time.now() - t.sent_at) : '-' %>

    <% if !t.under_construction? %>
      <%= link_to theme_image_tag("icons/table_actions/document.gif"), :action => 'status', :path => t.id  %>
    <% else -%>
      -
    <% end -%>

<% end -%>


Note on search index and renaming someone.

<%= error_messages_for 'admin_user' %>

Name (will change URL name and break URLs; unlike authorities, there is no history; you will need to rebuild the search index afterwards)

<%= text_field 'admin_user', 'name', :size => 60  %>

Email (you must first validate this)

<%= text_field 'admin_user', 'email', :size => 60  %>

Admin level (none or super; this is for admin features and links which are in the site proper)

<%= text_field 'admin_user', 'admin_level', :size => 60  %>

<%= error_messages_for 'admin_user' %>

Name (will change URL name and break URLs; unlike authorities, there is no history)

<%= text_field 'admin_user', 'name', :size => 60  %>

Email (you must first validate this)

<%= text_field 'admin_user', 'email', :size => 60  %>

Admin level (none or super; this is for admin features and links which are in the site proper)

<%= text_field 'admin_user', 'admin_level', :size => 60  %>


Improve warning wording.

Improve warning wording.

<% @title = "Make an " + h(@info_request.law_used_short) + " request to '" + h(@info_request.public_body.name) + "'" %>

<% if @existing_request %>

    <%= user_or_you_capital_link(@existing_request.user) %> already
    created the same request on <%=simple_date(@existing_request.created_at)%>.
    You can either view the <a href="<%=request_url(@existing_request)%>">existing request,
    or edit the details below to make a new but similar request.

<% end %>

<%= foi_error_messages_for :info_request, :outgoing_message %>

Read this before writing your <%=h(@info_request.law_used_full)%> request

        <% form_tag("http://www.google.co.uk/search", {:id => "search_body_website_form", :method => "get"} ) do %>

               First, search the authority's web site ...
               <% if !@info_request.public_body.calculated_home_page.nil? %>

                           <%= text_field_tag 'q', params[:q], { :size => 20 } %>
                   <%= hidden_field_tag 'as_sitesearch', @info_request.public_body.calculated_home_page %>
                   <%= submit_tag "Search" %>
               <% end %>

               ... to check that the info isn't already published.

        <% end %>

Write your request in simple, precise language.
    <% if @info_request.public_body.info_requests.size > 0 %>

Browse <%= link_to "other requests", public_body_url(@info_request.public_body)  %>
        to '<%= h(@info_request.public_body.name) %>'
        for examples of how to word your request.

    <% else %>

Browse <%= link_to "other requests", request_list_url %> for examples of how to word your request.

    <% end %>

Keep it focussed, if you ask for everything it might cost too much
    and you might get nothing.

Ask for particular documents, rather than general questions.

This site is public, everything you type (except your email address) and any response will be published.

    <% if @info_request.public_body.notes != "" %>

Special note for this authority!

<%=MySociety::Format.make_clickable(@info_request.public_body.notes) %>

    <% end %>

    <% if @info_request.public_body.eir_only? %>

Please ask for environmental information only

The Freedom of Information Act does not apply to <%=h(@info_request.public_body.name)%>.
        However, you have the right to request environmental
        information under a different law (explanation).
        This covers a very wide spectrum of information about the state of
        the natural and built environment, such as:

Air, water, soil, land, flora and fauna (including how these effect
        human beings)

Information on emissions and discharges (e.g. noise, energy,
        radiation, waste materials)

Human health and safety

Cultural sites and built structures (as they may be affected by the
        environmental factors listed above)

Plans and administrative measures that affect these matters

Please only request information that comes under those categories, do not waste your
        time or the time of the public authority by requesting unrelated information.

    <% end %>

<% form_for(:info_request, @info_request, :html => { :id => 'write_form' }  ) do |f| %>

			To:
			<%=h(@info_request.public_body.name)%>

			Summary:
			<%= f.text_field :title, :size => 50 %>

			(a one line summary of the information you are requesting,
			e.g.
            <% if @info_request.law_used == 'eir' %>
                'Pollution levels over time for the River Tyne'
            <% else %>
                'Crime statistics by ward level for Wales'
            <% end %>
            )

		<% fields_for :outgoing_message do |o| %>

			Your request:
			<%= o.text_area :body, :rows => 20, :cols => 60 %>

		<% end %>

        <% if !@user %>

                Everything that you enter on this page, including your name,
                will be displayed publicly on
                this website (why?).
                If you would like to use a pseudonym,
                please read this first.

        <% else %>

                Everything that you enter on this page
                will be displayed publicly on
                this website (why?).

        <% end %>

			Can I request information about myself?
			No! (Click here for details)

			<%= f.hidden_field(:public_body_id, { :value => @info_request.public_body_id } ) %>
			<%= hidden_field_tag(:submitted_new_request, 1 ) %>
			<%= hidden_field_tag(:preview, 1 ) %>
			<%= submit_tag "Preview your public request" %>

<% end %>

<% @title = "Make an " + h(@info_request.law_used_short) + " request to '" + h(@info_request.public_body.name) + "'" %>

<% if @existing_request %>

    <%= user_or_you_capital_link(@existing_request.user) %> already
    created the same request on <%=simple_date(@existing_request.created_at)%>.
    You can either view the <a href="<%=request_url(@existing_request)%>">existing request,
    or edit the details below to make a new but similar request.

<% end %>

<%= foi_error_messages_for :info_request, :outgoing_message %>

Read this before writing your <%=h(@info_request.law_used_full)%> request

        <% form_tag("http://www.google.co.uk/search", {:id => "search_body_website_form", :method => "get"} ) do %>

               First, search the authority's web site ...
               <% if !@info_request.public_body.calculated_home_page.nil? %>

                           <%= text_field_tag 'q', params[:q], { :size => 20 } %>
                   <%= hidden_field_tag 'as_sitesearch', @info_request.public_body.calculated_home_page %>
                   <%= submit_tag "Search" %>
               <% end %>

               ... to check that the info isn't already published.

        <% end %>

Write your request in simple, precise language.
    <% if @info_request.public_body.info_requests.size > 0 %>

Browse <%= link_to "other requests", public_body_url(@info_request.public_body)  %>
        to '<%= h(@info_request.public_body.name) %>'
        for examples of how to word your request.

    <% else %>

Browse <%= link_to "other requests", request_list_url %> for examples of how to word your request.

    <% end %>

Keep it focussed, if you ask for everything it might cost too much
    and you might get nothing.

Ask for particular documents, rather than general questions.

This site is public, everything you type (except your email address) and any response will be published.

    <% if @info_request.public_body.notes != "" %>

Special note for this authority!

<%=MySociety::Format.make_clickable(@info_request.public_body.notes) %>

    <% end %>

    <% if @info_request.public_body.eir_only? %>

Please ask for environmental information only

The Freedom of Information Act does not apply to <%=h(@info_request.public_body.name)%>.
        However, you have the right to request environmental
        information under a different law (explanation).
        This covers a very wide spectrum of information about the state of
        the natural and built environment, such as:

Air, water, soil, land, flora and fauna (including how these effect
        human beings)

Information on emissions and discharges (e.g. noise, energy,
        radiation, waste materials)

Human health and safety

Cultural sites and built structures (as they may be affected by the
        environmental factors listed above)

Plans and administrative measures that affect these matters

Please only request information that comes under those categories, do not waste your
        time or the time of the public authority by requesting unrelated information.

    <% end %>

<% form_for(:info_request, @info_request, :html => { :id => 'write_form' }  ) do |f| %>

			To:
			<%=h(@info_request.public_body.name)%>

			Summary:
			<%= f.text_field :title, :size => 50 %>

			(a one line summary of the information you are requesting,
			e.g.
            <% if @info_request.law_used == 'eir' %>
                'Pollution levels over time for the River Tyne'
            <% else %>
                'Crime statistics by ward level for Wales'
            <% end %>
            )

		<% fields_for :outgoing_message do |o| %>

			Your request:
			<%= o.text_area :body, :rows => 20, :cols => 60 %>

		<% end %>

        <% if !@user %>

                All information that you enter
                on this page, including your name, will be
                displayed publicly on this website
                (why?).

                We encourage you to use
                your real name, but you may use a pseudonym if you
                read this first.
                Any response you get will also be published.

        <% else %>

                Privacy warning: All information that you enter
                on this page will be displayed publicly on this website. Any
                response you get will also be published.
                See our privacy policy.

        <% end %>

			Can I request information about myself?
			No! (Click here for details)

			<%= f.hidden_field(:public_body_id, { :value => @info_request.public_body_id } ) %>
			<%= hidden_field_tag(:submitted_new_request, 1 ) %>
			<%= hidden_field_tag(:preview, 1 ) %>
			<%= submit_tag "Preview your public request" %>

<% end %>


fix local sharing_mode variable

fix local sharing_mode variable

<%# initialization: required to keep javascript independent of the access type codes, to allow the use the constants instead -%>
<input type="hidden" id="const_private" value="<%= Policy::PRIVATE -%>"/>
<input type="hidden" id="const_everyone" value="<%= Policy::EVERYONE -%>"/>
<input type="hidden" id="const_all_registered_users" value="<%= Policy::ALL_REGISTERED_USERS -%>"/>
<input type="hidden" id="const_all_elab_users" value="<%= Policy::ALL_ELAB_USERS -%>"/>
<input type="hidden" id="const_custom_permissions_only" value="<%= Policy::CUSTOM_PERMISSIONS_ONLY -%>"/>

<input type="hidden" id="const_determined_by_group" value="<%= Policy::DETERMINED_BY_GROUP -%>"/>
<input type="hidden" id="const_no_access" value="<%= Policy::NO_ACCESS -%>"/>
<input type="hidden" id="const_viewing" value="<%= Policy::VIEWING -%>"/>
<input type="hidden" id="const_downloading" value="<%= Policy::DOWNLOADING -%>"/>
<input type="hidden" id="const_editing" value="<%= Policy::EDITING -%>"/>

<%# this hidden input will submit all permission data with the form -%>
<%= hidden_field_tag "sharing[permissions][contributor_types]", "" -%>
<%= hidden_field_tag "sharing[permissions][values]", "" -%>

    Sharing

    		Here you can specify who can view and download this <% if @resource_type=="Script" -%>
                Script/Method
                <% elsif @resource_type=="Csvarchive" -%>
                Data Extract
                <% else -%>
                <%= @resource_type -%>
                <% end -%>

<label for="sharing_scope_<%= Policy::PRIVATE -%>">
    	<input type="hidden" name="sharing[access_type_<%= Policy::PRIVATE -%>]" value="<%= Policy::NO_ACCESS -%>"/>
			<input type="hidden" name="sharing[include_custom_sharing_<%= Policy::PRIVATE -%>]" value="0"/>

			<input <%= 'checked="checked"' if @sharing_mode == Policy::PRIVATE %> id="sharing_scope_<%= Policy::PRIVATE -%>" name="sharing[sharing_scope]"
            value="<%= Policy::PRIVATE -%>" type="radio" onclick="javascript:setSharingElementVisibility(<%= Policy::PRIVATE -%>);" />
        - Keep this <% if @resource_type=="Script" -%>
                Script/Method
                <% else -%>
                <%= @resource_type -%>
                <% end -%> private.

Or share it with..

    	<label for="sharing_scope_<%= Policy::ALL_REGISTERED_USERS -%>">
      	<input type="radio" <%= 'checked="checked"' if @sharing_mode == Policy::ALL_REGISTERED_USERS -%> id="sharing_scope_<%= Policy::ALL_REGISTERED_USERS -%>" name="sharing[sharing_scope]"
              value="<%= Policy::ALL_REGISTERED_USERS -%>" onclick="javascript:setSharingElementVisibility(<%= Policy::ALL_REGISTERED_USERS -%>);" />
          - All registered users for

		  <%= render :partial => "assets/sharing_form_access_type_dropdown", :locals => { :access_type_selector_for_scope => Policy::ALL_REGISTERED_USERS,
			                                                                             :sharing_scope => @sharing_mode, :access_type => @access_mode } -%>

	    	<label for="sharing_scope_<%= Policy::CUSTOM_PERMISSIONS_ONLY -%>">
	      	<input type="radio" <%= 'checked="checked"' if @sharing_mode == Policy::CUSTOM_PERMISSIONS_ONLY -%> id="include_custom_sharing_<%= Policy::CUSTOM_PERMISSIONS_ONLY -%>" name="sharing[sharing_scope]"
	              value="<%= Policy::CUSTOM_PERMISSIONS_ONLY-%>" onclick="javascript:setSharingElementVisibility(<%= Policy::CUSTOM_PERMISSIONS_ONLY-%>);" />
	          - Specific Groups

				<%#= work_group_popup_link_action_new() -%>
				<div id="specific_sharing" <%= @sharing_mode == Policy::CUSTOM_PERMISSIONS_ONLY ? hide_style(false) : hide_style(true) -%>>

						Share with group(s):

					<%= render :partial => "assets/workgroup_selector", :locals => { :resource_id => "groups", :resource_type => "Groups",   # this is only for presentation, not for any processing
				      :collection=>groups,:selected=>selected_groups,:authorization_for_showing_already_done => false } -%>

<%# initialization: required to keep javascript independent of the access type codes, to allow the use the constants instead -%>
<input type="hidden" id="const_private" value="<%= Policy::PRIVATE -%>"/>
<input type="hidden" id="const_everyone" value="<%= Policy::EVERYONE -%>"/>
<input type="hidden" id="const_all_registered_users" value="<%= Policy::ALL_REGISTERED_USERS -%>"/>
<input type="hidden" id="const_all_elab_users" value="<%= Policy::ALL_ELAB_USERS -%>"/>
<input type="hidden" id="const_custom_permissions_only" value="<%= Policy::CUSTOM_PERMISSIONS_ONLY -%>"/>

<input type="hidden" id="const_determined_by_group" value="<%= Policy::DETERMINED_BY_GROUP -%>"/>
<input type="hidden" id="const_no_access" value="<%= Policy::NO_ACCESS -%>"/>
<input type="hidden" id="const_viewing" value="<%= Policy::VIEWING -%>"/>
<input type="hidden" id="const_downloading" value="<%= Policy::DOWNLOADING -%>"/>
<input type="hidden" id="const_editing" value="<%= Policy::EDITING -%>"/>

<%# this hidden input will submit all permission data with the form -%>
<%= hidden_field_tag "sharing[permissions][contributor_types]", "" -%>
<%= hidden_field_tag "sharing[permissions][values]", "" -%>

    Sharing

    		Here you can specify who can view and download this <% if @resource_type=="Script" -%>
                Script/Method
                <% elsif @resource_type=="Csvarchive" -%>
                Data Extract
                <% else -%>
                <%= @resource_type -%>
                <% end -%>

<label for="sharing_scope_<%= Policy::PRIVATE -%>">
    	<input type="hidden" name="sharing[access_type_<%= Policy::PRIVATE -%>]" value="<%= Policy::NO_ACCESS -%>"/>
			<input type="hidden" name="sharing[include_custom_sharing_<%= Policy::PRIVATE -%>]" value="0"/>

			<input <%= 'checked="checked"' if @sharing_mode == Policy::PRIVATE %> id="sharing_scope_<%= Policy::PRIVATE -%>" name="sharing[sharing_scope]"
            value="<%= Policy::PRIVATE -%>" type="radio" onclick="javascript:setSharingElementVisibility(<%= Policy::PRIVATE -%>);" />
        - Keep this <% if @resource_type=="Script" -%>
                Script/Method
                <% else -%>
                <%= @resource_type -%>
                <% end -%> private.

Or share it with..

    	<label for="sharing_scope_<%= Policy::ALL_REGISTERED_USERS -%>">
      	<input type="radio" <%= 'checked="checked"' if @sharing_mode == Policy::ALL_REGISTERED_USERS -%> id="sharing_scope_<%= Policy::ALL_REGISTERED_USERS -%>" name="sharing[sharing_scope]"
              value="<%= Policy::ALL_REGISTERED_USERS -%>" onclick="javascript:setSharingElementVisibility(<%= Policy::ALL_REGISTERED_USERS -%>);" />
          - All registered users for

		  <%= render :partial => "assets/sharing_form_access_type_dropdown", :locals => { :access_type_selector_for_scope => Policy::ALL_REGISTERED_USERS,
			                                                                             :sharing_scope => @sharing_mode, :access_type => @access_mode } -%>

	    	<label for="sharing_scope_<%= Policy::CUSTOM_PERMISSIONS_ONLY -%>">
	      	<input type="radio" <%= 'checked="checked"' if sharing_mode == Policy::CUSTOM_PERMISSIONS_ONLY -%> id="include_custom_sharing_<%= Policy::CUSTOM_PERMISSIONS_ONLY -%>" name="sharing[sharing_scope]"
	              value="<%= Policy::CUSTOM_PERMISSIONS_ONLY-%>" onclick="javascript:setSharingElementVisibility(<%= Policy::CUSTOM_PERMISSIONS_ONLY-%>);" />
	          - Specific Groups

				<%#= work_group_popup_link_action_new() -%>
				<div id="specific_sharing" <%= sharing_mode == Policy::CUSTOM_PERMISSIONS_ONLY ? hide_style(false) : hide_style(true) -%>>

						Share with group(s):

					<%= render :partial => "assets/workgroup_selector", :locals => { :resource_id => "groups", :resource_type => "Groups",   # this is only for presentation, not for any processing
				      :collection=>groups,:selected=>selected_groups,:authorization_for_showing_already_done => false } -%>


added show login in problem stat view

added show login in problem stat view

git-svn-id: bd379d88a756ded56d998f9d005ecc36158942ed@362 6386c4cd-e34a-4fa8-8920-d93eb39b512e

Problem stat: <%= @problem.name %>

This is just a hack.  Really not efficient.

<% if @submissions!=nil %>

    login
    name
    submitted_at
    points
    comment

  <% count = 0 %>
  <% @submissions.each do |sub| %>
    <tr class="<%= (count % 2 ==0) ? "info-even" : "info-odd" %>">
    <%= sub.user.login %>
    <%= sub.user.full_name if sub.user %>
    <%= sub.submitted_at.to_s %>
    <%= sub.points %>

<%= sub.grader_comment %>

    <% count += 1 %>
  <% end %>

<% else %>
No submission
<% end %>

Problem stat: <%= @problem.name %>

This is just a hack.  Really not efficient.

<% if @submissions!=nil %>

    user_id
    submitted_at
    points
    comment

  <% count = 0 %>
  <% @submissions.each do |sub| %>
    <tr class="<%= (count % 2 ==0) ? "info-even" : "info-odd" %>">
    <%= sub.user.full_name if sub.user %>
    <%= sub.submitted_at.to_s %>
    <%= sub.points %>

<%= sub.grader_comment %>

    <% count += 1 %>
  <% end %>

<% else %>
No submission
<% end %>


Add press release link

Add press release link

<% @title = "Prensa" %>

Prensa

Noticias sobre tuderechoasaber.es, así como imágenes, logos y otros materiales útiles para los medios de comunicación.

Notas de prensa

22/3/2012: tuderechoasaber.es permitirá comprobar la eficacia de la futura Ley de Transparencia

3/12/2012: Las instituciones no responden al 47% de las solicitudes de información pese a la inminente Ley de Transparencia

tuderechoasaber.es en los medios

Una web para la transparencia. (El País, 19/11/2011)

Crean una web para pedir una ley de acceso a la información pública (La Información, 05/03/2012)

S'estrena una eina 2.0 que recorda el dret a obtenir informació pública (324.cat, 05/03/2012)

Nos lo ocultan, ¿por qué? (El País, 18/03/2012)

¿Un gobierno más transparente? (Yorokobu, 20/03/2012)

Las administraciones no saben, no contestan (El Periódico, 20/03/2012)

Tienes derecho a saber qué hacen tus gobernantes (Yorokobu, 21/03/2012)

El voto se convierte en dinero (eldiario.es, 23/11/2012)

Imágenes

Logotipo tuderechoasaber.es

Logotipo Access Info Europe

Logotipo Fundación Ciudadana Civio

Entrega simbólica de "cheques colectivos" a los dos primeros proyectos cofinanciados a través de Goteo.org: Tuderechoasaber.es y #bookcamping:
        1,
        2

        Fotógrafo: Carlos Cazurro bajo licencia CC BY-NC-ND 2.0.

Contactos de prensa

Access Info Europe: Victoria Anderica. victoria@access-info.org / tlf. 606592976

Fundación Ciudadana Civio: Javier de Vega – javier@civio.es  / tlf. 650074421

<% @title = "Prensa" %>

Prensa

Noticias sobre tuderechoasaber.es, así como imágenes, logos y otros materiales útiles para los medios de comunicación.

Notas de prensa

22/3/2012: tuderechoasaber.es permitirá comprobar la eficacia de la futura Ley de Transparencia

tuderechoasaber.es en los medios

Una web para la transparencia. (El País, 19/11/2012)

Crean una web para pedir una ley de acceso a la información pública (La Información, 05/03/2012)

S'estrena una eina 2.0 que recorda el dret a obtenir informació pública (324.cat, 05/03/2012)

Nos lo ocultan, ¿por qué? (El País, 18/03/2012)

¿Un gobierno más transparente? (Yorokobu, 20/03/2012)

Las administraciones no saben, no contestan (El Periódico, 20/03/2012)

Tienes derecho a saber qué hacen tus gobernantes (Yorokobu, 21/03/2012)

El voto se convierte en dinero (eldiario.es, 23/11/2012)

Imágenes

Logotipo tuderechoasaber.es

Logotipo Access Info Europe

Logotipo Fundación Ciudadana Civio

Entrega simbólica de "cheques colectivos" a los dos primeros proyectos cofinanciados a través de Goteo.org: Tuderechoasaber.es y #bookcamping:
        1,
        2

        Fotógrafo: Carlos Cazurro bajo licencia CC BY-NC-ND 2.0.

Contactos de prensa

Access Info Europe: Victoria Anderica. victoria@access-info.org / tlf. 606592976

Fundación Ciudadana Civio: Javier de Vega – javier@civio.es  / tlf. 650074421


Last changed header.

Last changed header.

<%
	idstr = Knj::Php.md5("#{_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"]}")

	tmp_use = false
	tmp_write = false
	if $knj_webscripts_image_config
		tmp_use = true
		tmp_path = "#{$knj_webscripts_image_config["tmp_path"]}/#{idstr}"
		tmp_exists = File.exists?(tmp_path)
		tmp_write = true if !tmp_exists

		if !tmp_write and tmp_exists
			time_orig = File.mtime(_get["path"])
			time_cache = File.mtime(tmp_path)

			if time_orig > time_cache
				tmp_write = true
			end
		end
	end

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

	if !tmp_use or tmp_write or _get["force"].to_i > 0
    pic = Magick::Image.read(_get["path"]).first
    pic.format = "png"

		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

      Knj::Image.rounded_corners(args)
    end

		blob_cont = pic.to_blob
	end

	if tmp_write and blob_cont
		Knj::Php.file_put_contents(tmp_path, blob_cont)
	end

	if tmp_use
    Knj::Php.header("Last-Modified: #{time_orig.httpdate} GMT")
		Knj::Php.header("Content-Type: image/png")
		print File.read(tmp_path)
	else
    Knj::Php.header("Last-Modified: #{time_orig.httpdate} GMT")
		Knj::Php.header("Content-Type: image/png")
		print blob_cont
	end
%>

<%
	idstr = Knj::Php.md5("#{_get["path"]}_#{_get["smartsize"].to_i}_#{_get["width"].to_i}_#{_get["height"].to_i}_#{_get["maxwidth"].to_i}_#{_get["maxheight"].to_i}_#{_get["border"].to_i}_#{_get["border_color"]}")

	tmp_use = false
	tmp_write = false
	if $knj_webscripts_image_config
		tmp_use = true
		tmp_path = "#{$knj_webscripts_image_config["tmp_path"]}/#{idstr}"
		tmp_exists = File.exists?(tmp_path)
		tmp_write = true if !tmp_exists

		if !tmp_write and tmp_exists
			time_orig = File.mtime(_get["path"])
			time_cache = File.mtime(tmp_path)

			if time_orig > time_cache
				tmp_write = true
			end
		end
	end

	if !tmp_use or tmp_write or _get["force"].to_i > 0
    pic = Magick::ImageList.new(_get["path"])
		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

      Knj::Image.rounded_corners(args)
    end

		pic.format = "png"
		blob_cont = pic.to_blob
	end

	if tmp_write and blob_cont
		Knj::Php.file_put_contents(tmp_path, blob_cont)
	end

	if tmp_use
		Knj::Php.header("Content-Type: image/png")
		print File.read(tmp_path)
	else
		Knj::Php.header("Content-Type: image/png")
		print blob_cont
	end
%>


Escape HTML tags in the page title.  Closes #519

git-svn-id: 70ab0960c3db1cbf656efd6df54a8f3de72dc710@748 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">

  <title><%=h page_title %></title>
  <meta http-equiv="content-type" content="text/html; charset=utf-8" />
  <%= meta_tag 'ICBM', config_value(:geourl_location)  %>
  <link rel="EditURI" type="application/rsd+xml" title="RSD" href="<%= server_url_for :controller => 'xml', :action => 'rsd' %>" />
  <link rel="alternate" type="application/rss+xml" title="RSS" href="<%= @auto_discovery_url_rss %>" />
  <link rel="alternate" type="application/atom+xml" title="Atom" href="<%= @auto_discovery_url_atom %>" />
  <%= stylesheet_link_tag "/stylesheets/theme/azure", :media => 'all' %>
  <%= stylesheet_link_tag "/stylesheets/user-styles", :media => 'all' %>
  <%= stylesheet_link_tag "/stylesheets/theme/print", :media => 'print' %>
  <%= javascript_include_tag "cookies" %>
  <%= javascript_include_tag "prototype" %>
  <%= javascript_include_tag "effects" %>
  <%= javascript_include_tag "typo" %>
  <% benchmark "BENCHMARK: layout/script" do %>

  <% end %>

<% benchmark "BENCHMARK: layout/body" do %>

<%= link_to config_value('blog_name'), { :controller => '/' } %>

<%= config_value('blog_subtitle') %>

 <%= render :partial => "shared/search" %>

      <% benchmark "BENCHMARK: layout/content" do %>

          <%= @content_for_layout %>
          <%= javascript_tag "show_dates_as_local_time()" %>

        <% end %>

            <% benchmark "BENCHMARK: layout/sidebars" do %>
              <%= render_sidebars %>
            <% end %>

            <%= link_to image_tag("powered.gif"),  "http://typo.leetsoft.com/", {:class => "powered" } %>

Valid XHTML 1.0

<a href="http://jigsaw.w3.org/css-validator/validator?uri=<%= server_url_for :controller => 'articles' %>">Valid CSS

<% end %>

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

  <title><%= page_title %></title>
  <meta http-equiv="content-type" content="text/html; charset=utf-8" />
  <%= meta_tag 'ICBM', config_value(:geourl_location)  %>
  <link rel="EditURI" type="application/rsd+xml" title="RSD" href="<%= server_url_for :controller => 'xml', :action => 'rsd' %>" />
  <link rel="alternate" type="application/rss+xml" title="RSS" href="<%= @auto_discovery_url_rss %>" />
  <link rel="alternate" type="application/atom+xml" title="Atom" href="<%= @auto_discovery_url_atom %>" />
  <%= stylesheet_link_tag "/stylesheets/theme/azure", :media => 'all' %>
  <%= stylesheet_link_tag "/stylesheets/user-styles", :media => 'all' %>
  <%= stylesheet_link_tag "/stylesheets/theme/print", :media => 'print' %>
  <%= javascript_include_tag "cookies" %>
  <%= javascript_include_tag "prototype" %>
  <%= javascript_include_tag "effects" %>
  <%= javascript_include_tag "typo" %>
  <% benchmark "BENCHMARK: layout/script" do %>

  <% end %>

<% benchmark "BENCHMARK: layout/body" do %>

<%= link_to config_value('blog_name'), { :controller => '/' } %>

<%= config_value('blog_subtitle') %>

 <%= render :partial => "shared/search" %>

      <% benchmark "BENCHMARK: layout/content" do %>

          <%= @content_for_layout %>
          <%= javascript_tag "show_dates_as_local_time()" %>

        <% end %>

            <% benchmark "BENCHMARK: layout/sidebars" do %>
              <%= render_sidebars %>
            <% end %>

            <%= link_to image_tag("powered.gif"),  "http://typo.leetsoft.com/", {:class => "powered" } %>

Valid XHTML 1.0

<a href="http://jigsaw.w3.org/css-validator/validator?uri=<%= server_url_for :controller => 'articles' %>">Valid CSS

<% end %>


ActionItem898: removing unused template

ActionItem898: removing unused template

<%= _('There is no such page: %s') % (content_tag('tt', @path)) %>


Get links right.

Get links right.

<%
    existing_track = TrackThing.find_by_existing_track(@user, track_thing.track_query)
    tracking_people = []
    if list_people
        tracking_people = TrackThing.find_tracking_people(track_thing.track_query)
    end
%>

<% if (not list_people) or tracking_people.size > 0 %>
    <% if tracking_people.size > 0 %>

        <% for u in tracking_people %>

<%=user_link(u)%>

        <% end %>

    <% end %>

        <% if existing_track %>
            You are already <%= track_thing.params[:verb_on_page_already] %>
            (<%= link_to "alter your subscriptions", user_url(@user) %>).
        <% else %>
            <% if own_request %>

You will be emailed when there are updates to your own request.

You may also <%= link_to "get an RSS feed", do_track_url(track_thing) %>

            <% else %>
                <%= link_to track_thing.params[:verb_on_page], do_track_url(track_thing) %>
                (by email or RSS feed )
            <% end %>
        <% end %>

<% else %>
    <% if own_request %>

You will be emailed when there are updates to your own request.

You may also get an <%= link_to 'RSS feed', do_track_url(track_thing) %>

    <% else %>

Be the first to <%= link_to track_thing.params[:verb_on_page].downcase, do_track_url(track_thing) %>
        (by email or RSS feed )

    <% end %>
<% end %>

<%
    existing_track = TrackThing.find_by_existing_track(@user, track_thing.track_query)
    if list_people
        tracking_people = TrackThing.find_tracking_people(track_thing.track_query)
    end
%>

<% if not list_people %>

<%= link_to track_thing.params[:verb_on_page], do_track_url(track_thing) %>
    (by email or RSS feed )

<% elsif tracking_people.size > 0 %>

    <% for u in tracking_people %>

<%=user_link(u)%>

    <% end %>

        <% if existing_track %>
            You are already <%= track_thing.params[:verb_on_page_already] %>
            (<%= link_to "alter your subscriptions", user_url(@user) %>).
        <% else %>
            <% if own_request %>

You will be emailed when there are updates to your own request.

You may also <%= link_to "get an RSS feed", do_track_url(track_thing) %>

            <% else %>
                <%= link_to track_thing.params[:verb_on_page], do_track_url(track_thing) %>
                (by email or RSS feed )
            <% end %>
        <% end %>

<% else %>
    <% if own_request %>

You will be emailed when there are updates to your own request.

You may also get an <%= link_to 'RSS feed', do_track_url(track_thing) %>

    <% else %>

Be the first to <%= link_to track_thing.params[:verb_on_page].downcase, do_track_url(track_thing) %>
        (by email or RSS feed )

    <% end %>
<% end %>


setting lon2 correctly. Was displaying one of the bbox numbers wrong

  <% cl = cycle('table0', 'table1') %>

  <td class="<%= cl %>">
    #<%= changeset.id %>

  <td class="<%= cl %>">
    <% if changeset.closed_at > DateTime.now %> (still editing)
    <% else %><%= changeset.closed_at.strftime("%d %b %Y %H:%M") %><% end %>

  <td class="<%= cl %>">
    <% if changeset.tags['comment'] %>
      <%= changeset.tags['comment'] %>
    <% else %>
      (none)
    <% end %>

  <td class="<%= cl %>">
    <% if changeset.min_lat.nil? %>
      (no edits)
    <% else
      lat1 = changeset.min_lat/GeoRecord::SCALE.to_f
      lat2 = changeset.max_lat/GeoRecord::SCALE.to_f
      lon1 = changeset.min_lon/GeoRecord::SCALE.to_f
      lon2 = changeset.max_lon/GeoRecord::SCALE.to_f
    %>
      (<a href='/?lat=<%= lat1 %>&lon=<%= lon1 %>&zoom=14'><%= format("%0.3f",lat1) -%>,<%= format("%0.3f",lon1) -%>) to
      (<a href='/?lat=<%= lat2 %>&lon=<%= lon2 %>&zoom=14'><%= format("%0.3f",lat2) -%>,<%= format("%0.3f",lon2) -%>)
  <% end %>

  <td class="<%= cl %>">
    <%= link_to 'more', {:controller => 'browse', :action => 'changeset', :id => changeset.id}, {:title => 'View changeset details'} %>

  <% cl = cycle('table0', 'table1') %>

  <td class="<%= cl %>">
    #<%= changeset.id %>

  <td class="<%= cl %>">
    <% if changeset.closed_at > DateTime.now %> (still editing)
    <% else %><%= changeset.closed_at.strftime("%d %b %Y %H:%M") %><% end %>

  <td class="<%= cl %>">
    <% if changeset.tags['comment'] %>
      <%= changeset.tags['comment'] %>
    <% else %>
      (none)
    <% end %>

  <td class="<%= cl %>">
    <% if changeset.min_lat.nil? %>
      (no edits)
    <% else
      lat1 = changeset.min_lat/GeoRecord::SCALE.to_f
      lat2 = changeset.max_lat/GeoRecord::SCALE.to_f
      lon1 = changeset.min_lon/GeoRecord::SCALE.to_f
      lon2 = changeset.min_lon/GeoRecord::SCALE.to_f
    %>
      (<a href='/?lat=<%= lat1 %>&lon=<%= lon1 %>&zoom=14'><%= format("%0.3f",lat1) -%>,<%= format("%0.3f",lon1) -%>) to
      (<a href='/?lat=<%= lat2 %>&lon=<%= lon2 %>&zoom=14'><%= format("%0.3f",lat2) -%>,<%= format("%0.3f",lon2) -%>)
  <% end %>

  <td class="<%= cl %>">
    <%= link_to 'more', {:controller => 'browse', :action => 'changeset', :id => changeset.id}, {:title => 'View changeset details'} %>


Giving the comment list a new look and feel.

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

<% @page_heading = "Comments for #{ link_to h(@article.title), :controller => '/admin/content', :action => 'show', :id => @article }" %>

  <% content_for('tasks') do %>
    <%= task_new('Write a comment') %>

<%= link_to _('Manage articles'), :controller => '/admin/content', :action => 'list' %>

  <% end %>

	<% for comment in @comments -%>

<%= mail_to h(comment.email), h(comment.author) %> |
		<%= link_to_unless comment.url.blank?, h(comment.url), comment.url %> |
		IP: <%=h comment.ip %>

		<%= comment.body %>

<%=comment.created_at.strftime("%d/%m/%Y at %H:%M") %> – [
		   <%= link_to_edit comment %> |
		   <%= link_to_destroy comment %> |
		   <%= comment.state %> ]

	<% end -%>

<% @page_heading = "Comments for #{ link_to h(@article.title), :controller => '/admin/content', :action => 'show', :id => @article }" %>

  <% content_for('tasks') do %>
    <%= task_new('Write a comment') %>

<%= link_to _('Manage articles'), :controller => '/admin/content', :action => 'list' %>

  <% end %>

      <%= _("Author")%>
      <%= _("Email")%>
      <%= _("Body")%>
      <%= _("IP")%>
      <%= _("Posted date")%>
	  <%= _("Status")%>
	  <%= _("Action") %>

    <% for comment in @comments -%>

       <%=link_to_unless comment.url.blank?, h(comment.author), comment.url %>
      <%=h comment.email %>
      <%= link_to_permalink comment, truncate((comment.body).strip_html) %>
      <%=h comment.ip %>
      <%=comment.created_at.strftime("%d/%m/%Y at %H:%M") %>
	  <%= image_tag 'checked.png' %>
	  <%= link_to_show comment %>
      <%= link_to_edit comment %>
      <%= link_to_destroy comment %>

    <% end -%>


Text change.

Text change.

To let us know, follow this link and then select the appropriate box.

<%=@url%>

Your request was called '<%= @info_request.title %>'. Letting everyone know
whether you got the information will help us keep tabs on
<%= @info_request.public_body.name %>.

-- the WhatDoTheyKnow team

To let us know, follow this link and then select the appropriate box.

<%=@url%>

-- the WhatDoTheyKnow team


Fixed formatting of show page.

Fixed formatting of show page.

<% if is_confirmed_member_of_team(session[:person].id, @team.id) %>

  <% @heading=@task.name %>
  <% @h1class='task' %>

  <% @breadcrumbs = link_to_team(@team, 'breadcrumb') + " > " + link_to_list(@list, 'breadcrumb') + " > " + link_to_task(@task, 'breadcrumb') %>

  <% @links = [] %>
  <% @links += [{:url => "/tasks/edit/" + @task.id.to_s, :title => "Edit task", :accesskey => "e"}] %>
  <% if @task.status == 'active' %>
    <% @links += [{:url => "/tasks/disactivate/" + @task.id.to_s, :title => "Make inactive", :accesskey => "i"}] %>
  <% else %>
    <% @links += [{:url => "/tasks/activate/" + @task.id.to_s, :title => "Make active", :accesskey => "a"}] %>
  <% end %>
  <% @links += [{:url => "/tasks/destroy/" + @task.id.to_s, :title => "Delete task", :accesskey => "d", :onclick => "return confirm('Are you sure you want to delete this task?');"}] %>
  <% @links += [{:url => "/tasks/markdone/" + @task.id.to_s, :title => "Mark as done", :accesskey => "m"}] %>
  <% @links += [{:url => "/tasks/nudge/" + @task.id.to_s, :title => "Nudge someone", :accesskey => "n"}] %>

    <% unless @task.picture.blank? %>
      <%= show_picture(@task.picture) %>

    <% end %>

    <%= link_to('Choose a picture', :controller => 'pictures', :action => 'choose', :task => @task.id) %>

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

        Description:
        <%= textilize @task.description %>

    <% end %>

      Status:

        <%= @task.status %>

    <% if @task.status == 'active' %>

        Next due:

          <span id='task-duedate-<%= @task.id.to_s %>'><%= formatted_date(@task.next_due) %> (<%= time_from_today(@task.next_due, @datetoday) %>)
          <% if @enable_js and @quick_edit_options.include?("duedate") -%>
            <%= aimee_in_place_date_editor('task-duedate-' + @task.id.to_s, @task.next_due, {:url => url_for(:controller => "tasks", :action => "change_due_date", :id => @task.id)}) %>
          <% end -%>

            <%= link_to(image_tag('tick.png', :size => '12x12', :alt => 'done', :title => 'Tick to mark as done by you today'), {:controller => 'tasks', :action => 'done', :id => @task.id, :return=>'task'})  %>

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

          Recurrence:
          <%= @task.recurrence_description %>

      <% end %>

        Assigned to:

          <% if @task.person_id.nil? %>
            <%= link_to_team(@team, 'picturelink') %>
          <% else %>
            <%= link_to_person(@task.person, 'picturelink') %>
            <% if @task.rotate == true %>

            <% end %>
          <% end %>

        Importance:

          <% if @enable_js and @quick_edit_options.include?("importance") %>

          <% else %>
            <% for loop in 1..@task.current_importance -%><% end -%> - <%= @importance.name %>
          <% end %>

    <% end %>

      Last done:

        <% if @completions.empty? %>
          No completion history for this task.
        <% else %>

            <% for completion in @completions %>

                  <%= formatted_date(completion.date_completed) %> (<%= time_from_today(completion.date_completed, @datetoday) %>)

                  by <%= link_to_person(completion.person, 'picturelink') %>

                  <%= link_to(image_tag('undo.png', :size => '13x13', :alt => 'undo', :title => 'undo', :align => 'absmiddle'), { :controller => 'completions', :action => 'undo', :id => completion.id, :return => 'task' }, :confirm => 'Do you want to undo this completion?') %>

            <% end %>

            <% if @completions_count > 5 %>

<%= link_to('View more ...', {:controller => 'completions', :action => 'list', :id => @task.id}, :class => 'action' )%>

            <% end %>

        <% end %>

  <% unless @tips.empty? %>

Potentially useful tips

    <% for tip in @tips %>

<%= link_to_tip(tip) %>

      <% if tip.full_description.size > 300 %>
        <% truncated_description = truncate(tip.full_description, 300, "").to_s %>
        <% number_to_chop = truncated_description.reverse.index(" ").to_i %>
        <% if number_to_chop > 0 %>
          <% for i in 1..number_to_chop %>
            <% truncated_description.chop! %>
          <% end %>
        <% end %>

<%= truncated_description %> [<a href='/tips/show/<%= tip.id.to_s %>'>read more ...]

      <% else %>
        <%= textilize(tip.full_description) %>
      <% end %>

Submitted

        <% if tip.person.nil? or tip.is_anon == true %>
          anonymously
        <% else %>
          by <%= link_to_person(tip.person, 'picturelink') %>
        <% end %>

        <% unless tip.cached_tag_list.nil? or tip.cached_tag_list.empty? %>
          in <%= print_tags_for_tip(tip) %>
      <% end %>

    <% end %>

Browse all tips

  <% end%>

<% else %>

  <%= access_denied() %>

<% end %>


added my name to the about page

added my name to the about page

git-svn-id: 63e5431e33a10c4701b329fb6d8e0744110cb91e@37 c2b4ead4-481d-0410-ac63-b02590f85e3f

<% @title = "About" -%>

About News Sniffer

The News Sniffer project aims to monitor corporate news organisations to
uncover bias.

You can contact the News Sniffer author by email at newssniffer@newworldodour.co.uk.

Watch Your Mouth

'Watch Your Mouth' monitors the BBC's 'Have Your Say' website and detects
when comments get censored.

The Have Your Say site has two moderation modes: full and reactive.  In full
mode, all comments are checked before being published.  In reactive, all
comments from registered users appear immediately and can be moderated later.

We can only detect comments that were removed.  We cannot detect comments
that never appeared in the first place.  This would appear to limit us to
reactive mode comments, but fully moderated comments are still often censored.

Revisionista

Revisionista monitors news websites and detects when articles change.
The versions are viewable and the changes are highlighted.

It currently monitors a few key feeds from the BBC News website, The
Guardian and The Independent.  Feel free to suggest other feeds to us.

Who Made News Sniffer?

News Sniffer was created by John Leach
of Leeds, in the UK.


Show commits in chronological order (last at bottom)

    Source repository
    <%=h @review.repository %>

      Submitted for review by

      <%=h @review.developer %>

      Submitted on

      <%=h @review.created_on %>

<% @review.commits.reverse.each do |commit| %>

  <%= render_partial 'commit/header', commit %>

  <% commit.diff.file_change_sets.each do |fcs| %>
    <%= render_partial 'commit/file_change_set', fcs %>
  <% end %>

<% end %>

    Source repository
    <%=h @review.repository %>

      Submitted for review by

      <%=h @review.developer %>

      Submitted on

      <%=h @review.created_on %>

<% @review.commits.each do |commit| %>

  <%= render_partial 'commit/header', commit %>

  <% commit.diff.file_change_sets.each do |fcs| %>
    <%= render_partial 'commit/file_change_set', fcs %>
  <% end %>

<% end %>


Updated feedback location

Updated feedback location

<%= link_to @model.to_s.capitalize, :model => params[:model], :action => "index" %>

<%= link_to image_tag('typus/arrow_right.gif'), { :page => @item_pages.current.previous, :filter_by => params[:filter_by], :filter_id => params[:filter_id], :model => params[:model], :status => params[:status], :search => params[:search], :order_by => params[:order_by], :sort_order => params[:sort_order] } if @item_pages.current.previous %> <%= link_to image_tag('typus/arrow_left.gif'), { :page => @item_pages.current.next, :filter_by => params[:filter_by], :filter_id => params[:filter_id], :model => params[:model], :status => params[:status], :search => params[:search], :order_by => params[:order_by], :sort_order => params[:sort_order] } if @item_pages.current.next %><%= " " if @item_pages.current.next %><%= link_to_function image_tag("typus/search_right.gif"), "['search'].each(Element.toggle);" %> <%= link_to image_tag("typus/add.gif", :title => "New #{@model}"), :action => "new" %>

<%= feedback %>

<div id="search" <%= "style=\"display: none;\"" if !params[:search] %> class="box">
	<% form_tag ({:action => 'index', :model => params[:model]}, :method => 'get') do %>

<%= text_field_tag :search, params[:search] %>  <%= submit_tag "Search", :name => nil %>

	<% end %>

<% if @model.count > 0 -%>

	<% if @items.size > 0 -%>

		<% @fields.each do |column| %>

		<a href="?order_by=<%= column %>&sort_order=<% if params[:order_by].include? column %><%= (@status = (params[:sort_order] == "asc") ? "desc" : "asc" ) %><% else %><%= "asc" %><% end %>"><div class="<% if params[:order_by].include? column %><%= (@status = (params[:sort_order] == "asc") ? "order_desc" : "order_asc" ) %><% else %><%= "order" %><% end %>"><%= column.humanize %>

		<% end %>

		<% @items.each do |item| %>
		  <tr class="<%= cycle('even', 'odd') %>" id="item_<%= item.id %>">
		  <% @fields.each do |column| %>
		    <% if %w(id title name full_name).include? column -%>
		    <%= link_to item.send(column), :action => 'edit', :id => item.id %>
		    <% elsif %w(email).include? column -%>
		    <%= mail_to item.send(column), item.send(column), :title => "" %>
		    <% elsif %w(status).include? column -%>
		      <%= status = item.send(column)? "Active" : "Inactive" %>
		    <% elsif %w(verified is_admin).include? column -%>
		      <%= status = item.send(column)? "Yes" : "No" %>
		    <% elsif %w(created_at updated_at).include? column -%>
		      <%= fmt_date(item.send(column)) %>
		    <% else -%>
		      <%=h item.send(column) %>
		    <% end -%>
		  <% end %>
		    <%= link_to image_tag("typus/trash.gif"), { :action => 'destroy', :id => item }, :confirm => "Remove this entry?" %>

		<% end %>

	<% else -%>

There are no <%= params[:model] %> under this filter.

	<% end -%>

<% else -%>

<%= link_to "Add the first #{params[:model].singularize}", :action => "new", :model => params[:model] %>

<% end -%>

<%= link_to @model.to_s.capitalize, :model => params[:model], :action => "index" %>

<%= link_to image_tag('typus/arrow_right.gif'), { :page => @item_pages.current.previous, :filter_by => params[:filter_by], :filter_id => params[:filter_id], :model => params[:model], :status => params[:status], :search => params[:search], :order_by => params[:order_by], :sort_order => params[:sort_order] } if @item_pages.current.previous %> <%= link_to image_tag('typus/arrow_left.gif'), { :page => @item_pages.current.next, :filter_by => params[:filter_by], :filter_id => params[:filter_id], :model => params[:model], :status => params[:status], :search => params[:search], :order_by => params[:order_by], :sort_order => params[:sort_order] } if @item_pages.current.next %><%= " " if @item_pages.current.next %><%= link_to_function image_tag("typus/search_right.gif"), "['search'].each(Element.toggle);" %> <%= link_to image_tag("typus/add.gif", :title => "New #{@model}"), :action => "new" %>

<%= feedback %>

<div id="search" <%= "style=\"display: none;\"" if !params[:search] %> class="box">
	<% form_tag ({:action => 'index', :model => params[:model]}, :method => 'get') do %>

<%= text_field_tag :search, params[:search] %>  <%= submit_tag "Search", :name => nil %>

	<% end %>

<% if @model.count > 0 -%>

	<% if @items.size > 0 -%>

		<% @fields.each do |column| %>

		<a href="?order_by=<%= column %>&sort_order=<% if params[:order_by].include? column %><%= (@status = (params[:sort_order] == "asc") ? "desc" : "asc" ) %><% else %><%= "asc" %><% end %>"><div class="<% if params[:order_by].include? column %><%= (@status = (params[:sort_order] == "asc") ? "order_desc" : "order_asc" ) %><% else %><%= "order" %><% end %>"><%= column.humanize %>

		<% end %>

		<% @items.each do |item| %>
		  <tr class="<%= cycle('even', 'odd') %>" id="item_<%= item.id %>">
		  <% @fields.each do |column| %>
		    <% if %w(id title name full_name).include? column -%>
		    <%= link_to item.send(column), :action => 'edit', :id => item.id %>
		    <% elsif %w(email).include? column -%>
		    <%= mail_to item.send(column), item.send(column), :title => "" %>
		    <% elsif %w(status).include? column -%>
		      <%= status = item.send(column)? "Active" : "Inactive" %>
		    <% elsif %w(verified is_admin).include? column -%>
		      <%= status = item.send(column)? "Yes" : "No" %>
		    <% elsif %w(created_at updated_at).include? column -%>
		      <%= fmt_date(item.send(column)) %>
		    <% else -%>
		      <%=h item.send(column) %>
		    <% end -%>
		  <% end %>
		    <%= link_to image_tag("typus/trash.gif"), { :action => 'destroy', :id => item }, :confirm => "Remove this entry?" %>

		<% end %>

	<% else -%>

There are no <%= params[:model] %> under this filter.

	<% end -%>

<% else -%>

Empty

<% end -%>


Really show correct last_login time for users

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

<%= "" %>

	    <%= link_to image_tag("user_edit.png", :border => 0, :title => _("Edit %s", @user.name), :class => "tooltip"), :controller => 'users', :action => 'edit', :id => @user %>
	    <%  if(@user.id != current_user.id && !user_online?( @user.id)) %>
              <%= link_to(image_tag("user_delete.png", :border => 0, :title => _("Delete %s", @user.name), :class => "tooltip"), { :controller => 'users', :action => 'destroy', :id => @user}, :confirm => _("Are you sure?")) %>
	    <% end %>
	    <% if current_user.admin > 1 %>
              <%= link_to 'Switch', :controller => 'users', :action => 'impersonate', :id => @user %>
	    <% end %>
	    <%= if user_online?( @user.id ) then image_tag('status_online.png', :title => _('Online'), :class => 'tooltip') else image_tag('status_offline.png', :title => _('Offline'), :class => 'tooltip') end %>

<%= h(@user.name) %>

<%= _('Email') %>

<%= h @user.email %>

<%= _('Local Time') %>

<%= @user.tz.now.strftime( (@user.tz.now.yday == current_user.tz.now.yday ? "#{current_user.time_format}" : "#{current_user.time_format} #{current_user.date_format}") ) %>

<%= _('Last Login') %>

	    <% if @user.last_login_at %>
	      <%= _('%s ago', distance_of_time_in_words(@user.last_login_at, Time.now.utc)) %>
	    <% else %>
	      Never
            <% end %>

	  <% if @user.projects.size > 0 %>

<%= _('Projects') %>

<%= @user.projects.collect{|p| "#{h(p.full_name)}"}.join("
 ") %>

	  <% end %>

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

<%= "" %>

	    <%= link_to image_tag("user_edit.png", :border => 0, :title => _("Edit %s", @user.name), :class => "tooltip"), :controller => 'users', :action => 'edit', :id => @user %>
	    <%  if(@user.id != current_user.id && !user_online?( @user.id)) %>
              <%= link_to(image_tag("user_delete.png", :border => 0, :title => _("Delete %s", @user.name), :class => "tooltip"), { :controller => 'users', :action => 'destroy', :id => @user}, :confirm => _("Are you sure?")) %>
	    <% end %>
	    <% if current_user.admin > 1 %>
              <%= link_to 'Switch', :controller => 'users', :action => 'impersonate', :id => @user %>
	    <% end %>
	    <%= if user_online?( @user.id ) then image_tag('status_online.png', :title => _('Online'), :class => 'tooltip') else image_tag('status_offline.png', :title => _('Offline'), :class => 'tooltip') end %>

<%= h(@user.name) %>

<%= _('Email') %>

<%= h @user.email %>

<%= _('Local Time') %>

<%= @user.tz.now.strftime( (@user.tz.now.yday == current_user.tz.now.yday ? "#{current_user.time_format}" : "#{current_user.time_format} #{current_user.date_format}") ) %>

<%= _('Last Login') %>

	    <% if @user.last_login_at %>
	      <%= _('%s ago', time_ago_in_words(tz.utc_to_local(@user.last_login_at), false)) %>
	    <% else %>
	      Never
            <% end %>

	  <% if @user.projects.size > 0 %>

<%= _('Projects') %>

<%= @user.projects.collect{|p| "#{h(p.full_name)}"}.join("
 ") %>

	  <% end %>


add csrf_meta_tag

add csrf_meta_tag

<!DOCTYPE html>

    <meta charset="utf-8" />
    <%= csrf_meta_tag %>
    <title>Walkrr</title>
    <link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.4/themes/base/jquery-ui.css" rel="stylesheet" />
    <%= stylesheet_link_tag 'application' %>

    <%= javascript_include_tag :all, :cache => true %>

        <%= button_to_function "new", "walk.pathEditor.newPath();" , {}, {:class => "button"}%>
        <%= button_to_function "delete", "walk.pathEditor.deletePath();", {}, {:class => "button"}%>
        <%= button_to_function "clear", "walk.pathEditor.deleteAll();", {}, {:class => "button"}%>
        <%= button_to_function "elevation", "walk.requestElevation();", {}, {:class => "button"}%>
        <%= form_tag({:action => "import"}, {:id => "import_form", :multipart => true, :target => "import_frame", :style => "display: inline;"}) do %>
          <%= file_field_tag "file" %>
          <%= button_to_function "import", "walk.importFile();", {}, {:class => "button"}%>
        <% end %>
        Now editing...0m

search

create

        <%= form_tag({:action => 'search'}, {:id => 'search_form', :remote => true, :method => 'GET'}) do  %>
          <%= hidden_field_tag "latitude" %>
          <%= hidden_field_tag "longitude" %>
          <%= hidden_field_tag "radius" %>
          <%= hidden_field_tag "areas" %>
          <%= hidden_field_tag 'search_path' %>

            <%= radio_button_tag :condition, "neighbor"%>neighbor
            <%= radio_button_tag :condition, "areas"%>areas
            <%= radio_button_tag :condition, "cross"%>cross
            <%= radio_button_tag :condition, "all", "checked"%>all

    <%#

            areas
            <%= select_tag "areas", options_for_select(@areas), {:multiple => true, :size =>5, :name => 'areas[]'} >

 %>

            date
            <%= select_tag "year",
              options_for_select(@year_opts)%> /
            <%= select_tag "month",
              options_for_select(@month_opts)%>

            order
            <%= select_tag "order",
              options_for_select([["new first","date desc"], ["old first","date"],
                ["long first","length desc"], ["short first","length"],
                ["east first","xmax(PATH) desc"], ["west first","xmin(PATH)"],
                ["south first","ymin(PATH)"],["north first","ymax(PATH) desc"]])%>

            per page<%= text_field_tag "per_page","20" %>

          <%= submit_tag "search", :disable_with => "searching" %>
        <% end %>
        <%= form_tag({:action => 'create'}, {:id => 'create_form', :remote => true }) do  %>

date
          <%= text_field_tag 'date' %>

            start
            <%= text_field_tag 'start'  %>

            end
            <%= text_field_tag 'end'  %>

          <%= hidden_field_tag 'create_path'  %>
          <%= submit_tag "create", :disable_with => "creating" %>
        <% end %>

      <%= form_tag("", {:id => "results_form"}) do %>

          <%= button_to_function "check all", "$('input[name=id[]]').attr('checked', true);", {}%>
          <%= button_to_function "reset", "$('input[name=id[]]').attr('checked', false);", {}%>
          <%= submit_tag "show", {:onclick => "$('#results_form').attr('action', '#{url_for(:action => :show)}');$('#results_form').attr('data-remote', true);"} %>
          <%= submit_tag "export", {:onclick => "$('#results_form').attr('action', '#{url_for(:action => :export_file)}');$('#results_form').removeAttr('data-remote');"} %>
          <%= submit_tag "delete", {:confirm => "Are you sure to delete?", :onclick => "$('#results_form').attr('action', '#{url_for(:action => :destroy)}');$('#results_form').attr('data-remote', true);"} %>

      <% end %>

<!DOCTYPE html>

    <meta charset="utf-8" />
    <title>Walkrr</title>
    <link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.4/themes/base/jquery-ui.css" rel="stylesheet" />
    <%= stylesheet_link_tag 'application' %>

    <%= javascript_include_tag :all, :cache => true %>

        <%= button_to_function "new", "walk.pathEditor.newPath();" , {}, {:class => "button"}%>
        <%= button_to_function "delete", "walk.pathEditor.deletePath();", {}, {:class => "button"}%>
        <%= button_to_function "clear", "walk.pathEditor.deleteAll();", {}, {:class => "button"}%>
        <%= button_to_function "elevation", "walk.requestElevation();", {}, {:class => "button"}%>
        <%= form_tag({:action => "import"}, {:id => "import_form", :multipart => true, :target => "import_frame", :style => "display: inline;"}) do %>
          <%= file_field_tag "file" %>
          <%= button_to_function "import", "walk.importFile();", {}, {:class => "button"}%>
        <% end %>
        Now editing...0m

search

create

        <%= form_tag({:action => 'search'}, {:id => 'search_form', :remote => true, :method => 'GET'}) do  %>
          <%= hidden_field_tag "latitude" %>
          <%= hidden_field_tag "longitude" %>
          <%= hidden_field_tag "radius" %>
          <%= hidden_field_tag "areas" %>
          <%= hidden_field_tag 'search_path' %>

            <%= radio_button_tag :condition, "neighbor"%>neighbor
            <%= radio_button_tag :condition, "areas"%>areas
            <%= radio_button_tag :condition, "cross"%>cross
            <%= radio_button_tag :condition, "all", "checked"%>all

    <%#

            areas
            <%= select_tag "areas", options_for_select(@areas), {:multiple => true, :size =>5, :name => 'areas[]'} >

 %>

            date
            <%= select_tag "year",
              options_for_select(@year_opts)%> /
            <%= select_tag "month",
              options_for_select(@month_opts)%>

            order
            <%= select_tag "order",
              options_for_select([["new first","date desc"], ["old first","date"],
                ["long first","length desc"], ["short first","length"],
                ["east first","xmax(PATH) desc"], ["west first","xmin(PATH)"],
                ["south first","ymin(PATH)"],["north first","ymax(PATH) desc"]])%>

            per page<%= text_field_tag "per_page","20" %>

          <%= submit_tag "search", :disable_with => "searching" %>
        <% end %>
        <%= form_tag({:action => 'create'}, {:id => 'create_form', :remote => true }) do  %>

date
          <%= text_field_tag 'date' %>

            start
            <%= text_field_tag 'start'  %>

            end
            <%= text_field_tag 'end'  %>

          <%= hidden_field_tag 'create_path'  %>
          <%= submit_tag "create", :disable_with => "creating" %>
        <% end %>

      <%= form_tag("", {:id => "results_form"}) do %>

          <%= button_to_function "check all", "$('input[name=id[]]').attr('checked', true);", {}%>
          <%= button_to_function "reset", "$('input[name=id[]]').attr('checked', false);", {}%>
          <%= submit_tag "show", {:onclick => "$('#results_form').attr('action', '#{url_for(:action => :show)}');$('#results_form').attr('data-remote', true);"} %>
          <%= submit_tag "export", {:onclick => "$('#results_form').attr('action', '#{url_for(:action => :export_file)}');$('#results_form').removeAttr('data-remote');"} %>
          <%= submit_tag "delete", {:confirm => "Are you sure to delete?", :onclick => "$('#results_form').attr('action', '#{url_for(:action => :destroy)}');$('#results_form').attr('data-remote', true);"} %>

      <% end %>