Ver a proveniência

Moved templates to /views

tags/last-sinatra-version
Adrian Short há 14 anos
ascendente
cometimento
f24adf7fb0
5 ficheiros alterados com 34 adições e 46 eliminações
  1. +0
    -46
      app.rb
  2. +5
    -0
      public/style.css
  3. +7
    -0
      views/home.haml
  4. +15
    -0
      views/layout.haml
  5. +7
    -0
      views/wards.haml

+ 0
- 46
app.rb Ver ficheiro

@@ -19,50 +19,4 @@ get '/wards' do
@ward_name = result_ary['administrative']['ward']['title']
haml :wards
end

__END__

@@layout
!!!
%html
%head
%title Find My Candidates
%link{ :rel => 'stylesheet', :type => 'text/css', :href => 'style.css' }
%body
#header
%h1 Find My Candidates
#main
= yield
#footer
%hr/
%p
Made by
%a{ :href => "http://adrianshort.co.uk/" } Adrian Short
-#
with
%a{ :href => "http://www.ordnancesurvey.co.uk/oswebsite/products/code-point-open/" } Ordnance Survey
and
%a{ :href => "http://www.sutton.gov.uk/" } Sutton Council
data,
%a{ :href => "http://uk-postcodes.com" } UK Postcodes API
and
%a{ :href => "http://sinatrarb.com" } Sinatra.
%p
Hosted by
%a{ :href => "http://heroku.com" } Heroku.
Source at
%a{ :href => "http://github.com/adrianshort" } Github.
@@home
%form{ :method => 'get', :action => '/wards' }
%label{ :for => "postcode" } Postcode
%input{ :type => 'text', :name => 'postcode', :size => 8, :maxlength => 8 }
%input{ :type => 'submit', :value => "Find" }
-#
- for ward in @wards
%p= ward
@@wards
%h2 #{@postcode} is in #{@ward_name} Ward in #{@district_name}

+ 5
- 0
public/style.css Ver ficheiro

@@ -11,4 +11,9 @@ input
{
font-size: 150%;
text-transform: uppercase;
}

.highlight
{
background-color: yellow;
}

+ 7
- 0
views/home.haml Ver ficheiro

@@ -0,0 +1,7 @@
%form{ :method => 'get', :action => '/wards' }
%label{ :for => "postcode" } Postcode
%input{ :type => 'text', :name => 'postcode', :size => 8, :maxlength => 8 }
%input{ :type => 'submit', :value => "Find" }
-#
- for ward in @wards
%p= ward

+ 15
- 0
views/layout.haml Ver ficheiro

@@ -0,0 +1,15 @@
!!! Strict
%html
%head
%title Find My Candidates
%link{ :rel => 'stylesheet', :type => 'text/css', :href => 'style.css' }
%body
#header
%h1 Find My Candidates
#main
= yield
#footer
%hr
%p
Made by
%a{ :href => "http://adrianshort.co.uk/" } Adrian Short

+ 7
- 0
views/wards.haml Ver ficheiro

@@ -0,0 +1,7 @@
%h2
%span.highlight
= @postcode
is in
= @ward_name
Ward in
= @district_name

Carregando…
Cancelar
Guardar