notee 1.0.7 → 1.0.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (35) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/notee/application.js +45 -76973
  3. data/app/controllers/notee/comments_controller.rb +1 -1
  4. data/app/controllers/notee/tokens_controller.rb +15 -0
  5. data/app/models/notee/post.rb +1 -1
  6. data/app/models/notee/user.rb +0 -6
  7. data/app/views/notee/partials/_comment_box.html.erb +109 -120
  8. data/app/views/notee/partials/_meta.html.erb +3 -1
  9. data/app/views/notee/tokens/new.html.erb +16 -4
  10. data/config/routes.rb +2 -16
  11. data/db/migrate/20160605141437_create_notee_posts.rb +56 -1
  12. data/db/migrate/20160809145754_create_notee_users.rb +5 -0
  13. data/lib/notee/helpers/notee_helper.rb +8 -4
  14. data/lib/notee/version.rb +1 -1
  15. data/lib/tasks/config/notee.rb +1 -1
  16. data/lib/tasks/controllers/errors_controller.rb +23 -0
  17. data/lib/tasks/controllers/notee_controller.rb +1 -0
  18. data/lib/tasks/notee_tasks.rake +86 -48
  19. data/lib/tasks/stylesheets/notee/social/social.css +1 -0
  20. data/lib/tasks/views/layouts/notee_application.html.erb +6 -0
  21. data/lib/tasks/views/notee/about.html.erb +36 -41
  22. data/lib/tasks/views/notee/archives.html.erb +9 -14
  23. data/lib/tasks/views/notee/categories.html.erb +9 -14
  24. data/lib/tasks/views/notee/errors/internal_server_error.html.erb +5 -0
  25. data/lib/tasks/views/notee/errors/not_found.html.erb +5 -0
  26. data/lib/tasks/views/notee/partials/_footer.html.erb +5 -3
  27. data/lib/tasks/views/notee/partials/_header.html.erb +11 -1
  28. data/lib/tasks/views/notee/posts.html.erb +41 -44
  29. data/lib/tasks/views/notee/show.html.erb +29 -34
  30. data/lib/tasks/views/notee/writers.html.erb +5 -10
  31. data/test/controllers/notee/categories_controller_test.rb +2 -2
  32. data/test/controllers/notee/comments_controller_test.rb +2 -2
  33. data/test/controllers/notee/images_controller_test.rb +2 -2
  34. data/test/controllers/notee/posts_controller_test.rb +2 -2
  35. metadata +6 -2
@@ -1,3 +1,5 @@
1
- <div class="notee_footer">
2
- <p>Copyright <%= Date.today().strftime("%Y") %>. Your name All rights reserved.</p>
3
- </div>
1
+ <div class="notee_footer">
2
+ <p>Copyright <%= Date.today().strftime("%Y") %>. Your name All rights reserved.</p>
3
+ </div>
4
+ </body>
5
+ </html>
@@ -1,4 +1,14 @@
1
- <%= notee_meta(@notee_meta) %>
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta name="viewport" content="width=device-width,initial-scale=1.0" />
5
+ <%= csrf_meta_tags %>
6
+ <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track': 'reload' %>
7
+ <%= javascript_include_tag 'application', 'data-turbolinks-track': 'reload' %>
8
+ <%= notee_meta(@notee_meta) %>
9
+ </head>
10
+
11
+ <body>
2
12
  <div class="notee_header">
3
13
  <div class="notee_wrapper">
4
14
  <div class="notee_header_meta">
@@ -1,53 +1,50 @@
1
- <%= render :partial => "notee/partials/header.html.erb" %>
2
- <div class="notee_wrapper">
3
- <div class="notee_main">
4
- <h2><%= @notee_title %></h2>
5
- <% @posts.each do |post| %>
6
- <div class="notee_list">
7
-
8
- <!-- title -->
9
- <a href="/<%= post.slug %>">
10
- <h3><%= post.title %></h3>
11
- </a>
1
+ <div class="notee_main">
2
+ <h2><%= @notee_title %></h2>
3
+ <% @posts.each do |post| %>
4
+ <div class="notee_list">
12
5
 
