ecrire 0.26.1 → 0.26.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e721c37f57738d2e79e23190c75fb346ed10fe7f
4
- data.tar.gz: 3ca14baffff90df341b9c2716e1f62415cbc9880
3
+ metadata.gz: 4ce26477b0912ec3e5e72cdfe31cd7ebaf91367b
4
+ data.tar.gz: 7cfef2c63d03495c04cc90b97adc668bc653266a
5
5
  SHA512:
6
- metadata.gz: 2e4047293bd8959c766ebbce0f139b95e7fcf0e89a8181033c76a8bf089ccd793ad32e2695a67df85e7af10e922f6d14221b4098af618a74d44008a9daa9605e
7
- data.tar.gz: 7f55372eaea1db2211174634caa89b2b17f3f21c3d69ee2732ce99009b686034183bab6262420db24f0b92374e46c0b3171f1b18f31c750be1eb746659e61255
6
+ metadata.gz: bee627694b0efe4e26e5b1f23516714635f9fecbade81d20fa8c628c295a8fde2ce271869106608d345c2a5edabed12d00366088bea9cb39220ee7038a4a67eb
7
+ data.tar.gz: d34158b4a0a0ec3541afa55a2cf5cb222c20e12af7543725d59b5a9c819524704a54db7c18c97029e5ecb456e0bb9871754b46f9e742825a56762af363a9d5db
data/README.md CHANGED
@@ -1,13 +1,26 @@
1
1
  # Ecrire
