ecrire 0.28.3 → 0.29.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (87) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +1 -1
  3. data/Rakefile +22 -0
  4. data/lib/ecrire/app/assets/images/favicon.ico +0 -0
  5. data/lib/ecrire/app/assets/javascripts/admin/editor/content.coffee +3 -0
  6. data/lib/ecrire/app/assets/javascripts/admin/navigation/save.js.coffee +9 -2
  7. data/lib/ecrire/app/assets/javascripts/admin/posts/filter.js.coffee +19 -0
  8. data/lib/ecrire/app/assets/javascripts/admin/posts/filters/tags.js.coffee +15 -6
  9. data/lib/ecrire/app/assets/javascripts/admin/posts/header.coffee +17 -9
  10. data/lib/ecrire/app/assets/javascripts/admin/posts/list.coffee +6 -0
  11. data/lib/ecrire/app/assets/javascripts/admin/posts/tags/form.coffee +39 -0
  12. data/lib/ecrire/app/assets/javascripts/admin/posts/tags/list.coffee +27 -0
  13. data/lib/ecrire/app/assets/javascripts/admin/posts/tags/tag.coffee +17 -0
  14. data/lib/ecrire/app/assets/javascripts/admin/posts/tags.coffee +11 -0
  15. data/lib/ecrire/app/assets/javascripts/admin/posts/title.coffee +6 -39
  16. data/lib/ecrire/app/assets/javascripts/admin/posts/titles.coffee +8 -0
  17. data/lib/ecrire/app/assets/javascripts/shared/popup.js.coffee +17 -4
  18. data/lib/ecrire/app/assets/stylesheets/admin/header.scss +126 -17
  19. data/lib/ecrire/app/assets/stylesheets/admin/navigation.scss +5 -1
  20. data/lib/ecrire/app/assets/stylesheets/admin/posts.scss +80 -281
  21. data/lib/ecrire/app/assets/stylesheets/admin/preview.scss +55 -0
  22. data/lib/ecrire/app/assets/stylesheets/admin/tags.scss +59 -0
  23. data/lib/ecrire/app/assets/stylesheets/admin/title.scss +79 -89
  24. data/lib/ecrire/app/assets/stylesheets/shared/popup.scss +4 -20
  25. data/lib/ecrire/app/assets/stylesheets/vendor/prism.scss +1 -0
  26. data/lib/ecrire/app/controllers/admin/posts/tags_controller.rb +30 -2
  27. data/lib/ecrire/app/controllers/admin/posts/titles_controller.rb +10 -5
  28. data/lib/ecrire/app/controllers/admin/posts_controller.rb +10 -10
  29. data/lib/ecrire/app/helpers/admin/posts_helper.rb +7 -3
  30. data/lib/ecrire/app/helpers/application_helper.rb +20 -0
  31. data/lib/ecrire/app/helpers/content_tag_helper.rb +4 -0
  32. data/lib/ecrire/app/models/admin/post.rb +23 -0
  33. data/lib/ecrire/app/models/post.rb +1 -1
  34. data/lib/ecrire/app/models/tag.rb +8 -0
  35. data/lib/ecrire/app/views/admin/posts/_post.html.erb +9 -0
  36. data/lib/ecrire/app/views/admin/posts/edit.html.erb +21 -61
  37. data/lib/ecrire/app/views/admin/posts/header/_base.html.erb +54 -0
  38. data/lib/ecrire/app/views/admin/posts/index.html.erb +52 -33
  39. data/lib/ecrire/app/views/admin/posts/index.js.erb +1 -1
  40. data/lib/ecrire/app/views/admin/posts/show.html.erb +5 -23
  41. data/lib/ecrire/app/views/admin/posts/tags/_tag.html.erb +11 -2
  42. data/lib/ecrire/app/views/admin/posts/tags/_tags.html.erb +12 -0
  43. data/lib/ecrire/app/views/admin/posts/tags/create.js.erb +2 -0
  44. data/lib/ecrire/app/views/admin/posts/tags/index.js.erb +1 -0
  45. data/lib/ecrire/app/views/admin/posts/tags/toggle.js.erb +2 -1
  46. data/lib/ecrire/app/views/admin/posts/titles/_form.html.erb +2 -2
  47. data/lib/ecrire/app/views/admin/posts/titles/_index.html.erb +10 -0
  48. data/lib/ecrire/app/views/admin/posts/titles/_titles.html.erb +6 -0
  49. data/lib/ecrire/app/views/admin/posts/titles/index.html.erb +2 -37
  50. data/lib/ecrire/app/views/admin/posts/titles/index.js.erb +2 -0
  51. data/lib/ecrire/app/views/admin/posts/titles/update.js.erb +1 -0
  52. data/lib/ecrire/app/views/admin/tags/_tags.html.erb +6 -10
  53. data/lib/ecrire/app/views/admin/tags/index.js.erb +1 -1
  54. data/lib/ecrire/app/views/layouts/admin/application.html.erb +1 -1
  55. data/lib/ecrire/application.rb +0 -2
  56. data/lib/ecrire/commands/console.rb +1 -1
  57. data/lib/ecrire/config/environment/development.rb +2 -0
  58. data/lib/ecrire/db/migrate/20140618321984_add_properties_to_posts.rb +1 -1
  59. data/lib/ecrire/onboarding/assets/stylesheets/shared/base.scss +11 -10
  60. data/lib/ecrire/onboarding/assets/stylesheets/shared/complete.scss +1 -0
  61. data/lib/ecrire/onboarding/assets/stylesheets/shared/welcome.scss +1 -1
  62. data/lib/ecrire/routes.rb +1 -1
  63. data/lib/ecrire/theme/template/assets/stylesheets/shared/{base.css.scss → base.scss} +4 -18
  64. data/lib/ecrire/theme/template/assets/stylesheets/shared/code.scss +33 -0
  65. data/lib/ecrire/theme/template/assets/stylesheets/shared/{header.css.scss → header.scss} +13 -3
  66. data/lib/ecrire/theme/template/assets/stylesheets/shared/{posts.css.scss → posts.scss} +10 -0
  67. data/lib/ecrire/theme/template/controllers/posts_controller.rb +0 -4
  68. data/lib/ecrire/theme/template/secrets.yml +4 -4
  69. data/lib/ecrire/theme/template/views/layouts/application.html.erb +2 -2
  70. data/lib/ecrire/version.rb +1 -1
  71. data/lib/ecrire.rb +1 -0
  72. data/test/editor/models/post_test.rb +1 -1
  73. data/test/theme/theme/views/layouts/application.html.erb +1 -0
  74. metadata +35 -18
  75. data/lib/ecrire/app/assets/javascripts/admin/posts/filters/filter.js.coffee +0 -21
  76. data/lib/ecrire/app/assets/javascripts/admin/posts/tag.js.coffee +0 -11
  77. data/lib/ecrire/app/views/admin/posts/_posts.html.erb +0 -26
  78. /data/lib/ecrire/app/assets/javascripts/admin/posts/{new.js.coffee → new.coffee} +0 -0
  79. /data/lib/ecrire/app/assets/javascripts/admin/posts/{toggle.js.coffee → toggle.coffee} +0 -0
  80. /data/lib/ecrire/theme/template/assets/stylesheets/browser/{base.css.scss → base.scss} +0 -0
  81. /data/lib/ecrire/theme/template/assets/stylesheets/{browser.css.scss → browser.scss} +0 -0
  82. /data/lib/ecrire/theme/template/assets/stylesheets/mobile/{base.css.scss → base.scss} +0 -0
  83. /data/lib/ecrire/theme/template/assets/stylesheets/{mobile.css.scss → mobile.scss} +0 -0
  84. /data/lib/ecrire/theme/template/assets/stylesheets/shared/{tags.css.scss → tags.scss} +0 -0
  85. /data/lib/ecrire/theme/template/assets/stylesheets/tablet/{base.css.scss → base.scss} +0 -0
  86. /data/lib/ecrire/theme/template/assets/stylesheets/{tablet.css.scss → tablet.scss} +0 -0
  87. /data/lib/ecrire/theme/template/assets/stylesheets/{variables.css.scss → variables.scss} +0 -0