13
- <div class="notee_list_meta">
14
- <!-- publish-->
15
- <span class="notee_list_meta_content">
16
- <%= post.published_at.strftime("%Y/%m/%d") %>,
17
- </span>
6
+ <!-- title -->
7
+ <a href="/<%= post.slug %>">
8
+ <h3><%= post.title %></h3>
9
+ </a>
18
10
 
19
- <!-- writer -->
20
- <span class="notee_list_meta_content">
21
- writer: <a href="/writers/<%= post.user.name %>"><%= post.user.name %></a>
22
- </span>
23
- </div>
11
+ <div class="notee_list_meta">
12
+ <!-- publish-->
13
+ <span class="notee_list_meta_content">
14
+ <%= post.published_at.strftime("%Y/%m/%d") %>,
15
+ </span>
24
16
 
25
- <div class="notee_list_content">
26
- <!--thumbnail-->
17
+ <!-- writer -->
18
+ <span class="notee_list_meta_content">
19
+ writer: <a href="/writers/<%= post.user.name %>"><%= post.user.name %></a>
20
+ </span>
21
+ </div>
22
+
23
+ <div class="notee_list_content">
24
+ <!--thumbnail-->
25
+ <a href="/<%= post.slug %>">
26
+ <img src="/notee/<%= post.thumbnail.content %>">
27
+ </a>
28
+
29
+ <!-- content -->
30
+ <div class="notee_list_content_p">
27
31
  <a href="/<%= post.slug %>">
28
- <img src="/notee/<%= post.thumbnail.content %>">
32
+ <p><%= post.seo_description %></p>
29
33
  </a>
30
-
31
- <!-- content -->
32
- <div class="notee_list_content_p">
33
- <a href="/<%= post.slug %>">
34
- <p><%= post.seo_description %></p>
35
- </a>
36
- </div>
37
34
  </div>
35
+ </div>
38
36
 
39
- <div class="notee_list_meta">
40
- <!-- category -->
41
- <span class="notee_list_meta_content">
42
- category:
43
- <span class="notee_list_meta_content notee_list_category">
44
- <a href="/categories/<%= post.category.slug %>"><%= post.category.name %></a>
45
- </span>
46
- </span>
47
- </div>
37
+ <div class="notee_list_meta">
38
+ <!-- category -->
39
+ <span class="notee_list_meta_content">
40
+ category:
41
+ <span class="notee_list_meta_content notee_list_category">
42
+ <a href="/categories/<%= post.category.slug %>"><%= post.category.name %></a>
43
+ </span>
44
+ </span>
48
45
  </div>
49
- <% end %>
50
- </div>
51
- <%= render :partial => "notee/partials/sidebar.html.erb" %>
46
+ </div>
47
+ <% end %>
52
48
  </div>
53
- <%= render :partial => "notee/partials/footer.html.erb" %>
49
+
50
+
@@ -2,48 +2,43 @@
2
2
  <!-- you should change your favorite syntax -->
3
3
  <%= stylesheet_link_tag "notee/highlight/default", :media => "all" %>
4
4
 
5
- <%= render :partial => "notee/partials/header.html.erb" %>
6
- <div class="notee_wrapper">
7
- <div class="notee_main">
8
- <div class="notee_main_content">
9
- <h1><%= @post.title %></h1>
10
-
11
- <div class="notee_list_meta">
12
- <!-- publish-->
13
- <span class="notee_list_meta_content">
14
- <%= @post.published_at.strftime("%Y/%m/%d") %>,
15
- </span>
5
+ <div class="notee_main">
6
+ <div class="notee_main_content">
7
+ <h1><%= @post.title %></h1>
16
8
 
17
- <!-- writer -->
18
- <span class="notee_list_meta_content">
19
- writer: <a href="/writers/<%= @post.user.name %>"><%= @post.user.name %></a>
20
- </span>
9
+ <div class="notee_list_meta">
10
+ <!-- publish-->
11
+ <span class="notee_list_meta_content">
12
+ <%= @post.published_at.strftime("%Y/%m/%d") %>,
13
+ </span>
14
+
15
+ <!-- writer -->
16
+ <span class="notee_list_meta_content">
17
+ writer: <a href="/writers/<%= @post.user.name %>"><%= @post.user.name %></a>
18
+ </span>
21
19
 
22
- </div>
20
+ </div>
23
21
 
