home_page_blog 0.0.1 → 0.0.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: 742885d131a2cb8a2a15c2af9824e5485f11310b
4
- data.tar.gz: 9f6968552bb9635effdea6d0e0c5899c296041db
3
+ metadata.gz: 811d801f3160d923ccbf3adf260509116f608ae2
4
+ data.tar.gz: 5cacf55233e187f5c1a8c6f21c6ffd83cb5dd7c2
5
5
  SHA512:
6
- metadata.gz: 6c39fc829bdbfd47864e8f2228c297ed4b12b9fa2c196346f335fe03cfc753e0abcc6e3c8d6a70e1b488923c93d0e8fbc773d14fbeaa86a904e761d2ebd914b2
7
- data.tar.gz: 3d9ca98d7626f67cecffb721511751c1a492cb89c21e712cac67f0ebf0ac3cecfc2e6ef17326e33d17166049cc4ec3f82cc37844d5f352ca99da609b9a9c7ba1
6
+ metadata.gz: 71921bb1fe499a15f8f6965a11e3c8a335ac6a0af5835378839ec828296bb4d63a43d3d6764e0be3239a49e318a3c1efb8ae0da7692858535c4c95141454d417
7
+ data.tar.gz: 6421a52b499eb267ba14447ec92adbf7d57299de503aee4af8d6023391456cc85f35e5c47c6f17b4cbb2f92987eac5476ef1d941eb8707137bfa5a58fcedfe2f
@@ -11,8 +11,8 @@ module BlogController
11
11
  @posts = @posts.order('published_at DESC')
12
12
  end
13
13
 
14
- @posts = @posts.paginate(page: params[:page], per_page: 1)
15
-
14
+ @posts = @posts.paginate(page: params[:page], per_page: 10)
15
+ begin; @sidebar_modules = PageModule.by_collection_slug('blog-post-sidebar'); rescue ActiveRecord::RecordNotFound; nil; end
16
16
  @home_page_stylesheets = ['home_page/application', 'home_page_blog/posts']
17
17
 
18
18
  render 'posts/index', layout: 'home_page_blog/application'
@@ -19,16 +19,20 @@
19
19
  </div>
20
20
 
21
21
  <div class="row">
22
-
22
+ <% if content_for? :sidebar %>
23
23
  <div class="col-sm-8 blog-main">
24
24
  <%= yield %>
25
- </div><!-- /.blog-main -->
25
+ </div>
26
26
 
27
27
  <div class="col-sm-3 col-sm-offset-1 blog-sidebar">
28
28
  <%= yield :sidebar %>
29
- </div><!-- /.blog-sidebar -->
30
-
31
- </div><!-- /.row -->
29
+ </div>
30
+ <% else %>
31
+ <div class="col-sm-12 blog-main">
32
+ <%= yield %>
33
+ </div>
34
+ <% end %>
35
+ </div>
32
36
 
33
37
  </div>
34
38
 
@@ -1,4 +1,3 @@
1
- <%= render partial: 'posts/sidebar/about' %>
2
- <%= render partial: 'posts/sidebar/social_links' %>
3
- <%= render partial: 'posts/sidebar/tags' %>
4
- <%= render partial: 'posts/sidebar/archive' %>
1
+ <% @sidebar_modules.each do |page_module| %>
2
+ <%= render partial: page_module.partial_path %>
3
+ <% end %>
@@ -10,10 +10,14 @@
10
10
 
11
11
  <% if user_signed_in? %>
12
12
  <p>
13
- <%= link_to t('posts.new.title'), new_post_path, class: 'btn btn-default' %>
13
+ <%= link_to new_post_path, class: 'btn btn-default' do %>
14
+ <span class="glyphicon glyphicon-plus"></span> <%= t('posts.new.title') %>
15
+ <% end %>
14
16
  </p>
15
17
  <% end %>
16
18
 
17
- <% content_for :sidebar do %>
18
- <%= render partial: 'posts/sidebar' %>
19
+ <% if @sidebar_modules %>
20
+ <% content_for :sidebar do %>
21
+ <%= render partial: 'posts/sidebar' %>
22
+ <% end %>
19
23
  <% end %>