@@ -6,15 +6,10 @@ main.posts > section {
6
6
  @include flex(1);
7
7
  @include display(flex);
8
8
  @include flex-direction(column);
9
- @include justify-content(center);
10
- padding-top: 1em;
11
-
12
- & > div {
13
- @include flex(0 180px);
14
- margin: 0 auto;
15
- padding: 1em;
16
- }
9
+ }
17
10
 
11
+ main.posts > header + section {
12
+ margin-top: 260px;
18
13
  }
19
14
 
20
15
  main.posts div.done {
@@ -44,95 +39,64 @@ main.posts div.done {
44
39
  }
45
40
  }
46
41
 
47
- main.posts > header > nav > div.publish.state {
48
- @include transition(background-color 0.2s);
49
- position: relative;
50
- padding: 2px;
51
- margin: 0 2em;
52
- width: 10em;
53
- height: 30px;
54
- background-color: rgba(black, 0.2);
55
- color: darken($bright-blue, 25%);
56
- border-radius: 60px;
57
- cursor: pointer;
58
- overflow: hidden;
59
-
60
- &:hover label:last-child {
61
- background-color: darken(white, 2%);
62
- box-shadow: 0 2px 5px rgba(0, 0, 0, 0.6);
63
- }
42
+ main.posts.view > section:not(.preview) {
43
+ @include flex-direction(column);
44
+ @include align-items(center);
45
+ @include justify-content(flex-start);
64
46
 
65
- label {
66
- display: block;
67
- position: absolute;
68
- font-weight: bold;
69
- line-height: 2em;
70
- text-indent: 0;
71
- top: 1px;
72
- left: 1px;
73
- bottom: 1px;
74
- cursor: pointer;
75
- padding: 0 1em;
47
+ & > section {
48
+ @include display(flex);
49
+ @include flex-direction(column);
50
+ @include justify-content(center);
51
+ @include align-items(center);
76
52
  }
77
53
 
78
- label:first-child {
79
- @include transition(background 0.2s, text-indent 0.2s);
80
- right: 1px;
81
- background-color: #f1f1f1;
82
- border-radius: 30px;
83
- text-indent: 0;
54
+ svg.tag.icon {
55
+ width: 3em;
56
+ margin: 3em 0 0 0;
57
+ fill: lighten($gray-blue, 25%);
84
58
  }
85
59
 
86
- label:last-child {
87
- @include transition(background 0.2s, box-shadow 0.2s, margin 0.2s);
88
- width: 28px;
89
- background-color: white;
90
- border-radius: 100%;
91
- box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
92
- text-indent: 30px;
60
+ h3 {
61
+ @include display(flex);
62
+ @include align-items(center);
63
+ color: lighten($gray-blue, 15%);
64
+ font-size: 2em;
65
+ margin: 0;
93
66
  }
94
67
 
95
- &[published='true'] {
96
- background-color: rgba(black, 0.5);
97
-
98
- label:first-child {
99
- background-color: darken($bright-blue, 25%);
100
- color: lighten($bright-blue, 50%);
101
- }
102
-
103
- label:last-child {
104
- margin-left: calc(10em - 30px);
105
- text-indent: 10em;
106
- }
107
- }
68
+ ul {
69
+ max-width: 600px;
70
+ width: 100%;
71
+ margin: 1em 0;
108
72
 
109
- &:not([published='true']) {
110
- label:first-child {
111
- text-indent: -20em;
73
+ li {
74
+ @include display(flex);
75
+ @include align-items(center);
76
+ font-size: 1.3em;
77
+ font-weight: bold;
112
78
  }
113
79
 
114
- label:last-child {
115
- }
116
80
  }
117
-
118
81
  }
119
82
 
120
- #PostsIndex header {
83
+ #PostsIndex > section.posts {
121
84
  @include flex-direction(row);
85
+ max-width: 900px;
86
+ width: 100%;
87
+ margin: 48px auto 0 auto;
88
+ }
122
89
 
123
- min-height: 200px;
124
-
125
- & > section {
126
- @include flex(1);
127
- @include display(flex);
128
- }
90
+ #PostsIndex > section.posts > div.posts.list.filters {
91
+ @include flex(1);
92
+ margin: 2em 0;
129
93
  }
130
94
 
131
- #PostsIndex header section.search {
95
+ #PostsIndex > section.posts div.posts.list.filters div.search {
96
+
132
97
  @include display(flex);
133
- @include align-items(stretch);
134
98
 
135
- border: 1px solid darken($bright-blue, 10%);
99
+ border: 1px solid darken($gray-blue, 10%);
136
100
  border-radius: 2px;
137
101
  overflow: hidden;
138
102
  background-color: lighten($gray-blue, 50%);
@@ -192,105 +156,57 @@ main.posts > header > nav > div.publish.state {
192
156
  }
193
157
  }
194
158
 
195
- #PostsIndex section.posts {
196
- @include flex-direction(row);
197
- @include justify-content(space-between);
198
- max-width: 1000px;
199
- width: 100%;
200
- margin: 0 auto;
159
+
160
+ #PostsIndex > section.posts ul.filters {
161
+ @include flex(1);
162
+ @include display(flex);
163
+ }
164
+
165
+ #PostsIndex > section.posts ul.filters li {
166
+ margin: 12px 24px 12px 0;
201
167
  }
202
168
 
203
- #PostsIndex ol.posts {
169
+ #PostsIndex > section.posts ul.posts {
204
170
  @include display(flex);
205
171
  @include flex-direction(column);
206
- @include flex-wrap(wrap);
207
- @include justify-content(flex-start);
208
-
209
- margin: 2em 1em;
210
- max-width: 400px;
172
+
211
173
  width: 100%;
212
-
213
- & > h3 {
214
- @include align-self(center);
215
- text-align: center;
216
- font-size: 3em;
217
- font-weight: bolder;
218
- border-bottom: 1px solid $gray-blue;
219
- }
220
-
221
- li {
222
- @include display(flex);
223
- @include flex-direction(column);
224
- @include flex(0 0 auto);
225
- @include justify-content(space-between);
226
- padding: 1em;
227
- margin: 0.1em;
228
- color: darken($navy-blue, 25%);
229
-
230
- .title {
231
- margin: 0.5em 0;
232
- font-weight: bolder;
233
- font-size: 1.7em;
234
- text-decoration: none;
235
- &:hover {
236
- text-decoration: underline;
237
- }
238
- }
239
-
240
- svg {
241
- width: 12px;
242
- fill: $gray-blue;
243
- }
244
-
245
- a {
246
- color: inherit;
247
- }
248
- }
174
+ max-width: 500px;
249
175
  }
