grat 0.3.1 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (31) hide show
  1. data/README.rdoc +3 -3
  2. data/VERSION +1 -1
  3. data/grat.gemspec +21 -3
  4. data/lib/grat.rb +66 -3
  5. data/lib/grat/content.rb +18 -1
  6. data/public/gratfiles/application.js +24 -22
  7. data/public/gratfiles/custom.css +59 -2
  8. data/public/gratfiles/custom2.css +280 -0
  9. data/public/gratfiles/images/ui-bg_diagonals-thick_18_b81900_40x40.png +0 -0
  10. data/public/gratfiles/images/ui-bg_diagonals-thick_20_666666_40x40.png +0 -0
  11. data/public/gratfiles/images/ui-bg_flat_10_000000_40x100.png +0 -0
  12. data/public/gratfiles/images/ui-bg_glass_100_f6f6f6_1x400.png +0 -0
  13. data/public/gratfiles/images/ui-bg_glass_100_fdf5ce_1x400.png +0 -0
  14. data/public/gratfiles/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
  15. data/public/gratfiles/images/ui-bg_gloss-wave_35_f6a828_500x100.png +0 -0
  16. data/public/gratfiles/images/ui-bg_highlight-soft_100_eeeeee_1x100.png +0 -0
  17. data/public/gratfiles/images/ui-bg_highlight-soft_75_ffe45c_1x100.png +0 -0
  18. data/public/gratfiles/images/ui-icons_222222_256x240.png +0 -0
  19. data/public/gratfiles/images/ui-icons_228ef1_256x240.png +0 -0
  20. data/public/gratfiles/images/ui-icons_ef8c08_256x240.png +0 -0
  21. data/public/gratfiles/images/ui-icons_ffd27a_256x240.png +0 -0
  22. data/public/gratfiles/images/ui-icons_ffffff_256x240.png +0 -0
  23. data/public/gratfiles/jquery-combined.min.js +289 -2
  24. data/public/gratfiles/jquery-ui.css +406 -0
  25. data/public/gratfiles/reset.css +52 -0
  26. data/views/content_form.haml +48 -48
  27. data/views/import_form.haml +1 -3
  28. data/views/layout.haml +15 -6
  29. data/views/list.haml +19 -18
  30. data/views/page_list.haml +19 -0
  31. metadata +20 -2
@@ -0,0 +1,52 @@
1
+ /* v1.0 | 20080212 http://meyerweb.com/eric/tools/css/reset/ */
2
+
3
+ html, body, div, span, applet, object, iframe,
4
+ h1, h2, h3, h4, h5, h6, p, blockquote, pre,
5
+ a, abbr, acronym, address, big, cite, code,
6
+ del, dfn, em, font, img, ins, kbd, q, s, samp,
7
+ small, strike, strong, sub, sup, tt, var,
8
+ b, u, i, center,
9
+ dl, dt, dd, ol, ul, li,
10
+ fieldset, form, label, legend,
11
+ table, caption, tbody, tfoot, thead, tr, th, td {
12
+ margin: 0;
13
+ padding: 0;
14
+ border: 0;
15
+ outline: 0;
16
+ font-size: 100%;
17
+ vertical-align: baseline;
18
+ background: transparent;
19
+ }
20
+ body {
21
+ line-height: 1;
22
+ }
23
+ ol, ul {
24
+ list-style: none;
25
+ }
26
+ blockquote, q {
27
+ quotes: none;
28
+ }
29
+ blockquote:before, blockquote:after,
30
+ q:before, q:after {
31
+ content: '';
32
+ content: none;
33
+ }
34
+
35
+ /* remember to define focus styles! */
36
+ :focus {
37
+ outline: 0;
38
+ }
39
+
40
+ /* remember to highlight inserts somehow! */
41
+ ins {
42
+ text-decoration: none;
43
+ }
44
+ del {
45
+ text-decoration: line-through;
46
+ }
47
+
48
+ /* tables still need 'cellspacing="0"' in the markup */
49
+ table {
50
+ border-collapse: collapse;
51
+ border-spacing: 0;
52
+ }
@@ -1,50 +1,50 @@
1
- .grat_greet
2
- - if content.new_record?
3
- %p
4
- Let's make some
5
- %strong= url
6
- content!
7
- - else
8
- %p
9
- Editing
10
- %a{:href => url}
11
- %strong= url
12
- content.
13
-
14
1
  %form{:action => "#{content.url}", :method => 'post'}
