ActionItem154: splitting large message in here document into smaller and more manageable strings.

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

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

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

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

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

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

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

    <% end %>

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

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

BETA

        <%= _("This is %s's shortcuts bar. Using it you have access to the         main features of the environment and you find the information of your interest more quickly.") % @environment.name %>

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

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

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

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

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

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

      <%= footer %>

    <%= javascript_include_tag 'show-mouse-help' %>
    <%= javascript_include_tag 'noosfero-show-help' %>
    <%= javascript_tag('noosferoHelpInit(%s, %s)' % [ _('Do you want to activate the automatic help mode?').inspect, _('If needed, you can activate the automatic help mode by clicking the question mark symbol in the top-right corner').inspect ])  %>

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

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

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

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

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

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

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

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

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

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

    <% end %>

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

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

BETA

          <%= _(<<-CODE

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

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

          CODE
               ) % @environment.name %>

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

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

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

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

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

      <%= footer %>

    <%= javascript_include_tag 'show-mouse-help' %>
    <%= javascript_include_tag 'noosfero-show-help' %>
    <%= javascript_tag('noosferoHelpInit(%s, %s)' % [ _('Do you want to activate the automatic help mode?').inspect, _('If needed, you can activate the automatic help mode by clicking the question mark symbol in the top-right corner').inspect ])  %>

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

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

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

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


Fix eval of lambdas in application-ng layout

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

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

    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <meta name="description" content="<%= @environment.name %>" />
    <link rel="shortcut icon" href="<%= image_path(theme_favicon) %>" type="image/x-icon" />
    <%= noosfero_javascript %>
    <%= noosfero_stylesheets %>

    <%# Add custom tags/styles/etc via content_for %>
    <%= yield :head %>
    <%=
      @plugins.dispatch(:head_ending).collect do |content|
        if content.respond_to?(:call) then instance_eval &content else content end
      end.join("\n")
    %>

  <body class="<%= body_classes %>">
    <%= _("Go to the content") %>

    <%=
      @plugins.dispatch(:body_beginning).collect do |content|
        if content.respond_to?(:call) then instance_eval &content else content end
      end.join("\n")
    %>

        <%= theme_header %>

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

          <%= theme_site_title %>

            <%= theme_extra_navigation %>

          <%= render 'layouts/content' %>

    <%= render_environment_features(:logged_in) %>

      <%= theme_footer %>

    <%= noosfero_layout_features %>
    <%= addthis_javascript %>

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

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

    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <meta name="description" content="<%= @environment.name %>" />
    <link rel="shortcut icon" href="<%= image_path(theme_favicon) %>" type="image/x-icon" />
    <%= noosfero_javascript %>
    <%= noosfero_stylesheets %>

    <%# Add custom tags/styles/etc via content_for %>
    <%= yield :head %>
    <%=
      @plugins.dispatch(:head_ending).collect do |content|
        content.respond_to?(:call) ? content.call : content
      end.join("\n")
    %>

  <body class="<%= body_classes %>">
    <%= _("Go to the content") %>

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

        <%= theme_header %>

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

          <%= theme_site_title %>

            <%= theme_extra_navigation %>

          <%= render 'layouts/content' %>

    <%= render_environment_features(:logged_in) %>

      <%= theme_footer %>

    <%= noosfero_layout_features %>
    <%= addthis_javascript %>


git-svn-id: http://svn.castleproject.org:8080/svn/castle/trunk@101 73e77b4c-caa6-f847-a29a-24ab75ae54b6

<% @page_title = "PestControl" %>
<% @main_title = "PestControl" %>
<%= render "/sample/deflinks" %>

PestControl was created to serve as eat-your-own-dog-food. It brought several
issues to the light and as a consequence a lot of design decisions
were proved wrong or right. Furtunatelly there are more successful cases than
otherwise.

Few things that weren't planned also arise as benefits of the inversion
of control and Castle on Rails MVC design. We are glad to present them here.

What it is

PestControl is a build manager, in a nutshell. The flow is: you register
a project on it, the project has a source repository and a build system associated.
Castle project, for instance, uses SVN and NAnt as source control and build system.
It should inspect the source control from time to time and fire a build
when modifications are detected.

But the underlying intention is not to create this funcional application,
in fact, the current alpha version allows you to create an account and
create a project. The intention is to use Castle to see whether it's going to
improve your productivity or not. We're proud to say that it improved our
productivity, but we might be biased, so you should check for yourself. :-)

We list below a few things that were helpful and Windsor or Castle on Rails
provided for us.

Screenshots

Just to help you picture what this application is all about,
see the following screenshots:

Prevalence Facility

There was no need to write code to set up the Prevalence Engine and
Prevalence System. We just registered the facility and used the configuration
file as the following snippet:

<castle>
  <facilities>
    <facility id="prevalence">
      <engines>
        <engine
          id="prevalenceengine"
          autoVersionMigration="false"
          storageDir="storage"
          systemId="pestcontrolModel"
 systemType="Castle.Applications.PestControl.Model.PestControlModel,
       Castle.Applications.PestControl" />
      </engines>
    </facility>
  </facilities>

</castle>

The facility then registered the engine with the 'prevalenceengine' key
and the system with the 'pestcontrolModel' key. Any component in the container
that has a constructor or a property with the system type or the prevalence engine
type were automatically assembled.

For the test cases, I used the other property in the engine node
in the configuration: resetStorage='true', so everytime the engine starts,
the storage was recreated.

Family of components

Within PestControl we have different components implementing
the same service interface. For example, we have a SvnSourceControl component
and a VssSourceControl and even a CvsSourceControl. Also, we have
a NAntBuildSystem and a MSBuildBuildSystem. But how expose all of them to the user
and let him pick up one of each and associate with the project he's creating
on PestControl?

The solution was simple: a manager was registered, and this managed queries the
kernel for every component implementing a service. As a consequence, you can
add more source controls and more build system to the running application
 without the need to restart it.

Follows the BuildSystemManager code:

public class BuildSystemManager : IInitialize, IDisposable
{
	private IKernel _kernel;

	public BuildSystemManager(IKernel kernel)
	{
		_kernel = kernel;
	}

	public void Initialize()
	{
	}

	public void Dispose()
	{
		_kernel = null;
	}

	public virtual IBuildSystem[] AvailableBuildSystems()
	{
		ArrayList list = new ArrayList();

		IHandler[] handlers = _kernel.GetHandlers(
			typeof(IBuildSystem) );

		foreach(IHandler handler in handlers)
		{
			list.Add( handler.Resolve() );
		}

		return (IBuildSystem[])
			list.ToArray( typeof(IBuildSystem) );
	}
}

Application auto-assemble capability

The application code, even on the presentation layer,
became very straightforward, and the auto assemble simplified
the classes code more than we expected. Here is a complex controller code:

[Transient]
public class ProjectController : SmartDispatcherController
{
	private PestControlModel _model;
	private SourceControlManager _scm;
	private BuildSystemManager _bsm;
	private PrevalenceEngine _engine;

	public ProjectController(
		PestControlModel model, PrevalenceEngine engine,
		SourceControlManager scm, BuildSystemManager bsm)
	{
		_engine = engine;
		_model = model;
		_scm = scm;
		_bsm = bsm;
	}

	public void New()
	{
		PropertyBag.Add("SourceControlManager", _scm);
		PropertyBag.Add("BuildSystemManager", _bsm);
	}

	public void Insert(String name, String bs, String sc)
	{
		bool isPublic =
			(bool) PropertyBag["isPublic"];
		String ownerEmail =
			(String) PropertyBag["ownerEmail"];
		Hashtable properties =
			(Hashtable) PropertyBag["properties"];

		_engine.ExecuteCommand(
			new CreateProjectCommand(
				isPublic, name,
				sc, bs, ownerEmail, properties) );

		Redirect("dashboard", "index");
	}
}

We only need to express what the controller needs using the
constructor, and everything else is up to the MicroKernel.

Controllers and PropertyBags

  The PropertyBag is a dictionary exposed by the controller instance.
  Anything you put in the bag will try to find its way on the view.
  You can also use the Bag to pass data from the view to the controller
  again. Follows some controller code:

	public void New()
	{
		PropertyBag.Add("SourceControlManager", _scm);
		PropertyBag.Add("BuildSystemManager", _bsm);
	}

And here is the class (code behind) for a page associated:

public class New : System.Web.UI.Page
{
	private SourceControlManager _sourceControlManager;
	private BuildSystemManager _buildSystemManager;

	protected System.Web.UI.WebControls.Repeater dynRep;

	/// ...

	public SourceControlManager SourceControlManager
	{
		get { return _sourceControlManager; }
		set { _sourceControlManager = value; }
	}

	public BuildSystemManager BuildSystemManager
	{
		get { return _buildSystemManager; }
		set { _buildSystemManager = value; }
	}

