ecrire 0.28.3 → 0.29.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +1 -1
- data/Rakefile +22 -0
- data/lib/ecrire/app/assets/images/favicon.ico +0 -0
- data/lib/ecrire/app/assets/javascripts/admin/editor/content.coffee +3 -0
- data/lib/ecrire/app/assets/javascripts/admin/navigation/save.js.coffee +9 -2
- data/lib/ecrire/app/assets/javascripts/admin/posts/filter.js.coffee +19 -0
- data/lib/ecrire/app/assets/javascripts/admin/posts/filters/tags.js.coffee +15 -6
- data/lib/ecrire/app/assets/javascripts/admin/posts/header.coffee +17 -9
- data/lib/ecrire/app/assets/javascripts/admin/posts/list.coffee +6 -0
- data/lib/ecrire/app/assets/javascripts/admin/posts/tags/form.coffee +39 -0
- data/lib/ecrire/app/assets/javascripts/admin/posts/tags/list.coffee +27 -0
- data/lib/ecrire/app/assets/javascripts/admin/posts/tags/tag.coffee +17 -0
- data/lib/ecrire/app/assets/javascripts/admin/posts/tags.coffee +11 -0
- data/lib/ecrire/app/assets/javascripts/admin/posts/title.coffee +6 -39
- data/lib/ecrire/app/assets/javascripts/admin/posts/titles.coffee +8 -0
- data/lib/ecrire/app/assets/javascripts/shared/popup.js.coffee +17 -4
- data/lib/ecrire/app/assets/stylesheets/admin/header.scss +126 -17
- data/lib/ecrire/app/assets/stylesheets/admin/navigation.scss +5 -1
- data/lib/ecrire/app/assets/stylesheets/admin/posts.scss +80 -281
- data/lib/ecrire/app/assets/stylesheets/admin/preview.scss +55 -0
- data/lib/ecrire/app/assets/stylesheets/admin/tags.scss +59 -0
- data/lib/ecrire/app/assets/stylesheets/admin/title.scss +79 -89
- data/lib/ecrire/app/assets/stylesheets/shared/popup.scss +4 -20
- data/lib/ecrire/app/assets/stylesheets/vendor/prism.scss +1 -0
- data/lib/ecrire/app/controllers/admin/posts/tags_controller.rb +30 -2
- data/lib/ecrire/app/controllers/admin/posts/titles_controller.rb +10 -5
- data/lib/ecrire/app/controllers/admin/posts_controller.rb +10 -10
- data/lib/ecrire/app/helpers/admin/posts_helper.rb +7 -3
- data/lib/ecrire/app/helpers/application_helper.rb +20 -0
- data/lib/ecrire/app/helpers/content_tag_helper.rb +4 -0
- data/lib/ecrire/app/models/admin/post.rb +23 -0
- data/lib/ecrire/app/models/post.rb +1 -1
- data/lib/ecrire/app/models/tag.rb +8 -0
- data/lib/ecrire/app/views/admin/posts/_post.html.erb +9 -0
- data/lib/ecrire/app/views/admin/posts/edit.html.erb +21 -61
- data/lib/ecrire/app/views/admin/posts/header/_base.html.erb +54 -0
- data/lib/ecrire/app/views/admin/posts/index.html.erb +52 -33
- data/lib/ecrire/app/views/admin/posts/index.js.erb +1 -1
- data/lib/ecrire/app/views/admin/posts/show.html.erb +5 -23
- data/lib/ecrire/app/views/admin/posts/tags/_tag.html.erb +11 -2
- data/lib/ecrire/app/views/admin/posts/tags/_tags.html.erb +12 -0
- data/lib/ecrire/app/views/admin/posts/tags/create.js.erb +2 -0
- data/lib/ecrire/app/views/admin/posts/tags/index.js.erb +1 -0
- data/lib/ecrire/app/views/admin/posts/tags/toggle.js.erb +2 -1
- data/lib/ecrire/app/views/admin/posts/titles/_form.html.erb +2 -2
- data/lib/ecrire/app/views/admin/posts/titles/_index.html.erb +10 -0
- data/lib/ecrire/app/views/admin/posts/titles/_titles.html.erb +6 -0
- data/lib/ecrire/app/views/admin/posts/titles/index.html.erb +2 -37
- data/lib/ecrire/app/views/admin/posts/titles/index.js.erb +2 -0
- data/lib/ecrire/app/views/admin/posts/titles/update.js.erb +1 -0
- data/lib/ecrire/app/views/admin/tags/_tags.html.erb +6 -10
- data/lib/ecrire/app/views/admin/tags/index.js.erb +1 -1
- data/lib/ecrire/app/views/layouts/admin/application.html.erb +1 -1
- data/lib/ecrire/application.rb +0 -2
- data/lib/ecrire/commands/console.rb +1 -1
- data/lib/ecrire/config/environment/development.rb +2 -0
- data/lib/ecrire/db/migrate/20140618321984_add_properties_to_posts.rb +1 -1
- data/lib/ecrire/onboarding/assets/stylesheets/shared/base.scss +11 -10
- data/lib/ecrire/onboarding/assets/stylesheets/shared/complete.scss +1 -0
- data/lib/ecrire/onboarding/assets/stylesheets/shared/welcome.scss +1 -1
- data/lib/ecrire/routes.rb +1 -1
- data/lib/ecrire/theme/template/assets/stylesheets/shared/{base.css.scss → base.scss} +4 -18
- data/lib/ecrire/theme/template/assets/stylesheets/shared/code.scss +33 -0
- data/lib/ecrire/theme/template/assets/stylesheets/shared/{header.css.scss → header.scss} +13 -3
- data/lib/ecrire/theme/template/assets/stylesheets/shared/{posts.css.scss → posts.scss} +10 -0
- data/lib/ecrire/theme/template/controllers/posts_controller.rb +0 -4
- data/lib/ecrire/theme/template/secrets.yml +4 -4
- data/lib/ecrire/theme/template/views/layouts/application.html.erb +2 -2
- data/lib/ecrire/version.rb +1 -1
- data/lib/ecrire.rb +1 -0
- data/test/editor/models/post_test.rb +1 -1
- data/test/theme/theme/views/layouts/application.html.erb +1 -0
- metadata +35 -18
- data/lib/ecrire/app/assets/javascripts/admin/posts/filters/filter.js.coffee +0 -21
- data/lib/ecrire/app/assets/javascripts/admin/posts/tag.js.coffee +0 -11
- data/lib/ecrire/app/views/admin/posts/_posts.html.erb +0 -26
- /data/lib/ecrire/app/assets/javascripts/admin/posts/{new.js.coffee → new.coffee} +0 -0
- /data/lib/ecrire/app/assets/javascripts/admin/posts/{toggle.js.coffee → toggle.coffee} +0 -0
- /data/lib/ecrire/theme/template/assets/stylesheets/browser/{base.css.scss → base.scss} +0 -0
- /data/lib/ecrire/theme/template/assets/stylesheets/{browser.css.scss → browser.scss} +0 -0
- /data/lib/ecrire/theme/template/assets/stylesheets/mobile/{base.css.scss → base.scss} +0 -0
- /data/lib/ecrire/theme/template/assets/stylesheets/{mobile.css.scss → mobile.scss} +0 -0
- /data/lib/ecrire/theme/template/assets/stylesheets/shared/{tags.css.scss → tags.scss} +0 -0
- /data/lib/ecrire/theme/template/assets/stylesheets/tablet/{base.css.scss → base.scss} +0 -0
- /data/lib/ecrire/theme/template/assets/stylesheets/{tablet.css.scss → tablet.scss} +0 -0
- /data/lib/ecrire/theme/template/assets/stylesheets/{variables.css.scss → variables.scss} +0 -0
@@ -1,35 +1,54 @@
|
|
1
|
-
<%= content_tag :header, as: 'Posts.Filter', href: admin_posts_path do %>
|
2
|
-
<section class='status'>
|
3
|
-
</section>
|
4
|
-
|
5
|
-
<section class='search'>
|
6
|
-
<%= content_tag :div, href: admin_tags_path, as: 'Posts.Filter.Tags' do %>
|
7
|
-
<template for='Posts.Filter.Tags'>
|
8
|
-
<svg class='placeholder' x="0px" y="0px" viewBox='0 0 20 20'>
|
9
|
-
viewBox="0 0 20 20" enable-background="new 0 0 20 20" xml:space="preserve">
|
10
|
-
<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
|
11
|
-
C19.162,4.575,19.053,5.128,18.662,5.521z"/>
|
12
|
-
</svg>
|
13
|
-
|
14
|
-
<svg class='clear' x="0px" y="0px" viewBox="0 0 20 20" enable-background="new 0 0 20 20" xml:space="preserve">
|
15
|
-
<path d="M10,1.6c-4.639,0-8.4,3.761-8.4,8.4c0,4.639,3.761,8.4,8.4,8.4s8.4-3.761,8.4-8.4C18.4,5.361,14.639,1.6,10,1.6z
|
16
|
-
M14.789,13.061l-1.729,1.729L10,11.729l-3.061,3.06l-1.729-1.729L8.272,10L5.211,6.939L6.94,5.211L10,8.271l3.061-3.061
|
17
|
-
l1.729,1.729L11.728,10L14.789,13.061z"/>
|
18
|
-
</svg>
|
19
|
-
|
20
|
-
<span class='tag'></span>
|
21
|
-
</template>
|
22
|
-
<% end %>
|
23
|
-
|
24
|
-
<input type='text' placeholder='Search for a post' class='search' />
|
25
|
-
|
26
|
-
</section>
|
27
|
-
|
28
|
-
<section class='new'>
|
29
|
-
<%= link_to 'New post', new_admin_post_path %>
|
30
|
-
</section>
|
31
|
-
<% end %>
|
32
|
-
|
33
1
|
<section class='posts'>
|
34
|
-
|
2
|
+
<aside>
|
3
|
+
|
4
|
+
<%= link_to 'New post', new_admin_post_path, class: %w(new post) %>
|
5
|
+
|
6
|
+
</aside>
|
7
|
+
|
8
|
+
<div class='posts list filters'>
|
9
|
+
<div class='search'>
|
10
|
+
<%= content_tag :div, href: admin_tags_path, as: 'Posts.Filter.Tags' do %>
|
11
|
+
<input type='hidden' name='posts[tag]' form='PostsFilter' />
|
12
|
+
<template for='Posts.Filter.Tags'>
|
13
|
+
<svg class='placeholder' x="0px" y="0px" viewBox='0 0 20 20'>
|
14
|
+
viewBox="0 0 20 20" enable-background="new 0 0 20 20" xml:space="preserve">
|
15
|
+
<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
|
16
|
+
C19.162,4.575,19.053,5.128,18.662,5.521z"/>
|
17
|
+
</svg>
|
18
|
+
|
19
|
+
<svg class='clear' x="0px" y="0px" viewBox="0 0 20 20" enable-background="new 0 0 20 20" xml:space="preserve">
|
20
|
+
<path d="M10,1.6c-4.639,0-8.4,3.761-8.4,8.4c0,4.639,3.761,8.4,8.4,8.4s8.4-3.761,8.4-8.4C18.4,5.361,14.639,1.6,10,1.6z
|
21
|
+
M14.789,13.061l-1.729,1.729L10,11.729l-3.061,3.06l-1.729-1.729L8.272,10L5.211,6.939L6.94,5.211L10,8.271l3.061-3.061
|
22
|
+
l1.729,1.729L11.728,10L14.789,13.061z"/>
|
23
|
+
</svg>
|
24
|
+
|
25
|
+
<span class='tag'></span>
|
26
|
+
</template>
|
27
|
+
<% end %>
|
28
|
+
|
29
|
+
<input type='text' name='posts[title]' placeholder='Search for a post' class='search' form='PostsFilter' />
|
30
|
+
|
31
|
+
</div>
|
32
|
+
<ul class='filters'>
|
33
|
+
<li>
|
34
|
+
<%= radio_button_tag 'posts[status]', 'drafted', 'drafted' == search_posts_params[:status], form: 'PostsFilter' %>
|
35
|
+
<%= label_tag 'posts_status_drafted', 'Draft' %>
|
36
|
+
</li>
|
37
|
+
<li>
|
38
|
+
<%= radio_button_tag 'posts[status]', 'published', 'published' == search_posts_params[:status], form: 'PostsFilter' %>
|
39
|
+
<%= label_tag 'posts_status_published', 'Published' %>
|
40
|
+
</li>
|
41
|
+
<li>
|
42
|
+
<%= radio_button_tag 'posts[status]', 'all', 'all' == search_posts_params[:status], form: 'PostsFilter' %>
|
43
|
+
<%= label_tag 'posts_status_all', 'All Posts' %>
|
44
|
+
</li>
|
45
|
+
</ul>
|
46
|
+
|
47
|
+
<ul class='posts' as='Posts.List'>
|
48
|
+
<%= render @posts %>
|
49
|
+
</ul>
|
50
|
+
</div>
|
35
51
|
</section>
|
52
|
+
|
53
|
+
<%= form_for :posts, url: admin_posts_path, method: 'GET', html: {name: 'posts', id: 'PostsFilter', as: 'Posts.Filter'} do |f| %>
|
54
|
+
<% end %>
|
@@ -1 +1 @@
|
|
1
|
-
e.HTML = "<%= j
|
1
|
+
e.HTML = "<%= j content_tag(:ul, render(@posts)) %>".toHTML()
|
@@ -1,27 +1,9 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
<%= content_tag :header do |header| %>
|
4
|
-
<nav>
|
5
|
-
<div class='meta'>
|
6
|
-
<%= link_to 'Edit', edit_admin_post_path(@post), class: %w(button) %>
|
7
|
-
<%= link_to 'Preview', admin_post_path(@post), class: %w(selected button) %>
|
8
|
-
<%= link_to 'Tags', admin_post_tags_path(@post), class: %w(button) %>
|
9
|
-
<%= link_to 'Title', admin_post_titles_path(@post), class: %w(button) %>
|
10
|
-
</div>
|
11
|
-
|
12
|
-
<%= content_tag :div, class: %w(publish state), href: admin_post_toggle_path(@post), method: :put, published: @post.published?, as: 'Post.Publish' do %>
|
13
|
-
<label>Published</label>
|
14
|
-
<label>Draft</label>
|
15
|
-
<% end %>
|
16
|
-
</nav>
|
17
|
-
|
18
|
-
<%= content_tag :h2, @post.title %>
|
19
|
-
|
20
|
-
<% if @post.header? %>
|
21
|
-
<% header[:style] = "background-image: url(#{@post.header.url});" %>
|
22
|
-
<% end %>
|
1
|
+
<%= content_for :post_buttons do %>
|
2
|
+
<%= link_to 'Edit', edit_admin_post_path(@post), class: %w(button) %>
|
23
3
|
<% end %>
|
24
4
|
|
25
|
-
|
5
|
+
<%= render 'admin/posts/header/base', post: @post %>
|
6
|
+
|
7
|
+
<section class='preview' id='PostPreviewContent'>
|
26
8
|
<%= content_tag :article, @post.compiled_content.try(:html_safe) %>
|
27
9
|
<section>
|
@@ -1,4 +1,13 @@
|
|
1
|
-
<%= content_tag :li
|
2
|
-
|
1
|
+
<%= content_tag :li do |li| %>
|
2
|
+
|
3
|
+
<% li[:class] << 'tag' %>
|
4
|
+
<% li[:tabindex] = tag.id %>
|
5
|
+
<% li[:as] = 'Post.Tags.Tag' %>
|
6
|
+
<% li[:method] = :put %>
|
7
|
+
<% li[:oid] = tag.id %>
|
8
|
+
<% li[:href] = admin_post_tag_toggle_path(post, tag) %>
|
9
|
+
|
10
|
+
<%= content_tag :input, nil, id: "label_#{tag.id}", type: 'checkbox', checked: post.tags.include?(tag) %>
|
11
|
+
|
3
12
|
<%= content_tag :label, tag.name, for: "label_#{tag.id}" %>
|
4
13
|
<% end %>
|
@@ -0,0 +1,12 @@
|
|
1
|
+
<%= form_tag admin_post_tags_path(post), as: 'Post.Tags.Form' do |f| %>
|
2
|
+
<%= text_field_tag 'tag[name]', nil, id: 'TagName', placeholder: 'Create a new tag', autocomplete: :off %>
|
3
|
+
<p class='message'>A new tag will be created if no match can be found. The tag it finds will be toggled.</p>
|
4
|
+
<% end %>
|
5
|
+
|
6
|
+
<ul class='tags' as='Post.Tags.List'>
|
7
|
+
<% if tags.any? %>
|
8
|
+
<%= render partial: 'admin/posts/tags/tag', collection: tags, locals: { post: post } %>
|
9
|
+
<% else %>
|
10
|
+
<li class='empty'>No tag was found.</li>
|
11
|
+
<% end %>
|
12
|
+
</ul>
|
@@ -0,0 +1 @@
|
|
1
|
+
e.HTML = "<%= j popup_tag(render('admin/posts/tags/tags', post: @post, tags: @tags), class: %w(tags)) %>".toHTML()
|
@@ -1 +1,2 @@
|
|
1
|
-
e.
|
1
|
+
e.HTML = "<%= j render('admin/posts/tags/tag', tag: @tag, post: @post) %>".toHTML()
|
2
|
+
e.TagsHTML = "<%= j post_tags(@post) %>".toHTML()
|
@@ -1,10 +1,10 @@
|
|
1
|
-
<%= form_for title, url: url, as: 'title' do |form| %>
|
1
|
+
<%= form_for title, url: url, as: 'title', remote: request.xhr? do |form| %>
|
2
2
|
<%= content_tag :div, class: %w(fieldset) do |div| %>
|
3
3
|
<% if title.errors.any? %>
|
4
4
|
<% div.css << 'errors' %>
|
5
5
|
<% end %>
|
6
6
|
|
7
|
-
<%= form.text_field :name, placeholder: 'Create a new title for this post', tabindex: 1 %>
|
7
|
+
<%= form.text_field :name, placeholder: 'Create a new title for this post', tabindex: 1, autocomplete: :off %>
|
8
8
|
|
9
9
|
<% if title.errors.any? %>
|
10
10
|
<ul class='errors'>
|
@@ -0,0 +1,10 @@
|
|
1
|
+
<% if post.published? %>
|
2
|
+
<%= render 'admin/posts/titles/form', title: title, url: admin_post_titles_path(post) %>
|
3
|
+
<% else %>
|
4
|
+
<%= render 'admin/posts/titles/form', title: title, url: admin_post_title_path(post, title) %>
|
5
|
+
<% end %>
|
6
|
+
|
7
|
+
<h3>Titles for this post</h3>
|
8
|
+
|
9
|
+
<%= render 'admin/posts/titles/titles', post: post %>
|
10
|
+
|
@@ -1,38 +1,3 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
<%= content_tag :header do |header| %>
|
4
|
-
<nav>
|
5
|
-
<div class='meta'>
|
6
|
-
<%= link_to 'Edit', edit_admin_post_path(@post), class: %w(button) %>
|
7
|
-
<%= link_to 'Preview', admin_post_path(@post), class: %w(button) %>
|
8
|
-
<%= link_to 'Tags', admin_post_tags_path(@post), class: %w(button) %>
|
9
|
-
<%= link_to 'Title', admin_post_titles_path(@post), class: %w(selected button) %>
|
10
|
-
</div>
|
11
|
-
|
12
|
-
<%= content_tag :div, class: %w(publish state), href: admin_post_toggle_path(@post), method: :put, published: @post.published?, as: 'Post.Publish' do %>
|
13
|
-
<label>Published</label>
|
14
|
-
<label>Draft</label>
|
15
|
-
<% end %>
|
16
|
-
</nav>
|
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 %>
|
24
|
-
|
25
|
-
<section>
|
26
|
-
<% if @post.published? %>
|
27
|
-
<%= render 'admin/posts/titles/form', title: @title, url: admin_post_titles_path(@post) %>
|
28
|
-
<% else %>
|
29
|
-
<%= render 'admin/posts/titles/form', title: @title, url: admin_post_title_path(@post, @title) %>
|
30
|
-
<% end %>
|
31
|
-
|
32
|
-
<h3>Titles for this post</h3>
|
33
|
-
<ul class='titles'>
|
34
|
-
<% @post.titles.select(&:persisted?).each do |title| %>
|
35
|
-
<%= render 'admin/posts/titles/title', title: title %>
|
36
|
-
<% end %>
|
37
|
-
</ul>
|
1
|
+
<section class='titles'>
|
2
|
+
<%= render 'admin/posts/titles/index', post: @post, title: @title %>
|
38
3
|
</section>
|
@@ -0,0 +1 @@
|
|
1
|
+
e.HTML = "<%= j render('admin/posts/titles/titles', post: @post, title: @title) %>".toHTML()
|
@@ -1,10 +1,6 @@
|
|
1
|
-
<
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
<% end %>
|
8
|
-
</ul>
|
9
|
-
</div>
|
10
|
-
</div>
|
1
|
+
<h2>Tags</h2>
|
2
|
+
<ul>
|
3
|
+
<% tags.each do |tag| %>
|
4
|
+
<%= render 'admin/tags/tag', tag: tag %>
|
5
|
+
<% end %>
|
6
|
+
</ul>
|
@@ -1 +1 @@
|
|
1
|
-
e.HTML = "<%= j render('admin/tags/tags', tags: @tags) %>".toHTML()
|
1
|
+
e.HTML = "<%= j popup_tag(render('admin/tags/tags', tags: @tags)) %>".toHTML()
|
@@ -2,7 +2,7 @@
|
|
2
2
|
<html>
|
3
3
|
<head>
|
4
4
|
<title>Ecrire</title>
|
5
|
-
<link rel="shortcut icon" href="<%=
|
5
|
+
<link rel="shortcut icon" href="<%= image_url("favicon.ico")%>" />
|
6
6
|
<%= stylesheet_link_tag "admin", media: "all" %>
|
7
7
|
<%= javascript_include_tag "admin" %>
|
8
8
|
<%= csrf_meta_tags %>
|
data/lib/ecrire/application.rb
CHANGED
@@ -8,8 +8,8 @@
|
|
8
8
|
}
|
9
9
|
|
10
10
|
html, body {
|
11
|
-
display
|
12
|
-
flex
|
11
|
+
@include display(flex);
|
12
|
+
@include flex(1 auto);
|
13
13
|
margin: 0;
|
14
14
|
padding: 0;
|
15
15
|
font-family: Baskerville;
|
@@ -19,12 +19,6 @@ html {
|
|
19
19
|
height: 100vh;
|
20
20
|
}
|
21
21
|
|
22
|
-
body {
|
23
|
-
@include display(flex);
|
24
|
-
@include align-items(center);
|
25
|
-
@include justify-content(center);
|
26
|
-
}
|
27
|
-
|
28
22
|
a {
|
29
23
|
color: rgb(114, 153, 204);
|
30
24
|
}
|
@@ -56,8 +50,15 @@ body {
|
|
56
50
|
font-size: 13px;
|
57
51
|
background: #F3F0EA;
|
58
52
|
color: #313126;
|
59
|
-
|
60
|
-
display
|
53
|
+
|
54
|
+
@include display(flex);
|
55
|
+
@include align-items(center);
|
56
|
+
@include justify-content(center);
|
57
|
+
@include flex-direction(column);
|
58
|
+
|
59
|
+
& > main {
|
60
|
+
width: 100%;
|
61
|
+
}
|
61
62
|
|
62
63
|
section {
|
63
64
|
margin: 0 auto;
|
data/lib/ecrire/routes.rb
CHANGED
@@ -2,6 +2,10 @@
|
|
2
2
|
box-sizing: border-box;
|
3
3
|
}
|
4
4
|
|
5
|
+
html {
|
6
|
+
min-height: 100%;
|
7
|
+
}
|
8
|
+
|
5
9
|
html, body {
|
6
10
|
@include display(flex);
|
7
11
|
@include flex(1);
|
@@ -122,22 +126,4 @@ main.customize article {
|
|
122
126
|
@include flex-direction(column);
|
123
127
|
max-width:900px;
|
124
128
|
margin: 0 auto;
|
125
|
-
|
126
|
-
pre {
|
127
|
-
background-color: $gray-blue;
|
128
|
-
padding: 0;
|
129
|
-
|
130
|
-
header {
|
131
|
-
text-align: center;
|
132
|
-
font-size: 0.8em;
|
133
|
-
font-style: italic;
|
134
|
-
padding: 0.5em 1em;
|
135
|
-
background-color: $light-gray-blue;
|
136
|
-
}
|
137
|
-
|
138
|
-
code {
|
139
|
-
padding: 1em;
|
140
|
-
display: block;
|
141
|
-
}
|
142
|
-
}
|
143
129
|
}
|
@@ -0,0 +1,33 @@
|
|
1
|
+
pre {
|
2
|
+
background-color: $gray-blue;
|
3
|
+
padding: 0;
|
4
|
+
|
5
|
+
header {
|
6
|
+
text-align: center;
|
7
|
+
font-size: 0.8em;
|
8
|
+
font-style: italic;
|
9
|
+
padding: 0.5em 1em;
|
10
|
+
background-color: $light-gray-blue;
|
11
|
+
}
|
12
|
+
|
13
|
+
code {
|
14
|
+
padding: 1em;
|
15
|
+
display: block;
|
16
|
+
}
|
17
|
+
}
|
18
|
+
|
19
|
+
:not(pre) > code {
|
20
|
+
background-color: $gray-blue;
|
21
|
+
padding: 0.1em 0.5em;
|
22
|
+
border-radius: 3px;
|
23
|
+
font-size: 0.9em;
|
24
|
+
}
|
25
|
+
|
26
|
+
pre > code, pre > header {
|
27
|
+
font-size: 0.8em;
|
28
|
+
}
|
29
|
+
|
30
|
+
pre > header {
|
31
|
+
word-wrap: break-word;
|
32
|
+
}
|
33
|
+
|
@@ -2,21 +2,31 @@ main > header {
|
|
2
2
|
@include display(flex);
|
3
3
|
@include flex-direction(column);
|
4
4
|
|
5
|
-
padding: 2em
|
5
|
+
padding: 0 1em 2em 0;
|
6
|
+
font-size: 1.2em;
|
6
7
|
background-color: $navy-blue;
|
7
8
|
color: $light-blue;
|
9
|
+
min-height: 300px;
|
10
|
+
height: 30vh;
|
8
11
|
|
9
12
|
nav {
|
10
13
|
@include display(flex);
|
14
|
+
@include flex(1 auto);
|
15
|
+
@include flex-direction(column);
|
11
16
|
@include justify-content(space-between);
|
12
17
|
@include align-items(center);
|
13
18
|
|
14
|
-
|
19
|
+
ol {
|
15
20
|
margin: 0;
|
16
21
|
}
|
17
22
|
|
18
|
-
|
23
|
+
a.logo {
|
19
24
|
font-family: courier;
|
25
|
+
font-size: 10em;
|
26
|
+
text-decoration: none;
|
27
|
+
margin: auto 0;
|
28
|
+
line-height: 100%;
|
29
|
+
color: lighten($navy-blue, 10%);
|
20
30
|
}
|
21
31
|
|
22
32
|
ol {
|
@@ -25,6 +25,16 @@ ol.posts {
|
|
25
25
|
}
|
26
26
|
}
|
27
27
|
|
28
|
+
div.posts.empty {
|
29
|
+
@include flex(1);
|
30
|
+
@include align-items(center);
|
31
|
+
@include justify-content(center);
|
32
|
+
p {
|
33
|
+
color: darken($light-gray-blue, 15%);
|
34
|
+
text-shadow: 0 1px 0 lighten($light-gray-blue, 15%);
|
35
|
+
}
|
36
|
+
}
|
37
|
+
|
28
38
|
ol.posts li.latest {
|
29
39
|
margin: 6em 0;
|
30
40
|
background: $light-gray-blue;
|
@@ -3,10 +3,6 @@ class PostsController < Ecrire::ThemeController
|
|
3
3
|
|
4
4
|
def index
|
5
5
|
@posts = posts.published.includes(:titles).order('published_at DESC').page(params[:page]).per(params[:per])
|
6
|
-
if params[:page] == 1
|
7
|
-
@latest = @posts.first
|
8
|
-
@posts = @posts.where.not(id: @latest.id)
|
9
|
-
end
|
10
6
|
@tags = Tag.all
|
11
7
|
|
12
8
|
respond_to do |format|
|
@@ -2,10 +2,10 @@
|
|
2
2
|
development: &1
|
3
3
|
adapter: postgresql
|
4
4
|
database: ecrire
|
5
|
-
user:
|
6
|
-
password:
|
5
|
+
user: ''
|
6
|
+
password: ''
|
7
7
|
encoding: utf8
|
8
|
-
secret_key:
|
9
|
-
secret_key_base:
|
8
|
+
secret_key: 0e597dc0e17ad5af51d0f25b5a479044
|
9
|
+
secret_key_base: 0e597dc0e17ad5af51d0f25b5a479044
|
10
10
|
test: *1
|
11
11
|
production: *1
|
@@ -23,10 +23,10 @@
|
|
23
23
|
<header>
|
24
24
|
|
25
25
|
<nav>
|
26
|
-
|
26
|
+
<%= link_to 'E', '/', class: %w(logo) %>
|
27
27
|
|
28
28
|
<ol>
|
29
|
-
<li><%= link_to '
|
29
|
+
<li><%= link_to 'Get started', '/customize' %></li>
|
30
30
|
|
31
31
|
<% if !signed_in? %>
|
32
32
|
<li><%= link_to 'Log in', new_session_path %></li>
|
data/lib/ecrire/version.rb
CHANGED
data/lib/ecrire.rb
CHANGED
@@ -0,0 +1 @@
|
|
1
|
+
<%= yield %>
|