15
- .template
16
- %label{:for => form_nest('template_url')} Template
17
- %select{:name => form_nest('template_url')}
18
- %option{:value=>''} None
19
- - templates.each do |template|
20
- - option_hash = {:value => template.url}
21
- - option_hash.merge!(:selected => 'selected') if template.url == content.template_url
22
- %option{option_hash}= template.url
23
- .url
24
- %label{:for => form_nest('url')} Url
25
- %input{:name => form_nest('url'), :value => content.url}
26
- .content.collapsable
27
- %label{:for => form_nest('content')} Content
28
- %textarea{:name => form_nest('content')}= content.content
29
- .tags
30
- %label{:for => form_nest('tags')} Tags
31
- %input{:name => form_nest('tags'), :value => content.tags.join(' ')}
32
- - content.editable_fields.each_pair do |k,v|
33
- %div{:class => k}
34
- %label{:for => form_nest(k)}= k.capitalize
35
- %input{:name => form_nest(k), :value => v}
36
- #suggested_fields
37
- - content.suggested_fields.each do |field|
38
- %div{:class => field}
39
- %label{:for => form_nest(field)}= field.capitalize
40
- %input{:name => form_nest(field)}
41
- #new_fields
42
- %p
43
- %a.add{:href=>'#new_field'} Add a New Field
44
-
2
+ .tabs
3
+ %ul.mod
4
+ %li
5
+ %a{:href => '#basics'} Basics
6
+ %li
7
+ %a{:href => '#data'} Data
8
+ %li
9
+ %a{:href => '#history'} History
10
+ #basics
11
+ %p Edit your page. :)
12
+ .template
13
+ %label{:for => form_nest('template_url')} Template
14
+ %select{:name => form_nest('template_url')}
15
+ %option{:value=>''} None
16
+ - templates.each do |template|
17
+ - option_hash = {:value => template.url}
18
+ - option_hash.merge!(:selected => 'selected') if template.url == content.template_url
19
+ %option{option_hash}= template.url
20
+ .url
21
+ %label{:for => form_nest('url')} Url
22
+ %input{:name => form_nest('url'), :value => content.url}
23
+ .content.collapsable
24
+ %label{:for => form_nest('content')} Content
25
+ %textarea{:name => form_nest('content')}= content.content
26
+ .tags
27
+ %label{:for => form_nest('tags')} Tags
28
+ %input{:name => form_nest('tags'), :value => content.tags.join(' ')}
29
+ #data
30
+ - content.editable_fields.each_pair do |k,v|
31
+ %div{:class => k}
32
+ %label{:for => form_nest(k)}= k.capitalize
33
+ %input{:name => form_nest(k), :value => v}
34
+ #suggested_fields
35
+ - content.suggested_fields.each do |field|
36
+ %div{:class => field}
37
+ %label{:for => form_nest(field)}= field.capitalize
38
+ %input{:name => form_nest(field)}
39
+ #new_fields
40
+ %p
41
+ %a.add.button{:href=>'#new_field'} Add a New Field
42
+ .defaults.collapsable
43
+ %label{:for => form_nest('default_content_vars')} Default Content
44
+ %textarea{:id => 'default_content_vars', :name => form_nest('default_content_vars')}=content.default_content_vars.to_json
45
+ #history
46
+ %p This isn't implemented yet, sorry!
47
+
45
48
  .submit