	private void Page_Load(object sender, System.EventArgs e)
	{
		Save.Click += new EventHandler(OnSave);

		ISourceControl[] sourceControls =
		  SourceControlManager.AvailableSourceControl();

		if (!IsPostBack)
		{
		  SelectedSourceControl = -1;

		  sc.AutoPostBack = true;
		  sc.DataSource = sourceControls;
		  sc.DataTextField = "Name";
		  sc.DataValueField = "Key";
		  sc.DataBind();

		  bs.DataSource =
		    BuildSystemManager.AvailableBuildSystems();
		  bs.DataTextField = "Name";
		  bs.DataValueField = "Key";
		  bs.DataBind();
		}
	}

	/// ...
}

The keys in the PropertyBag will be used to find the proper
Property on the View class. Actually this is a implementation strategy
for the ASP.Net View Factory. If you create a NVelocity or other
factory you can choose another strategy to expose the data
to the view code.

The HttpApplication

We used the Global.asax to set up the container. Basically
the project Castle.Applications.PestControl exposes a container
which is nothing more than a subclass of WindsorContainer that
adds the components:

public class PestControlContainer : WindsorContainer
{
  public PestControlContainer(
    IConfigurationStore configStore ) : base()
  {
    Kernel.ConfigurationStore = configStore;

    AddFacility("prevalence", new PrevalenceFacility() );

    // BS Manager

    AddComponent("buildsystemmanager",
        typeof(BuildSystemManager));

    // Build Systems

    AddComponent("nant",
	    typeof(IBuildSystem), typeof(NAntBuildSystem));
    AddComponent("msbuild",
	    typeof(IBuildSystem), typeof(MSBuildBuildSystem));

    // SC Manager

    AddComponent("sourcecontrolmanager",
	    typeof(SourceControlManager));

    // Source Controls

    AddComponent("svnsc",
	    typeof(ISourceControl), typeof(SvnSourceControl));
    AddComponent("cvssc",
	    typeof(ISourceControl), typeof(CvsSourceControl));
    AddComponent("vsssc",
	    typeof(ISourceControl), typeof(VssSourceControl));
    }
}

Our Web Application (subclass of HttpApplication) adds the
components related to the web presentation:

public class PestControlApplication : HttpApplication,
	IContainerAccessor
{
	private static WindsorContainer container;

	public void Application_OnStart()
	{
		container = new PestControlContainer(
			new AppDomainConfigurationStore() );

		AddControllers(container);
	}

	private void AddControllers(WindsorContainer container)
	{
		container.AddComponent( "home",
			typeof(HomeController) );
		container.AddComponent( "dashboard",
			typeof(DashboardController) );
		container.AddComponent( "registration",
			typeof(RegistrationController) );
		container.AddComponent( "project",
			typeof(ProjectController) );
	}

	public void Application_OnEnd()
	{
		container.Dispose();
	}

	public void FormsAuthentication_OnAuthenticate(
		Object sender,
		FormsAuthenticationEventArgs e)
	{
		HttpCookie cookie =
			e.Context.Request.Cookies[
			  FormsAuthentication.FormsCookieName ];

		if (cookie == null) return;

		FormsAuthenticationTicket ticket =
		  FormsAuthentication.Decrypt(cookie.Value);

		PestControlModel model = (PestControlModel)
			container[ typeof(PestControlModel) ];

		e.User = model.Users.FindByEmail( ticket.Name );
	}

	#region IContainerAccessor implementation

	public IWindsorContainer Container
	{
		get { return container; }
	}

	#endregion
}

Conclusion

It seems that we are on the right track!

<% @page_title = "PestControl" %>
<% @main_title = "PestControl" %>
<%= render "/sample/deflinks" %>

PestControl was created to serve as own-your-own-dog-food. It brought several
issues to the light and as a consequence a lot of design decisions
were proved wrong or right. Furtunatelly there are more successful cases than
otherwise.

Few things that weren't planned also arise as benefits of the inversion
of control and Castle on Rails MVC design. We are glad to present them here.

What it is

PestControl is a build manager, in a nutshell. The flow is: you register
a project on it, the project has a source repository and a build system associated.
Castle project, for instance, uses SVN and NAnt as source control and build system.
It should inspect the source control from time to time and fire a build
when modifications are detected.

But the underlying intention is not to create this funcional application,
in fact, the current alpha version allows you to create an account and
create a project. The intention is to use Castle to see whether it's going to
improve your productivity or not. We're proud to say that it improved our
productivity, but we might be biased, so you should check for yourself. :-)

We list below a few things that were helpful and Windsor or Castle on Rails
provided for us.

Screenshots

Just to help you picture what this application is all about,
see the following screenshots:

Prevalence Facility

There was no need to write code to set up the Prevalence Engine and
Prevalence System. We just registered the facility and used the configuration
file as the following snippet:

<castle>
  <facilities>
    <facility id="prevalence">
      <engines>
        <engine
          id="prevalenceengine"
          autoVersionMigration="false"
          storageDir="storage"
          systemId="pestcontrolModel"
 systemType="Castle.Applications.PestControl.Model.PestControlModel,
       Castle.Applications.PestControl" />
      </engines>
    </facility>
  </facilities>

</castle>

The facility then registered the engine with the 'prevalenceengine' key
and the system with the 'pestcontrolModel' key. Any component in the container
that has a constructor or a property with the system type or the prevalence engine
type were automatically assembled.

For the test cases, I used the other property in the engine node
in the configuration: resetStorage='true', so everytime the engine starts,
the storage was recreated.

Family of components

Within PestControl we have different components implementing
the same service interface. For example, we have a SvnSourceControl component
and a VssSourceControl and even a CvsSourceControl. Also, we have
a NAntBuildSystem and a MSBuildBuildSystem. But how expose all of them to the user
and let him pick up one of each and associate with the project he's creating
on PestControl?

The solution was simple: a manager was registered, and this managed queries the
kernel for every component implementing a service. As a consequence, you can
add more source controls and more build system to the running application
 without the need to restart it.

Follows the BuildSystemManager code:

public class BuildSystemManager : IInitialize, IDisposable
{
	private IKernel _kernel;

	public BuildSystemManager(IKernel kernel)
	{
		_kernel = kernel;
	}

	public void Initialize()
	{
	}

	public void Dispose()
	{
		_kernel = null;
	}

	public virtual IBuildSystem[] AvailableBuildSystems()
	{
		ArrayList list = new ArrayList();

		IHandler[] handlers = _kernel.GetHandlers(
			typeof(IBuildSystem) );

		foreach(IHandler handler in handlers)
		{
			list.Add( handler.Resolve() );
		}

		return (IBuildSystem[])
			list.ToArray( typeof(IBuildSystem) );
	}
}

Application auto-assemble capability

The application code, even on the presentation layer,
became very straightforward, and the auto assemble simplified
the classes code more than we expected. Here is a complex controller code:

[Transient]
public class ProjectController : SmartDispatcherController
{
	private PestControlModel _model;
	private SourceControlManager _scm;
	private BuildSystemManager _bsm;
	private PrevalenceEngine _engine;

	public ProjectController(
		PestControlModel model, PrevalenceEngine engine,
		SourceControlManager scm, BuildSystemManager bsm)
	{
		_engine = engine;
		_model = model;
		_scm = scm;
		_bsm = bsm;
	}

	public void New()
	{
		PropertyBag.Add("SourceControlManager", _scm);
		PropertyBag.Add("BuildSystemManager", _bsm);
	}

	public void Insert(String name, String bs, String sc)
	{
		bool isPublic =
			(bool) PropertyBag["isPublic"];
		String ownerEmail =
			(String) PropertyBag["ownerEmail"];
		Hashtable properties =
			(Hashtable) PropertyBag["properties"];

		_engine.ExecuteCommand(
			new CreateProjectCommand(
				isPublic, name,
				sc, bs, ownerEmail, properties) );

		Redirect("dashboard", "index");
	}
}

We only need to express what the controller needs using the
constructor, and everything else is up to the MicroKernel.

Controllers and PropertyBags

  The PropertyBag is a dictionary exposed by the controller instance.
  Anything you put in the bag will try to find its way on the view.
  You can also use the Bag to pass data from the view to the controller
  again. Follows some controller code:

	public void New()
	{
		PropertyBag.Add("SourceControlManager", _scm);
		PropertyBag.Add("BuildSystemManager", _bsm);
	}

And here is the class (code behind) for a page associated:

public class New : System.Web.UI.Page
{
	private SourceControlManager _sourceControlManager;
	private BuildSystemManager _buildSystemManager;

	protected System.Web.UI.WebControls.Repeater dynRep;

	/// ...

	public SourceControlManager SourceControlManager
	{
		get { return _sourceControlManager; }
		set { _sourceControlManager = value; }
	}

	public BuildSystemManager BuildSystemManager
	{
		get { return _buildSystemManager; }
		set { _buildSystemManager = value; }
	}