24
- <%= render :partial => "notee/partials/social.html.erb" %>
22
+ <%= render :partial => "notee/partials/social.html.erb" %>
25
23
 
26
- <%= notee_content(@post) %>
24
+ <%= notee_content(@post) %>
27
25
 
28
- <%= render :partial => "notee/partials/social.html.erb" %>
26
+ <%= render :partial => "notee/partials/social.html.erb" %>
29
27
 
30
- <div class="notee_list_meta">
31
- <!-- category -->
32
- <span class="notee_list_meta_content righting">
33
- category:
34
- <span class="notee_list_meta_content notee_list_category">
35
- <a href="/categories/<%= @post.category.slug %>"><%= @post.category.name %></a>
36
- </span>
28
+ <div class="notee_list_meta">
29
+ <!-- category -->
30
+ <span class="notee_list_meta_content righting">
31
+ category:
32
+ <span class="notee_list_meta_content notee_list_category">
33
+ <a href="/categories/<%= @post.category.slug %>"><%= @post.category.name %></a>
37
34
  </span>
38
- </div>
35
+ </span>
39
36
  </div>
37
+ </div>
40
38
 
41
- <h4>Comments</h4>
42
- <%= notee_comment_box(@post.id) %>
39
+ <h4>Comments</h4>
40
+ <%= notee_comment_box(@post.id) %>
43
41
 
44
- <h4>Written by</h4>
45
- <%= render :partial => "notee/partials/profile.html.erb", :locals => {writer: @post.user} %>
46
- </div>
47
- <%= render :partial => "notee/partials/sidebar.html.erb" %>
42
+ <h4>Written by</h4>
43
+ <%= render :partial => "notee/partials/profile.html.erb", :locals => {writer: @post.user} %>
48
44
  </div>
49
- <%= render :partial => "notee/partials/footer.html.erb" %>
@@ -1,11 +1,6 @@
1
- <%= render :partial => "notee/partials/header.html.erb" %>
2
- <div class="notee_wrapper">
3
- <div class="notee_main">
4
- <h2>Writer List</h2>
5
- <% @writers.each do |writer| %>
6
- <%= render :partial => "notee/partials/profile.html.erb", :locals => {writer: writer} %>
7
- <% end %>
8
- </div>
9
- <%= render :partial => "notee/partials/sidebar.html.erb" %>
1
+ <div class="notee_main">
2
+ <h2>Writer List</h2>
3
+ <% @writers.each do |writer| %>
4
+ <%= render :partial => "notee/partials/profile.html.erb", :locals => {writer: writer} %>
5
+ <% end %>
10
6
  </div>
11
- <%= render :partial => "notee/partials/footer.html.erb" %>
@@ -20,7 +20,7 @@ module Notee
20
20
 
21
21
  test "should create category" do
22
22
  assert_difference('Category.count') do
23
- post :create, category: { name: @category.name, parent_id: @category.parent_id, slug: @category.slug, status: @category.status }
23
+ post :create, category: {name: @category.name, parent_id: @category.parent_id, slug: @category.slug, status: @category.status }
24
24
  end
25
25
 
26
26
  assert_redirected_to category_path(assigns(:category))
@@ -37,7 +37,7 @@ module Notee
37
37
  end
38
38
 
39
39
  test "should update category" do
40
- patch :update, id: @category, category: { name: @category.name, parent_id: @category.parent_id, slug: @category.slug, status: @category.status }
40
+ patch :update, id: @category, category: {name: @category.name, parent_id: @category.parent_id, slug: @category.slug, status: @category.status }
41
41
  assert_redirected_to category_path(assigns(:category))
42
42
  end
43
43
 
@@ -20,7 +20,7 @@ module Notee
20
20
 
21
21
  test "should create comment" do
22
22
  assert_difference('Comment.count') do
23
- post comments_url, params: { comment: { content: @comment.content, email: @comment.email, name: @comment.name, post_id: @comment.post_id } }
23
+ post comments_url, params: {comment: {content: @comment.content, email: @comment.email, name: @comment.name, post_id: @comment.post_id } }
24
24
  end
25
25
 
26
26
  assert_redirected_to comment_url(Comment.last)
@@ -37,7 +37,7 @@ module Notee
37
37
  end
