notee 1.0.6 → 1.0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/notee/helpers/notee_helper.rb +19 -6
- data/lib/notee/version.rb +1 -1
- data/lib/tasks/images/{default.png → notee/default.png} +0 -0
- data/lib/tasks/images/notee/profile/default.png +0 -0
- data/lib/tasks/notee_tasks.rake +203 -126
- data/lib/tasks/stylesheets/notee/social/social.css +120 -0
- data/lib/tasks/views/notee/categories.html.erb +3 -3
- data/lib/tasks/views/notee/partials/_sidebar.html.erb +3 -3
- data/lib/tasks/views/notee/partials/_social.html.erb +73 -0
- data/lib/tasks/views/notee/show.html.erb +4 -0
- metadata +5 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dc2e1258928226f96fb5fd54cc25aa6992fbb84b
|
4
|
+
data.tar.gz: cffccb71986ba0744901f76734ba7ee0f01a2bf7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 939d3020fe0362be445bd77fecac0df932a2d51eda070f56b38660e18c3073f937d923ebee0cceea0fa2231766f97927010efef82bd99315039250b9e3e7aa13
|
7
|
+
data.tar.gz: 3104f027fd6daef89e620e87ee479ba10f393a49521d548e153ba017ca9bf21ec787ea50d0f48ab6f460bec11804122f69256d876bb53b51654f29fc40cf19f8
|
@@ -61,10 +61,19 @@ module Notee
|
|
61
61
|
|
62
62
|
|
63
63
|
def notee_categories
|
64
|
-
|
65
|
-
published_categories = categories.select { |category| category if category.posts.count > 0 }.map { |category| category }
|
64
|
+
posts = Notee::Post.select(:category_id).where(status: 1, is_deleted: false).order(created_at: :desc)
|
66
65
|
|
67
|
-
|
66
|
+
notee_categories = {}
|
67
|
+
posts.each do |post|
|
68
|
+
category = post.category
|
69
|
+
if notee_categories.has_key?(category.name)
|
70
|
+
notee_categories[category.name][0] = notee_categories[category.name][0] + 1
|
71
|
+
else
|
72
|
+
notee_categories.store(category.name, [1, category])
|
73
|
+
end
|
74
|
+
end
|
75
|
+
|
76
|
+
notee_categories
|
68
77
|
end
|
69
78
|
|
70
79
|
|
@@ -87,10 +96,14 @@ module Notee
|
|
87
96
|
|
88
97
|
|
89
98
|
def notee_writers
|
90
|
-
|
91
|
-
|
99
|
+
posts = Notee::Post.select(:user_id).where(status: 1, is_deleted: false).order(created_at: :desc)
|
100
|
+
|
101
|
+
notee_writers = []
|
102
|
+
posts.each do |post|
|
103
|
+
notee_writers.push(post.user)
|
104
|
+
end
|
92
105
|
|
93
|
-
|
106
|
+
notee_writers
|
94
107
|
end
|
95
108
|
|
96
109
|
|
data/lib/notee/version.rb
CHANGED
File without changes
|
Binary file
|
data/lib/tasks/notee_tasks.rake
CHANGED
@@ -1,52 +1,51 @@
|
|
1
1
|
desc 'setup notee'
|
2
2
|
namespace :notee do
|
3
|
-
|
4
3
|
require 'fileutils'
|
5
4
|
|
6
|
-
task :start do
|
7
|
-
notee_mark
|
8
|
-
sh 'bundle exec rake notee:install:migrations'
|
9
|
-
add_engine_to_route
|
10
|
-
add_highlight_setting_to_js
|
11
|
-
add_notee_css_path
|
12
|
-
add_viewport_meta_info_and_delete_title
|
13
|
-
copy_directory("/app/views/notee/", "../views/notee")
|
14
|
-
copy_directory("/app/assets/stylesheets/notee/", "../stylesheets/notee")
|
15
|
-
copy_directory("/app/assets/javascripts/notee/", "../javascripts/notee")
|
16
|
-
create_file("/config/schedule.rb", "../config/schedule.rb", nil)
|
17
|
-
create_file("/app/controllers/notee_controller.rb", "../controllers/notee_controller.rb", nil)
|
18
|
-
create_file("/config/initializers/notee.rb", "../config/notee.rb", nil)
|
19
|
-
copy_default_image("/public/notee")
|
20
|
-
copy_default_image("/public/notee/profile")
|
21
|
-
sh 'bundle exec whenever --update-crontab RAILS_ENV=production'
|
22
|
-
end
|
23
5
|
|
24
|
-
|
25
|
-
|
26
|
-
________________________________
|
27
|
-
________________________________
|
6
|
+
APPLICATION_ERB_PATH = "/app/views/layouts/application.html.erb"
|
7
|
+
ADD_META_TXT = <<-EOC
|
28
8
|
|
29
|
-
|
30
|
-
| \\ | ___ __|__ __|__ __
|
31
|
-
| \\ | | | | | /__\\
|
32
|
-
| \\| |___| | | \\___
|
9
|
+
<!-- default notee setting -->
|
33
10
|
|
34
|
-
|
35
|
-
________________________________
|
11
|
+
<meta name="viewport" content="width=device-width,initial-scale=1.0" />
|
36
12
|
|
37
|
-
|
38
|
-
|
13
|
+
<!-- notee setting end -->
|
14
|
+
|
15
|
+
EOC
|
39
16
|
|
40
17
|
|
41
|
-
|
42
|
-
|
43
|
-
return if File.open("#{Rails.root}/config/routes.rb","r").read.include?("Notee::Engine")
|
18
|
+
APPLICATION_JS_PATH = "/app/assets/javascripts/application.js"
|
19
|
+
ADD_HIGHLIGHT_TXT = <<-EOC
|
44
20
|
|
45
|
-
|
21
|
+
//////// default notee setting
|
22
|
+
|
23
|
+
$(document).on('ready', function() {
|
24
|
+
hljs.initHighlightingOnLoad();
|
25
|
+
});
|
46
26
|
|
47
|
-
|
48
|
-
|
49
|
-
|
27
|
+
//////// notee setting end
|
28
|
+
|
29
|
+
EOC
|
30
|
+
|
31
|
+
|
32
|
+
APPLICATION_CSS_PATH = "/app/assets/stylesheets/application.css"
|
33
|
+
ADD_CSS_TXT = <<-EOC
|
34
|
+
|
35
|
+
//////// default notee setting
|
36
|
+
|
37
|
+
*= require_directory .
|
38
|
+
*= require_directory ./notee
|
39
|
+
|
40
|
+
//////// notee setting end
|
41
|
+
|
42
|
+
EOC
|
43
|
+
|
44
|
+
|
45
|
+
ROUTE_FILE_PATH = "/config/routes.rb"
|
46
|
+
ADD_ROUTE_TXT = <<-EOC
|
47
|
+
|
48
|
+
######## default notee path
|
50
49
|
|
51
50
|
get '/about' => 'notee#about'
|
52
51
|
|
@@ -62,127 +61,133 @@ ________________________________
|
|
62
61
|
get '/writers/:name_or_id' => 'notee#writer_posts', as: 'notee_public_writer_posts'
|
63
62
|
get '/:id_or_slug' => 'notee#show', as: 'notee_public_show'
|
64
63
|
|
65
|
-
|
64
|
+
######## notee setting end
|
66
65
|
|
67
|
-
|
68
|
-
route.each_line do |line|
|
69
|
-
line += text if line.include?("Rails.application.routes.draw do")
|
70
|
-
new_route += line
|
71
|
-
end
|
66
|
+
EOC
|
72
67
|
|
73
|
-
f = File.open("#{Rails.root}/config/routes.rb","w")
|
74
|
-
f.write(new_route)
|
75
|
-
f.close()
|
76
68
|
|
77
|
-
|
78
|
-
|
69
|
+
NOTEE_VIEW_PATH = "/app/views/notee/"
|
70
|
+
NOTEE_VIEW_ORIGIN_PATH = "../views/notee"
|
71
|
+
NOTEE_CSS_PATH = "/app/assets/stylesheets/notee/"
|
72
|
+
NOTEE_CSS_ORIGIN_PATH = "../stylesheets/notee"
|
73
|
+
NOTEE_JS_PATH = "/app/assets/javascripts/notee/"
|
74
|
+
NOTEE_JS_ORIGIN_PATH = "../javascripts/notee"
|
75
|
+
NOTEE_SCHEJULE_PATH = "/config/schedule.rb"
|
76
|
+
NOTEE_SCHEJULE_ORIGIN_PATH = "../config/schedule.rb"
|
77
|
+
NOTEE_CONTROLLER_PATH = "/app/controllers/notee_controller.rb"
|
78
|
+
NOTEE_CONTROLLER_ORIGIN_PATH = "../controllers/notee_controller.rb"
|
79
|
+
NOTEE_INIT_FILE_PATH = "/config/initializers/notee.rb"
|
80
|
+
NOTEE_INIT_FILE_ORIGIN_PATH = "../config/notee.rb"
|
81
|
+
NOTEE_IMAGE_PATH = "/public/notee/"
|
82
|
+
NOTEE_IMAGE_ORIGIN_PATH = "../images/notee"
|
79
83
|
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
84
|
+
task :start do
|
85
|
+
notee_mark
|
86
|
+
sh 'bundle exec rake notee:install:migrations'
|
87
|
+
delete_line( APPLICATION_ERB_PATH, "<title>" )
|
88
|
+
add_notee_code( APPLICATION_ERB_PATH, ADD_META_TXT, "<head>", '<meta name="viewport" content="width=device-width,initial-scale=1.0" />' )
|
89
|
+
add_notee_code( APPLICATION_JS_PATH, ADD_HIGHLIGHT_TXT, "//= require_tree .", "hljs.initHighlightingOnLoad()" )
|
90
|
+
add_notee_code( APPLICATION_CSS_PATH, ADD_CSS_TXT, "*= require_tree .", "*= require_directory ./notee" )
|
91
|
+
delete_line( APPLICATION_CSS_PATH, "*= require_tree ." )
|
92
|
+
add_notee_code( ROUTE_FILE_PATH, ADD_ROUTE_TXT, "Rails.application.routes.draw do", "Notee::Engine" )
|
93
|
+
copy_directory( NOTEE_VIEW_PATH, NOTEE_VIEW_ORIGIN_PATH )
|
94
|
+
copy_directory( NOTEE_CSS_PATH, NOTEE_CSS_ORIGIN_PATH )
|
95
|
+
copy_directory( NOTEE_JS_PATH, NOTEE_JS_ORIGIN_PATH )
|
96
|
+
copy_directory( NOTEE_IMAGE_PATH, NOTEE_IMAGE_ORIGIN_PATH )
|
97
|
+
create_file( NOTEE_SCHEJULE_PATH, NOTEE_SCHEJULE_ORIGIN_PATH)
|
98
|
+
create_file( NOTEE_CONTROLLER_PATH, NOTEE_CONTROLLER_ORIGIN_PATH)
|
99
|
+
create_file( NOTEE_INIT_FILE_PATH, NOTEE_INIT_FILE_ORIGIN_PATH)
|
100
|
+
sh 'bundle exec whenever --update-crontab RAILS_ENV=production'
|
101
|
+
end
|
85
102
|
|
86
|
-
|
87
|
-
|
88
|
-
|
103
|
+
task :destroy do
|
104
|
+
delete_directory(NOTEE_VIEW_PATH)
|
105
|
+
delete_directory(NOTEE_CSS_PATH)
|
106
|
+
delete_directory(NOTEE_JS_PATH)
|
107
|
+
delete_directory(NOTEE_IMAGE_PATH)
|
108
|
+
delete_file(NOTEE_SCHEJULE_PATH)
|
109
|
+
delete_file(NOTEE_CONTROLLER_PATH)
|
110
|
+
delete_file(NOTEE_INIT_FILE_PATH)
|
111
|
+
add_line(APPLICATION_ERB_PATH, "<title>#{Rails.application.class.parent_name.to_s}</title>", "<head>", "<title>")
|
112
|
+
delete_notee_code(APPLICATION_ERB_PATH, "<!-- default notee setting -->", "<!-- notee setting end -->")
|
113
|
+
delete_notee_code(APPLICATION_JS_PATH, "//////// default notee setting", "//////// notee setting end")
|
114
|
+
add_line(APPLICATION_CSS_PATH, "*= require_tree .", "//////// notee setting end", "*= require_tree .")
|
115
|
+
delete_notee_code(APPLICATION_CSS_PATH, "//////// default notee setting", "//////// notee setting end")
|
116
|
+
delete_notee_code(ROUTE_FILE_PATH, "######## default notee path", "######## notee setting end")
|
117
|
+
end
|
89
118
|
|
90
|
-
|
91
|
-
hljs.initHighlightingOnLoad();
|
92
|
-
});
|
119
|
+
private
|
93
120
|
|
94
|
-
|
121
|
+
def notee_mark
|
122
|
+
puts "
|
123
|
+
________________________________
|
124
|
+
________________________________
|
95
125
|
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
end
|
126
|
+
|\\ |
|
127
|
+
| \\ | ___ __|__ __|__ __
|
128
|
+
| \\ | | | | | /__\\
|
129
|
+
| \\| |___| | | \\___
|
101
130
|
|
102
|
-
|
103
|
-
|
104
|
-
f.close()
|
131
|
+
________________________________
|
132
|
+
________________________________
|
105
133
|
|
106
|
-
|
134
|
+
"
|
107
135
|
end
|
108
136
|
|
109
137
|
|
110
|
-
def add_notee_css_path
|
111
|
-
return puts 'setup for application.css in /app/assets/stylesheets/application.css\n' unless route = File.open("#{Rails.root}/app/assets/stylesheets/application.css","r")
|
112
|
-
return if File.open("#{Rails.root}/app/assets/stylesheets/application.css","r").read.include?("*= require_directory ./notee")
|
113
|
-
|
114
|
-
text = <<-EOC
|
115
138
|
|
116
|
-
|
117
|
-
|
118
|
-
// ///////////////////////////
|
139
|
+
def add_notee_code(file_path, insert_txt, beginning_line, check_txt)
|
140
|
+
add_file_path = Rails.root.to_s + file_path
|
119
141
|
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
EOC
|
142
|
+
return puts 'add notee code failed => '+ add_file_path + '\n' unless add_file = File.open(add_file_path,"r")
|
143
|
+
return if File.open(add_file_path,"r").read.include?(check_txt)
|
124
144
|
|
125
|
-
|
126
|
-
|
127
|
-
line
|
128
|
-
|
145
|
+
new_file = String.new
|
146
|
+
add_file.each_line do |line|
|
147
|
+
line += insert_txt if line.include?(beginning_line)
|
148
|
+
new_file += line
|
129
149
|
end
|
130
150
|
|
131
|
-
f = File.open(
|
132
|
-
f.write(
|
151
|
+
f = File.open(add_file_path,"w")
|
152
|
+
f.write(new_file)
|
133
153
|
f.close()
|
134
154
|
|
135
|
-
puts 'Notee added
|
155
|
+
puts 'Notee added code => ' + add_file_path
|
136
156
|
end
|
137
157
|
|
138
|
-
def add_viewport_meta_info_and_delete_title
|
139
|
-
return puts 'setup for application.html.erb in /app/views/layouts/application.html.erb\n' unless route = File.open("#{Rails.root}/app/views/layouts/application.html.erb","r")
|
140
|
-
return if File.open("#{Rails.root}/app/views/layouts/application.html.erb","r").read.include?('<meta name="viewport" content="width=device-width,initial-scale=1.0" />')
|
141
158
|
|
142
|
-
text = <<-EOC
|
143
|
-
|
144
|
-
<meta name="viewport" content="width=device-width,initial-scale=1.0" />
|
145
159
|
|
146
|
-
|
160
|
+
def delete_notee_code(file_path, beginning_line, ending_line)
|
161
|
+
delete_file_path = Rails.root.to_s + file_path
|
147
162
|
|
148
|
-
|
149
|
-
|
150
|
-
line += text if line.include?("<head>")
|
151
|
-
line = "" if line.include?("<title>")
|
152
|
-
new_html += line
|
153
|
-
end
|
163
|
+
return puts 'delete failed => notee code '+ delete_file_path + '\n' unless delete_file = File.open(delete_file_path,"r")
|
164
|
+
return unless File.open(delete_file_path,"r").read.include?(beginning_line)
|
154
165
|
|
155
|
-
|
156
|
-
|
157
|
-
f.close()
|
166
|
+
new_file_text = String.new
|
167
|
+
initial_txt = true
|
158
168
|
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
169
|
+
delete_file.each_line do |line|
|
170
|
+
initial_txt = false if line.include?(beginning_line)
|
171
|
+
if line.include?(ending_line)
|
172
|
+
initial_txt = true
|
173
|
+
next
|
174
|
+
end
|
165
175
|
|
166
|
-
|
167
|
-
image_dir = Rails.root.to_s + image_path
|
168
|
-
FileUtils.mkdir_p(image_dir) unless FileTest.exist?(image_dir)
|
176
|
+
next unless initial_txt
|
169
177
|
|
170
|
-
|
171
|
-
unless FileTest.exist?(image_url)
|
172
|
-
open(image_url, 'wb') do |output|
|
173
|
-
output.write(File.open(File.expand_path('../images/default.png', __FILE__)).read)
|
174
|
-
end
|
178
|
+
new_file_text += line
|
175
179
|
end
|
176
180
|
|
177
|
-
|
181
|
+
f = File.open(delete_file_path,"w")
|
182
|
+
f.write(new_file_text)
|
183
|
+
f.close()
|
184
|
+
|
185
|
+
puts 'Notee deleted => notee code in' + delete_file_path
|
178
186
|
end
|
179
187
|
|
180
|
-
def create_file(create_path, origin_path, dir)
|
181
|
-
if dir.present?
|
182
|
-
new_dir = Rails.root.to_s + dir.to_s
|
183
|
-
FileUtils.mkdir_p(new_dir) unless FileTest.exist?(new_dir)
|
184
|
-
end
|
185
188
|
|
189
|
+
|
190
|
+
def create_file(create_path, origin_path)
|
186
191
|
create_file_path = Rails.root.to_s + create_path.to_s
|
187
192
|
return if File.exist?(create_file_path)
|
188
193
|
|
@@ -195,14 +200,86 @@ $(document).on('ready', function() {
|
|
195
200
|
File.open(create_file_path,"w") do |file|
|
196
201
|
file.puts new_file
|
197
202
|
end
|
198
|
-
puts 'create file
|
203
|
+
puts 'create file => ' + create_file_path.to_s
|
199
204
|
end
|
200
205
|
|
206
|
+
|
207
|
+
|
208
|
+
def delete_file(file_path)
|
209
|
+
delete_file_path = Rails.root.to_s + file_path.to_s
|
210
|
+
return unless File.exist?(delete_file_path)
|
211
|
+
FileUtils.rm_f(delete_file_path)
|
212
|
+
puts 'delete file => ' + file_path.to_s
|
213
|
+
end
|
214
|
+
|
215
|
+
|
216
|
+
|
201
217
|
def copy_directory(create_dir, origin_dir)
|
202
218
|
new_dir = Rails.root.to_s + create_dir.to_s
|
203
219
|
return if FileTest.exist?(new_dir)
|
204
220
|
FileUtils.cp_r(File.expand_path(origin_dir.to_s, __FILE__), new_dir)
|
205
|
-
puts 'create directory
|
221
|
+
puts 'create directory => ' + create_dir.to_s
|
206
222
|
end
|
207
223
|
|
224
|
+
|
225
|
+
|
226
|
+
def delete_directory(dir_path)
|
227
|
+
delete_dir = Rails.root.to_s + dir_path.to_s
|
228
|
+
return unless FileTest.exist?(delete_dir)
|
229
|
+
FileUtils.rm_rf(delete_dir)
|
230
|
+
puts 'delete directory => ' + dir_path.to_s
|
231
|
+
end
|
232
|
+
|
233
|
+
|
234
|
+
|
235
|
+
def add_line(file_path, add_line, beginning_path, check_txt)
|
236
|
+
add_file_path = Rails.root.to_s + file_path
|
237
|
+
|
238
|
+
txt = <<-EOC
|
239
|
+
|
240
|
+
#{add_line}
|
241
|
+
EOC
|
242
|
+
|
243
|
+
return puts 'delete failed => notee code '+ add_file_path + '\n' unless delete_file = File.open(add_file_path,"r")
|
244
|
+
return if File.open(add_file_path,"r").read.include?(check_txt)
|
245
|
+
|
246
|
+
new_file_text = String.new
|
247
|
+
initial_txt = true
|
248
|
+
|
249
|
+
delete_file.each_line do |line|
|
250
|
+
line += txt if line.include?(beginning_path)
|
251
|
+
new_file_text += line if initial_txt
|
252
|
+
end
|
253
|
+
|
254
|
+
f = File.open(add_file_path,"w")
|
255
|
+
f.write(new_file_text)
|
256
|
+
f.close()
|
257
|
+
|
258
|
+
puts 'Notee added => ' + add_line + ' in' + add_file_path
|
259
|
+
end
|
260
|
+
|
261
|
+
|
262
|
+
|
263
|
+
def delete_line(file_path, delete_line)
|
264
|
+
delete_file_path = Rails.root.to_s + file_path
|
265
|
+
|
266
|
+
return puts 'delete failed => notee code '+ delete_file_path + '\n' unless delete_file = File.open(delete_file_path,"r")
|
267
|
+
return unless File.open(delete_file_path,"r").read.include?(delete_line)
|
268
|
+
|
269
|
+
new_file_text = String.new
|
270
|
+
initial_txt = true
|
271
|
+
|
272
|
+
delete_file.each_line do |line|
|
273
|
+
line = "" if line.include?(delete_line)
|
274
|
+
new_file_text += line if initial_txt
|
275
|
+
end
|
276
|
+
|
277
|
+
f = File.open(delete_file_path,"w")
|
278
|
+
f.write(new_file_text)
|
279
|
+
f.close()
|
280
|
+
|
281
|
+
puts 'Notee deleted => ' + delete_line + ' in' + delete_file_path
|
282
|
+
end
|
283
|
+
|
284
|
+
|
208
285
|
end
|
@@ -0,0 +1,120 @@
|
|
1
|
+
/******************************
|
2
|
+
|
3
|
+
ソーシャルエリア全体を囲む要素
|
4
|
+
* 他のコンテンツと距離を取りたい場合は[margin]を設定して下さい
|
5
|
+
|
6
|
+
******************************/
|
7
|
+
.social-area-syncer {
|
8
|
+
width: 100% ;
|
9
|
+
min-height: 190px ;
|
10
|
+
padding: 1.5em 0 ;
|
11
|
+
}
|
12
|
+
|
13
|
+
/* デスクトップPCでは高さを拡張する */
|
14
|
+
@media screen and ( min-width:480px ) {
|
15
|
+
.social-area-syncer {
|
16
|
+
min-height: 119px ;
|
17
|
+
}
|
18
|
+
}
|
19
|
+
|
20
|
+
|
21
|
+
/******************************
|
22
|
+
|
23
|
+
[ul]要素
|
24
|
+
|
25
|
+
******************************/
|
26
|
+
/* スマホ */
|
27
|
+
ul.social-button-syncer {
|
28
|
+
width: 238px ;
|
29
|
+
margin: 24px auto ;
|
30
|
+
padding: 0 ;
|
31
|
+
border: none ;
|
32
|
+
list-style-type: none ;
|
33
|
+
}
|
34
|
+
|
35
|
+
/* デスクトップ */
|
36
|
+
@media screen and ( min-width:480px ) {
|
37
|
+
ul.social-button-syncer {
|
38
|
+
width: 410px ;
|
39
|
+
}
|
40
|
+
}
|
41
|
+
|
42
|
+
|
43
|
+
/******************************
|
44
|
+
|
45
|
+
[li]要素
|
46
|
+
|
47
|
+
******************************/
|
48
|
+
ul.social-button-syncer li {
|
49
|
+
float: left ;
|
50
|
+
text-align: center ;
|
51
|
+
height: 71px ;
|
52
|
+
margin: 0 8px ;
|
53
|
+
padding:0 ;
|
54
|
+
}
|
55
|
+
|
56
|
+
|
57
|
+
/******************************
|
58
|
+
|
59
|
+
各種ボタン
|
60
|
+
|
61
|
+
******************************/
|
62
|
+
/* [Twitter] */
|
63
|
+
.sc-tw {
|
64
|
+
width: 71px ;
|
65
|
+
}
|
66
|
+
|
67
|
+
.sc-tw svg {
|
68
|
+
width: 30px ;
|
69
|
+
height: 30px ;
|
70
|
+
}
|
71
|
+
|
72
|
+
.sc-tw a {
|
73
|
+
height: 56px ;
|
74
|
+
margin: 0 auto ;
|
75
|
+
padding-top: 6px ;
|
76
|
+
display: block ;
|
77
|
+
background: #1B95E0 ;
|
78
|
+
font-size: 12px ;
|
79
|
+
color: #fff ;
|
80
|
+
font-weight: 700 ;
|
81
|
+
text-decoration: none ;
|
82
|
+
letter-spacing: .5px ;
|
83
|
+
border-radius: 2px ;
|
84
|
+
}
|
85
|
+
|
86
|
+
.sc-tw a:hover {
|
87
|
+
color: #fff ;
|
88
|
+
background: #0c7abf ;
|
89
|
+
}
|
90
|
+
|
91
|
+
.sc-tw span:before {
|
92
|
+
white-space: pre ;
|
93
|
+
content: '\A' ;
|
94
|
+
}
|
95
|
+
|
96
|
+
/* [Facebook] */
|
97
|
+
.sc-fb {
|
98
|
+
z-index: 99 ;
|
99
|
+
width: 69px ;
|
100
|
+
}
|
101
|
+
|
102
|
+
/* [LINE] */
|
103
|
+
.sc-li {
|
104
|
+
width: 50px ;
|
105
|
+
}
|
106
|
+
|
107
|
+
.sc-li-img {
|
108
|
+
border: none ;
|
109
|
+
margin: 0 auto ;
|
110
|
+
padding:0 ;
|
111
|
+
width: 36px ;
|
112
|
+
height: 60px ;
|
113
|
+
}
|
114
|
+
|
115
|
+
/* デスクトップPCではLINEボタンを表示しない */
|
116
|
+
@media screen and ( min-width:480px ) {
|
117
|
+
.sc-li {
|
118
|
+
display: none ;
|
119
|
+
}
|
120
|
+
}
|
@@ -2,10 +2,10 @@
|
|
2
2
|
<div class="notee_wrapper">
|
3
3
|
<div class="notee_main">
|
4
4
|
<h2>Category List</h2>
|
5
|
-
<% @categories.each do |
|
5
|
+
<% @categories.each do |key, category_array| %>
|
6
6
|
<div class="notee_list">
|
7
|
-
<a href="/categories/<%=
|
8
|
-
<h3><%=
|
7
|
+
<a href="/categories/<%= category_array[1].slug %>">
|
8
|
+
<h3><%= category_array[1].name %> (<%= category_array[0] %>)</h3>
|
9
9
|
</a>
|
10
10
|
</div>
|
11
11
|
<% end %>
|
@@ -2,9 +2,9 @@
|
|
2
2
|
<h3>Category</h3>
|
3
3
|
<div class="notee_sidebar_content">
|
4
4
|
<ul class="notee_sidebar_ul">
|
5
|
-
<% notee_categories.each do |
|
6
|
-
<a href="/categories/<%=
|
7
|
-
<li><%=
|
5
|
+
<% notee_categories.each do |key, category_array| %>
|
6
|
+
<a href="/categories/<%= category_array[1].slug %>">
|
7
|
+
<li><%= category_array[1].name %> (<%= category_array[0] %>)</li>
|
8
8
|
</a>
|
9
9
|
<% end %>
|
10
10
|
</ul>
|
@@ -0,0 +1,73 @@
|
|
1
|
+
<%= stylesheet_link_tag "notee/social/social", :media => "all" %>
|
2
|
+
|
3
|
+
<% url = request.url %>
|
4
|
+
<div class="social-area-syncer">
|
5
|
+
<ul class="social-button-syncer">
|
6
|
+
<!-- Twitter ([Tweet]の部分を[ツイート]にすると日本語にできます) -->
|
7
|
+
<li class="sc-tw"><a data-url="<%= url %>" href="https://twitter.com/share" class="twitter-share-button" data-lang="ja" data-count="vertical" data-dnt="true" target="_blank"><svg viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="1.414"><path d="M16 3.038c-.59.26-1.22.437-1.885.517.677-.407 1.198-1.05 1.443-1.816-.634.375-1.337.648-2.085.795-.598-.638-1.45-1.036-2.396-1.036-1.812 0-3.282 1.468-3.282 3.28 0 .258.03.51.085.75C5.152 5.39 2.733 4.084 1.114 2.1.83 2.583.67 3.147.67 3.75c0 1.14.58 2.143 1.46 2.732-.538-.017-1.045-.165-1.487-.41v.04c0 1.59 1.13 2.918 2.633 3.22-.276.074-.566.114-.865.114-.21 0-.416-.02-.617-.058.418 1.304 1.63 2.253 3.067 2.28-1.124.88-2.54 1.404-4.077 1.404-.265 0-.526-.015-.783-.045 1.453.93 3.178 1.474 5.032 1.474 6.038 0 9.34-5 9.34-9.338 0-.143-.004-.284-.01-.425.64-.463 1.198-1.04 1.638-1.7z" fill="#fff" fill-rule="nonzero"/></svg><span>Tweet</span></a></li>
|
8
|
+
|
9
|
+
<!-- Google+ -->
|
10
|
+
<li><div data-href="<%= url %>" class="g-plusone" data-size="tall"></div></li>
|
11
|
+
|
12
|
+
<!-- はてなブックマーク -->
|
13
|
+
<li><a href="http://b.hatena.ne.jp/entry/<%= url %>" class="hatena-bookmark-button" data-hatena-bookmark-layout="vertical-balloon" data-hatena-bookmark-lang="ja" title="このエントリーをはてなブックマークに追加"><img src="https://b.st-hatena.com/images/entry-button/button-only@2x.png" alt="このエントリーをはてなブックマークに追加" width="20" height="20" style="border:none;" /></a></li>
|
14
|
+
|
15
|
+
<!-- pocket -->
|
16
|
+
<li><a data-save-url="<%= url %>" data-pocket-label="pocket" data-pocket-count="vertical" class="pocket-btn" data-lang="en"></a></li>
|
17
|
+
|
18
|
+
<!-- Facebook -->
|
19
|
+
<li class="sc-fb"><div class="fb-like" data-href="<%= url %>" data-layout="box_count" data-action="like" data-show-faces="true" data-share="false"></div></li>
|
20
|
+
</ul>
|
21
|
+
|
22
|
+
<!-- Facebook用 -->
|
23
|
+
<div id="fb-root"></div>
|
24
|
+
|
25
|
+
</div>
|
26
|
+
|
27
|
+
<script>
|
28
|
+
/* DOMの読み込み完了後に処理 */
|
29
|
+
if(window.addEventListener) {
|
30
|
+
window.addEventListener( "load" , shareButtonReadSyncer, false );
|
31
|
+
}else{
|
32
|
+
window.attachEvent( "onload", shareButtonReadSyncer );
|
33
|
+
}
|
34
|
+
|
35
|
+
/* シェアボタンを読み込む関数 */
|
36
|
+
function shareButtonReadSyncer(){
|
37
|
+
|
38
|
+
// 遅延ロードする場合は次の行と、終わりの方にある行のコメント(//)を外す
|
39
|
+
// setTimeout(function(){
|
40
|
+
|
41
|
+
// Twitter (オリジナルボタンを使用するので、コメントアウトして無効化)
|
42
|
+
// window.twttr=(function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],t=window.twttr||{};if(d.getElementById(id))return;js=d.createElement(s);js.id=id;js.src="https://platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);t._e=[];t.ready=function(f){t._e.push(f);};return t;}(document,"script","twitter-wjs"));
|
43
|
+
|
44
|
+
// Facebook
|
45
|
+
(function(d, s, id) {
|
46
|
+
var js, fjs = d.getElementsByTagName(s)[0];
|
47
|
+
if (d.getElementById(id)) return;
|
48
|
+
js = d.createElement(s); js.id = id;
|
49
|
+
js.src = "//connect.facebook.net/ja_JP/sdk.js#xfbml=1&version=v2.0";
|
50
|
+
fjs.parentNode.insertBefore(js, fjs);
|
51
|
+
}(document, 'script', 'facebook-jssdk'));
|
52
|
+
|
53
|
+
// Google+
|
54
|
+
var scriptTag = document.createElement("script");
|
55
|
+
scriptTag.type = "text/javascript"
|
56
|
+
scriptTag.src = "https://apis.google.com/js/platform.js";
|
57
|
+
scriptTag.async = true;
|
58
|
+
document.getElementsByTagName("head")[0].appendChild(scriptTag);
|
59
|
+
|
60
|
+
// はてなブックマーク
|
61
|
+
var scriptTag = document.createElement("script");
|
62
|
+
scriptTag.type = "text/javascript"
|
63
|
+
scriptTag.src = "https://b.st-hatena.com/js/bookmark_button.js";
|
64
|
+
scriptTag.async = true;
|
65
|
+
document.getElementsByTagName("head")[0].appendChild(scriptTag);
|
66
|
+
|
67
|
+
// pocket
|
68
|
+
(!function(d,i){if(!d.getElementById(i)){var j=d.createElement("script");j.id=i;j.src="https://widgets.getpocket.com/v1/j/btn.js?v=1";var w=d.getElementById(i);d.body.appendChild(j);}}(document,"pocket-btn-js"));
|
69
|
+
|
70
|
+
//},5000); //ページを開いて5秒後(5,000ミリ秒後)にシェアボタンを読み込む
|
71
|
+
|
72
|
+
}
|
73
|
+
</script>
|
@@ -21,8 +21,12 @@
|
|
21
21
|
|
22
22
|
</div>
|
23
23
|
|
24
|
+
<%= render :partial => "notee/partials/social.html.erb" %>
|
25
|
+
|
24
26
|
<%= notee_content(@post) %>
|
25
27
|
|
28
|
+
<%= render :partial => "notee/partials/social.html.erb" %>
|
29
|
+
|
26
30
|
<div class="notee_list_meta">
|
27
31
|
<!-- category -->
|
28
32
|
<span class="notee_list_meta_content righting">
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: notee
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- funaota
|
@@ -211,7 +211,8 @@ files:
|
|
211
211
|
- lib/tasks/config/notee.rb
|
212
212
|
- lib/tasks/config/schedule.rb
|
213
213
|
- lib/tasks/controllers/notee_controller.rb
|
214
|
-
- lib/tasks/images/default.png
|
214
|
+
- lib/tasks/images/notee/default.png
|
215
|
+
- lib/tasks/images/notee/profile/default.png
|
215
216
|
- lib/tasks/javascripts/notee/highlight.pack.js
|
216
217
|
- lib/tasks/notee_tasks.rake
|
217
218
|
- lib/tasks/stylesheets/notee/highlight/agate.css
|
@@ -296,6 +297,7 @@ files:
|
|
296
297
|
- lib/tasks/stylesheets/notee/highlight/zenburn.css
|
297
298
|
- lib/tasks/stylesheets/notee/normalize.css
|
298
299
|
- lib/tasks/stylesheets/notee/notee_default.css
|
300
|
+
- lib/tasks/stylesheets/notee/social/social.css
|
299
301
|
- lib/tasks/views/notee/about.html.erb
|
300
302
|
- lib/tasks/views/notee/archives.html.erb
|
301
303
|
- lib/tasks/views/notee/categories.html.erb
|
@@ -303,6 +305,7 @@ files:
|
|
303
305
|
- lib/tasks/views/notee/partials/_header.html.erb
|
304
306
|
- lib/tasks/views/notee/partials/_profile.html.erb
|
305
307
|
- lib/tasks/views/notee/partials/_sidebar.html.erb
|
308
|
+
- lib/tasks/views/notee/partials/_social.html.erb
|
306
309
|
- lib/tasks/views/notee/posts.html.erb
|
307
310
|
- lib/tasks/views/notee/show.html.erb
|
308
311
|
- lib/tasks/views/notee/writers.html.erb
|