homeland-press 0.2.1 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 30be3e204d09b92d87040eb9d2ae7761afbcdad7
4
- data.tar.gz: df05927e51707cd6bbce8c83dc19a5917c995f50
3
+ metadata.gz: 84a424f8551d6830c25174da3ee5df9c73f5be68
4
+ data.tar.gz: e3eeecac2754dab4b91b16ab270eb58036cc7eec
5
5
  SHA512:
6
- metadata.gz: cda7883c57d45ec8bdd9096cb282b9da3bf8c7adc2c3a884bbc4a36aa4cf00d0e56a37e83145782318f52452dc54a5543b014a8401be3b82ecc424160181845c
7
- data.tar.gz: 41ee2131ca13e4c292253819b9a5b2513c91ed356328eec0f2c59b64b1c9da913fba38aa0a88e6818b174de85aed11317fdd6a6a54fe98b0a81e9a6434d9028d
6
+ metadata.gz: 19f407cfd77511ac3bc66e89ae878629c94adbe89d8384f1081accbe112058da9376510e3273368f723765d01ba1a5996de5d2dfc9708a03a0e2d70a485ccb44
7
+ data.tar.gz: 389974ae322f2c83784d0ffdc0412b496024d013d7e6a53c66dbcacc333df463e3997334aa8798dc427999f2b7128c640d15a0750f6ae9780dfeab1c1f9e1abe
@@ -26,6 +26,9 @@
26
26
  margin-bottom: 15px;
27
27
  border-bottom: 1px solid #eee;
28
28
 
29
+ @media (max-width: 480px) {
30
+ }
31
+
29
32
  &:last-child {
30
33
  border-bottom: 0;
31
34
  margin-bottom: 0px;
@@ -60,9 +63,13 @@
60
63
  a { color: #aaa; }
61
64
  }
62
65
 
63
- &.post-upcoming {
64
- .post-title { font-size: 16px; }
66
+ @media (max-width: 480px) {
67
+ .post-title { font-size: 16px; line-height: 18px; }
68
+ .post-likes {
69
+ width: 40px;
70
+ }
65
71
  }
72
+
66
73
  }
67
74
 
68
75
 
@@ -71,6 +78,12 @@
71
78
  padding: 30px 50px;
72
79
  }
73
80
 
81
+ @media (max-width: 480px) {
82
+ .panel-body {
83
+ padding: 15px;
84
+ }
85
+ }
86
+
74
87
  h1 {
75
88
  text-align: center; margin-bottom: 15px;
76
89
  font-size: 24px;
@@ -83,6 +96,17 @@
83
96
  color: #999;
84
97
  }
85
98
 
