Permalink
Browse files

Merge branch 'master' of github.com:alphagov/panopticon

  • Loading branch information...
2 parents f9b222f + f434b67 commit edb3fd2066d940bb720fcd8314f0ac2d03a8e723 @garethr garethr committed Jan 19, 2012
View
@@ -5,6 +5,8 @@ group :passenger_compatibility do
gem 'rake', '0.9.2'
end
+gem 'gds-warmup-controller'
+
gem 'plek', '~> 0'
gem 'formtastic', '2.0.0.rc5'
gem 'stomp'
@@ -14,6 +16,7 @@ gem 'daemonette', :git => 'git@github.com:alphagov/daemonette.git'
gem 'whenever'
gem 'ansi'
gem 'gelf'
+gem 'null_logger'
gem 'exception_notification'
@@ -28,7 +31,7 @@ gem 'colorize', '~> 0.5.8'
if ENV['BUNDLE_DEV']
gem 'gds-sso', :path => '../gds-sso'
else
- gem 'gds-sso', :git => 'git@github.com:alphagov/gds-sso.git'
+ gem 'gds-sso', '~> 0.4.1'
end
if ENV['SLIMMER_DEV']
View
@@ -4,18 +4,6 @@ GIT
specs:
daemonette (0.1.0)
-GIT
- remote: git@github.com:alphagov/gds-sso.git
- revision: df6cb953a1cbe75bef47d0061f7927966ad3d3f6
- specs:
- gds-sso (0.3.0)
- oa-core (= 0.2.6)
- oa-oauth (= 0.2.6)
- oauth2 (= 0.4.1)
- rack-accept (~> 0.4.4)
- rails (>= 3.0.0)
- warden (= 1.0.6)
-
GEM
remote: http://rubygems.org/
specs:
@@ -66,7 +54,7 @@ GEM
capybara-mechanize (0.3.0.rc3)
capybara (~> 1.1.0)
mechanize (~> 2.0.0)
- childprocess (0.2.4)
+ childprocess (0.3.0)
ffi (~> 1.0.6)
chronic (0.6.6)
ci_reporter (1.6.9)
@@ -82,15 +70,15 @@ GEM
capybara (>= 1.1.2)
cucumber (>= 1.1.3)
nokogiri (>= 1.5.0)
- database_cleaner (0.7.0)
+ database_cleaner (0.7.1)
diff-lcs (1.1.3)
erubis (2.7.0)
exception_notification (2.5.2)
actionmailer (>= 3.0.4)
- factory_girl (2.3.2)
+ factory_girl (2.4.0)
activesupport
- factory_girl_rails (1.4.0)
- factory_girl (~> 2.3.0)
+ factory_girl_rails (1.5.0)
+ factory_girl (~> 2.4.0)
railties (>= 3.0.0)
fakeweb (1.3.0)
faraday (0.6.1)
@@ -100,16 +88,26 @@ GEM
ffi (1.0.11)
formtastic (2.0.0.rc5)
rails (~> 3.0)
- gds-api-adapters (0.0.20)
+ gds-api-adapters (0.0.37)
null_logger
plek
+ gds-sso (0.4.1)
+ oa-core (= 0.2.6)
+ oa-oauth (= 0.2.6)
+ oauth2 (= 0.4.1)
+ plek
+ rack-accept (~> 0.4.4)
+ rails (>= 3.0.0)
+ warden (= 1.0.6)
+ gds-warmup-controller (0.0.2)
+ rails (>= 3.0.0)
gelf (1.3.2)
json
- gherkin (2.7.1)
+ gherkin (2.7.3)
json (>= 1.4.6)
hike (1.2.1)
i18n (0.6.0)
- json (1.6.4)
+ json (1.6.5)
mail (2.3.0)
i18n (>= 0.4.0)
mime-types (~> 1.16)
@@ -126,7 +124,7 @@ GEM
metaclass (0.0.1)
mime-types (1.17.2)
minitest (2.10.0)
- mocha (0.10.0)
+ mocha (0.10.1)
metaclass (~> 0.0.1)
multi_json (1.0.4)
multi_xml (0.2.2)
@@ -182,8 +180,8 @@ GEM
rdoc (3.12)
json (~> 1.4)
rubyzip (0.9.5)
- selenium-webdriver (2.15.0)
- childprocess (>= 0.2.1)
+ selenium-webdriver (2.17.0)
+ childprocess (>= 0.2.5)
ffi (~> 1.0.9)
multi_json (~> 1.0.4)
rubyzip
@@ -193,7 +191,7 @@ GEM
simplecov-html (0.4.5)
simplecov-rcov (0.2.3)
simplecov (>= 0.4.1)
- slimmer (1.1.16)
+ slimmer (1.1.21)
json
nokogiri (~> 1.5.0)
null_logger
@@ -208,7 +206,7 @@ GEM
sqlite3 (>= 1.3.3)
stomp (1.2.0)
term-ansicolor (1.0.7)
- test-unit (2.4.3)
+ test-unit (2.4.5)
thor (0.14.6)
tilt (1.3.3)
treetop (1.4.10)
@@ -246,13 +244,15 @@ DEPENDENCIES
fakeweb
formtastic (= 2.0.0.rc5)
gds-api-adapters (~> 0.0.15)
- gds-sso!
+ gds-sso (~> 0.4.1)
+ gds-warmup-controller
gelf
marples (~> 1.0)
minitest
mocha
mysql2
nokogiri
+ null_logger
pethau
plek (~> 0)
rack (= 1.3.5)
View
@@ -1,18 +1,21 @@
class Artefact < ActiveRecord::Base
MAXIMUM_RELATED_ITEMS = 8
- SECTIONS = [
- 'Crime and justice',
- 'Education',
- 'Work',
- 'Family',
- 'Money and Tax',
- 'Driving',
- 'Housing',
- 'Travel',
- 'Life in the UK',
- 'Neighbourhoods'
- ].freeze
+ def self.sections
+ @@sections ||= load_sections
+ end
+
+ def self.load_sections
+ section = nil
+ File.open(Rails.root.join('app', 'models', 'sections.txt'), 'r').map do |line|
+ if line =~ /^ /
+ raise "Bad section.txt, must start with a section (no spaces at start of first line)" if section.nil?
+ "#{section}:#{line.strip}"
+ else
+ section = line.strip
+ end
+ end
+ end
FORMATS = [
"answer",
View
@@ -0,0 +1,89 @@
+Crime and justice
+ Reporting crime
+ Terrorism and extremism
+ The police
+ Courts
+ Sentencing
+ Prisons and probation
+ Complaints
+ Young people and crime
+ Your neighbourhood
+ Victims of crime
+ Mental capacity and the law
+Education
+ School admissions
+ Schools
+ Special educational needs
+ Student money
+ Further and higher education
+ Adult learning
+ Libraries
+Work
+ Finding work
+ Starting work
+ Types of employment
+ Employment rights
+ Time off from work
+ Health and safety at work
+ Work-related benefits and schemes
+ Ending work
+Family
+ Maternity and paternity
+ Parenting
+ Adoption and fostering
+ Separation and divorce
+ Death and bereavement
+ Childcare
+ Registering life events
+ Marriage and civil partnership
+Money and tax
+ Children
+ Home
+ Sickness, disability and carers
+ Tax credits
+ Pensions
+ Debt and bankruptcy
+ Tax
+ Seasonal payments
+Driving
+ Learning to drive
+ Your driving licence
+ Vehicle tax
+ Buying/selling a vehicle
+ MOT
+ Owning a car/motorbike
+ Driving and your neighbourhood
+ Driving and the law
+ Driving courses
+Housing
+ Emergency housing
+ Council Tax
+ Council housing
+ Local council services
+ Housing problems and issues
+ Housing benefits, grants and schemes
+ Planning and building
+ Refuse and disposal
+ Your home
+ Buying and selling a home
+ Renting a home
+Life in the UK
+ The monarchy
+ How government works
+ Voting
+ Becoming a British citizen
+Travel
+ Foreign travel
+ Air travel
+ Passports
+ Animals and the UK
+ Moving and living abroad
+ Travelling in the UK
+Neighbourhoods
+ Community
+ Library and learning
+ Charities and volunteering
+ Council services
+ Reporting a problem
+ Open spaces
+ Your local area
@@ -7,7 +7,7 @@
<%= f.inputs :name => "Basic information" do %>
<%= f.input :name %>
<%= f.input :slug %>
- <%= f.input :section, :as => :select, :collection => Artefact::SECTIONS %>
+ <%= f.input :section, :as => :select, :collection => Artefact.sections.map {|s| [s.gsub(':', ' > '), s] } %>
<% end %>
<%= f.inputs "Related items", :class => "related" do %>
<%= f.semantic_fields_for :related_items, related_items_for(artefact) do |related_item| %>
@@ -4,6 +4,7 @@
<thead>
<tr>
<th>Title</th>
+ <th>Format</th>
<th>Section</th>
<th>Related Items</th>
<th>Relatedness Done?</th>
@@ -15,6 +16,7 @@
<% @artefacts.each do |artefact| %>
<tr>
<td><%= link_to artefact.name, edit_artefact_path(artefact.id) %></td>
+ <td><%=h artefact.kind %></td>
<td><%=h artefact.section %></td>
<td><%=h artefact.related_items_count %></td>
<td><%=h artefact.relatedness_done %></td>
@@ -11,6 +11,16 @@
<body>
<div id="wrapper" class="wrapper">
<h1 id="site-title">Panopticon</h1>
+ <nav class="admin-nav group" role="navigation">
+ <ul>
+ <li class="publications-nav">
+ <ul>
+ <li><%= link_to 'Sign out', gds_sign_out_path %></li>
+ </ul>
+ </li>
+ </ul>
+ </nav>
+
<div class="content" role="main">
<%= yield %>
<%= yield :extra_javascript %>
@@ -1,6 +1,9 @@
# Be sure to restart your server when you modify this file.
-Panopticon::Application.config.session_store :cookie_store, key: '_panopticon_session'
+Panopticon::Application.config.session_store :cookie_store,
+ key: '_panopticon_session',
+ secure: Rails.env.production?,
+ http_only: true
# Use the database for sessions instead of the cookie-based default,
# which shouldn't be used to store highly confidential information
Oops, something went wrong.

0 comments on commit edb3fd2

Please sign in to comment.