250
176
 
251
- #PostsIndex header section.new {
177
+ #PostsIndex > section.posts > aside {
178
+ @include display(flex);
179
+ @include flex-direction(column);
180
+ width: 200px;
252
181
  margin: 0 1em;
253
- a {
254
- @include transition(box-shadow 0.2s);
255
- text-transform: uppercase;
256
- font-size: 0.8em;
257
- font-weight: bold;
258
- padding: 4px 8px;
259
- border-radius: 2px;
260
- color: lighten($green, 35%);
261
- text-shadow: 0 -1px darken($green, 10%);
262
- text-decoration: none;
263
- background-color: darken($green, 5%);
264
- box-shadow: inset 0 1px 1px 0 lighten($green, 15%), 0 1px 1px transparent;
265
-
266
- &:hover {
267
- box-shadow: inset 0 1px 1px 0 transparent, 0 1px 1px darken($green, 25%);
268
- }
269
-
270
- &:active {
271
- box-shadow: none;
272
- }
182
+ border-right: 1px solid $light-blue;
183
+ padding: 2em 1em;
184
+ label {
185
+ cursor: pointer;
273
186
  }
274
187
  }
275
188
 
276
- #PostsIndex ~ div.overlay #TagsList {
277
- h2 {
278
- text-align: center;
279
- margin: 0;
280
- padding: 1em 0;
281
- background-color: $gray-blue;
282
- border-bottom: 1px solid lighten($light-blue, 25%);
283
- color: lighten($light-blue, 25%);
189
+ #PostsIndex > section.posts > aside a.new.post {
190
+ @include transition(box-shadow 0.2s);
191
+ text-align: center;
192
+ text-transform: uppercase;
193
+ font-size: 0.8em;
194
+ font-weight: bold;
195
+ padding: 4px 8px;
196
+ border-radius: 2px;
197
+ color: lighten($green, 35%);
198
+ text-shadow: 0 -1px darken($green, 10%);
199
+ text-decoration: none;
200
+ background-color: darken($green, 5%);
201
+
202
+ &:active {
203
+ box-shadow: none;
284
204
  }
205
+ }
285
206
 