99
+
100
+ .social-share-button {
101
+ text-align: center;
102
+ margin: 15px 0;
103
+ height: 24px;
104
+ .ssb-icon {
105
+ width: 24px; height: 24px;
106
+ background-size: 24px 24px;
107
+ }
108
+ }
109
+
86
110
  .post-info {
87
111
  .media-object { display: inline; }
88
112
  a { color: #777;}
@@ -1,5 +1,5 @@
1
1
  <% content_for :sitemap do %>
2
- <span class="current">头条</span>
2
+ <span class="current"><%= t('plugin.press') %></span>
3
3
  <% end %>
4
4
 
5
5
  <table class="table table-bordered table-striped table-condensed">
@@ -4,6 +4,8 @@
4
4
  <% if can? :create, Post %>
5
5
  <%= link_to "提交新文章", new_post_path, class: 'btn btn-block btn-primary' %>
6
6
  <% end %>
7
+ <hr />
8
+ <%= link_to "RSS 订阅", posts_path(format: 'xml'), class: 'btn btn-block btn-default' %>
7
9
 
8
10
  <% if can? :publish, Post %>
9
11
  <hr />
@@ -1,4 +1,4 @@
1
- <% title_tag "头条" %>
1
+ <% title_tag t('plugin.press') %>
2
2
 
3
3
  <div class="row">
4
4
  <div class="col-md-9">
@@ -0,0 +1,19 @@
1
+ xml.instruct! :xml, version: "1.0"
2
+ xml.rss(version: "2.0"){
3
+ xml.channel{
4
+ xml.title "#{Setting.app_name} - #{t('plugin.press')}"
5
+ xml.link posts_url
6
+ xml.description "#{Setting.app_name} - #{t('plugin.press')}"
7
+ xml.language('zh-CN')
8
+ for post in @posts
9
+ xml.item do
10
+ xml.title post.title
11
+ xml.description markdown(post.body)
12
+ xml.author post.user&.login
13
+ xml.pubDate(post.created_at.strftime("%a, %d %b %Y %H:%M:%S %z"))
14
+ xml.link post_url(post)
15
+ xml.guid post_url(post)
16
+ end
17
+ end
18
+ }
19
+ }
@@ -31,6 +31,7 @@
31
31
  <div class="post-body markdown">
32
32
  <%= markdown @post.body %>
33
33
  </div>
34
+ <%= social_share_button_tag @post.title %>
34
35
  <div class="post-actions">
35
36
  <%= likeable_tag(@post, class: 'btn btn-lg btn-default') %>
36
37
 
@@ -1,4 +1,4 @@
1
- <% title_tag "头条" %>
1
+ <% title_tag t('plugin.press') %>
2
2
 
3
3
  <div class="row">
4
4
  <div class="col-md-9">
@@ -3,28 +3,31 @@ module Homeland
3
3
  class Engine < ::Rails::Engine
4
4
  isolate_namespace Homeland::Press
5
5
 
6
- initializer 'homeland_press.init' do |app|
7
- if Setting.has_module?(:press)
6
+ initializer 'homeland.press.init' do |app|
7
+ return unless Setting.has_module?(:press)
8
+ app.config.after_initialize do
9
+ # Because need use I18n.t
10
+ # must after Rails application initialized will get correct locale
8
11
  Homeland.register_plugin do |plugin|
9
- plugin.name = 'press'
10
- plugin.display_name = '头条'
11
- plugin.description = 'A Press plugin for Homeland.'
12
- plugin.navbar_link = true
12
+ plugin.name = 'press'
13
+ plugin.display_name = I18n.t('plugin.press')
14
+ plugin.description = 'A Press/News plugin for Homeland.'
15
+ plugin.navbar_link = true
13
16
  plugin.admin_navbar_link = true
14
- plugin.user_menu_link = true
15
- plugin.root_path = "/posts"
16
- plugin.admin_path = "/admin/posts"
17
- plugin.spec_path = config.root.join('spec')
17
+ plugin.user_menu_link = true
18
+ plugin.root_path = "/posts"
19
+ plugin.admin_path = "/admin/posts"
18
20
  end
21
+ end
19
22
 
20
- User.send :include, Homeland::Press::UserMixin
21
23
 
22
- app.routes.prepend do
23
- mount Homeland::Press::Engine => '/'
24
- end
24
+ User.send :include, Homeland::Press::UserMixin
25
25
 
26
- app.config.paths["db/migrate"].concat(config.paths["db/migrate"].expanded)
26
+ app.routes.prepend do
27
+ mount Homeland::Press::Engine => '/'
27
28
  end
29
+
30
+ app.config.paths["db/migrate"].concat(config.paths["db/migrate"].expanded)
28
31
  end
29
32
  end
30
33
  end
@@ -1,6 +1,6 @@
1
1
  module Homeland
2
2
  module Press
3
3
  NAME = 'press'
4
- VERSION = '0.2.1'
4
+ VERSION = '0.3.1'
5
5
  end
6
6
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: homeland-press
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jason Lee
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-02-28 00:00:00.000000000 Z
11
+ date: 2017-03-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -50,6 +50,7 @@ files:
50
50
  - app/views/homeland/press/posts/_sidebar.html.erb
51
51
  - app/views/homeland/press/posts/edit.html.erb
52
52
  - app/views/homeland/press/posts/index.html.erb
53
+ - app/views/homeland/press/posts/index.xml.builder
53
54
  - app/views/homeland/press/posts/new.html.erb
54
55
  - app/views/homeland/press/posts/show.html.erb
55
56
  - app/views/homeland/press/posts/upcoming.html.erb
@@ -82,7 +83,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
82
83
  version: '0'
83
84
  requirements: []
84
85
  rubyforge_project:
85
- rubygems_version: 2.6.8
86
+ rubygems_version: 2.5.2
86
87
  signing_key:
87
88
  specification_version: 4
88
89
  summary: Press/Blog/News plugin for Homeland.