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
@@ -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
- <%= render 'admin/posts/posts', published: @posts.published, drafted: @posts.drafted %>
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 render('posts', published: @posts.published, drafted: @posts.drafted) %>".toHTML()
1
+ e.HTML = "<%= j content_tag(:ul, render(@posts)) %>".toHTML()
@@ -1,27 +1,9 @@
1
- <% content_for :class, 'post view' %>
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
- <section class='preview'>
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, as: 'Post.Tag', oid: tag.id, href: admin_post_tag_toggle_path(@post, tag), method: :put do %>
2
- <%= content_tag :input, nil, id: "label_#{tag.id}", type: 'checkbox', checked: @post.tags.include?(tag) %>
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,2 @@
1
+ e.HTML = "<%= j render('admin/posts/tags/tag', tag: @tag, post: @post) %>".toHTML()
2
+ e.TagsHTML = "<%= j post_tags(@post) %>".toHTML()
@@ -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.TagIncluded = <%= @post.tags.include? @tag %>
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
+
@@ -0,0 +1,6 @@
1
+ <ul class='titles' as='Post.Titles'>
2
+ <% post.titles.select(&:persisted?).each do |title| %>
3
+ <%= render 'admin/posts/titles/title', title: title %>
4
+ <% end %>
5
+ </ul>
6
+
@@ -1,38 +1,3 @@
1
- <% content_for :class, 'posts view' %>
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,2 @@
1
+ e.HTML = "<%= j popup_tag(render('admin/posts/titles/index', post: @post, title: @title), class: %w(popup titles)) %>".toHTML()
2
+
@@ -0,0 +1 @@
1
+ e.HTML = "<%= j render('admin/posts/titles/titles', post: @post, title: @title) %>".toHTML()
@@ -1,10 +1,6 @@
1
- <div class='overlay' as='Overlay'>
2
- <div class='popup' id='TagsList'>
3
- <h2>Tags</h2>
4
- <ul>
5
- <% tags.each do |tag| %>
6
- <%= render 'admin/tags/tag', tag: tag %>
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="<%= url_for("/favicon.ico")%>" />
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 %>
@@ -24,8 +24,6 @@ module Ecrire
24
24
  class Application < Rails::Application
25
25
  require 'ecrire/config/environment'
26
26
 
27
- alias :require_environment! :initialize!
28
-
29
27
  config.before_initialize do
30
28
  if paths['config/database'].existent.any?
31
29
  require 'ecrire/theme/engine'
@@ -11,7 +11,7 @@ module Ecrire
11
11
  require 'rails/commands/console'
12
12
 
13
13
  shift_argv!
14
- Ecrire::Application.require_environment!
14
+ Ecrire::Application.initialize!
15
15
 
16
16
  Rails::Console.start(Ecrire::Application, *ARGV)
17
17
  end
@@ -1,3 +1,5 @@
1
+ require 'byebug'
2
+
1
3
  Ecrire::Application.configure do
2
4
  config.cache_classes = false
3
5
  config.eager_load = false
@@ -1,6 +1,6 @@
1
1
  class AddPropertiesToPosts < ActiveRecord::Migration
2
2
  def change
3
- execute 'CREATE EXTENSION hstore'
3
+ execute 'CREATE EXTENSION IF NOT EXISTS hstore'
4
4
  add_column :posts, :properties, :hstore
5
5
  end
6
6
  end
@@ -8,8 +8,8 @@
8
8
  }
9
9
 
10
10
  html, body {
11
- display: flex;
12
- flex: 1 auto;
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
- flex-direction: column;
60
- display: flex;
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;
@@ -1,3 +1,4 @@
1
1
  #OnboardingIndex section.complete {
2
+ margin: 0 auto;
2
3
  font-size: 1.4em;
3
4
  }
@@ -31,7 +31,7 @@
31
31
  @include align-items(center);
32
32
  @include justify-content(center);
33
33
  @include flex-direction(column);
34
- margin: 3em 0 0 0;
34
+ margin: 3em auto 0 auto;
35
35
  min-height: 50vh;
36
36
  min-width: 60vw;
37
37
  &.welcome {
data/lib/ecrire/routes.rb CHANGED
@@ -13,7 +13,7 @@ Ecrire::Application.routes.draw do
13
13
  get 'help', controller: :posts, action: :help
14
14
  end
15
15
 
16
- resources :tags, only: [:index], module: 'posts' do
16
+ resources :tags, only: [:index, :create], module: 'posts' do
17
17
  put :toggle
18
18
  end
19
19
 
@@ -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 1em;
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
- h1, ol {
19
+ ol {
15
20
  margin: 0;
16
21
  }
17
22
 
18
- h1 {
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: postgres
6
- password: a69164528b8b6622e730f722c5d88386
5
+ user: ''
6
+ password: ''
7
7
  encoding: utf8
8
- secret_key: 7681ee4652c6f230cfdb96127826c438
9
- secret_key_base: 7681ee4652c6f230cfdb96127826c438
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
- <h1><%= link_to 'E', '/' %></h1>
26
+ <%= link_to 'E', '/', class: %w(logo) %>
27
27
 
28
28
  <ol>
29
- <li><%= link_to 'Customize', '/customize' %></li>
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>
@@ -1,3 +1,3 @@
1
1
  module Ecrire
2
- VERSION = '0.28.3'
2
+ VERSION = '0.29.0'
3
3
  end
data/lib/ecrire.rb CHANGED
@@ -16,6 +16,7 @@ module Ecrire
16
16
  require 'bundler/setup'
17
17
  require 'rails/all'
18
18
 
19
+ require 'jbuilder'
19
20
  require 'bourbon'
20
21
  require 'sass-rails'
21
22
  require 'sprockets'
@@ -42,7 +42,7 @@ class PostTest < ActiveSupport::TestCase
42
42
  end
43
43
 
44
44
  test "fetch draft post" do
45
- @posts = Post.status("draft")
45
+ @posts = Post.status("drafted")
46
46
  assert_equal @posts.count, Post.drafted.count
47
47
  @posts.each do |post|
48
48
  assert post.draft?
@@ -0,0 +1 @@
1
+ <%= yield %>