38
38
 
39
39
  test "should update comment" do
40
- patch comment_url(@comment), params: { comment: { content: @comment.content, email: @comment.email, name: @comment.name, post_id: @comment.post_id } }
40
+ patch comment_url(@comment), params: {comment: {content: @comment.content, email: @comment.email, name: @comment.name, post_id: @comment.post_id } }
41
41
  assert_redirected_to comment_url(@comment)
42
42
  end
43
43
 
@@ -20,7 +20,7 @@ module Notee
20
20
 
21
21
  test "should create image" do
22
22
  assert_difference('Image.count') do
23
- post :create, image: { content: @image.content }
23
+ post :create, image: {content: @image.content }
24
24
  end
25
25
 
26
26
  assert_redirected_to image_path(assigns(:image))
@@ -37,7 +37,7 @@ module Notee
37
37
  end
38
38
 
39
39
  test "should update image" do
40
- patch :update, id: @image, image: { content: @image.content }
40
+ patch :update, id: @image, image: {content: @image.content }
41
41
  assert_redirected_to image_path(assigns(:image))
42
42
  end
43
43
 
@@ -20,7 +20,7 @@ module Notee
20
20
 
21
21
  test "should create post" do
22
22
  assert_difference('Post.count') do
23
- post :create, post: { category_id: @post.category_id, content: @post.content, published_at: @post.published_at, seo_description: @post.seo_description, seo_keyword: @post.seo_keyword, slug: @post.slug, status: @post.status, thumbnail_id: @post.thumbnail_id, title: @post.title }
23
+ post :create, post: {category_id: @post.category_id, content: @post.content, published_at: @post.published_at, seo_description: @post.seo_description, seo_keyword: @post.seo_keyword, slug: @post.slug, status: @post.status, thumbnail_id: @post.thumbnail_id, title: @post.title }
24
24
  end
25
25
 
26
26
  assert_redirected_to post_path(assigns(:post))
@@ -37,7 +37,7 @@ module Notee
37
37
  end
38
38
 
39
39
  test "should update post" do
40
- patch :update, id: @post, post: { category_id: @post.category_id, content: @post.content, published_at: @post.published_at, seo_description: @post.seo_description, seo_keyword: @post.seo_keyword, slug: @post.slug, status: @post.status, thumbnail_id: @post.thumbnail_id, title: @post.title }
40
+ patch :update, id: @post, post: {category_id: @post.category_id, content: @post.content, published_at: @post.published_at, seo_description: @post.seo_description, seo_keyword: @post.seo_keyword, slug: @post.slug, status: @post.status, thumbnail_id: @post.thumbnail_id, title: @post.title }
41
41
  assert_redirected_to post_path(assigns(:post))
42
42
  end
43
43
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: notee
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.7
4
+ version: 1.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - funaota
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-12-08 00:00:00.000000000 Z
11
+ date: 2016-12-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -210,6 +210,7 @@ files:
210
210
  - lib/notee/version.rb
211
211
  - lib/tasks/config/notee.rb
212
212
  - lib/tasks/config/schedule.rb
213
+ - lib/tasks/controllers/errors_controller.rb
213
214
  - lib/tasks/controllers/notee_controller.rb
214
215
  - lib/tasks/images/notee/default.png
215
216
  - lib/tasks/images/notee/profile/default.png
@@ -298,9 +299,12 @@ files:
298
299
  - lib/tasks/stylesheets/notee/normalize.css
299
300
  - lib/tasks/stylesheets/notee/notee_default.css
300
301
  - lib/tasks/stylesheets/notee/social/social.css
302
+ - lib/tasks/views/layouts/notee_application.html.erb
301
303
  - lib/tasks/views/notee/about.html.erb
302
304
  - lib/tasks/views/notee/archives.html.erb
303
305
  - lib/tasks/views/notee/categories.html.erb
306
+ - lib/tasks/views/notee/errors/internal_server_error.html.erb
307
+ - lib/tasks/views/notee/errors/not_found.html.erb
304
308
  - lib/tasks/views/notee/partials/_footer.html.erb
305
309
  - lib/tasks/views/notee/partials/_header.html.erb
306
310
  - lib/tasks/views/notee/partials/_profile.html.erb