46
- %input{:name => form_nest('submit'), :type => 'submit', :value => "Let's save this thing"}
47
- %input{:name => form_nest('submit'), :type => 'submit', :value => "Save and make another"}
48
- .defaults.collapsable.collapsed
49
- %label{:for => form_nest('default_content_vars')} Default Content
50
- %textarea{:id => 'default_content_vars', :name => form_nest('default_content_vars')}= content.default_content_vars.to_json
49
+ %input{:name => form_nest('submit'), :type => 'submit', :value => "Save and continue editing"}
50
+ %input{:name => form_nest('submit'), :type => 'submit', :value => "Save and make a new doc"}
@@ -1,5 +1,4 @@
1
- .grat_greet
2
- %p Hey, import some json if you like.
1
+ %h1 Import
3
2
  %form{:action => "/__admin/import", :method => 'post', :enctype=>'multipart/form-data' }
4
3
  .import_file
5
4
  %label{:for => 'import_file'} Upload a json file:
@@ -21,4 +20,3 @@
21
20
  %input{:type=> 'radio', :id => 'import_demolish', :value => 'demolish', :name => 'import[strategy]'}
22
21
  .submit
23
22
  %input{:name => 'import[submit]', :type => 'submit', :value => "Let's save this thing"}
24
-
@@ -4,16 +4,25 @@
4
4
  %head
5
5
  %title Grat
6
6
  %link{:rel=>"shortcut icon", :href=>"/gratfiles/favicon.ico"}
7
-
7
+
8
8
  %script{:type=>"text/javascript", :src=>"/gratfiles/jquery-combined.min.js"}
9
9
  %script{:type=>"text/javascript", :src=>"/gratfiles/application.js"}
10
-
10
+
11
11
  %script{:type=>"text/javascript", :src=>"/gratfiles/js-beautifier.min.js"}
12
-
13
- %link{:rel => 'stylesheet', :type => 'text/css', :media => 'all', :href => '/gratfiles/oocss.min.css'}
14
- %link{:rel => 'stylesheet', :type => 'text/css', :media => 'all', :href => '/gratfiles/custom.css'}
12
+
13
+ %link{:rel => 'stylesheet', :type => 'text/css', :media => 'all', :href => '/gratfiles/reset.css'}
14
+ %link{:rel => 'stylesheet', :type => 'text/css', :media => 'all', :href => '/gratfiles/custom2.css'}
15
15
 
16
16
  %body
17
- = yield
17
+ .masthead
18
+ %h1
19
+ %a{:href => '/__admin/'} Grat
20
+ %h2= page_heading_text
21
+ .panel.mod
22
+ %h2 Pages
23
+ .pages
24
+ = haml :page_list, :locals => {:pages => [nested_root]}, :layout => false
25
+ .container
26
+ = yield
18
27
  /
19
28
  .debug= params.inspect
@@ -1,23 +1,24 @@
1
- .grat_greet
2
- %p Great. Here's everything. Hope you're happy.
3
- %h2 Make a new page
1
+ %ul.bulk-options
2
+ %li
3
+ %a.button{:href => "/__admin/import"} Import
4
+ %li
5
+ %a.button{:href => "/__admin/export"} Export
4
6
  .new_page
7
+ %h2 Make a new page
5
8
  %form{:action => "/__admin/new"}
6
9
  %input{:name => 'url'}
7
10
  %input{:name => "submit", :value=>'New Page', :type => 'submit'}
8
- %h2 Pages
9
- %ol
10
- - @pages.each do |page|
11
- %li
12
- %a{:href => page.url}= page.url
13
- (
14
- %a{:href => edit_path(page.url)} edit
15
- )
16
11
  %h2 Templates