	private void Page_Load(object sender, System.EventArgs e)
	{
		Save.Click += new EventHandler(OnSave);

		ISourceControl[] sourceControls =
		  SourceControlManager.AvailableSourceControl();

		if (!IsPostBack)
		{
		  SelectedSourceControl = -1;

		  sc.AutoPostBack = true;
		  sc.DataSource = sourceControls;
		  sc.DataTextField = "Name";
		  sc.DataValueField = "Key";
		  sc.DataBind();

		  bs.DataSource =
		    BuildSystemManager.AvailableBuildSystems();
		  bs.DataTextField = "Name";
		  bs.DataValueField = "Key";
		  bs.DataBind();
		}
	}

	/// ...
}

The keys in the PropertyBag will be used to find the proper
Property on the View class. Actually this is a implementation strategy
for the ASP.Net View Factory. If you create a NVelocity or other
factory you can choose another strategy to expose the data
to the view code.

The HttpApplication

We used the Global.asax to set up the container. Basically
the project Castle.Applications.PestControl exposes a container
which is nothing more than a subclass of WindsorContainer that
adds the components:

public class PestControlContainer : WindsorContainer
{
  public PestControlContainer(
    IConfigurationStore configStore ) : base()
  {
    Kernel.ConfigurationStore = configStore;

    AddFacility("prevalence", new PrevalenceFacility() );

    // BS Manager

    AddComponent("buildsystemmanager",
        typeof(BuildSystemManager));

    // Build Systems

    AddComponent("nant",
	    typeof(IBuildSystem), typeof(NAntBuildSystem));
    AddComponent("msbuild",
	    typeof(IBuildSystem), typeof(MSBuildBuildSystem));

    // SC Manager

    AddComponent("sourcecontrolmanager",
	    typeof(SourceControlManager));

    // Source Controls

    AddComponent("svnsc",
	    typeof(ISourceControl), typeof(SvnSourceControl));
    AddComponent("cvssc",
	    typeof(ISourceControl), typeof(CvsSourceControl));
    AddComponent("vsssc",
	    typeof(ISourceControl), typeof(VssSourceControl));
    }
}

Our Web Application (subclass of HttpApplication) adds the
components related to the web presentation:

public class PestControlApplication : HttpApplication,
	IContainerAccessor
{
	private static WindsorContainer container;

	public void Application_OnStart()
	{
		container = new PestControlContainer(
			new AppDomainConfigurationStore() );

		AddControllers(container);
	}

	private void AddControllers(WindsorContainer container)
	{
		container.AddComponent( "home",
			typeof(HomeController) );
		container.AddComponent( "dashboard",
			typeof(DashboardController) );
		container.AddComponent( "registration",
			typeof(RegistrationController) );
		container.AddComponent( "project",
			typeof(ProjectController) );
	}

	public void Application_OnEnd()
	{
		container.Dispose();
	}

	public void FormsAuthentication_OnAuthenticate(
		Object sender,
		FormsAuthenticationEventArgs e)
	{
		HttpCookie cookie =
			e.Context.Request.Cookies[
			  FormsAuthentication.FormsCookieName ];

		if (cookie == null) return;

		FormsAuthenticationTicket ticket =
		  FormsAuthentication.Decrypt(cookie.Value);

		PestControlModel model = (PestControlModel)
			container[ typeof(PestControlModel) ];

		e.User = model.Users.FindByEmail( ticket.Name );
	}

	#region IContainerAccessor implementation

	public IWindsorContainer Container
	{
		get { return container; }
	}

	#endregion
}

Conclusion

It seems that we are on the right track!


oops, should be this _crisis_information_form.rhtml


git-svn-id: https://svn.csc.ncsu.edu:8443/svn/research-expertiza/trunk@146 392d7b7b-3f31-0410-9dc3-c95a9635ea79

Courses

<%= flash[:notice] %>

Folder Name	Course

<% for folder in @folders %>

    <%= link_to folder, :action => 'list_folders', :curr_dir=>folder %>
    <% for course in @courses
            print course.directory_path + " " + folder + "\n"
            if CourseController.remove_last_slash(course.directory_path) === folder then %>
                <%= link_to course.title, :action=>'edit_course', :id => course.id %>
            <% end
           end %>

<% end -%>

<%= start_form_tag :action => 'new_folder', :curr_dir=>@curr_dir %>
<%= text_field 'folder', 'name'%>
<%= submit_tag 'New folder' %>
<%= end_form_tag %>

<%= link_to 'New Course', :action => 'new_course', :curr_dir=>@curr_dir %>


Disabling colorpicker: we have a lot of warnings about it

(ActionItem1601)

<%= javascript_include_tag :defaults, 'jquery-latest.js', 'jquery.noconflict.js', 'jquery.cycle.all.min.js', 'thickbox.js', 'lightbox', 'jquery-ui-1.8.2.custom.min', 'jquery.scrollTo', 'jquery.form.js', 'reflection', :cache => 'cache-general' %>

<%= javascript_include_tag :defaults, 'jquery-latest.js', 'jquery.noconflict.js', 'jquery.cycle.all.min.js', 'thickbox.js', 'lightbox', 'jquery-ui-1.8.2.custom.min', 'jquery.scrollTo', 'jquery.form.js', 'colorpicker', 'colorpicker-noosfero', 'reflection', :cache => 'cache-general' %>


Removed asset_manager partial from layout file

git-svn-id: 4158f9403e16ea83fe8a6e07a45f1f3b56a747ab@767 567b1171-46fb-0310-a4c9-b4bef9110e78

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

		<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
		<title>Mephisto: <%= controller.controller_name %> Admin</title>
		<%= stylesheet_link_tag 'mephisto', 'asset-manager' %>
		<%= javascript_include_tag :defaults %>
		<%= javascript_include_tag 'logger', 'mephisto' %>

<%= link_to 'settings', :controller => 'settings' %>

<%= link_to 'account', :controller => 'users', :action => 'show', :id => current_user %>

Mephisto: Admin

        <% if logged_in? -%>

<%= link_to 'Dashboard', :controller => '/admin/dashboard' %>

<%= link_to 'Articles',  :controller => '/admin/articles' %>

<%= link_to 'categories', :controller => '/admin/categories' %>

<%= link_to 'design',     :controller => '/admin/design' %>

<%= link_to "users",      :controller => "users" %>

        <% end -%>

    	    <% if flash[:notice] %>

    	      <%= @flash[:notice] %>

    	    <% end %>

    	    <%= yield %>

    	    <%= @content_for_sidebar %>

Mephisto

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


Handle params[:search] empty condition in field_search.

<% # We have to remove search form params before the url_for method call, otherwise it throughs it on %>
<% search_params = params %>
<% params.merge!(:search => nil) -%>
<% href = url_for(params_for(:action => :update_table, :escape => false)) -%>
<%= form_remote_tag :url => href,
                    :method => :get,
                    :before => "addActiveScaffoldPageToHistory('#{href}', '#{params[:controller]}')",
                    :after => "$('#{loading_indicator_id(:action => :search, :id => params[:id])}').style.visibility = 'visible'; Form.disable('#{search_form_id}');",
                    :complete => "$('#{loading_indicator_id(:action => :search, :id => params[:id])}').style.visibility = 'hidden'; Form.enable('#{search_form_id}');",
                    :failure => "ActiveScaffold.report_500_response('#{active_scaffold_id}')",
                    :update => active_scaffold_content_id,
                    :html => { :href => href, :id => search_form_id, :class => 'search' } %>

    <% active_scaffold_config.field_search.columns.each do |column| -%>
      <% name = "search[#{column.name}]" %>
      <% value = nil %>
      <% value = params[:search][column.name] if params[:search] %>

        <label for="<%= "search_#{column.name}" %>"><%= column.label %>
        <%= case column.ui_type
          when :boolean
            check_box_tag(name, 1, value || value == 1)
          else
            text_field_tag(name, value, { :autocomplete => "off", :size => 20, :class => 'text-input', :id => "search_#{column.name}"})
          end
        %>

    <% end -%>

  <%= submit_tag _('SEARCH_BUTTON'), :class => "submit" %>
  <%= _('RESET_BUTTON') -%>
  <%= loading_indicator_tag(:action => :search) %>
</form>

