Skip to content

Commit

Permalink
Bringing Repository up to date with Live root
Browse files Browse the repository at this point in the history
  • Loading branch information
Duncan Stuart committed Aug 24, 2010
1 parent 802ca12 commit 4e4e964
Show file tree
Hide file tree
Showing 20 changed files with 9,229 additions and 163 deletions.
2 changes: 2 additions & 0 deletions app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ class ApplicationController < ActionController::Base

layout "main"

require 'digest/md5'

# Scrub sensitive parameters from your log
# filter_parameter_logging :password
end
6 changes: 2 additions & 4 deletions app/controllers/events_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,8 @@ def destroy
def authenticate
@cms_page=true

authenticate_or_request_with_http_basic do |username, password|
if username == USERNAME && password == PASSWORD
@authenticated=true
end
@authenticated = authenticate_or_request_with_http_basic do |username, password|
LOGINS[username] == Digest::MD5.hexdigest(password)
end
end

Expand Down
6 changes: 2 additions & 4 deletions app/controllers/organisers_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,8 @@ def destroy
def authenticate
@cms_page=true

authenticate_or_request_with_http_basic do |username, password|
if username == USERNAME && password == PASSWORD
@authenticated=true
end
@authenticated = authenticate_or_request_with_http_basic do |username, password|
LOGINS[username] == Digest::MD5.hexdigest(password)
end
end
end
6 changes: 2 additions & 4 deletions app/controllers/venues_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,8 @@ def destroy
def authenticate
@cms_page=true

authenticate_or_request_with_http_basic do |username, password|
if username == USERNAME && password == PASSWORD
@authenticated=true
end
@authenticated = authenticate_or_request_with_http_basic do |username, password|
LOGINS[username] == Digest::MD5.hexdigest(password)
end
end
end
15 changes: 7 additions & 8 deletions app/helpers/events_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ module EventsHelper

#move somewhere general?
def row_tag(myclass, day=nil)
tag :li, {:class => add_todayclass(myclass, day)}, false
tag :li, {:class => add_todayclass(myclass, day)}, true
end

# add an extra event if today is the target day or date
Expand All @@ -28,13 +28,13 @@ def is_tomorrow(d)

def today_label(d)
if is_today(d)
content_tag :span, "Today", :id => "today_label"
content_tag :span, "Today", :class => "today_label"
end
end

def tomorrow_label(d)
if is_tomorrow(d)
content_tag :span, "Tomorrow", :id => "tomorrow_label"
content_tag :span, "Tomorrow", :class => "tomorrow_label"
end
end

Expand All @@ -58,6 +58,9 @@ def social_link(event)
event_title_class = "social_title"
event_details_class = "social_details"

#Highlight socials which are monthly or more infrequent:
event_title_class += " social_highlight" if event.frequency == 0 || event.frequency >= 4

event_title = event.title
#If this is empty, something has gone wrong, and we shouldn't be displaying anything. Catch this earlier.

Expand Down Expand Up @@ -130,11 +133,7 @@ def compass_point(event)
title = event.venue.compass_text
compass = event.venue.compass
end

#TEMPORARY
compass = link_to compass, event
#END OF TEMPORARY


content_tag :abbr, :title => title, :class => "compass" do
compass
end
Expand Down
13 changes: 10 additions & 3 deletions app/models/event.rb
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,11 @@ def frequency_text
# ---------- #

CLASS_TYPES = ['class', 'class with social']
SOCIAL_TYPES = ['social', 'social with class']
SOCIAL_TYPES = ['social', 'social with class', 'class with social', 'vintage club']
HAS_CLASS_TYPES = ['class', 'class with social', 'social with class']

def self.event_types
CLASS_TYPES + SOCIAL_TYPES
(CLASS_TYPES + SOCIAL_TYPES).uniq
end

def is_class?
Expand Down Expand Up @@ -116,6 +116,7 @@ def dates
end

def dates_rows
puts "ID=#{id}, #{title}"
date_array(",\n")
end

Expand Down Expand Up @@ -164,6 +165,9 @@ def uk_date_from_string(date_string)

private

# NOTE: this is a HORRIBLY inefficient way to build up the array, involving multiple passes and sorts. There must be a better way...


