Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
<!DOCTYPE html>
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<title>FoI Multi</title>
<style type="text/css" media="screen">
body {font-family: "Helvetica Neue", Arial, Helvetica, sans-serif; color:#333;}
.alert { color: #c00;}
.success_message, label { font-weight: bold;}
.sub_message { background-color: yellow;}
.placeholder { color: #999;}
#insert_boilerplate {float:right;}
#foi_text, form {width: 600px;}
<script type="text/javascript" charset="utf-8" src="">
<script type="text/javascript" charset="utf-8">
var boilerplate_prefix = "Under the Freedom of Information Act 2000 I would like to request the following information:\n\n";
var boilerplate_suffix = "\n\nIf this information is held by an outside contractor then it is your responsibility under the FOIA to obtain that information.\n\nIf the arrangements for any of the agreements with the Publisher have been delegated or passed onto another public body, please can you inform me of this and if possible transfer the request to that public body. My preferred format to receive this information is by electronic means, specifically in a machine-readable form (e.g. CSV, Word or Excel Documents rather than scans of printouts).\n\nIf you need any clarification of this request or if it is too broad in any way please feel free to email me. If some parts of this request are more difficult to answer than others please release the answerable material as it is available rather than hold up the entire request for the contested data.\n\nIf FOI requests of a similar nature have already been asked could you please include your responses to those requests. I would be grateful if you could confirm in writing that you have received this request, and I look forward to hearing from you within the 20-working day statutory time period.";
var machine_tag = 'mfoi_' + new Date().getTime();
$(document).ready( function() {
var new_text = boilerplate_prefix + $('#foi_text').val() + boilerplate_suffix;
$('#selected_councils ul').append('<li><a href="' + $(this).val() + '/new" class="wdtk_link">' + this.options[this.selectedIndex].text + '</a> <a href="#" class="delete_selected_council">delete</a></li>');
$('#message').html('<span class="sub_message">Council added. </span>Please choose another council');
var selected_councils = $('#selected_councils a.wdtk_link');
var selected_councils_count = selected_councils.length;
for (var i = selected_councils.length - 1; i >= 0; i--){
var success_message='<div class="success_message">'+ selected_councils.length + ' requests have prepared (in new windows) and are ready for submission. After they have been submitted the status will be available at:\<br /><a href="' + machine_tag + '">' + machine_tag + '</a></div>';
function insertCouncils (data) {
var councils = data.councils;
for (var i=0; i < councils.length; i++){
// $('#council_selector').append("<option value='" + councils[i].wdtk_id + "'>" + councils[i].name + "</option>");
$('#council_selector').append("<option value='" + i + "'>" + councils[i].name + "</option>");
$('#message').html('Please choose council');
function submitFormFor (wdtk_id) {
var form = document.createElement("form");
form.setAttribute("method", "post");
form.setAttribute("action", "http://localhost:3000/" + wdtk_id);
form.setAttribute("target", "_blank");
form.appendChild(hiddenField('machine_tag', machine_tag))
form.appendChild(hiddenField('preview', '1'))
form.appendChild(hiddenField('outgoing_message[body]', $('#foi_text').val()))
function hiddenField (name, value) {
var newHiddenField = document.createElement("input");
newHiddenField.setAttribute("name", name);
newHiddenField.setAttribute("value", value);
return newHiddenField;
jQuery.getJSON('', function(data){insertCouncils(data);});
<body onload="">
<h1>Multi Council FoI Submitter tool</h1>
<p class='intro'>This is a very simple tool to help you submit the same FoI requests to multiple councils (particularly useful if you are trying to compare data across councils). It is an interface to the wonderful <a href=""></a> and uses <a href="">OpenlyLocal</a>'s <a href="">database of councils</a></p>
<form id='multi_foi' action="index" method="post" accept-charset="utf-8">
<div id='message' class="alert">
Loading list of councils...
<select name="council_selector" id="council_selector" size="1">
<option value="" selected="selected">-----</option>
<div id="selected_councils">
<h3>Selected councils</h3>
<p class="placeholder">None yet</p>
<a href='#' id='insert_boilerplate'>Insert standard text (can be edited)</a>
<label for="foi_text">Text of request</label>
<textarea id='foi_text' name="foi_text" rows="20"></textarea>
<p><input type="submit" value="Generate Requests"><br />
Note: A new window will open for each request</p>
<div id="hidden_form_area" style="display:none">
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.