<% # We have to remove search form params before the url_for method call, otherwise it throughs it on %>
<% search_params = params %>
<% params.merge!(:search => nil) -%>
<% href = url_for(params_for(:action => :update_table, :escape => false)) -%>
<%= form_remote_tag :url => href,
                    :method => :get,
                    :before => "addActiveScaffoldPageToHistory('#{href}', '#{params[:controller]}')",
                    :after => "$('#{loading_indicator_id(:action => :search, :id => params[:id])}').style.visibility = 'visible'; Form.disable('#{search_form_id}');",
                    :complete => "$('#{loading_indicator_id(:action => :search, :id => params[:id])}').style.visibility = 'hidden'; Form.enable('#{search_form_id}');",
                    :failure => "ActiveScaffold.report_500_response('#{active_scaffold_id}')",
                    :update => active_scaffold_content_id,
                    :html => { :href => href, :id => search_form_id, :class => 'search' } %>

    <% active_scaffold_config.field_search.columns.each do |column| -%>
  		<% name = "search[#{column.name}]" %>

  			<label for="<%= "search_#{column.name}" %>"><%= column.label %>
				<%= case column.ui_type
					when :boolean
            check_box_tag(name, 1, params[:search][column.name] || params[:search][column.name] == 1)
					else
						text_field_tag(name, params[:search][column.name], { :autocomplete => "off", :size => 20, :class => 'text-input', :id => "search_#{column.name}"})
					end
				%>

  	<% end -%>

  <%= submit_tag _('SEARCH_BUTTON'), :class => "submit" %>
  <%= _('RESET_BUTTON') -%>
  <%= loading_indicator_tag(:action => :search) %>
</form>


minor improvements to signup form

minor improvements to signup form

Signup

<%= error_messages_for :user %>
<% form_for :user, :url => users_path do |f| -%>

Login

<%= f.text_field :login %>
<%= javascript_tag "$('user_login').focus()" %>

Email

<%= f.text_field :email %>

Password

<%= f.password_field :password %>

Confirm Password

<%= f.password_field :password_confirmation %>

<%= submit_tag 'Sign up' %>

<% end -%>

<%= error_messages_for :user %>
<% form_for :user, :url => users_path do |f| -%>

Login

<%= f.text_field :login %>

Email

<%= f.text_field :email %>

Password

<%= f.password_field :password %>

Confirm Password

<%= f.password_field :password_confirmation %>

<%= submit_tag 'Sign up' %>

<% end -%>


More notes.

More notes.

<%= error_messages_for 'censor_rule' %>

Text (that you want to remove, case sensitive)

<%= text_field 'censor_rule', 'text', :size => 60  %>

Replacement (put it in [square brackets], e.g. [personal information removed]. applies only to text in emails; binaries must stay the same length and the replacement is just a bunch of 'x's)

<%= text_field 'censor_rule', 'replacement', :size => 60  %>

Comment for this edit (put purpose of the rule, and why the change)

<%= text_area 'censor_rule', 'last_edit_comment', :rows => 2, :cols => 60  %>

Rule is for request '<%=request_link(info_request)%>'
    <%= hidden_field 'censor_rule', 'info_request_id', { :value => info_request.id } %>

Warning and notes: This does replace text in binary files, but only
in a naive way.  It doesn't even do UCS-2 (unicode sometimes used in Word). It
should work for cases that aren't links and are in Word documents, but probably
won't work for much else.  Please carefully check all
attachments have changed in the way you expect.

You may need to manually rebuild the search index afterwards. If you need to
redact things across a large number of requests, ask for code changes, should
be easy enough to add this per user or per authority.


Set the map units to something OpenLayers? actually understands...

User details

<%= error_messages_for 'user' %>
<% form_tag :controller => 'user', :action => 'account', :display_name => @user.display_name do %>

Name	<%= @user.email %>

Mapper since	<%= @user.creation_time %> (<%= time_ago_in_words(@user.creation_time) %> ago)

Display Name	<%= text_field :user, :display_name, :value => @user.display_name %>

Password	<%= password_field('user', 'pass_crypt',{:value => '', :size => 50, :maxlength => 255}) %>

Confirm Password	<%= password_field('user', 'pass_crypt_confirmation',{:value => '', :size => 50, :maxlength => 255}) %>

  <tr id="homerow" <% unless @user.home_lat and @user.home_lon %> class="nohome" <%end%> >Your home	You have not entered your home location.Latitude: <%= text_field :user, :home_lat, :value => @user.home_lat, :size => 20, :id => "home_lat" %> Longitude <%= text_field :user, :home_lon, :value => @user.home_lon, :size => 20, :id => "home_lon" %>

Update home location when I click on the map? <input type="checkbox" value="1" <% unless @user.home_lat and @user.home_lon %> checked="checked" <% end %> id="updatehome" />

    <% # This now just used to detect the width/height required for the popup. %>

Description	<%= text_area :user, :description, :value => @user.description, :class => "editDescription" %>

<%= submit_tag 'Save Changes' %>
<% end %>

<% nearest_str = "" %>
<% if @user.home_lat and @user.home_lon %>

Users in your area

    <% if @user.nearby.empty? %>
    There are no users who admit to mapping in your area.  Better go out and spread the word about OSM!
    <% else %>

These users are mapping in your area:

    Name
    Distance
    Contact

    <% @user.nearby.each do |nearby| %>
    <% nearest_str += "nearest.push( { 'display_name' : '#{nearby.display_name}', 'home_lat' : #{nearby.home_lat}, 'home_lon' : #{nearby.home_lon} } );\n" %>

    <%= link_to nearby.display_name, :controller => 'user', :action => 'view',  :display_name => nearby.display_name %>
    <%= @user.distance(nearby).round %>km away
    <%= link_to 'send message', :controller => 'message', :action => 'new', :user_id => nearby.id %>

    <%end%>

    <%end%>

<% end %>

<% if @user.home_lat and @user.home_lon %>
    <% marker = true %>
    <% mlon = @user.home_lon %>
    <% mlat = @user.home_lat %>
    <% lon =  @user.home_lon %>
    <% lat =  @user.home_lat  %>
    <% zoom =  '12' %>

<% else %>
    <% lon =  params['lon'] || '-0.1' %>
    <% lat =  params['lat'] || '51.5' %>
    <% zoom =  params['zoom'] || '4' %>
<% end %>

Privacy

<% if @user.data_public? %>
  All your edits are public.
<% else %>
  Currently your edits are anonymous and people can't find out where you are located. To show what you edited and allow people to contact you through the website, click the button below. This action cannot be reversed.

  <% form_tag :controller => 'user', :action => 'go_public' do %>
  <%= submit_tag 'Make all my edits public, forever' %>
  <% end %>
<% end %>


WDTK-62 Add attribution section to credits help page

<% @title = "Credit where credit is due" %>

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

<%= @title%> #

Which people made <%= site_name %>? #

    Matthew Landauer, Henare Degan, Katherine Szuminska and Alexander Sadleir set up the software that runs Right To Know, collected and collated the information, adapted the help text and generally pushed, prodded and poked until things worked.

    Guy King's donation to the OpenAustralia Foundation, made building and running this site possible.

    Our early testers, for checking over all the legal help text and making sure that things worked as expected.

    Peter Timmins, Australia's foremost authority on Freedom of Information law, has kept us informed through the years with his indespensable blog Open and Shut.

    Everyone who has helped look up Freedom of Information email addresses.

    All the amazing staff and volunteers at MySociety, past and present, who created WhatDoTheyKnow.com in the UK, which ultimately was spun out into the international software project Alaveteli, on which <%= site_name %> runs.

    Finally, all the officers who will and have answered the requests
    made through the site. Their diligence, patience and professionalism is
    what has actually made the information that you see here. Thank them for
    helping make Government more transparent.

You're all stars.

Can I help out? #

Yes please! We're built out of our supporters and volunteers.

You can make a donation. We're a charity with Deductible Gift Recipient (DGR) status. That means your donation is tax-deductible.

Help people find successful requests, and monitor performance of authorities, by
    playing the categorisation game.

Find out the Freedom of Information email addresses of authorities that we're missing.

Write a blog post about either <%= site_name %> or an interesting request that you've
    found. Post about it on a forum that you frequent. Tell friends about it.

If you're
    a programmer, get the source code for our parent project, Alaveteli
    and tell us about patches we can pull. It's made in Ruby on Rails.

Read more about volunteering.

Attribution #

    Some descriptions of public authorities were sourced and adapted from australia.gov.au in which the text content is licensed under Creative Commons Attribution 3.0 Australia.


Link to email token URLs.

Link to email token URLs.

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

<%=@title%>

Id: <%= @admin_user.id%>

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

<% end %>

<%= link_to 'Public page', main_url(user_url(@admin_user)) %>

Track things

  Id
  <% for column in TrackThing.content_columns %>
    <%= column.human_name %>
  <% end %>
  Items sent by email

<% for track_thing in @admin_user.track_things.find(:all, :order => 'created_at desc') %>
  <tr class="<%= cycle('odd', 'even') %>">
  <%=h track_thing.id %>
  <% for column in TrackThing.content_columns.map { |c| c.name } %>
    <%=h track_thing.send(column) %>
  <% end %>
  <%= track_thing.track_things_sent_emails.size %>

<% end %>

Post redirects

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

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

<% end %>

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

<%=@title%>

Id: <%= @admin_user.id%>

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