2
-
3
2
  [![Build Status](https://travis-ci.org/pothibo/ecrire.svg?branch=master)](https://travis-ci.org/pothibo/ecrire)
4
3
 
5
- Ecrire is a blog built *on top* of Ruby on Rails. The goal of this blog engine is to make it **easy** to start a blog while keeping control over the content. You can see this as an alternative to WordPress.
4
+ Ecrire is a blog engine built for web professionals. Most best practices comes builtin for you to quickly create powerful websites.
5
+
6
+ ## How does it work?
7
+ Essentially, Ecrire is a blog engine. It provides a powerful Markdown editor, tags support, drafts, permalinks, image uploads, and everything else you would need to create a website.
8
+
9
+ Ecrire is built around the concept of themes. When you create a project with Ecrire, you are actually creating a new theme for you to customize to your needs.
10
+
11
+ ## How flexible is a theme?
12
+ You can do pretty much anything you want inside a theme. It is based on Rails::Engine, a foundation block of Ruby on Rails. You can add gems, routes, controllers, views, javascript files, anything.
13
+
14
+ By default, a theme has 3 type of routes: posts, tags and static. While the first two serve dynamic contents (posts and tags), the third one is a route that handles static pages. This is useful when you want to add an about/FAQ/Contact page that doesn't change much and you want to use normal HTML to render it instead of the Markdown Editor.
15
+
16
+ Views(HTML) uses by default ERB, a Ruby + HTML template to build dynamic pages. The default theme provides tons of example on how to use ERB to build pages with content written in Markdown.
17
+
6
18
 
7
19
  ## The editor
8
- The editor was built around the Markdown syntax. The content change as you type to offer you a very good approximation of how your post will look like once publish.
9
20
 
10
- Here's the available feature:
21
+ The editor uses Markdown as its syntax. The advantage is to format your text as you type. The syntax is easy to understand and is powerful enough to let you structure your text as you type so you can focus on the content.
22
+
23
+ Here's the different structures available to you in the editor:
11
24
  - Headers
12
25
  - Unordered list
13
26
  - Ordered list
@@ -16,35 +29,23 @@ Here's the available feature:
16
29
  - Links
17
30
  - Bold and Italic words
18
31
 
19
- More feature will be implemented as the Editor mature.
20
-
21
- ## Theme
22
- When you start a new blog with Ecrire, it will generate a folder for you. Everything in that folder is for you to modify. You won't break anything. It also features a few characteristic that you may recognize if you are a Rails developer.
23
-
24
- - SASS
25
- - Coffeescript
26
- - Assets caching through Sprockets
27
- - View using layouts, views and partials
28
- - Controllers
29
- - Helpers
30
- - Static pages
31
-
32
- When you install your theme, the documentation will be available direclty within your blog so you can go back to it when you need it.
32
+ You can learn more about the syntax on [Ecrire.io](http://ecrire.io/markdown)
33
33
 
34
- ## How to install
34
+ ## Get started
35
+ First, you need to install ecrire as a gem and then create a new theme.
35
36
 
36
- ```bash
37
+ ~~~bash
37
38
  $ gem install ecrire
38
39
  $ ecrire new my.blog.com
39
40
  $ cd my.blog.com/
40
41
  $ ecrire server
41
- ```
42
+ ~~~
42
43
 
43
- From there, you can access your new blog via the browser and start configuring your database.
44
+ Once the server is started, you can load your browser at **http://localhost:3000** to finish the configuration.
44
45
 
45
- ## Heroku
46
+ ## Go live on Heroku
46
47
 
47
- Once you have finished your changes in your local environment, here's how you can publish your blog on Heroku.
48
+ Once you're ready to go live, you can use Heroku to deploy your application in production:
48
49
 
49
50
  ~~~bash
50
51
  $ heroku git:remote -a name-of-your-app-on-heroku
@@ -63,4 +64,4 @@ irb(main)> user.save!
63
64
  irb(main)> exit
64
65
  ~~~
65
66
 
66
- You can now log in to your blog in production and start writing for real!
67
+
@@ -1,6 +1,7 @@
1
1
  ObserveJS.bind 'Editor.Save', class
2
2
  loaded: =>
3
- @on 'keydown', window, @save
3
+ @on 'click', @save
4
+ @on 'keydown', window, @shouldSave
4
5
  @on 'Editor:loaded', document, @cache
5
6
  @on 'Editor:updated', document, @update
6
7
  @on 'posts:update', document, @saved
@@ -19,15 +20,18 @@ ObserveJS.bind 'Editor.Save', class
19
20
  cache
20
21
  @cache()
21
22
 
22
- save: (e) =>
23
+ shouldSave: (e) =>
23
24
  @cache()
24
25
  if e.metaKey isnt true || e.which isnt 83
25
26
  return
26
27
 
28
+ @save(e)
29
+
30
+ save: (e) =>
27
31
  e.preventDefault()
28
32
  e.stopPropagation()
29
33
 
30
- dialog = @element().content.querySelector('#SavePost').cloneNode(true)
34
+ dialog = @retrieve('#SavePost').cloneNode(true)
31
35
  document.body.appendChild(dialog)
32
36
 
33
37
  saved: (e) =>
@@ -101,34 +101,35 @@ main {
101
101
  }
102
102
 
103
103
  .button {
104
- @include transition(text-shadow 0.3s ease-in, border-color 0.3s, background-color 0.3s, box-shadow 0.3s, color 0.3s);
105
- border: 1px solid lighten($navy-blue, 5%);
104
+ @include transition(text-shadow 0.1s ease-in, border-color 0.1s, background-color 0.1s, box-shadow 0.1s, color 0.1s);
105
+ border: 1px solid darken($bright-blue, 15%);
106
106
  border-radius: 2px;
107
107
  text-decoration: none;
108
108
  padding: 4px 8px;
109
109
  margin: 0 0.5em;
110
110
  font-size: 0.8em;
111
111
  text-transform: uppercase;
112
- font-weight: bolder;
113
- box-shadow: inset 0 1px 0 transparent;
114
- text-shadow: 0 1px 0 transparent;
112
+ font-weight: bold;
113
+ background-color: $bright-blue;
114
+
115
+ color: lighten($navy-blue, 100%);
116
+ box-shadow: inset 0 1px 0 0 lighten($bright-blue, 15%);
115
117
 
116
118
  &.selected {
117
- background-color: lighten($navy-blue, 25%);
118
- border-color: lighten($navy-blue, 25%);
119
- color: lighten($navy-blue, 100%);
119
+ background-color: darken($bright-blue, 15%);
120
+ border-color: darken($bright-blue, 25%);
121
+ box-shadow: none;
120
122
  }
121
123
 
122
124
  &:hover:not(.selected) {
123
- background-color: lighten($navy-blue, 25%);
124
- box-shadow: inset 0 1px 0 lighten($navy-blue, 30%), 0 1px 1px lighten($navy-blue, 15%);
125
- color: lighten($navy-blue, 60%);
126
- text-shadow: 0 1px lighten($navy-blue, 25%);
125
+ background-color: lighten($bright-blue, 5%);
126
+ color: lighten($navy-blue, 100%);
127
+ border-color: darken($bright-blue, 25%);
128
+ box-shadow: inset 0 1px 0 0 lighten($bright-blue, 15%), 0 0 2px 0 darken($bright-blue, 15%);
127
129
  }
128
130
 
129
131
  &:active:not(.selected) {
130
- box-shadow: none;
131
- color: lighten($navy-blue, 100%);
132
- text-shadow: 0 1px lighten($navy-blue, 25%);
132
+ box-shadow: inset 0 1px 2px 0 darken($bright-blue, 15%), 0 0 2px 0 transparent;
133
+ background-color: darken($bright-blue, 5%);
133
134
  }
134
135
  }
@@ -1,20 +1,27 @@
1
- main.edit.posts > header {
1
+ main.posts > header {
2
2
  @include display(flex);
3
3
  @include flex(0 auto);
4
4
  @include align-items(center);
5
5
  @include justify-content(center);
6
+ @include flex-direction(column);
6
7
  background-color: $bright-blue;
8
+ background-size: cover;
7
9
  color: lighten($bright-blue, 50%);
8
- min-height: 200px;
10
+ max-height: 200px;
11
+ height: 30vh;
9
12
  }
10
13
 
11
14
  main.edit.posts > header > div.title {
12
15
  @include display(flex);
16
+ @include flex(1);
13
17
  @include flex-direction(column);
14
18
  @include transition(opacity 0.2s linear);
19
+ @include justify-content(center);
15
20
  text-align: center;
16
21
  width: 100%;
17
22
  z-index: 5;
23
+ margin: 1em 0;
24
+
18
25
  & > p.browse {
19
26
  @include transition(color 0.3s);
20
27
  font-size: 0.7em;
@@ -29,7 +36,7 @@ main.edit.posts > header > div.title {
29
36
  width: 30px;
30
37
  position: absolute;
31
38
  right: 1em;
32
- top: 1em;
39
+ bottom: 1em;
33
40
  fill: #D8ABAB;
34
41
  cursor: pointer;
35
42
  &:hover {
@@ -44,8 +51,6 @@ main.edit.posts > header > div.title {
44
51
 
45
52
  font-size: 2.3em;
46
53
  line-height: 1.4em;
47
- padding: 0.3em 1em;
48
- margin: 0.5em 0 0 0;
49
54
  cursor: pointer;
50
55
  text-decoration: none;
51
56
  color: inherit;
@@ -56,6 +61,23 @@ main.edit.posts > header > div.title {
56
61
 
57
62
  }
58
63
 
64
+ [as='Post.Header'] [as='Editor.Save'] {
65
+ margin-right: 2em;
66
+ background-color: darken($green, 10%);
67
+ box-shadow: inset 0 1px 0 0 lighten($green, 5%);
68
+ border-color: darken($green, 35%);
69
+
70
+ &:hover {
71
+ background-color: darken($green, 10%);
72
+ box-shadow: inset 0 1px 0 0 lighten($green, 10%), 0 0 2px 0 darken($green, 30%);
73
+ }
74
+
75
+ &:active {
76
+ box-shadow: inset 0 1px 2px 0 darken($green, 25%), 0 0 2px 0 transparent;
77
+ background-color: darken($green, 5%);
78
+ }
79
+ }
80
+
59
81
  [as='Post.Header'] {
60
82
  @include display(flex);
61
83
  @include flex-direction(column);
@@ -83,6 +105,7 @@ main.edit.posts > header > div.title {
83
105
 
84
106
  input[type='file'] {
85
107
  visibility: hidden;
108
+ height: 1px;
86
109
  }
87
110
 
88
111
  }
@@ -10,6 +10,7 @@ nav#Menu.admin {
10
10
  font-size: 16px;
11
11
  font-weight: bold;
12
12
  padding: 0 0.5em;
13
+ z-index: 10;
13
14
 
14
15
  background-color: darken($gray-blue, 25%);
15
16
  color: lighten($gray-blue, 15%);
@@ -18,8 +19,8 @@ nav#Menu.admin {
18
19
  text-shadow: 0 -1px darken($light-blue, 75%);
19
20
 
20
21
  .button {
21
- @include transition(text-shadow 0.3s ease-in, border-color 0.3s, background-color 0.3s, box-shadow 0.3s, color 0.3s);
22
- border: 1px solid lighten($gray-blue, 15%);
22
+ @include transition(text-shadow 0.2s ease-in, border-color 0.2s, background-color 0.2s, box-shadow 0.2s, color 0.2s);
23
+ border: 1px solid darken($navy-blue, 5%);
23
24
  border-radius: 2px;
24
25
  text-decoration: none;
25
26
  padding: 4px 8px;
@@ -27,9 +28,10 @@ nav#Menu.admin {
27
28
  font-size: 0.8em;
28
29
  text-transform: uppercase;
29
30
  font-weight: bolder;
30
- box-shadow: inset 0 1px 0 transparent;
31
- text-shadow: 0 1px 0 transparent;
32
- color: inherit;
31
+ background-color: lighten($navy-blue, 25%);
32
+ box-shadow: inset 0 1px 0 lighten($navy-blue, 35%), 0 1px 1px darken($navy-blue, 15%);
33
+ color: lighten($navy-blue, 60%);
34
+ text-shadow: 0 1px lighten($navy-blue, 25%);
33
35
 
34
36
  &.selected {
35
37
  background-color: lighten($navy-blue, 25%);
@@ -38,17 +40,14 @@ nav#Menu.admin {
38
40
  }
39
41
 
40
42
  &:hover:not(.selected) {
41
- background-color: lighten($navy-blue, 25%);
42
- box-shadow: inset 0 1px 0 lighten($navy-blue, 25%), 0 1px 1px darken($navy-blue, 15%);
43
- color: lighten($navy-blue, 60%);
44
- text-shadow: 0 1px lighten($navy-blue, 25%);
45
- border-color: lighten($navy-blue, 25%);
43
+ border-color: darken($navy-blue, 25%);
46
44
  }
47
45
 
48
46
  &:active:not(.selected) {
49
- box-shadow: none;
50
47
  color: lighten($navy-blue, 100%);
51
48
  text-shadow: 0 1px lighten($navy-blue, 25%);
49
+ box-shadow: inset 0 0 2px darken($navy-blue, 15%), 0 1px 1px transparent;
50
+ border-color: darken($navy-blue, 15%);
52
51
  }
53
52
 
54
53
  &.home {
@@ -61,16 +60,16 @@ nav#Menu.admin form.logout {
61
60
  @include transition(color 0.3s,background-color 0.3s, border 0.3s, box-shadow 0.3s);
62
61
  border: 1px solid lighten($red, 5%);
63
62
  border-radius: 2px;
64
- color: lighten($red, 5%);
65
63
  margin: 0;
66
64
  padding: 4px 8px;
67
65
  cursor: pointer;
68
66
  outline: none;
67
+ background-color: lighten($red, 5%);
68
+ color: lighten($red, 30%);
69
+ box-shadow: inset 0 1px 0 0 lighten($red, 10%), 0 1px 1px darken($red, 20%);
69
70
 
70
71
  &:hover {
71
- background-color: lighten($red, 5%);
72
- color: lighten($red, 30%);
73
- box-shadow: inset 0 1px 0 0 lighten($red, 10%), 0 1px 1px darken($red, 20%);
72
+ border-color: darken($red, 10%);
74
73
  }
75
74
 
76
75
  &:active {
@@ -44,7 +44,7 @@ main.posts div.done {
44
44
  }
45
45
  }
46
46
 
47
- main.posts.view > header > nav > div.publish.state {
47
+ main.posts > header > nav > div.publish.state {
48
48
  @include transition(background-color 0.2s);
49
49
  position: relative;
50
50
  padding: 2px;
@@ -52,6 +52,7 @@ main.posts.view > header > nav > div.publish.state {
52
52
  width: 10em;
53
53
  height: 30px;
54
54
  background-color: #dddddd;
55
+ color: darken($bright-blue, 25%);
55
56
  border-radius: 60px;
56
57
  cursor: pointer;
57
58
  overflow: hidden;
@@ -92,11 +93,11 @@ main.posts.view > header > nav > div.publish.state {
92
93
  }
93
94
 
94
95
  &[published='true'] {
95
- background-color: lighten($gray-blue, 5%);
96
+ background-color: darken($bright-blue, 15%);
96
97
 
97
98
  label:first-child {
98
- background-color: lighten($navy-blue, 25%);
99
- color: darken($navy-blue, 25%);
99
+ background-color: darken($bright-blue, 25%);
100
+ color: lighten($bright-blue, 50%);
100
101
  }
101
102
 
102
103
  label:last-child {
@@ -117,9 +118,9 @@ main.posts.view > header > nav > div.publish.state {
117
118
  }
118
119
 
119
120
  #PostsIndex header {
121
+ @include flex-direction(row);
122
+
120
123
  min-height: 200px;
121
- @include display(flex);
122
- @include align-items(center);
123
124
 
124
125
  & > section {
125
126
  @include flex(1);
@@ -131,8 +132,10 @@ main.posts.view > header > nav > div.publish.state {
131
132
  @include display(flex);
132
133
  @include align-items(stretch);
133
134
 
134
- border: 1px solid lighten($gray-blue, 25%);
135
+ border: 1px solid darken($bright-blue, 10%);
135
136
  border-radius: 2px;
137
+ overflow: hidden;
138
+ background-color: lighten($gray-blue, 50%);
136
139
 
137
140
  input {
138
141
  @include flex(1);
@@ -141,6 +144,8 @@ main.posts.view > header > nav > div.publish.state {
141
144
  font-size: 1.0em;
142
145
  margin: 0 auto;
143
146
  border: none;
147
+ border-radius: 0;
148
+ background-color: inherit;
144
149
  }
145
150
 
146
151
  svg {
@@ -155,6 +160,7 @@ main.posts.view > header > nav > div.publish.state {
155
160
  @include transition(background-color 0.3s ease, box-shadow 0.3s ease);
156
161
  border-right: 1px solid lighten($gray-blue, 25%);
157
162
  cursor: pointer;
163
+ color: darken($bright-blue, 15%);
158
164
 
159
165
  &:hover, &.tagged {
160
166
  background-color: $light-blue;
@@ -201,11 +207,15 @@ main.posts.view > header > nav > div.publish.state {
201
207
  @include justify-content(flex-start);
202
208
 
203
209
  margin: 2em 1em;
210
+ max-width: 400px;
211
+ width: 100%;
204
212
 
205
213
  & > h3 {
214
+ @include align-self(center);
206
215
  text-align: center;
207
216
  font-size: 3em;
208
217
  font-weight: bolder;
218
+ border-bottom: 1px solid $gray-blue;
209
219
  }
210
220
 
211
221
  li {
@@ -213,21 +223,25 @@ main.posts.view > header > nav > div.publish.state {
213
223
  @include flex-direction(column);
214
224
  @include flex(0 0 auto);
215
225
  @include justify-content(space-between);
216
- max-width: 400px;
217
226
  padding: 1em;
218
227
  margin: 0.1em;
219
228
  color: darken($navy-blue, 25%);
220
229
 
221
230
  .title {
222
- margin: 1em 0;
231
+ margin: 0.5em 0;
223
232
  font-weight: bolder;
224
- font-size: 1.3em;
233
+ font-size: 1.7em;
225
234
  text-decoration: none;
226
235
  &:hover {
227
236
  text-decoration: underline;
228
237
  }
229
238
  }
230
239
 
240
+ svg {
241
+ width: 12px;
242
+ fill: $gray-blue;
243
+ }
244
+
231
245
  a {
232
246
  color: inherit;
233
247
  }
@@ -323,22 +337,27 @@ main.posts.view > header > nav > div.publish.state {
323
337
  }
324
338
  }
325
339
 
326
- main.posts.view > header {
340
+ main.posts > header {
327
341
 
328
342
  h2 {
329
- margin: 2em 0;
343
+ @include display(flex);
344
+ @include flex(1);
345
+ font-size: 2.3em;
346
+ margin: 1em 0;
330
347
  text-align: center;
331
- text-transform: uppercase;
332
- color: lighten($gray-blue, 5%);
348
+ color: lighten($gray-blue, 50%);
333
349
  }
334
350
 
335
351
  nav {
336
352
  @include display(flex);
337
353
  @include justify-content(space-between);
338
354
  @include align-items(center);
339
- @include flex(1);
340
- padding: 0 1em 1em 1em;
341
- border-bottom: 1px solid lighten($gray-blue, 25%);
355
+ @include flex(0 auto);
356
+
357
+ z-index: 100;
358
+ width: 100%;
359
+ margin: 2em 0 0 0;
360
+ padding: 0 1em;
342
361
  }
343
362
 
344
363
  }
@@ -132,18 +132,19 @@
132
132
  border-color: $red;
133
133
  font-weight: bold;
134
134
  color: $red;
135
+ background-color: lighten($red, 15%);
136
+ text-shadow: 0 1px lighten($red, 25%);
137
+ box-shadow: inset 0 1px 0 0 lighten($red, 25%), 0 1px 1px darken($red, 15%);
135
138
 
136
139
  &:hover:not(:active) {
137
140
  color: darken($red, 25%);
138
- background-color: lighten($red, 15%);
139
- text-shadow: 0 1px lighten($red, 25%);
140
- box-shadow: inset 0 1px 0 0 lighten($red, 25%), 0 1px 1px darken($red, 15%);
141
141
  }
142
142
 
143
143
  &:active {
144
144
  background-color: lighten($red, 15%);
145
145
  text-shadow: 0 1px lighten($red, 25%);
146
146
  color: darken($red, 25%);
147
+ box-shadow: inset 0 1px 2px 0 darken($red, 5%), 0 1px 1px transparent;
147
148
  }
148
149
  }
149
150
  }
@@ -208,18 +209,19 @@
208
209
  border-color: $red;
209
210
  color: $red;
210
211
  font-weight: bold;
212
+ background-color: lighten($red, 15%);
213
+ text-shadow: 0 1px lighten($red, 25%);
214
+ box-shadow: inset 0 1px 0 0 lighten($red, 25%), 0 1px 1px darken($red, 15%);
211
215
 
212
216
  &:hover:not(:active) {
213
217
  color: darken($red, 25%);
214
- background-color: lighten($red, 15%);
215
- text-shadow: 0 1px lighten($red, 25%);
216
- box-shadow: inset 0 1px 0 0 lighten($red, 25%), 0 1px 1px darken($red, 15%);
217
218
  }
218
219
 
219
220
  &:active {
220
221
  background-color: lighten($red, 15%);
221
222
  text-shadow: 0 1px lighten($red, 25%);
222
223
  color: darken($red, 25%);
224
+ box-shadow: inset 0 1px 2px 0 darken($red, 5%), 0 1px 1px transparent;
223
225
  }
224
226
  }
225
227
 
@@ -8,6 +8,7 @@ article.content > figure {
8
8
 
9
9
  &.dropping div[contenteditable] {
10
10
  background-color: rgb(122, 199, 122);
11
+ padding: 1em;
11
12
  }
12
13
 
13
14
  figcaption {
@@ -2,6 +2,13 @@ module Admin
2
2
  module PostsHelper
3
3
  include ::PostsHelper
4
4
 
5
+ def post_tags(post)
6
+ tags = post.tags.map do |tag|
7
+ tag.name.capitalize
8
+ end
9
+ tags.join(', ')
10
+ end
11
+
5
12
  def edit_content_tag(post)
6
13
  content_tag :article, id: 'PostBody', postid: @post.id,
7
14
  class: %w(content),
@@ -2,7 +2,7 @@
2
2
  <h3>Drafts</h3>
3
3
  <% drafted.each do |post| %>
4
4
  <li>
5
- <%= link_to post.title, url('/admin/posts/:post.id', post: post), class: %w(title) %>
5
+ <%= link_to post.title, url('/admin/posts/:post.id/edit', post: post), class: %w(title) %>
6
6
  </li>
7
7
  <% end %>
8
8
  </ol>
@@ -11,7 +11,16 @@
11
11
  <h3>Published</h3>
12
12
  <% published.each do |post| %>
13
13
  <li>
14
- <%= link_to post.title, url('/admin/posts/:post.id', post: post), class: %w(title) %>
14
+ <%= link_to post.title, url('/admin/posts/:post.id/edit', post: post), class: %w(title) %>
15
+ <% if post.tags.any? %>
16
+ <%= content_tag :div, class: %w(tags) do %>
17
+ <svg version="1.1" class="tag icon" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 20 20" enable-background="new 0 0 20 20" xml:space="preserve">
18
+ <path d="M18.662,5.521L5.237,19l0.707-4.967l-4.945,0.709L14.424,1.263c0.391-0.392,1.133-0.308,1.412,0l2.826,2.839 C19.162,4.575,19.053,5.128,18.662,5.521z"/>
19
+ </svg>
20
+
21
+ <%= post_tags(post) %>
22
+ <% end %>
23
+ <% end %>
15
24
  </li>
16
25
  <% end %>
17
26
  </ol>
@@ -1,13 +1,30 @@
1
- <template as='Editor.Save'>
2
- <%= content_tag :div, as: 'Editor.Save.Dialog', id: 'SavePost', href: admin_post_path(@post), method: 'PUT' do %>
3
- <div class='progress'></div>
4
- <p class='message'>
5
- Saving...
6
- </p>
7
- <% end %>
8
- </template>
9
-
10
1
  <%= content_tag :header, as: "Post.Header", href: admin_post_image_path(@post), method: 'POST' do |header| %>
2
+ <nav class='actions'>
3
+ <div class='meta'>
4
+ <button class='button' as='Editor.Save'>
5
+ Save
6
+ <template for='Editor.Save'>
7
+ <%= content_tag :div, as: 'Editor.Save.Dialog', id: 'SavePost', href: admin_post_path(@post), method: 'PUT' do %>
8
+ <div class='progress'></div>
9
+ <p class='message'>
10
+ Saving...
11
+ </p>
12
+ <% end %>
13
+ </template>
14
+ </button>
15
+
16
+ <%= link_to 'Edit', edit_admin_post_path(@post), class: %w(selected button) %>
17
+ <%= link_to 'Preview', admin_post_path(@post), class: %w(button) %>
18
+ <%= link_to 'Tags', admin_post_tags_path(@post), class: %w(button) %>
19
+ <%= link_to 'Title', admin_post_titles_path(@post), class: %w(button) %>
20
+ </div>
21
+
22
+
23
+ <%= content_tag :div, class: %w(publish state), href: admin_post_toggle_path(@post), method: :put, published: @post.published?, as: 'Post.Publish' do %>
24
+ <label>Published</label>
25
+ <label>Draft</label>
26
+ <% end %>
27
+ </nav>
11
28
  <template for='Post.Header'>
12
29
  <%= render 'admin/posts/header/dropping', css: %w(status dropping hidden) %>
13
30
  <%= render 'admin/posts/header/uploading', css: %w(status uploading hidden) %>
@@ -1,8 +1,9 @@
1
1
  <% content_for :class, 'post view' %>
2
- <header>
3
- <%= content_tag :h2, @post.title %>
2
+
3
+ <%= content_tag :header do |header| %>
4
4
  <nav>
5
5
  <div class='meta'>
6
+ <%= link_to 'Edit', edit_admin_post_path(@post), class: %w(button) %>
6
7
  <%= link_to 'Preview', admin_post_path(@post), class: %w(selected button) %>
7
8
  <%= link_to 'Tags', admin_post_tags_path(@post), class: %w(button) %>
8
9
  <%= link_to 'Title', admin_post_titles_path(@post), class: %w(button) %>
@@ -13,9 +14,14 @@
13
14
  <label>Draft</label>
14
15
  <% end %>
15
16
  </nav>
16
- </header>
17
+
18
+ <%= content_tag :h2, @post.title %>
19
+
20
+ <% if @post.header? %>
21
+ <% header[:style] = "background-image: url(#{@post.header.url});" %>
22
+ <% end %>
23
+ <% end %>
17
24
 
18
25
  <section class='preview'>
19
- <%= link_to 'Edit this post', edit_admin_post_path(@post) %>
20
26
  <%= content_tag :article, @post.compiled_content.try(:html_safe) %>
21
27
  <section>
@@ -1,8 +1,9 @@
1
1
  <% content_for :class, 'posts view' %>
2
- <header>
3
- <%= content_tag :h2, @post.title %>
2
+
3
+ <%= content_tag :header do |header| %>
4
4
  <nav>
5
5
  <div class='meta'>
6
+ <%= link_to 'Edit', edit_admin_post_path(@post), class: %w(button) %>
6
7
  <%= link_to 'Preview', admin_post_path(@post), class: %w(button) %>
7
8
  <%= link_to 'Tags', admin_post_tags_path(@post), class: %w(selected button) %>
8
9
  <%= link_to 'Title', admin_post_titles_path(@post), class: %w(button) %>
@@ -12,9 +13,14 @@
12
13
  <label>Published</label>
13
14
  <label>Draft</label>
14
15
  <% end %>
15
-
16
16
  </nav>
17
- </header>
17
+
18
+ <%= content_tag :h2, @post.title %>
19
+
20
+ <% if @post.header? %>
21
+ <% header[:style] = "background-image: url(#{@post.header.url});" %>
22
+ <% end %>
23
+ <% end %>
18
24
 
19
25
  <section>
20
26
  <svg version="1.1" class="tag icon" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 20 20" enable-background="new 0 0 20 20" xml:space="preserve">
@@ -1,8 +1,9 @@
1
1
  <% content_for :class, 'posts view' %>
2
- <header>
3
- <%= content_tag :h2, @post.title %>
2
+
3
+ <%= content_tag :header do |header| %>
4
4
  <nav>
5
5
  <div class='meta'>
6
+ <%= link_to 'Edit', edit_admin_post_path(@post), class: %w(button) %>
6
7
  <%= link_to 'Preview', admin_post_path(@post), class: %w(button) %>
7
8
  <%= link_to 'Tags', admin_post_tags_path(@post), class: %w(button) %>
8
9
  <%= link_to 'Title', admin_post_titles_path(@post), class: %w(selected button) %>
@@ -12,9 +13,14 @@
12
13
  <label>Published</label>
13
14
  <label>Draft</label>
14
15
  <% end %>
15
-
16
16
  </nav>
17
- </header>
17
+
18
+ <%= content_tag :h2, @post.title %>
19
+
20
+ <% if @post.header? %>
21
+ <% header[:style] = "background-image: url(#{@post.header.url});" %>
22
+ <% end %>
23
+ <% end %>
18
24
 
19
25
  <section>
20
26
  <% if @post.published? %>
@@ -1,3 +1,3 @@
1
1
  module Ecrire
2
- VERSION = '0.26.1'
2
+ VERSION = '0.26.2'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ecrire
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.26.1
4
+ version: 0.26.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pier-Olivier Thibault
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-04-30 00:00:00.000000000 Z
11
+ date: 2015-05-11 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Blog engine on Rails
14
14
  email: pothibo@gmail.com