jabe 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (106) hide show
  1. data/Gemfile +35 -0
  2. data/Gemfile.lock +217 -0
  3. data/LICENSE.txt +20 -0
  4. data/README.textile +12 -0
  5. data/Rakefile +55 -0
  6. data/VERSION +1 -0
  7. data/app/controllers/admin/base_controller.rb +3 -0
  8. data/app/controllers/admin/entries_controller.rb +42 -0
  9. data/app/controllers/admin/settings_controller.rb +11 -0
  10. data/app/controllers/comments_controller.rb +25 -0
  11. data/app/controllers/entries_controller.rb +26 -0
  12. data/app/helpers/application_helper.rb +9 -0
  13. data/app/models/admin.rb +9 -0
  14. data/app/models/comment.rb +17 -0
  15. data/app/models/entry.rb +17 -0
  16. data/app/models/settings.rb +2 -0
  17. data/app/stylesheets/_will_paginate.scss +102 -0
  18. data/app/stylesheets/application.scss +247 -0
  19. data/app/stylesheets/grid.scss +336 -0
  20. data/app/stylesheets/handheld.scss +7 -0
  21. data/app/stylesheets/style.scss +273 -0
  22. data/app/views/admin/entries/_form.html.haml +6 -0
  23. data/app/views/admin/entries/edit.html.haml +1 -0
  24. data/app/views/admin/entries/index.html.haml +43 -0
  25. data/app/views/admin/entries/new.html.haml +1 -0
  26. data/app/views/admin/settings/edit.html.haml +9 -0
  27. data/app/views/entries/_comment.html.haml +0 -0
  28. data/app/views/entries/_comment_form.html.haml +3 -0
  29. data/app/views/entries/index.html.haml +13 -0
  30. data/app/views/entries/show.html.haml +36 -0
  31. data/app/views/layouts/_footer.html.haml +2 -0
  32. data/app/views/layouts/_header.html.haml +4 -0
  33. data/app/views/layouts/_sidebar.html.haml +0 -0
  34. data/app/views/layouts/application.html.haml +59 -0
  35. data/config/initializers/sass.rb +5 -0
  36. data/config/initializers/settings.rb +5 -0
  37. data/config/initializers/time_formats.rb +4 -0
  38. data/config/routes.rb +26 -0
  39. data/features/admin.feature +30 -0
  40. data/features/entries.feature +24 -0
  41. data/features/step_definitions/admin_steps.rb +14 -0
  42. data/features/step_definitions/entry_steps.rb +35 -0
  43. data/features/step_definitions/support_steps.rb +3 -0
  44. data/features/step_definitions/web_steps.rb +219 -0
  45. data/features/support/blueprints.rb +31 -0
  46. data/features/support/env.rb +59 -0
  47. data/features/support/paths.rb +37 -0
  48. data/lib/generators/jabe/migrations/migrations_generator.rb +42 -0
  49. data/lib/generators/jabe/templates/migrations/create_comments.rb +20 -0
  50. data/lib/generators/jabe/templates/migrations/create_entries.rb +16 -0
  51. data/lib/generators/jabe/templates/migrations/create_settings.rb +21 -0
  52. data/lib/generators/jabe/templates/migrations/create_slugs.rb +18 -0
  53. data/lib/generators/jabe/templates/migrations/devise_create_admins.rb +26 -0
  54. data/lib/jabe.rb +9 -0
  55. data/public/.htaccess +220 -0
  56. data/public/apple-touch-icon.png +0 -0
  57. data/public/blackbird/blackbird.css +80 -0
  58. data/public/blackbird/blackbird.js +365 -0
  59. data/public/blackbird/blackbird.png +0 -0
  60. data/public/crossdomain.xml +25 -0
  61. data/public/images/delete_page.png +0 -0
  62. data/public/images/full_page.png +0 -0
  63. data/public/javascripts/application.js +34 -0
  64. data/public/javascripts/jquery-ui.js +11511 -0
  65. data/public/javascripts/jquery-ui.min.js +404 -0
  66. data/public/javascripts/jquery.js +7179 -0
  67. data/public/javascripts/jquery.min.js +167 -0
  68. data/public/javascripts/libs/dd_belatedpng.js +13 -0
  69. data/public/javascripts/libs/modernizr-1.6.min.js +30 -0
  70. data/public/javascripts/libs/profiling/charts.swf +0 -0
  71. data/public/javascripts/libs/profiling/config.js +59 -0
  72. data/public/javascripts/libs/profiling/yahoo-profiling.css +7 -0
  73. data/public/javascripts/libs/profiling/yahoo-profiling.min.js +39 -0
  74. data/public/javascripts/plugins.js +40 -0
  75. data/public/javascripts/rails.js +154 -0
  76. data/public/nginx.conf +108 -0
  77. data/public/robots.txt +5 -0
  78. data/spec/support/blueprints.rb +31 -0
  79. data/test/dummy/app/controllers/application_controller.rb +3 -0
  80. data/test/dummy/app/helpers/application_helper.rb +2 -0
  81. data/test/dummy/config/application.rb +45 -0
  82. data/test/dummy/config/boot.rb +10 -0
  83. data/test/dummy/config/environment.rb +5 -0
  84. data/test/dummy/config/environments/development.rb +26 -0
  85. data/test/dummy/config/environments/production.rb +49 -0
  86. data/test/dummy/config/environments/test.rb +35 -0
  87. data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
  88. data/test/dummy/config/initializers/devise.rb +142 -0
  89. data/test/dummy/config/initializers/inflections.rb +10 -0
  90. data/test/dummy/config/initializers/mime_types.rb +5 -0
  91. data/test/dummy/config/initializers/secret_token.rb +7 -0
  92. data/test/dummy/config/initializers/session_store.rb +8 -0
  93. data/test/dummy/config/routes.rb +58 -0
  94. data/test/dummy/db/migrate/20101229224027_create_settings.rb +21 -0
  95. data/test/dummy/db/migrate/20101229224028_create_slugs.rb +18 -0
  96. data/test/dummy/db/migrate/20101229224029_devise_create_admins.rb +26 -0
  97. data/test/dummy/db/migrate/20101229224030_create_entries.rb +16 -0
  98. data/test/dummy/db/migrate/20101229224031_create_comments.rb +20 -0
  99. data/test/dummy/db/schema.rb +82 -0
  100. data/test/dummy/vendor/plugins/acts_as_textiled/init.rb +8 -0
  101. data/test/dummy/vendor/plugins/acts_as_textiled/lib/acts_as_textiled.rb +108 -0
  102. data/test/dummy/vendor/plugins/acts_as_textiled/test/fixtures/author.rb +4 -0
  103. data/test/dummy/vendor/plugins/acts_as_textiled/test/fixtures/story.rb +4 -0
  104. data/test/dummy/vendor/plugins/acts_as_textiled/test/helper.rb +87 -0
  105. data/test/dummy/vendor/plugins/acts_as_textiled/test/textiled_test.rb +145 -0
  106. metadata +641 -0