<% end %>

<%= link_to 'Public page', main_url(user_url(@admin_user)) %>

Track things

  Id
  <% for column in TrackThing.content_columns %>
    <%= column.human_name %>
  <% end %>
  Items sent by email

<% for track_thing in @admin_user.track_things.find(:all, :order => 'created_at desc') %>
  <tr class="<%= cycle('odd', 'even') %>">
  <%=h track_thing.id %>
  <% for column in TrackThing.content_columns.map { |c| c.name } %>
    <%=h track_thing.send(column) %>
  <% end %>
  <%= track_thing.track_things_sent_emails.size %>

<% end %>

Post redirects

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

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

<% end %>


Bugfix tag typo

Bugfix tag typo

<% @title = "Your privacy" %>

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

<%= @title %> #

Who gets to see my email address? #

We will not disclose your email address to anyone unless we are obliged to by law,
or you ask us to. This includes the public authority that you are sending a
request to.  They only get to see an email address
@whatdotheyknow.com which is specific to that request.

If you send a message to another user on the site, then it will reveal your
email address to them. You will be told that this is going to happen.

Will you send nasty, brutish spam to my email address? #

Nope. After you sign up to WhatDoTheyKnow we will only send you emails
relating to a request you made, an email alert that you have signed up for,
or for other reasons that you specifically authorise. We will never give or
sell your email addresses to anyone else, unless we are obliged to by law, or
you ask us to.

Why will my name and my request appear publicly on the site? #

We publish your request on the Internet so that anybody can read it and
make use of the information that you have found. We do not normally delete
requests (more details).

Your name is tangled up with your request, so has to be published as well.
It is only fair, as we're going to publish the name of the civil servant who
writes the response to your request.  Using your real name also helps people
get in touch with you to assist you with your research or to campaign with you.

By law, you must use your real name for the request to be a valid Freedom of
Information request. See the next question for alternatives if you do not want
to publish your full name.

Can I make an FOI request using a pseudonym? #

Technically, you must use your real name for your request to be a valid Freedom of Information request in law. See this
guidance from the Information Commissioner (January 2009).

However, the same guidance also says it is good practice for the public
authority to still consider a request made using an obvious pseudonym.
You should refer to this if a public authority refuses a request because you
used a pseudonym.

Be careful though, even if the authority follows this good practice, the
pseudonym will probably make it impossible for you to complain to the
Information Commissioner later about the handling of your request.

There are several good alternatives to using a pseudonym.

Use a different form of your name. The guidance says
that "Mr Arthur Thomas Roberts" can make a valid request as "Arthur Roberts",
"A. T. Roberts", or "Mr Roberts", but not as "Arthur" or "A.T.R.".

Women may use their maiden name.

In most cases, you may use any name by which you are "widely known and/or
is regularly used".

Use the name of an organisation, the name of a company, the trading name of
a company, or the trading name of a sole trader.

Ask someone else to make the request on your behalf.

You may, if you are really stuck, ask us to make the request on
your behalf. Please contact us with
a good reason why you cannot make the request yourself and cannot
ask a friend to. We don't have the resources to do this for everyone.

Please do not try to impersonate someone else.

They've asked for my postal address! #

If a public authority asks you for your full, physical address, reply to them saying
that section 8.1.b of the FOI Act asks for an "address for correspondence",
and that the email address you are using is sufficient.

The Ministry of Justice has guidance
on this –
"As well as hard copy written correspondence, requests that are
transmitted electronically (for example, in emails) are acceptable
... If a request is received by email and no postal address is given, the email
address should be treated as the return address."

As if that isn't enough, the Information Commissioner's
Hints for Practitioners say
"Any correspondence could include a request for information. If it is written (this includes e-mail), legible, gives the name of the applicant, an address for reply (which could be electronic), and includes a description of the information required, then it will fall within the scope of the legislation."

No no, they need a postal address to send a paper response! #

If an authority only has a paper copy of the information that you want,
they may ask you for a postal address. To start with, try persuading them
to scan in the documents for you. You can even offer to gift them a scanner, which in that particular case
embarrassed the authority into finding one they had already.

If that doesn't work, and you want to provide your postal address privately
in order to receive the documents, mark your request as "They are going to reply by post", and it will
give you an email address to use for that purpose.

Can you delete my requests, or alter my name?  #

WhatDoTheyKnow is a permanent, public archive of Freedom of
Information requests. Even though you may not find the response to
a request useful any more, it may be of interest to others. For this
reason, we will not delete requests.

Under exceptional circumstances we may remove or change your name
on the website, see the next question.
Similarly, we may also remove other personal information.

If you're worried about this before you make your request,
see the section on pseudonyms.

Can you take down personal information about me? #

If you see any personal information about you on the site which you'd like
us to remove or hide, then please let us know.
Specify exactly what information you believe to be problematic and why, and
where it appears on the site.

If it is sensitive personal information that has been accidentally
posted, then we will usually remove it. Normally we will only consider
requests to remove personal information which come from the individual
concerned, but for sensitive information we would appreciate anyone
pointing out anything they see.

We consider that there is a strong public interest in
retaining the names of officers or servants of public authorities. We will only
remove such names in exceptional circumstances, such as where the disclosure of
a name and position of employment would substantially risk an individual's
safety. If you are such an official and you wish to have your name removed for
such an urgent reason, you must supply us with a request to do so from your
line manager. This request must demonstrate that a risk has been perceived
which outweighs the public interest, and must demonstrate that efforts have
been made to conceal the name on the organisation's own website.

For all other requests we apply a public interest test to decide
whether information should be removed.
 Section 32
of the Data Protection Act 1998 permits us to do this, as the material we
publish is journalistic. We cannot easily edit many types of attachments (such
as PDFs, or Microsoft Word or Excel files), so we will usually ask
that authorities resend these with the personal information removed.

What about cookies and third party services? #

Our use of cookies and external services: what you should know, and how to opt out if you want to.

Summary: We care a lot about our users’ privacy. We provide details below, and we try our hardest to look after the private data that we hold. Like many other websites, we sometimes use cookies and Google Analytics to help us make our websites better. These tools are very common and used by many other sites, but they do have privacy implications, and as a charity concerned with socially positive uses of the internet, we think it’s important to explain them in full. If you don’t want to share your browsing activities on mySociety’s sites with other companies, you can adjust your usage or install opt-out browser plugins.

Cookies

To make our service easier or more useful, we sometimes place small data files on your computer or mobile phone, known as cookies; many websites do this. We use this information to, for example, remember you have logged in so you don't need to do that on every page, or to measure how people use the website so we can improve it and make sure it works properly. Below, we list the cookies and services that this site can use.

Name	Typical Content	Expires

_wdtk_cookie_session	A random unique identifier	When web browser is closed, or 1 month if 'Remember me' is used

seen_foi2	The number 1 if you have seen a notice	7 days

last_request_id	A number, identifying the last FOI request you looked at on the site	When web browser is closed

last_body_id	A number, identifying the last public authority you looked at on the site	When web browser is closed

Measuring website usage (Google Analytics)

  We use Google Analytics to collect information about how people use this site. We do this to make sure it’s meeting its users’ needs and to understand how we could do it better. Google Analytics stores information such as what pages you visit, how long you are on the site, how you got here, what you click on, and information about your web browser. IP addresses are masked (only a portion is stored) and personal information is only reported in aggregate. We do not allow Google to use or share our analytics data for any purpose besides providing us with analytics information, and we recommend that any user of Google Analytics does the same.

If you’re unhappy with data about your visit to be used in this way, you can install the official browser plugin for blocking Google Analytics.

The cookies set by Google Analytics are as follows:

Name	Typical Content	Expires

__utma	Unique anonymous visitor ID	2 years

__utmb	Unique anonymous session ID	30 minutes

__utmz	Information on how the site was reached (e.g. direct or via a link/search/advertisement)	6 months

__utmx	Which variation of a page you are seeing if we are testing different versions to see which is best	2 years

Google’s Official Statement about Analytics Data

“This website uses Google Analytics, a web analytics service provided by Google, Inc. (“Google”).  Google Analytics uses “cookies”, which are text files placed on your computer, to help the website analyze how users use the site. The information generated by the cookie about your use of the website (including your IP address) will be transmitted to and stored by Google on servers in the United States . Google will use this information for the purpose of evaluating your use of the website, compiling reports on website activity for website operators and providing other services relating to website activity and internet usage.  Google may also transfer this information to third parties where required to do so by law, or where such third parties process the information on Google’s behalf. Google will not associate your IP address with any other data held by Google.  You may refuse the use of cookies by selecting the appropriate settings on your browser, however please note that if you do this you may not be able to use the full functionality of this website.  By using this website, you consent to the processing of data about you by Google in the manner and for the purposes set out above.”

More general information on how third party services work

Credits

Bits of wording taken from the gov.uk cookies page (under the Open Government Licence).