17
- %ol
18
- - @templates.each do |template|
19
- %li
20
- %a{:href => template.url}= template.url
21
- (
22
- %a{:href => edit_path(template.url)} edit
23
- )
12
+ - if @templates.any?
13
+ %ol
14
+ - @templates.each do |template|
15
+ %li
16
+ %a{:href => template.url}= template.url
17
+ (
18
+ %a{:href => edit_path(template.url)} edit
19
+ )
20
+ - else
21
+ %p
22
+ Templates are ordinary pages with the tag
23
+ %strong template
24
+ \.
@@ -0,0 +1,19 @@
1
+ - if pages.any?
2
+ %ol
3
+ - pages.each do |page|
4
+ %li
5
+ %a{:href => "/__admin/edit#{page.url}", :class => page.class.to_s.downcase[/[a-z]+\Z/]}= page.url
6
+ - if page.class == Grat::Content
7
+ %span.tags
8
+ = page.tags.join(', ')
9
+ %span.template
10
+ - if page.template
11
+ = page.template
12
+ - else
13
+ No template!
14
+ %span.created
15
+ 8 Jan 2009
16
+ - else
17
+ %span.missing_message <-- Page missing, click to create it
18
+ - if page.children.any?
19
+ = haml :page_list, :locals => {:pages => page.children}, :layout => false
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: grat
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sam Schenkman-Moore
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2010-01-12 00:00:00 -05:00
12
+ date: 2010-01-17 00:00:00 -05:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -93,6 +93,7 @@ files:
93
93
  - lib/grat/system.rb
94
94
  - public/gratfiles/application.js
95
95
  - public/gratfiles/custom.css
96
+ - public/gratfiles/custom2.css
96
97
  - public/gratfiles/einars-js-beautify/HTML-Beautify.js
97
98
  - public/gratfiles/einars-js-beautify/beautify-cl.js
98
99
  - public/gratfiles/einars-js-beautify/beautify-tests.js
@@ -107,7 +108,22 @@ files:
107
108
  - public/gratfiles/einars-js-beautify/unmaintained/opera-userscript/make_opera_userscript.sh
108
109
  - public/gratfiles/einars-js-beautify/unmaintained/opera-userscript/opera_userscript.js
109
110
  - public/gratfiles/favicon.ico
111
+ - public/gratfiles/images/ui-bg_diagonals-thick_18_b81900_40x40.png
112
+ - public/gratfiles/images/ui-bg_diagonals-thick_20_666666_40x40.png
113
+ - public/gratfiles/images/ui-bg_flat_10_000000_40x100.png
114
+ - public/gratfiles/images/ui-bg_glass_100_f6f6f6_1x400.png
115
+ - public/gratfiles/images/ui-bg_glass_100_fdf5ce_1x400.png
116
+ - public/gratfiles/images/ui-bg_glass_65_ffffff_1x400.png
117
+ - public/gratfiles/images/ui-bg_gloss-wave_35_f6a828_500x100.png
118
+ - public/gratfiles/images/ui-bg_highlight-soft_100_eeeeee_1x100.png
119
+ - public/gratfiles/images/ui-bg_highlight-soft_75_ffe45c_1x100.png
120
+ - public/gratfiles/images/ui-icons_222222_256x240.png
121
+ - public/gratfiles/images/ui-icons_228ef1_256x240.png
122
+ - public/gratfiles/images/ui-icons_ef8c08_256x240.png
123
+ - public/gratfiles/images/ui-icons_ffd27a_256x240.png
124
+ - public/gratfiles/images/ui-icons_ffffff_256x240.png
110
125
  - public/gratfiles/jquery-combined.min.js
126
+ - public/gratfiles/jquery-ui.css
111
127
  - public/gratfiles/js-beautifier.min.js
112
128
  - public/gratfiles/oocss.min.css
113
129
  - public/gratfiles/oocss/content.css
@@ -121,6 +137,7 @@ files:
121
137
  - public/gratfiles/oocss/talk_skins.css
122
138
  - public/gratfiles/oocss/template.css
123
139
  - public/gratfiles/oocss/template_debug.css
140
+ - public/gratfiles/reset.css
124
141
  - views/content_form.haml
125
142
  - views/css/_content.sass
126
143
  - views/css/_custom.sass
@@ -137,6 +154,7 @@ files:
137
154
  - views/layout.haml
138
155
  - views/list.haml
139
156
  - views/missing.haml
157
+ - views/page_list.haml
140
158
  has_rdoc: true
141
159
  homepage: http://github.com/samsm/grat
142
160
  licenses: []