# Get a hash of all dates in the selected range, and the list of all weekly socials occuring on that date
def self.weekly_socials_dates
#get an array of all the dates under consideration:
Expand Down Expand Up @@ -206,7 +210,10 @@ def self.other_socials_dates

# merge two hashes of dates and socials, concatenating the lists of dates
def self.merge_dates_hashes(hash1,hash2)
hash1.merge(hash2) {|key, val1, val2| val1 + val2}
hash1.merge(hash2) do |key, val1, val2|
#have two sorted segments, but need to sort the result...
(val1 + val2).sort{|a,b| a.title <=> b.title}
end
end

def self.date_array
Expand Down
20 changes: 16 additions & 4 deletions app/views/layouts/main.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,15 @@

<title>Swing Out London - listings of Lindy Hop classes and socials</title>

<%= stylesheet_link_tag 'reset' %>
<%= stylesheet_link_tag 'reset' %>
<!--[if lte IE 7 ]>
<%= stylesheet_link_tag 'ie' %>
<![endif]-->
<%= stylesheet_link_tag 'playbill' %>
<%= stylesheet_link_tag 'cms' if @cms_page==true%>
<%= stylesheet_link_tag 'rails_errors' if @cms_page==true%>

<link rel="profile" href="http://microformats.org/profile/hcalendar">
<link rel="profile" href="http://microformats.org/profile/hcalendar"/>

</head>
<body>
Expand All @@ -35,9 +38,18 @@
<%= yield %>
<% end %>

<div id="footer">
<div id="footer">

<address><a href="mailto:[email protected]?subject=Swing Out London">Site by LeveretWeb</a></address>
<div id="valid_icons">
<a href="http://validator.w3.org/check?uri=referer" id="xhtml_icon">
<img src="http://www.w3.org/Icons/valid-xhtml10-blue" alt="Valid XHTML 1.0 Strict" />
</a>
<a href="http://jigsaw.w3.org/css-validator/check/referer" id="css_icon">
<img src="http://jigsaw.w3.org/css-validator/images/vcss-blue" alt="Valid CSS" />
</a>
</div>

<address><a href="mailto:[email protected]?subject=Swing Out London">Site by LeveretWeb</a></address>

<%= render :partial => 'website/navigation', :locals => { :nav_id => 'footer_nav' } %>

Expand Down
2 changes: 2 additions & 0 deletions app/views/organisers/index.html.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<h1>Listing organisers</h1>

<%= link_to 'New organiser', new_organiser_path %>

<table>
<tr>
<th>Name</th>
Expand Down
2 changes: 1 addition & 1 deletion app/views/venues/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,5 @@
<% end %>
</table>

<br />
<%= link_to 'New venue', new_venue_path %>

16 changes: 10 additions & 6 deletions app/views/website/about.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<h2> Mission statement</h2>

<p>
This website is born out of my own frustration at trying to find details of Lindy Hop events in London. While there are a <a href="http://www.swingjunction.co.uk/modules/piCal/index.php?cid=1" title="Swing Junction-Calendar">couple</a> of <a href="http://www.swingdancersoflondon.org/" title="Swing Dancers of London">listings</a> sites around they don't provide the information I need in the way I want it, so I decided to make my own (as you do).
This website is born out of my own frustration at trying to find details of Lindy Hop events in London, particularly when I was just starting out. While there are a <a href="http://www.swingjunction.co.uk/modules/piCal/index.php?cid=1" title="Swing Junction-Calendar">couple</a> of <a href="http://www.swingdancersoflondon.org/" title="Swing Dancers of London">listings</a> sites around they don't provide the information I need in the way I want it, so I decided to make my own (as you do).
</p>
<p>
There are so many awesome social nights and lessons on every night of the week all over the capital, but often people don't know what's going on just round the corner from where they live. My goal then is simple:
Expand All @@ -21,7 +21,10 @@
<div id="scope">
<h2>What we cover</h2>
<p>
At least to start with the listings will focus on regular weekly classes teaching primarily Lindy Hop, and weekly and monthly clubs and social dances where Lindy Hop can be danced. Blues, Balboa, Collegiate Shag and 20s Charleston will also be considered, but nights which are primarily 50's Jive or Rock and Roll are out.
At least to start with the listings will focus on <em>regular</em> events: weekly classes teaching primarily Lindy Hop, and weekly and monthly clubs and social dances where Lindy Hop can be danced. Blues, Balboa and 20s Charleston will also be considered, but nights which are primarily 50's Jive or Rock and Roll are out.
</p>
<p>
Personally I love to dress up and go to vintage clubs: while the dancing usually isn't great, for me it's all an extension of the experience, so I'm going to cover these (most listings don't).
</p>
<p>
Listings are primarily for events within the M25 and usually those which are on the London transport network (i.e. places you can get a night bus home from!).
Expand All @@ -32,8 +35,8 @@