Learn more from the help for FOI officers -->


fix img tag for EY logo so it shows up

fix img tag for EY logo so it shows up

git-svn-id: 7c1659e0f98dda52dfd8ce475cf311495cbaa212@3185 410327ef-2207-0410-a325-f78bbcb22a5a

---
extension: html
filter:    erb
---
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

    <title>RSpec-<%= rspec_version %>: <%= @page.title %></title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="description" content="RSpec, {title: }, BDD, behaviour driven development, behavior driven development, TDD, test driven development, Ruby, Rails, testing, watir, selenium"/>

    <link rel="stylesheet" href="/css/coderay.css" type="text/css" />

    <link rel="stylesheet" href="/css/breadcrumbs.css" type="text/css" media="screen, projection" />
    <link rel="stylesheet" href="/css/default.css" type="text/css" media="screen, projection" />

RSpec <%= rspec_version %>

  <%= breadcrumb_menu(@page) %>

    <%= @content %>

      Webdesign by JM

              Hosted by our
good friends at
Engine Yard


Project ID is removed

Project ID is removed

A <%= @exception.class %> occurred in <%= @job.class.to_s %>:

  <%= @exception.message %>
  <%= @backtrace.first %>

  <%= @params.inspect %>

  User : <%= User.find(@job.user_id).inspect %>
  Project : <%= Project.find(@job.project_id).inspect %>

A <%= @exception.class %> occurred in <%= @job.class.to_s %>:

  <%= @exception.message %>
  <%= @backtrace.first %>

  <%= @params.inspect %>

  User : <%= User.find(@job.user_id).inspect %>
  Project : <%= Project.find(@job.project).inspect %>


remove unecessary "<br>" tag from text

remove unecessary "<br>" tag from text

<% @title = _("Select the authority to write to")  %>