@@ -0,0 +1,7 @@
1
+ * {
2
+ float: none;
3
+ background: #fff;
4
+ color: #000; }
5
+
6
+ body {
7
+ font-size: 80%; }
@@ -0,0 +1,273 @@
1
+ /* HTML5 ✰ Boilerplate */
2
+
3
+ html, body, div, span, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, abbr, address, cite, code, del, dfn, em, img, ins, kbd, q, samp, small, strong, sub, sup, var, b, i, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, article, aside, canvas, details, figcaption, figure, footer, header, hgroup, menu, nav, section, summary, time, mark, audio, video {
4
+ margin: 0;
5
+ padding: 0;
6
+ border: 0;
7
+ outline: 0;
8
+ font-size: 100%;
9
+ vertical-align: baseline;
10
+ background: transparent; }
11
+
12
+ article, aside, details, figcaption, figure, footer, header, hgroup, menu, nav, section {
13
+ display: block; }
14
+
15
+ nav ul {
16
+ list-style: none; }
17
+
18
+ blockquote, q {
19
+ quotes: none; }
20
+
21
+ blockquote {
22
+ &:before, &:after {
23
+ content: '';
24
+ content: none; } }
25
+
26
+ q {
27
+ &:before, &:after {
28
+ content: '';
29
+ content: none; } }
30
+
31
+ a {
32
+ margin: 0;
33
+ padding: 0;
34
+ font-size: 100%;
35
+ vertical-align: baseline;
36
+ background: transparent; }
37
+
38
+ ins {
39
+ background-color: #ff9;
40
+ color: #000;
41
+ text-decoration: none; }
42
+
43
+ mark {
44
+ background-color: #ff9;
45
+ color: #000;
46
+ font-style: italic;
47
+ font-weight: bold; }
48
+
49
+ del {
50
+ text-decoration: line-through; }
51
+
52
+ abbr[title], dfn[title] {
53
+ border-bottom: 1px dotted;
54
+ cursor: help; }
55
+
56
+ table {
57
+ border-collapse: collapse;
58
+ border-spacing: 0; }
59
+
60
+ hr {
61
+ display: block;
62
+ height: 1px;
63
+ border: 0;
64
+ border-top: 1px solid #ccc;
65
+ margin: 1em 0;
66
+ padding: 0; }
67
+
68
+ input, select {
69
+ vertical-align: middle; }
70
+
71
+ body {
72
+ font: 13px / 1.231 sans-serif;
73
+ *font-size: small; }
74
+
75
+ select, input, textarea, button {
76
+ font: 99% sans-serif; }
77
+
78
+ pre, code, kbd, samp {
79
+ font-family: monospace, sans-serif; }
80
+
81
+ body, select, input, textarea {
82
+ color: #444; }
83
+
84
+ h1, h2, h3, h4, h5, h6 {
85
+ font-weight: bold; }
86
+
87
+ html {
88
+ overflow-y: scroll; }
89
+
90
+ a {
91
+ &:hover {
92
+ outline: none; }
93
+ &:active {
94
+ outline: none;
95
+ color: #607890; }
96
+ color: #607890;
97
+ &:visited {
98
+ color: #607890; }
99
+ &:hover {
100
+ color: #036; } }
101
+
102
+ ul {
103
+ margin-left: 1.8em; }
104
+
105
+ ol {
106
+ margin-left: 1.8em;
107
+ list-style-type: decimal; }
108
+
109
+ nav {
110
+ ul, li {
111
+ margin: 0; } }
112
+
113
+ small {
114
+ font-size: 85%; }
115
+
116
+ strong, th {
117
+ font-weight: bold; }
118
+
119
+ td {
120
+ vertical-align: top;
121
+ img {
122
+ vertical-align: top; } }
123
+
124
+ sub {
125
+ vertical-align: sub;
126
+ font-size: smaller; }
127
+
128
+ sup {
129
+ vertical-align: super;
130
+ font-size: smaller; }
131
+
132
+ pre {
133
+ padding: 15px;
134
+ // white-space: pre;
135
+ // white-space: pre-wrap;
136
+ // white-space: pre-line;
137
+ // word-wrap: break-word;
138
+ }
139
+
140
+ textarea {
141
+ overflow: auto; }
142
+
143
+ .ie6 legend, .ie7 legend {
144
+ margin-left: -7px; }
145
+
146
+ input {
147
+ &[type="radio"] {
148
+ vertical-align: text-bottom; }
149
+ &[type="checkbox"] {
150
+ vertical-align: bottom; } }
151
+
152
+ .ie7 input[type="checkbox"] {
153
+ vertical-align: baseline; }
154
+
155
+ .ie6 input {
156
+ vertical-align: text-bottom; }
157
+
158
+ label {
159
+ cursor: pointer; }
160
+
161
+ input {
162
+ &[type=button], &[type=submit] {
163
+ cursor: pointer; } }
164
+
165
+ button {
166
+ cursor: pointer;
167
+ margin: 0; }
168
+
169
+ input, select, textarea {
170
+ margin: 0; }
171
+
172
+ input:valid, textarea:valid {}
173
+
174
+ input:invalid, textarea:invalid {
175
+ border-radius: 1px;
176
+ -moz-box-shadow: 0px 0px 5px red;
177
+ -webkit-box-shadow: 0px 0px 5px red;
178
+ box-shadow: 0px 0px 5px red; }
179
+
180
+ .no-boxshadow {
181
+ input:invalid, textarea:invalid {
182
+ background-color: #f0dddd; } }
183
+
184
+ a:link {
185
+ -webkit-tap-highlight-color: #FF5E99; }
186
+
187
+ button {
188
+ width: auto;
189
+ overflow: visible; }
190
+
191
+ .ie7 img {
192
+ -ms-interpolation-mode: bicubic; }
193
+
194
+ .ir {
195
+ display: block;
196
+ text-indent: -999em;
197
+ overflow: hidden;
198
+ background-repeat: no-repeat;
199
+ text-align: left;
200
+ direction: ltr; }
201
+
202
+ .hidden {
203
+ display: none;
204
+ visibility: hidden; }
205
+
206
+ .visuallyhidden {
207
+ position: absolute !important;
208
+ clip: rect(1px 1px 1px 1px);
209
+ clip: rect(1px, 1px, 1px, 1px); }
210
+
211
+ .invisible {
212
+ visibility: hidden; }
213
+
214
+ .clearfix {
215
+ &:before {
216
+ content: "\0020";
217
+ display: block;
218
+ height: 0;
219
+ visibility: hidden; }
220
+ &:after {
221
+ content: "\0020";
222
+ display: block;
223
+ height: 0;
224
+ visibility: hidden;
225
+ clear: both; }
226
+ zoom: 1; }
227
+
228
+ /* Primary Styles
229
+ Author:
230
+ */
231
+
232
+ @media all and (orientation:portrait) {}
233
+
234
+
235
+ @media all and (orientation:landscape) {}
236
+
237
+
238
+ @media screen and (max-device-width: 480px) {
239
+ /* html { -webkit-text-size-adjust:none; -ms-text-size-adjust:none; } */ }
240
+
241
+
242
+ @media print {
243
+ * {
244
+ background: transparent !important;
245
+ color: #444 !important;
246
+ text-shadow: none !important; }
247
+ a {
248
+ color: #444 !important;
249
+ text-decoration: underline;
250
+ &:visited {
251
+ color: #444 !important;
252
+ text-decoration: underline; }
253
+ &:after {
254
+ content: " (" attr(href) ")"; } }
255
+ abbr:after {
256
+ content: " (" attr(title) ")"; }
257
+ .ir a:after {
258
+ content: ""; }
259
+ pre, blockquote {
260
+ border: 1px solid #999;
261
+ page-break-inside: avoid; }
262
+ thead {
263
+ display: table-header-group; }
264
+ tr, img {
265
+ page-break-inside: avoid; }
266
+ @page {
267
+ margin: 0.5cm; }
268
+
269
+ p, h2, h3 {
270
+ orphans: 3;
271
+ widows: 3; }
272
+ h2, h3 {
273
+ page-break-after: avoid; } }
@@ -0,0 +1,6 @@
1
+ = semantic_form_for [:admin, entry] do |form|
2
+ = form.input :title
3
+ = form.input :body
4
+ = form.input :published_at if entry.published_at
5
+ = form.submit 'Save as draft', :class => 'button'
6
+ = form.submit 'Publish', :class => 'button'
@@ -0,0 +1 @@
1
+ = render 'form'
@@ -0,0 +1,43 @@
1
+ %p
2
+ = link_to 'Start a new entry', new_admin_entry_path
3
+ %br
4
+
5
+ %h2 Drafts
6
+
7
+ - if @drafts.any?
8
+ %table.entries
9
+ - @drafts.each do |entry|
10
+ %tr
11
+ %td
12
+ = link_to image_tag('delete_page.png'),
13
+ admin_entry_path(entry),
14
+ :confirm => 'Are you sure?',
15
+ :method => :delete,
16
+ :title => 'Delete'
17
+ = link_to image_tag('full_page.png'),
18
+ entry_path(entry),
19
+ :title => 'Preview'
20
+ %td
21
+ = link_to entry.title, edit_admin_entry_path(entry)
22
+
23
+ %br
24
+
25
+ %h2 Published
26
+
27
+ - if @published.any?
28
+ %table.entries
29
+ - @published.each do |entry|
30
+ %tr
31
+ %td.icons
32
+ = link_to image_tag('delete_page.png'),
33
+ admin_entry_path(entry),
34
+ :confirm => 'Are you sure?',
35
+ :method => :delete,
36
+ :title => 'Delete'
37
+ = link_to image_tag('full_page.png'),
38
+ public_entry_path(entry),
39
+ :title => 'Preview'
40
+ %td
41
+ = link_to entry.title, edit_admin_entry_path(entry)
42
+ %td.when
43
+ = entry.published_at.to_s(:long)
@@ -0,0 +1 @@
1
+ = render 'form'
@@ -0,0 +1,9 @@
1
+ %h2 Site Settings
2
+ = semantic_form_for SETTINGS, :url => admin_settings_path do |form|
3
+ = form.input :site_url
4
+ = form.input :site_name
5
+ = form.input :tagline
6
+ = form.input :time_zone, :label => 'Your local time zone'
7
+ = form.input :entries_per_page, :label => 'Entries on the home page'
8
+
9
+ = form.submit 'Save', :class => 'button'
File without changes
@@ -0,0 +1,3 @@
1
+ = semantic_form_for [entry, Comment.new] do |form|
2
+ = form.inputs
3
+ = form.submit 'Submit comment'
@@ -0,0 +1,13 @@
1
+ #entries.grid_8
2
+ - @entries.each do |entry|
3
+ .entry{ :class => entry == @entries.last ? 'last' : '' }
4
+ .title
5
+ = link_to entry.title, public_entry_path(entry)
6
+ .date
7
+ = entry.published_at.to_s(:long)
8
+ .content
9
+ ~ entry.body.html_safe
10
+ .meta
11
+ = link_to "Comments: #{entry.comments.count}", entry_path(entry, :anchor => 'comments')
12
+ #pagination.apple_pagination
13
+ = will_paginate @entries
@@ -0,0 +1,36 @@
1
+ #entries.grid_8
2
+ .entry.last
3
+ .title
4
+ = entry.title
5
+ .date
6
+ = entry.published_at.to_s(:long)
7
+ .content
8
+ ~ entry.body.html_safe
9
+
10
+ %a{ :name => 'comments' }
11
+ #comments
12
+ %h2 Comments
13
+ - if entry.comments.any?
14
+ - entry.comments.each do |comment|
15
+ .comment
16
+ .author
17
+ = comment.name
18
+ %span.when
19
+ = comment.created_at.to_s(:long)
20
+ .body
21
+ = comment.body
22
+ - else
23
+ .comment
24
+ .author
25
+ None yet...
26
+
27
+ %a{ :name => 'add-comment' }
28
+ #new_comment
29
+ %h2 Add a comment
30
+ = semantic_form_for [entry, comment] do |form|
31
+ = form.input :name
32
+ = form.input :nickname
33
+ = form.input :email, :label => 'Email (not shown to the public)'
34
+ = form.input :url, :label => 'Website'
35
+ = form.input :body, :label => 'Comment'
36
+ = form.submit 'Add comment', :class => 'button'
@@ -0,0 +1,2 @@
1
+ Powered by #{link_to 'JABE', 'http://github.com/pixels-and-bits/jabe'}
2
+ a #{link_to 'Pixels and Bits', 'http://pixels-and-bits.com'} project
@@ -0,0 +1,4 @@
1
+ %h1#site-title
2
+ = link_to SETTINGS.site_name, '/'
3
+ %h1#site-tagline
4
+ = SETTINGS.tagline
File without changes
@@ -0,0 +1,59 @@
1
+ <!doctype html>
2
+ /[if lt IE 7 ] <html lang="en" class="no-js ie6">
3
+ /[if IE 7 ] <html lang="en" class="no-js ie7">
4
+ /[if IE 8 ] <html lang="en" class="no-js ie8">
5
+ /[if IE 9 ] <html lang="en" class="no-js ie9">
6
+ / [if (gt IE 9)|!(IE)]><!
7
+ %html.no-js{:lang => "en"}
8
+ / <![endif]
9
+ %head
10
+ %meta{:charset => "utf-8"}/
11
+ %meta{:content => "IE=edge,chrome=1", "http-equiv" => "X-UA-Compatible"}/
12
+ %title= SETTINGS.site_name
13
+ %meta{:content => "", :name => "description"}/
14
+ %meta{:content => "", :name => "author"}/
15
+ %meta{:content => "width=device-width, initial-scale=1.0", :name => "viewport"}/
16
+ %link{:href => "/favicon.ico", :rel => "shortcut icon"}/
17
+ %link{:href => "/apple-touch-icon.png", :rel => "apple-touch-icon"}/
18
+ = stylesheet_link_tag 'style', 'grid', 'application'
19
+ = formtastic_stylesheet_link_tag
20
+ = javascript_include_tag 'libs/modernizr-1.6.min.js'
21
+ %body
22
+ #container.container_12
23
+ %header.grid_12
24
+ = render 'layouts/header'
25
+ - if admin_signed_in?
26
+ %nav.grid_12.nav.admin
27
+ %ul
28
+ %li= link_to 'Entries', admin_entries_path
29
+ %li= link_to 'Settings', edit_admin_settings_path
30
+ %li= link_to 'Logout', destroy_admin_session_path
31
+ #main.grid_12
32
+ #content.grid_9
33
+ = yield
34
+ #sidebar.grid_2
35
+ = render 'layouts/sidebar'
36
+ %footer.grid_12
37
+ = render 'layouts/footer'
38
+ %script{:src => "//ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.js"}
39
+ :javascript
40
+ !window.jQuery && document.write(unescape('%3Cscript src="/javascripts/libs/jquery-min.js"%3E%3C/script%3E'))
41
+ = javascript_include_tag 'libs/plugins'
42
+ = javascript_include_tag 'application'
43
+ /[if lt IE 7 ]
44
+ <script src="/javascripts/libs/dd_belatedpng.js"></script>
45
+ <script> DD_belatedPNG.fix('img, .png_bg'); </script>
46
+ - unless Rails.env.production?
47
+ / yui profiler and profileviewer - remove for production
48
+ = javascript_include_tag 'libs/profiling/yahoo-profiling.min.js'
49
+ = javascript_include_tag 'libs/profiling/config.js'
50
+ / change the UA-XXXXX-X to be your site's ID
51
+ :javascript
52
+ var _gaq = [['_setAccount', 'UA-XXXXX-X'], ['_trackPageview']];
53
+ (function(d, t) {
54
+ var g = d.createElement(t),
55
+ s = d.getElementsByTagName(t)[0];
56
+ g.async = true;
57
+ g.src = ('https:' == location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
58
+ s.parentNode.insertBefore(g, s);
59
+ })(document, 'script');