@@ -0,0 +1,6 @@
1
+ <div class="sidebar-module">
2
+ <h4><%= t 'post_archive.index.title' %></h4>
3
+ <ol class="list-unstyled">
4
+ <li><%= t 'general.coming_soon' %>: <a href="https://github.com/home-page/home_page_blog/issues/16">Blog Issue #16</a></li>
5
+ </ol>
6
+ </div>
@@ -0,0 +1,6 @@
1
+ <div class="sidebar-module">
2
+ <h4><%= t 'tags.index.title' %></h4>
3
+ <ol class="list-unstyled">
4
+ <li><%= t 'general.coming_soon' %>: <a href="https://github.com/home-page/home_page_blog/issues/16">Blog Issue #3</a></li>
5
+ </ol>
6
+ </div>
@@ -0,0 +1,32 @@
1
+ <div class="panel panel-default">
2
+ <div class="panel-heading" role="tab" id="heading<%= index + 1 %>">
3
+ <h4 class="panel-title">
4
+ <a data-toggle="collapse" data-parent="#settings_accordion" href="#home_page_blog_settings" aria-expanded="true" aria-controls="home_page_blog_settings">
5
+ <%= t('settings.index.plugins.home_page_blog.index.title') %>
6
+ </a>
7
+ </h4>
8
+ </div>
9
+
10
+ <div id="home_page_blog_settings" class="panel-collapse collapse<% if index == 0 %> in<% end %>" role="tabpanel" aria-labelledby="heading<%= index + 1 %>">
11
+ <div class="panel-body">
12
+ <div role="tabpanel">
13
+ <ul class="nav nav-tabs" role="tablist">
14
+ <li role="presentation" class="active">
15
+ <a href="#home_page_blog_settings_general" aria-controls="home_page_blog_settings_general" role="tab" data-toggle="tab">
16
+ <%= t('settings.index.plugins.home_page.tabs.general.title') %>
17
+ </a>
18
+ </li>
19
+ </ul>
20
+ <div class="tab-content">
21
+ <div role="tabpanel" class="tab-pane active" id="home_page_blog_settings_general">
22
+ <p>
23
+ <%= setting_input(
24
+ f, 'home_page_blog.general.partial_paths', label: t('settings.vars.home_page.general.partial_paths')
25
+ ) %>
26
+ </p>
27
+ </div>
28
+ </div>
29
+ </div>
30
+ </div>
31
+ </div>
32
+ </div>
@@ -0,0 +1,3 @@
1
+ Setting.defaults['home_page_blog.general.partial_paths'] = [
2
+ 'posts/sidebar/about', 'posts/sidebar/social_links', 'posts/sidebar/tags', 'posts/sidebar/archive'
3
+ ]
@@ -0,0 +1,3 @@
1
+ if Setting.table_exists? && !Setting['home_page.general.plugins'].include?('home_page_blog')
2
+ Setting['home_page.general.plugins'] = Setting['home_page.general.plugins'] + ['home_page_blog']
3
+ end
@@ -0,0 +1,10 @@
1
+ en:
2
+ settings:
3
+ index:
4
+ plugins:
5
+ home_page_blog:
6
+ index:
7
+ title: Blog
8
+ tabs:
9
+ general:
10
+ title: General
@@ -2,7 +2,7 @@ module HomePageBlog
2
2
  module Navigation
3
3
  def self.menu_code(resource)
4
4
  case resource
5
- when :posts
5
+ when 'posts'
6
6
  Proc.new do |primary, options|
7
7
  primary.item :posts, I18n.t('posts.index.title'), posts_path do |posts|
8
8
  posts.item :new, I18n.t('general.new'), new_post_path
@@ -1,3 +1,3 @@
1
1
  module HomePageBlog
2
- VERSION = "0.0.1"
2
+ VERSION = '0.0.2'
3
3
  end
metadata CHANGED
@@ -1,43 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: home_page_blog
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mathias Gawlista
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-03-10 00:00:00.000000000 Z
11
+ date: 2015-03-18 00:00:00.000000000 Z
12
12
  dependencies:
13
- - !ruby/object:Gem::Dependency
14
- name: rails
15
- requirement: !ruby/object:Gem::Requirement
16
- requirements:
17
- - - "~>"
18
- - !ruby/object:Gem::Version
19
- version: 4.2.0
20
- type: :runtime
21
- prerelease: false
22
- version_requirements: !ruby/object:Gem::Requirement
23
- requirements:
24
- - - "~>"
25
- - !ruby/object:Gem::Version
26
- version: 4.2.0
27
13
  - !ruby/object:Gem::Dependency
28
14
  name: home_page
29
15
  requirement: !ruby/object:Gem::Requirement
30
16
  requirements:
31
17
  - - "~>"
32
18
  - !ruby/object:Gem::Version
33
- version: 0.0.4
19
+ version: 0.0.6
34
20
  type: :runtime
35
21
  prerelease: false
36
22
  version_requirements: !ruby/object:Gem::Requirement
37
23
  requirements:
38
24
  - - "~>"
39
25
  - !ruby/object:Gem::Version
40
- version: 0.0.4
26
+ version: 0.0.6
41
27
  - !ruby/object:Gem::Dependency
42
28
  name: mysql2
43
29
  requirement: !ruby/object:Gem::Requirement
@@ -52,7 +38,7 @@ dependencies:
52
38
  - - ">="
53
39
  - !ruby/object:Gem::Version
54
40
  version: '0'
55
- description: Blog module for home_page gem.
41
+ description: 'Blog plugin for #Rails CMS http://Home-Page.Software'
56
42
  email:
57
43
  - gawlista@gmail.com
58
44
  executables: []
@@ -77,10 +63,16 @@ files:
77
63
  - app/views/posts/new.html.erb
78
64
  - app/views/posts/show.html.erb
79
65
  - app/views/posts/sidebar/_about.html.erb
66
+ - app/views/posts/sidebar/_archive.html.erb
80
67
  - app/views/posts/sidebar/_social_links.html.erb
68
+ - app/views/posts/sidebar/_tags.html.erb
69
+ - app/views/settings/plugins/home_page_blog/_panel.html.erb
70
+ - config/initializers/default_settings.rb
71
+ - config/initializers/settings.rb
81
72
  - config/locales/general/en.yml
82
73
  - config/locales/resources/post/en.yml
83
74
  - config/locales/resources/post_archive/en.yml
75
+ - config/locales/resources/setting/en.yml
84
76
  - config/routes.rb
85
77
  - db/migrate/20150307194234_create_initial_blog_schema.rb
86
78
  - lib/home_page_blog.rb
@@ -111,5 +103,5 @@ rubyforge_project:
111
103
  rubygems_version: 2.4.5
112
104
  signing_key:
113
105
  specification_version: 4
114
- summary: Blog module for home_page gem.
106
+ summary: Blog plugin for Rails CMS gem home_page.
115
107
  test_files: []