<div id="about_me">
<h2>About me</h2>
<p>I live in South London, I've been dancing lindy for a few months now, and I love it.</p>
<p><a href="http://twitter.com/lindyhoplondon/" title="Swing Out London on Twitter">Swing Out London is on twitter</a> and I'll tweet information about the site there, but more useful is the <a href="http://twitter.com/lindyhoplondon/lindyhoplondon" title="Swing Out London list on Twitter">twitter list of people tweeting about lindy</a>.</p>
<p>I live in South London, I've been dancing lindy for less than a year, and I love it.</p>
<p><a href="http://twitter.com/swingoutlondon/" title="Swing Out London on Twitter">Swing Out London is on twitter</a> and I'll tweet information about the site there, but more useful is the <a href="http://twitter.com/swingoutlondon/lindyhopinlondon" title="Swing Out London list on Twitter">twitter list of people tweeting about lindy</a>.</p>
<p>Please send any comments, corrections or listings to <a href="mailto:[email protected]?subject=Swing Out London">[email protected]</a>.</p>
</div>

Expand All @@ -57,7 +60,7 @@
<h2>Colophon</h2>

<ul>
<li>The styling of the site was inspired by vintage playbills, magazine listings and event posters.</li>
<li>The styling of the site was inspired by vintage playbills, magazine listings and event posters. The primary font used is <a href="http://en.wikipedia.org/wiki/Futura_(typeface)" title="Wikipedia - Futura">Futura</a> (falling back to Trebuchet MS on Windows) which was designed in 1927.</li>
<li>The vintage wallpaper in the background is by <a href="http://zebiii.deviantart.com/" title="ZeBii on DeviantArt">ZeBii on DeviantArt</a>. You can get it <a href="http://zebiii.deviantart.com/art/Patterns-2-94330934" title="Patterns.2 by ZeBii on DeviantArt">here</a>.</li>
<li>This site was written on a Mac, mainly using <a href="http://www.firefox.com" title="Firefox web browser">Firefox</a> with the following plugins:

Expand All @@ -70,7 +73,8 @@

</li>
<li>The site sits on a custom-built <a href="http://rubyonrails.org/" title="Ruby on Rails">Ruby on Rails</a> CMS, which I wrote from scratch. I plan to make this available as open source, once I've figured out how to do that...</li>
<li>The site is currently hosted on <a href="http://www.patrickinternet.co.uk/" title="Patrick Internet">Patrick Internet.</a></li>
<li><a href="http://www.codestyle.org/servlets/FontStack" title="Font Stack Builder">CodeStyle's Font Stack Builder</a> and <a href="http://www.identifont.com/similar.html" title="Identifont">Identifont</a> came in handy for picking fonts.</li>
<li>The site is currently hosted on <a href="https://www.asmallorange.com/" title="A Small Orange">A Small Orange</a>.</li>
</ul>
</div>

Expand Down
2 changes: 1 addition & 1 deletion config/database.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# gem install sqlite3-ruby (not necessary on OS X Leopard)
development:
adapter: sqlite3
database: db/development.sqlite3
database: db/production.sqlite3
pool: 5
timeout: 5000

Expand Down
9 changes: 7 additions & 2 deletions config/initializers/constants.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,10 @@

COMPASS_POINTS = %w( C N S E W NE NW SE SW )

USERNAME = "dgms"
PASSWORD = "Tatgdsd23"
LOGINS={
"dgms" => "879851e2ad3d62ceceed2f74f2242ea8",
"lancep" => "9a261213120510fcb48bb27d300f9815"
}

# Number of socials to show in the initial list
INITIAL_SOCIALS = 14
Empty file removed log/.gitignore
Empty file.
Loading

0 comments on commit 4e4e964

Please sign in to comment.