286
- li {
287
- @include transition(background-color 0.2s ease);
288
- padding: 1em;
289
- margin: 0;
290
- cursor: pointer;
291
- &:hover {
292
- background-color: $light-blue;
293
- }
207
+ #PostsIndex > section.posts > ul.posts li {
208
+ h3 {
209
+ font-size: 1.8em;
294
210
  }
295
211
  }
296
212
 
@@ -337,120 +253,3 @@ main.posts > header > nav > div.publish.state {
337
253
  }
338
254
  }
339
255
 
340
- main.posts > header {
341
-
342
- h2 {
343
- @include display(flex);
344
- @include flex(1);
345
- font-size: 2.3em;
346
- margin: 1em 0;
347
- text-align: center;
348
- color: lighten($gray-blue, 50%);
349
- }
350
-
351
- nav {
352
- @include display(flex);
353
- @include justify-content(space-between);
354
- @include align-items(center);
355
- @include flex(0 auto);
356
-
357
- z-index: 100;
358
- width: 100%;
359
- margin: 2em 0 0 0;
360
- padding: 0 1em;
361
- }
362
-
363
- }
364
-
365
-
366
- main.posts.view > section:not(.preview) {
367
- @include flex-direction(column);
368
- @include align-items(center);
369
- @include justify-content(flex-start);
370
-
371
- & > section {
372
- @include display(flex);
373
- @include flex-direction(column);
374
- @include justify-content(center);
375
- @include align-items(center);
376
- }
377
-
378
- svg.tag.icon {
379
- width: 3em;
380
- margin: 3em 0 0 0;
381
- fill: lighten($gray-blue, 25%);
382
- }
383
-
384
- h3 {
385
- @include display(flex);
386
- @include align-items(center);
387
- color: lighten($gray-blue, 15%);
388
- font-size: 2em;
389
- margin: 0;
390
- }
391
-
392
- ul {
393
- max-width: 600px;
394
- width: 100%;
395
- margin: 1em 0;
396
-
397
- li {
398
- @include display(flex);
399
- @include align-items(center);
400
- font-size: 1.3em;
401
- font-weight: bold;
402
- }
403
-
404
- }
405
- }
406
-
407
- main.posts.view > section.preview {
408
- @include justify-content(flex-start);
409
- max-width: 800px;
410
- width: 100%;
411
- margin: 3em auto;
412
- padding: 0 2em;
413
-
414
- font-size: 1.3em;
415
- line-height: 1.6em;
416
-
417
- h1,h2,h3,h4,h5,h6 {
418
- font-weight: bolder;
419
- }
420
-
421
- ul, ol {
422
- padding-left: 1em;
423
- }
424
-
425
- ul {
426
- list-style-type: circle;
427
- }
428
-
429
- ol {
430
- list-style-type: decimal;
431
- }
432
-
433
- li {
434
- margin: 0.3em 0;
435
- }
436
-
437
- p {
438
- margin: 1.5em 0;
439
- }
440
-
441
- pre {
442
- font-size: 0.7em;
443
- background: lighten($gray-blue, 40%);
444
- padding: 0;
445
-
446
- header {
447
- background: lighten($gray-blue, 20%);
448
- padding: 0.3em 1em;
449
- }
450
-
451
- code {
452
- display: block;
453
- padding: 0.8em;
454
- }
455
- }
456
- }
@@ -0,0 +1,55 @@
1
+ #PostPreviewContent > article {
2
+ @include justify-content(flex-start);
3
+
4
+ max-width: 900px;
5
+ margin: 0 auto;
6
+ padding: 0 1em 6em 1em;
7
+ width: 100%;
8
+
9
+ font-size: 1.3em;
10
+ line-height: 1.6em;
11
+
12
+ h1,h2,h3,h4,h5,h6 {
13
+ font-weight: bolder;
14
+ }
15
+
16
+ ul, ol {
17
+ padding-left: 1em;
18
+ }
19
+
20
+ ul {
21
+ list-style-type: circle;
22
+ }
23
+
24
+ ol {
25
+ list-style-type: decimal;
26
+ }
27
+
28
+ li {
29
+ margin: 0.3em 0;
30
+ }
31
+
32
+ p {
33
+ margin: 1.5em 0;
34
+ }
35
+ }
36
+
37
+ #PostPreviewContent pre {
38
+ background-color: $light-blue;
39
+ font-size: 0.7em;
40
+ border-radius: 2px;
41
+ overflow: hidden;
42
+ padding: 0;
43
+
44
+ header {
45
+ padding: 0.3em 1em;
46
+ background-color: $navy-blue;
47
+ color: $light-blue;
48
+ font-style: italic;
49
+ }
50
+
51
+ code {
52
+ padding: 1em;
53
+ display: inline-block;
54
+ }
55
+ }
@@ -1,3 +1,62 @@
1
+ #PostEditContent > div.tags {
2
+ color: $gray-blue;
3
+ text-align: center;
4
+ max-width: 900px;
5
+ margin: 0 auto;
6
+ }
7
+
8
+ [as='Popup'].tags > form {
9
+ @include display(flex);
10
+ @include flex-direction(column);
11
+ }
12
+
13
+ [as='Popup'].tags > form > input {
14
+ border: 1px solid $gray-blue;
15
+ margin: 1em 1em 0 1em;
16
+ font-size: 1.2em;
17
+ line-height: 1.2em;
18
+ }
19
+
20
+ [as='Popup'].tags > form > p.message {
21
+ margin: 0 0 1em 0;
22
+ padding: 0 2em;
23
+ text-align: center;
24
+ font-size: 0.8em;
25
+ color: $gray-blue;
26
+ }
27
+
28
+ [as='Popup'].tags > ul.tags > li.empty {
29
+ text-align: center;
30
+ font-size: 1.2em;
31
+ margin: 1em 0;
32
+ color: $gray-blue;
33
+ }
34
+
35
+ [as='Popup'].tags > ul.tags > li.tag {
36
+ @include display(flex);
37
+ margin: 0;
38
+ cursor: pointer;
39
+
40
+ input {
41
+ visibility: hidden;
42
+ }
43
+
44
+ label {
45
+ @include flex(1);
46
+ padding: 1em;
47
+ cursor: inherit;
48
+ }
49
+
50
+ input:checked + label {
51
+ font-weight: bold;
52
+ }
53
+
54
+ &:hover, &:focus {
55
+ outline: none;
56
+ background-color: $light-blue;
57
+ }
58
+ }
59
+
1
60
  #TagsIndex, #TagsCreate {
2
61
  header > form {
3
62
  @include display(flex);