Skip to content
This repository was archived by the owner on Oct 4, 2020. It is now read-only.

Commit 758547a

Browse files
committed
Layout, basic forms, css.
1 parent 4160631 commit 758547a

File tree

8 files changed

+74
-19
lines changed

8 files changed

+74
-19
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.sass-cache

Gemfile

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ gem "sinatra"
55
gem "haml"
66
gem "sinatra-assetpack"
77
gem "padrino-helpers"
8+
gem "sass"
89

910
group :development do
1011
gem "shotgun"

Gemfile.lock

+2
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ GEM
2727
rack
2828
rack-test (0.6.2)
2929
rack (>= 1.0)
30+
sass (3.2.12)
3031
shotgun (0.9)
3132
rack (>= 1.0)
3233
sinatra (1.4.4)
@@ -49,6 +50,7 @@ PLATFORMS
4950
DEPENDENCIES
5051
haml
5152
padrino-helpers
53+
sass
5254
shotgun
5355
sinatra
5456
sinatra-assetpack

app/css/app.css

Whitespace-only changes.

app/css/app.scss

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
body {
2+
margin-top: 50px;
3+
}
4+
5+
#wrapper {
6+
padding: 10px;
7+
}
8+
9+
#metadata-panel {
10+
border-bottom: 1px solid #ccc;
11+
}
12+
13+
#text-panel {
14+
margin-top: 20px;
15+
}
16+
17+
#source_text {
18+
width: 100%;
19+
}

steno_app.rb

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
class StenoApp < Sinatra::Base
66
set :root, File.dirname(__FILE__)
77
set :haml, format: :html5
8+
set :protect_from_csrf, false
89

910
register Padrino::Helpers
1011
register Sinatra::AssetPack

views/index.haml

+36-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,36 @@
1-
%h2 The template
1+
- form_tag '/parse', method: 'post', class: 'form-horizontal' do
2+
3+
#metadata-panel
4+
.row
5+
.col-xs-6
6+
.form-group
7+
%label.col-sm-3.control-label Full title
8+
.col-sm-9
9+
= text_field_tag 'doc[title]', placeholder: 'eg. City of Cape Town: How to Have Fun By-law, 2012', class: 'form-control'
10+
.form-group
11+
%label.col-sm-3.control-label Short name
12+
.col-sm-6
13+
= text_field_tag 'doc[short_name]', placeholder: 'short-name', class: 'form-control'
14+
.form-group
15+
%label.col-sm-3.control-label Gazette
16+
.col-sm-6
17+
= text_field_tag 'doc[pub][name]', placeholder: 'Province of Western Cape: Provincial Gazette', class: 'form-control'
18+
%label.col-sm-1.control-label no.
19+
.col-sm-2
20+
= text_field_tag 'doc[pub][number]', placeholder: '1234', class: 'form-control'
21+
.col-xs-6
22+
.form-group
23+
%label.col-sm-2.control-label Locale
24+
.col-sm-3
25+
= text_field_tag 'doc[locale]', placeholder: 'Cape Town', class: 'form-control'
26+
.form-group
27+
%label.col-sm-2.control-label Published
28+
.col-sm-4
29+
= text_field_tag 'doc[pub][date]', type: 'date', class: 'form-control'
30+
31+
#text-panel
32+
.row
33+
.col-xs-6
34+
%textarea#source_text(name="source_text")
35+
.col-xs-6
36+
second

views/layout.haml

+14-18
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,10 @@
44
%meta(charset="utf-8")
55
%meta(http-equiv="X-UA-Compatible" content="IE=edge,chrome=1")
66

7-
= stylesheet_link_tag '//netdna.bootstrapcdn.com/bootstrap/2.3.2/css/bootstrap.min.css', media: "screen, print"
8-
= stylesheet_link_tag '//netdna.bootstrapcdn.com/font-awesome/3.2.1/css/font-awesome.min.css', media: "screen, print"
9-
= css :app, media: "screen, print"
7+
= stylesheet_link_tag '//netdna.bootstrapcdn.com/bootstrap/3.0.1/css/bootstrap.min.css'
8+
= stylesheet_link_tag '//netdna.bootstrapcdn.com/bootstrap/3.0.1/css/bootstrap-theme.min.css'
9+
= stylesheet_link_tag '//netdna.bootstrapcdn.com/font-awesome/3.2.1/css/font-awesome.min.css'
10+
= css :app
1011
%body
1112
/[if lt IE 7]
1213
%p.chromeframe
@@ -16,21 +17,16 @@
1617
%a(href="http://www.google.com/chromeframe/?redirect=true") install Google Chrome Frame
1718
to better experience this site.
1819

19-
.container
20-
%header#header
21-
.navbar.navbar-inverse
22-
.navbar-inner
23-
%a.btn.btn-navbar(data-toggle="collapse" data-target=".nav-collapse")
24-
%span.icon-bar
25-
%span.icon-bar
26-
%span.icon-bar
27-
28-
%a.brand(href='/')
20+
%header#header
21+
.navbar.navbar-inverse.navbar-fixed-top
22+
.container
23+
.navbar-header
24+
%a.navbar-brand(href='/')
2925
Steno
3026

31-
%section#main
32-
= yield
27+
#wrapper
28+
= yield
3329

34-
= javascript_include_tag '//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js'
35-
= javascript_include_tag '//netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/js/bootstrap.min.js'
36-
= js :app
30+
= javascript_include_tag '//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js'
31+
= javascript_include_tag '//netdna.bootstrapcdn.com/twitter-bootstrap/3.0.1/js/bootstrap.min.js'
32+
= js :app

0 commit comments

Comments
 (0)