<%= _('1. Select an authority') %>

    <% form_tag({:controller => "request", :action => "select_authority"}, {:id => "search_form", :method => "get"}) do %>

           <%= _('First, type in the name of the UK public authority you\'d
           like information from. By law, they have to respond
           (why?).') % help_about_url %>

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

    <% end %>

 <% if !@xapian_requests.nil? %>
  <% if  @xapian_requests.results.size > 0 %>

<%= _('Top search results:') %>

      <%= _('Select one to see more information about the authority.')%>

  <% else %>

<%= _('No results found.') %>

  <% end %>

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

 <% end %>


Slightly clearer.

Slightly clearer.

     Name
     Tags
      <% for column in PublicBody.content_columns.map { |c| c.human_name } - [ "Name", "Last edit comment" ] %>
        <%= column %>
      <% end %>

<% for public_body in bodies %>
  <tr class="<%= cycle('odd', 'even') %>">
    <%= public_body_both_links(public_body) %>
    <%= render :partial => 'tags', :locals => { :body => public_body} %>
  <% for column in PublicBody.content_columns.map { |c| c.name } - [ "name", "last_edit_comment" ] %>
    <%=h public_body.send(column) %>
  <% end %>

<% end %>

<% form_tag(admin_url("body/mass_tag_add"), :method => "post", :class => "forms_on_one_line" ) do %>

       <%= text_field_tag 'new_tag', params[:new_tag], { :size => 15, :id => "mass_add_tag_new_tag_" + table_name } %>
       <%= hidden_field_tag(:query, params[:query], { :id => "mass_add_tag_query_" + table_name } ) %>
       <%= hidden_field_tag(:table_name, table_name, { :id => "mass_add_tag_table_name_" + table_name } ) %>
       <%= submit_tag "Add tag to all" %> (in every page of table just above)

<% end %>

     Name
     Tags
      <% for column in PublicBody.content_columns.map { |c| c.human_name } - [ "Name", "Last edit comment" ] %>
        <%= column %>
      <% end %>

<% for public_body in bodies %>
  <tr class="<%= cycle('odd', 'even') %>">
    <%= public_body_both_links(public_body) %>
    <%= render :partial => 'tags', :locals => { :body => public_body} %>
  <% for column in PublicBody.content_columns.map { |c| c.name } - [ "name", "last_edit_comment" ] %>
    <%=h public_body.send(column) %>
  <% end %>

<% end %>

<% form_tag(admin_url("body/mass_tag_add"), :method => "post", :class => "forms_on_one_line" ) do %>

       <%= text_field_tag 'new_tag', params[:new_tag], { :size => 15, :id => "mass_add_tag_new_tag_" + table_name } %>
       <%= hidden_field_tag(:query, params[:query], { :id => "mass_add_tag_query_" + table_name } ) %>
       <%= hidden_field_tag(:table_name, table_name, { :id => "mass_add_tag_table_name_" + table_name } ) %>
       <%= submit_tag "Add tag to all" %> (in table just above)

<% end %>


Don't say "your" when it isn't.

Don't say "your" when it isn't.

<% if @incoming_message.recently_arrived %>
    <% @title = "New response to '" + h(@info_request.title) + "'" %>
<% else %>
    <% @title = "Response to '" + h(@info_request.title) + "'" %>
<% end %>

<%= foi_error_messages_for :incoming_message, :outgoing_message %>

    <% if @is_owning_user %>
        <% if @incoming_message.recently_arrived %>

New response to your request '<%= request_link @info_request %>'

        <% else %>

Response to your request '<%= request_link @info_request %>'

        <% end %>
    <% else %>
        <% if @incoming_message.recently_arrived %>

New response to FOI request '<%= request_link @info_request %>'

        <% else %>

Response to FOI request '<%= request_link @info_request %>'

        <% end %>
    <% end %>

    <%= render :partial => 'correspondence', :locals => { :info_request_event => nil, :incoming_message => @incoming_message } %>

        <%= render :partial => 'followup', :locals => { :incoming_message => @incoming_message } %>

<% if @incoming_message.recently_arrived %>
    <% @title = "New response to '" + h(@info_request.title) + "'" %>
<% else %>
    <% @title = "Response to '" + h(@info_request.title) + "'" %>
<% end %>

<%= foi_error_messages_for :incoming_message, :outgoing_message %>

    <% if @incoming_message.recently_arrived %>

New response to your request '<%= request_link @info_request %>'

    <% else %>

Response to your request '<%= request_link @info_request %>'

    <% end %>

    <%= render :partial => 'correspondence', :locals => { :info_request_event => nil, :incoming_message => @incoming_message } %>

        <%= render :partial => 'followup', :locals => { :incoming_message => @incoming_message } %>


changing review, author feedback, meta review and teammate review scores to refer to the scores table.

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

<% i = 0;
        for @question in @questions %>
          <%=@question.txt%>

          <% @rs = Score.find(:first,:conditions => ["instance_id = ? AND question_id = ? and questionnaire_type_id=?", @review.id, @question.id, QuestionnaireType.find_by_name("Review").id])%>
          <input id=new_review_score_<%=i%>_comments name=new_review_score[<%=i%>][comments] value = "<%=@rs.comments.gsub(/\"/,'"')%>"  size=70 type=text />
          <% if @question.true_false? %>
              <select id=new_score_<%=i%> name=new_score[<%=i%>]>
                 <option value="<%=@min%>" <%if @min==@rs.score%>selected="selected"<%end%> >false</option>
                 <option value="<%=@max%>" <%if @max==@rs.score%>selected="selected"<%end%> >true</option>
              </select>

          <% else %>
              <select id=new_score_<%=i%> name=new_score[<%=i%>]>
                  <% for j in @min..@max %>
                    <option value="<%=j%>" <%if j==@rs.score%>selected="selected"<%end%> ><%=j%></option>
                  <% end %>
              </select>

          <% end %>
          <input id=new_question_<%=i%> name=new_question[<%=i%>] value=<%=@question.id%> type=hidden />
    <% i += 1;
    end %>

	Additional Comments
	<textarea cols="70" rows="5" id=new_review_comments name=new_review[comments]><%=@review.additional_comment%></textarea>

<% i = 0;
        for @question in @questions %>
          <%=@question.txt%>

          <% @rs = ReviewScore.find(:first,:conditions => ["review_id = ? AND question_id = ?", @review.id, @question.id])%>
          <input id=new_review_score_<%=i%>_comments name=new_review_score[<%=i%>][comments] value = "<%=@rs.comments.gsub(/\"/,'"')%>"  size=70 type=text />
          <% if @question.true_false? %>
              <select id=new_score_<%=i%> name=new_score[<%=i%>]>
                 <option value="<%=@min%>" <%if @min==@rs.score%>selected="selected"<%end%> >false</option>
                 <option value="<%=@max%>" <%if @max==@rs.score%>selected="selected"<%end%> >true</option>
              </select>

          <% else %>
              <select id=new_score_<%=i%> name=new_score[<%=i%>]>
                  <% for j in @min..@max %>
                    <option value="<%=j%>" <%if j==@rs.score%>selected="selected"<%end%> ><%=j%></option>
                  <% end %>
              </select>

          <% end %>
          <input id=new_question_<%=i%> name=new_question[<%=i%>] value=<%=@question.id%> type=hidden />
    <% i += 1;
    end %>

	Additional Comments
	<textarea cols="70" rows="5" id=new_review_comments name=new_review[comments]><%=@review.additional_comment%></textarea>


Added an average weight and an average food for the cage.

Dossier on <%= @cage.name%>

Owner: <%= @cage.user ? @cage.user.name : 'NP' %>

Room: <%= @cage.room %>

Bats: <%= @cage.bats.count %>

<% if @cage.bats.length > 0 %>

<% combined_weights = 0.0 %>
<% for bat in @cage.bats %>
  <% combined_weights = combined_weights + bat.weights.recent[0].weight %>
<% end %>
<% average = combined_weights/@cage.bats.length %>
Average weight: <%= (("%.0" + 1.to_s + "f") % average).to_f %> g

<% end %>

Food: <%= @cage.food %> grams in <%= @cage.dish_num %> <%= @cage.dish_type %>

<% if @cage.bats.length > 0 %>
<% average = @cage.food / @cage.bats.length %>

Amount of food/bat: <%= (("%.0" + 1.to_s + "f") % average).to_f %> g

<% end %>

Date created: <%= nice_date @cage.date_created %>

<% if @cage.date_destroyed != nil %>

Date destroyed: <%= nice_date @cage.date_destroyed %>

<% else %>

<% end %>

<%= render_partial 'weighing_tasks' %>

<% if @cage.bats.active.length == 0 %>
No bats are in this cage.
<% else %>
  Current Bats:

  Band
  Last Weight
  Weigh Date
  Date in
  Who
  Why
  <% for bat in @cage.bats %>
    <% cih = bat.cage_in_histories %>
    <% if cih %>
    <%      @date_in = cih[0].date %>
    <%      @sig = cih[0].user.initials %>
    <%      @why = cih[0].note %>
    <% else %>
    <%      @date_in ="" %>
    <%      @sig = "" %>
    <%      @why = "" %>
    <% end %>

    <%= link_to bat.band, :controller => 'bats', :action => 'show', :id => bat %>
    <% if bat.weights.length > 0 %>
          <%=h bat.weights[0].weight %>
          <%=h nice_date bat.weights[0].date %>
    <% else %>
          N/A
          N/A
    <% end %>
    <%=h nice_date @date_in %>
    <%=h @sig %>
    <%=h @why %>

  <% end %>

<% end %>

<% if @cohs.length == 0 %>
No bats were in this cage.
<% else %>
  Past Bats:

  Band
  Date in
  Who
  Date out
  Who
  <% for coh in @cohs %>

    <%=link_to coh.bat.band, :controller => 'bats', :action => 'show', :id => coh.bat %>
    <%=h nice_date coh.cage_in_history.date %>
    <%=h coh.cage_in_history.user.initials %>
    <%=h nice_date coh.date %>
    <%=h coh.user.initials %>

  <% end %>

<% end %>

<%= link_to 'Edit', :action => 'edit', :id => @cage %> |
<%= link_to 'List Current Cages', :action => 'list' %>

Dossier on <%= @cage.name%>

Owner: <%= @cage.user ? @cage.user.name : 'NP' %>

Room: <%= @cage.room %>

Bats: <%= @cage.bats.count %>

<% if @cage.bats.length > 0 %>

<% combined_weights = 0.0 %>
<% for bat in @cage.bats %>
  <% combined_weights = combined_weights + bat.weights.recent[0].weight %>
<% end %>
<% average = combined_weights/@cage.bats.count %>
Average weight: <%= (("%.0" + 1.to_s + "f") % average).to_f %> g

<% end %>

Food: <%= @cage.food %> grams in <%= @cage.dish_num %> <%= @cage.dish_type %>

Date created: <%= nice_date @cage.date_created %>

<% if @cage.date_destroyed != nil %>

Date destroyed: <%= nice_date @cage.date_destroyed %>

<% else %>

<% end %>

<%= render_partial 'weighing_tasks' %>

<% if @cage.bats.active.length == 0 %>
No bats are in this cage.
<% else %>
  Current Bats:

  Band
  Last Weight
  Weigh Date
  Date in
  Who
  Why
  <% for bat in @cage.bats %>
    <% cih = bat.cage_in_histories %>
    <% if cih %>
    <%      @date_in = cih[0].date %>
    <%      @sig = cih[0].user.initials %>
    <%      @why = cih[0].note %>
    <% else %>
    <%      @date_in ="" %>
    <%      @sig = "" %>
    <%      @why = "" %>
    <% end %>

    <%= link_to bat.band, :controller => 'bats', :action => 'show', :id => bat %>
    <% if bat.weights.length > 0 %>
          <%=h bat.weights[0].weight %>
          <%=h nice_date bat.weights[0].date %>
    <% else %>
          N/A
          N/A
    <% end %>
    <%=h nice_date @date_in %>
    <%=h @sig %>
    <%=h @why %>

  <% end %>

<% end %>

<% if @cohs.length == 0 %>
No bats were in this cage.
<% else %>
  Past Bats:

  Band
  Date in
  Who
  Date out
  Who
  <% for coh in @cohs %>

    <%=link_to coh.bat.band, :controller => 'bats', :action => 'show', :id => coh.bat %>
    <%=h nice_date coh.cage_in_history.date %>
    <%=h coh.cage_in_history.user.initials %>
    <%=h nice_date coh.date %>
    <%=h coh.user.initials %>

  <% end %>

<% end %>

<%= link_to 'Edit', :action => 'edit', :id => @cage %> |
<%= link_to 'List Current Cages', :action => 'list' %>


turn off deborphan's nice mode to get enough packages

git-svn-id: e70f47238a868777ecefe75ba01929cffb2d8127@741 d8b24053-1f83-4035-b5c3-ce8b92cd91ad


Fixed new revision issue

Fixed new revision issue

<% if info[1] -%>

Version <%= dec info[1].revision %>, <%= info[1].active? ? 'Active'.t : 'Inactive'.t %>, <%= render :partial => '/edit/saved_by', :locals => { :revision => info[1] } %>

  <% info[1].used_images.each do |img| %>

         <img src='<%= img.thumbnail_url(theme,'thumb') %>'/>

         <%= h(img.name) %>

  <% end -%>

<% if permit?('editor_editor') %>
  <% if info[2] && info[1] != info[2] -%>
    <%= link_to 'Edit Active Revision (%d)' / info[1].revision, { :controller => 'edit', :action => 'page', :path => ['page',@node.id,info[0] ] }, :class => 'link_button' %>
    <%= link_to 'Edit Latest Revision (%d)' / info[2].revision, { :controller => 'edit', :action => 'page', :path => ['page',@node.id,info[2].id ] }, :class => 'link_button' %>

  <% else -%>
    <%= link_to 'Edit Page', { :controller => 'edit', :action => 'page', :path => ['page',@node.id,info[0] ] }, :class => 'link_button' %>
  <% end -%>
<% end -%>

  <% if info[1].active? %>
    <%= link_to 'Goto Page', @revision_info.length > 1 ? "/view/#{info[0]}#{@node.node_path}"  : @node.node_path, :class => 'link_button' -%>
  <% end -%>
<% else -%>
<% if permit?('editor_structure') %>

  <% remote_form_for :revision_create, info[1],
      :update => "node_#{@node.id}_#{info[0]}",
      :method => 'post',
      :url =>  { :action => 'create_revision', :language  => info[0]  } do  |f| -%>
    <input type='submit' value='<%= "Create Page".t %>' /> From
    <%= f.select :from_revision_id, @revision_info.find_all { |inf| inf[1] }.collect { |inf| [ inf[0].upcase, inf[1].id ] } %>
  <% end -%>
<% else %>
  <%= "No Existing Revision".t %>
<% end -%>

<% end -%>

<% if info[1] -%>

<% if permit?('editor_structure') %>
  <div id='<%= "node_#{@node.id}_#{info[0]}_view" %>' >
  <% link_edit_form_for  :revision_view, info[1],
      :styled_form => {
	  :onclick => "Element.hide(\"node_#{@node.id}_#{info[0]}_view\"); Element.show(\"node_#{@node.id}_#{info[0]}_edit\");",
	  :classname => "ajax_link page_information_link"
      } do |f| -%>
      <%= render :partial => 'revision_info_table', :locals => { :f => f } %>
  <% end -%>

  <div id='node_<%= @node.id %>_<%= info[0] %>_edit' style='display:none;'>
  <% remote_cms_form_for :revision_edit, info[1],
      :update => "node_#{@node.id}_#{info[0]}",
      :method => 'post',
      :html => { :class => 'admin_form' },
      :url =>  { :action => 'update_revision', :revision  => info[1].id  } do  |f| -%>
      <%= render :partial => 'revision_info_table', :locals => { :f => f  } %>

    <%= f.header 'Additional Page Options' %>
    <%= f.filemanager_image :icon_id, :label => 'Page Icon' %>
    <%= f.filemanager_image :icon_hot_id, :label => 'Page Icon Hot' %>
    <%= f.filemanager_image :icon_disabled_id, :label => 'Page Icon Disabled' %>
    <%= f.filemanager_image :icon_selected_id, :label => 'Page Icon Selected'  %>
    <%= f.color_field :color, :label => 'Color' %>
    <%= f.color_field :color_selected, :label => 'Selected Color' %>
    <%= f.color_field :color_hover, :label => 'Hover Color' %>
    <%= f.text_field :field1, :description => 'Additional Field available in Menu Features' %>
    <%= f.text_field :field2, :description => '2nd Additional Field available in Menu Features' %>

    <%= f.cancel_submit_buttons 'Cancel','Submit',
	{
	  :onclick => "Element.show(\"node_#{@node.id}_#{info[0]}_view\"); Element.hide(\"node_#{@node.id}_#{info[0]}_edit\"); return false;"
        },
	{}
	%>
  <% end -%>
<% else -%>
  <% tabled_display_form_for :revision_view, info[1] do |f| -%>
      <%= render :partial => 'revision_info_table', :locals => { :f => f } %>
  <% end -%>
<% end -%>

<% end -%>

<% if info[1] -%>

Version <%= dec info[1].revision %>, <%= info[1].active? ? 'Active'.t : 'Inactive'.t %>, <%= render :partial => '/edit/saved_by', :locals => { :revision => info[1] } %>

  <% info[1].used_images.each do |img| %>

         <img src='<%= img.thumbnail_url(theme,'thumb') %>'/>

         <%= h(img.name) %>

  <% end -%>

<% if permit?('editor_editor') %>
  <% if info[1] != info[2] -%>
    <%= link_to 'Edit Active Revision (%d)' / info[1].revision, { :controller => 'edit', :action => 'page', :path => ['page',@node.id,info[0] ] }, :class => 'link_button' %>
    <%= link_to 'Edit Latest Revision (%d)' / info[2].revision, { :controller => 'edit', :action => 'page', :path => ['page',@node.id,info[2].id ] }, :class => 'link_button' %>

  <% else -%>
    <%= link_to 'Edit Page', { :controller => 'edit', :action => 'page', :path => ['page',@node.id,info[0] ] }, :class => 'link_button' %>
  <% end -%>
<% end -%>

  <% if info[1].active? %>
    <%= link_to 'Goto Page', @revision_info.length > 1 ? "/view/#{info[0]}#{@node.node_path}"  : @node.node_path, :class => 'link_button' -%>
  <% end -%>
<% else -%>
<% if permit?('editor_structure') %>

  <% remote_form_for :revision_create, info[1],
      :update => "node_#{@node.id}_#{info[0]}",
      :method => 'post',
      :url =>  { :action => 'create_revision', :language  => info[0]  } do  |f| -%>
    <input type='submit' value='<%= "Create Page".t %>' /> From
    <%= f.select :from_revision_id, @revision_info.find_all { |inf| inf[1] }.collect { |inf| [ inf[0].upcase, inf[1].id ] } %>
  <% end -%>
<% else %>
  <%= "No Existing Revision".t %>
<% end -%>

<% end -%>

<% if info[1] -%>

<% if permit?('editor_structure') %>
  <div id='<%= "node_#{@node.id}_#{info[0]}_view" %>' >
  <% link_edit_form_for  :revision_view, info[1],
      :styled_form => {
	  :onclick => "Element.hide(\"node_#{@node.id}_#{info[0]}_view\"); Element.show(\"node_#{@node.id}_#{info[0]}_edit\");",
	  :classname => "ajax_link page_information_link"
      } do |f| -%>
      <%= render :partial => 'revision_info_table', :locals => { :f => f } %>
  <% end -%>

  <div id='node_<%= @node.id %>_<%= info[0] %>_edit' style='display:none;'>
  <% remote_cms_form_for :revision_edit, info[1],
      :update => "node_#{@node.id}_#{info[0]}",
      :method => 'post',
      :html => { :class => 'admin_form' },
      :url =>  { :action => 'update_revision', :revision  => info[1].id  } do  |f| -%>
      <%= render :partial => 'revision_info_table', :locals => { :f => f  } %>

    <%= f.header 'Additional Page Options' %>
    <%= f.filemanager_image :icon_id, :label => 'Page Icon' %>
    <%= f.filemanager_image :icon_hot_id, :label => 'Page Icon Hot' %>
    <%= f.filemanager_image :icon_disabled_id, :label => 'Page Icon Disabled' %>
    <%= f.filemanager_image :icon_selected_id, :label => 'Page Icon Selected'  %>
    <%= f.color_field :color, :label => 'Color' %>
    <%= f.color_field :color_selected, :label => 'Selected Color' %>
    <%= f.color_field :color_hover, :label => 'Hover Color' %>
    <%= f.text_field :field1, :description => 'Additional Field available in Menu Features' %>
    <%= f.text_field :field2, :description => '2nd Additional Field available in Menu Features' %>

    <%= f.cancel_submit_buttons 'Cancel','Submit',
	{
	  :onclick => "Element.show(\"node_#{@node.id}_#{info[0]}_view\"); Element.hide(\"node_#{@node.id}_#{info[0]}_edit\"); return false;"
        },
	{}
	%>
  <% end -%>
<% else -%>
  <% tabled_display_form_for :revision_view, info[1] do |f| -%>
      <%= render :partial => 'revision_info_table', :locals => { :f => f } %>
  <% end -%>
<% end -%>

<% end -%>


Some tweaks to edit page.

Some tweaks to edit page.

Edit basic details of request

<%= error_messages_for 'info_request' %>

<% form_tag '../update/' + @info_request.id.to_s do %>

Title (warning: editing this will break URLs right now)

   <%= text_field 'info_request', 'title', :size => 50  %>

Prominence (whether is shown in lists of requests / search or not)

   <%= select( 'info_request', "prominence", { "normal" => "normal", "backpage" => "backpage"}) %>

Stop new responses (use this on requests getting spam, but also work out how the email leaked and plug it)

   <%= select('info_request', "stop_new_responses", [["Yes - stop new responses",true],["No - allow new responses",false]]) %>

Described state (don't forget to change 'awaiting description' below too if necessary)

   <%= select( 'info_request', "described_state",
       [
        'waiting_response',
        'waiting_clarification',
        'not_held',
        'rejected',
        'successful',
        'partially_successful',
        'requires_admin',
    ]) %>

Awaiting description

   <%= select('info_request', "awaiting_description", [["Yes - needs state updating",true],["No - state is up to date",false]]) %>

<%= submit_tag 'Save changes' %>

Note: To edit the actual request body text, click edit
  next to the specific outgoing message.

<% end %>

<%= link_to 'Show', '../show/' + @info_request.id.to_s %> |
<%= link_to 'List all', '../list' %>

<% form_tag '../fully_destroy/' + @info_request.id.to_s do %>

    This is permanent and irreversible! <%= submit_tag 'Destory request entirely' %>

Use it mainly if someone posts private information, e.g. made a Data Protection request. It
    destroys all responses and tracks as well.

<% end %>

Edit basic details of request

<%= error_messages_for 'info_request' %>

<% form_tag '../update/' + @info_request.id.to_s do %>

Title (warning: editing this will break URLs right now)

   <%= text_field 'info_request', 'title', :size => 50  %>

Prominence (whether is shown in lists of requests or not)

   <%= select( 'info_request', "prominence", { "normal" => "normal", "backpage" => "backpage"}) %>

Awaiting description

   <%= select('info_request', "awaiting_description", [["Yes",true],["No",false]]) %>

Stop new responses (use this on requests getting spam, but also work out how the email leaked and plug it)

   <%= select('info_request', "stop_new_responses", [["Yes",true],["No",false]]) %>

Described state

   <%= select( 'info_request', "described_state",
       [
        'waiting_response',
        'waiting_clarification',
        'not_held',
        'rejected',
        'successful',
        'partially_successful',
        'requires_admin',
    ]) %>

<%= submit_tag 'Save changes' %>

Note: To edit the actual request body text, click edit
  next to the specific outgoing message.

<% end %>

<% form_tag '../fully_destroy/' + @info_request.id.to_s do %>

    This is permanent and irreversible! <%= submit_tag 'Destory request entirely' %>

Use it mainly if someone posts private information, e.g. made a Data Protection request. It
    destroys all responses and tracks as well.

<% end %>

<%= link_to 'Show', '../show/' + @info_request.id.to_s %> |
<%= link_to 'List all', '../list' %>