-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Contact page now has a much clearer structure, with fold-out sections that guide the user to the right contact method. This will need translating to Welsh! Removed the `flash[:notice]` handling since it’s no longer used in Core. Part of mysociety/alaveteli#74.
- Loading branch information
Showing
4 changed files
with
257 additions
and
89 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
// Houdini is a custom-written CSS+HTML library for | ||
// showing and hiding elements on a page using just | ||
// checkboxes and radio buttons. | ||
|
||
// Relies on the "+" adjacent/next sibling selector and | ||
// the ":checked" pseudo-class, which means this doesn't | ||
// work in IE8 or below. | ||
|
||
// Example use: | ||
// | ||
// <label class="houdini-label" for="input1">Click me...</label> | ||
// <input class="houdini-input" type="checkbox" id="input1"> | ||
// <div class="houdini-target">...To show and hide me</div> | ||
|
||
// Or an example where the input remains visible to the user, | ||
// and is placed before the label (eg: to be floated right, so it | ||
// appears to the right of the label, like a normal checkbox): | ||
// | ||
// <input class="houdini-input houdini-input--visible" type="checkbox" id="input2"> | ||
// <label class="houdini-label" for="input2">Click me...</label> | ||
// <div class="houdini-target">...To show and hide me</div> | ||
|
||
// The three elements must be placed sequentially in the document, | ||
// either label+input+target or input+label+target. | ||
|
||
// Each label+input pair must have matching `id` and `for` attributes. | ||
// You cannot nest the input inside the label. | ||
|
||
.houdini-input { | ||
position: absolute; | ||
opacity: 0; | ||
} | ||
|
||
.houdini-input--visible { | ||
position: static; | ||
opacity: 1; | ||
} | ||
|
||
.houdini-target { | ||
display: none; | ||
|
||
.houdini-input:checked + &, | ||
.houdini-input:checked + .houdini-label + & { | ||
display: block; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
<%= form_for :contact, :html => {:class => 'contact-form'} do |f| %> | ||
|
||
<p class="contact-form__understand"> | ||
<input type="checkbox" id="understand" required="required"> | ||
<label for="understand" class="form_label"> | ||
I understand that WhatDoTheyKnow is <strong>not</strong> run by the | ||
government, and the WhatDoTheyKnow volunteers <strong>cannot</strong> | ||
help me with personal matters relating to government services. | ||
</label> | ||
</p> | ||
|
||
<% if not @user %> | ||
<p> | ||
<label class="form_label" for="contact_name">My name:</label> | ||
<%= f.text_field :name, :size => 20 %> | ||
(or <%= link_to "sign in", signin_url(:r => request.fullpath) %>) | ||
</p> | ||
|
||
<p> | ||
<label class="form_label" for="contact_email">My email:</label> | ||
<%= f.text_field :email, :size => 20 %> | ||
</p> | ||
<% end %> | ||
|
||
<p> | ||
<label class="form_label" for="contact_subject">My message is about:</label> | ||
<%= f.text_field :subject, :size => 50, :class => "message-subject" %> | ||
</p> | ||
|
||
<p> | ||
<label class="form_label" for="contact_message"> | ||
My message to the WhatDoTheyKnow volunteers: | ||
</label> | ||
<%= f.text_area :message, :rows => 10, :cols => 60 %> | ||
</p> | ||
|
||
<p style="display:none;"> | ||
<%= f.label :comment, 'Do not fill in this field' %> | ||
<%= f.text_field :comment %> | ||
</p> | ||
|
||
<% if !@last_request.nil? %> | ||
<p> | ||
<label class="form_label" for="contact_message">Include link to request:</label> | ||
<%=request_link(@last_request) %> | ||
<%= submit_tag "remove", :name => 'remove' %> | ||
</p> | ||
<% end %> | ||
<% if !@last_body.nil? %> | ||
<p> | ||
<label class="form_label" for="contact_message">Include link to authority:</label> | ||
<%=public_body_link(@last_body) %> | ||
<%= submit_tag "remove", :name => 'remove' %> | ||
</p> | ||
<% end %> | ||
|
||
<div class="form_button"> | ||
<%= hidden_field_tag(:submitted_contact_form, 1) %> | ||
<%= submit_tag "Send message to WhatDoTheyKnow volunteers", :disable_with => "Sending..." %> | ||
</div> | ||
|
||
<% end %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters