monologue 0.3.0 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +13 -5
- data/README.md +47 -23
- data/app/assets/javascripts/monologue/admin/application.js +2 -1
- data/app/assets/javascripts/monologue/blog/archive.js +11 -0
- data/app/assets/stylesheets/monologue/blog/monologue.css +27 -0
- data/app/controllers/monologue/admin/base_controller.rb +2 -8
- data/app/controllers/monologue/admin/posts_controller.rb +11 -9
- data/app/controllers/monologue/admin/users_controller.rb +6 -3
- data/app/controllers/monologue/application_controller.rb +16 -12
- data/app/controllers/monologue/controller_helpers/auth.rb +21 -0
- data/app/controllers/monologue/controller_helpers/user.rb +18 -0
- data/app/controllers/monologue/posts_controller.rb +1 -3
- data/app/controllers/monologue/tags_controller.rb +2 -3
- data/app/helpers/monologue/application_helper.rb +7 -7
- data/app/helpers/monologue/tags_helper.rb +1 -1
- data/app/models/monologue/post.rb +7 -9
- data/app/models/monologue/tag.rb +1 -3
- data/app/models/monologue/tagging.rb +1 -3
- data/app/models/monologue/user.rb +1 -3
- data/app/views/layouts/monologue/admin/_nav_bar.html.erb +1 -4
- data/app/views/layouts/monologue/application.html.erb +2 -2
- data/app/views/layouts/monologue/application/_disqus.html.erb +1 -1
- data/app/views/layouts/monologue/application/_disqus_embed.html.erb +1 -1
- data/app/views/layouts/monologue/application/_fb_open_graph.html.erb +3 -3
- data/app/views/layouts/monologue/application/_gauge_analytics.html.erb +2 -2
- data/app/views/layouts/monologue/application/_google_analytics.html.erb +2 -2
- data/app/views/layouts/monologue/application/_head.html.erb +1 -1
- data/app/views/layouts/monologue/application/_meta_description.html.erb +1 -1
- data/app/views/layouts/monologue/application/_sidebar.html.erb +2 -2
- data/app/views/layouts/monologue/application/_twitter_cards.html.erb +3 -3
- data/app/views/monologue/admin/comments/show.html.erb +1 -1
- data/app/views/monologue/posts/_social_sharing.html.erb +4 -4
- data/app/views/monologue/posts/feed.rss.builder +4 -4
- data/app/views/monologue/sidebar/_archive.html.erb +27 -0
- data/app/views/monologue/sidebar/_latest_tweets.html.erb +2 -2
- data/config/locales/de.yml +136 -0
- data/config/locales/en.yml +0 -12
- data/config/locales/fr.yml +1 -13
- data/config/locales/it.yml +0 -12
- data/config/locales/pt.yml +0 -12
- data/config/locales/ro.yml +0 -12
- data/config/locales/tr.yml +136 -0
- data/config/routes.rb +0 -3
- data/db/migrate/20130108123111_move_user_id_to_post.rb +0 -1
- data/db/migrate/20130509015400_merge_revisions_into_posts.rb +1 -2
- data/lib/monologue.rb +2 -36
- data/lib/monologue/configuration.rb +40 -0
- data/lib/monologue/configuration_extensions.rb +21 -0
- data/lib/monologue/engine.rb +8 -0
- data/lib/monologue/version.rb +1 -1
- data/vendor/assets/javascripts/monologue/bootstrap/bootstrap-datepicker-tr.js +7 -0
- metadata +56 -54
- data/app/controllers/monologue/admin/cache_controller.rb +0 -27
- data/app/sweepers/monologue/posts_sweeper.rb +0 -42
- data/app/sweepers/monologue/total_sweeper.rb +0 -5
- data/app/views/monologue/admin/cache/_config.html.erb +0 -18
- data/app/views/monologue/admin/cache/how_to_enable.html.erb +0 -6
- data/app/views/monologue/admin/cache/show.html.erb +0 -26
- data/lib/tasks/monologue_cache.rake +0 -26
checksums.yaml
CHANGED
@@ -1,7 +1,15 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
|
2
|
+
!binary "U0hBMQ==":
|
3
|
+
metadata.gz: !binary |-
|
4
|
+
NmQ2OTVlOGE1OWU1NjJiOWI0MTU1ZTQzYmU1NDMwNzk1NzMzZmYzMQ==
|
5
|
+
data.tar.gz: !binary |-
|
6
|
+
YTljNzZhNjM0Y2UyYjNlZDM4YTg2YmI0M2IwMWQ5ODdlMjQ2YWRlNA==
|
5
7
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
|
8
|
+
metadata.gz: !binary |-
|
9
|
+
YTdkY2EwN2E1OTM2MmEwMzNhZTEwMGY5ZTY1ODlhNTdiODJiMjZjMjYzOGI4
|
10
|
+
NGZhM2FjNTk4ZDcxNTZjOTMzNWEzOWY4OWQ4MDUwYmMzNDMxZmVkZDYyY2Nh
|
11
|
+
YmJlZWJmOTcxNWIwMTE5NTE5OTg1NTBlNGUwMzI3OTU0ZTM5NGQ=
|
12
|
+
data.tar.gz: !binary |-
|
13
|
+
MzBjMTJkZjkxOGU5Yzc0MjJiYjNiMDJkNDE2ODU3YzhlNjU3MjNmMzQ3ODMw
|
14
|
+
YTE3Zjc5ZTE2MDIzNWIxZTBiZmM5YjQ4M2NmYjUwMTZkZmI3MGY1OTFmMjgw
|
15
|
+
MTE4ZmQzZjgyZjhkM2VlZGRlN2Q1NjZlODM0ZWM1OWNhMjNlMjA=
|
data/README.md
CHANGED
@@ -1,14 +1,18 @@
|
|
1
1
|
# Monologue
|
2
|
-
Monologue is a basic mountable blogging engine in Rails built to be easily mounted in an already existing Rails app, but it can also be used alone.
|
3
|
-
|
4
2
|
[![Gem Version](https://badge.fury.io/rb/monologue.png)](http://badge.fury.io/rb/monologue)
|
5
3
|
[![Build Status](https://secure.travis-ci.org/jipiboily/monologue.png)](http://travis-ci.org/jipiboily/monologue)
|
6
4
|
[![Code Climate](https://codeclimate.com/github/jipiboily/monologue.png)](https://codeclimate.com/github/jipiboily/monologue)
|
7
5
|
[![Coverage Status](https://coveralls.io/repos/jipiboily/monologue/badge.png?branch=master)](https://coveralls.io/r/jipiboily/monologue?branch=master)
|
8
6
|
|
9
|
-
|
7
|
+
**THIS README IS FOR THE MASTER BRANCH AND REFLECTS THE WORK CURRENTLY EXISTING ON THE MASTER BRANCH. IF YOU ARE WISHING TO USE A NON-MASTER BRANCH OF MONOLOGUE, PLEASE CONSULT THAT BRANCH'S README AND NOT THIS ONE.**
|
8
|
+
|
9
|
+
-
|
10
|
+
|
11
|
+
Monologue is a basic mountable blogging engine in Rails built to be easily mounted in an already existing Rails app, but it can also be used alone.
|
10
12
|
|
11
|
-
|
13
|
+
## Version
|
14
|
+
|
15
|
+
This README is for a future Monologue version, that will be 0.4.X and be Rails 4 specific. See other branches for other versions (0-3-stable being the latest stable version).
|
12
16
|
|
13
17
|
## Upgrade and changes
|
14
18
|
|
@@ -16,11 +20,12 @@ To know how to upgrade, see [UPGRADE.md](https://github.com/jipiboily/monologue/
|
|
16
20
|
|
17
21
|
## Questions? Problems? Documentation?
|
18
22
|
|
19
|
-
- [
|
23
|
+
- [Mailing list for questions](http://groups.google.com/forum/#!forum/monologue-rb)
|
20
24
|
- [Issues and bugs](http://github.com/jipiboily/monologue/issues)
|
21
25
|
- [Wiki](https://github.com/jipiboily/monologue/wiki/_pages)
|
26
|
+
- IRC channel (on Freenode): #monologue.
|
22
27
|
|
23
|
-
##
|
28
|
+
## Some features
|
24
29
|
- Rails mountable engine (fully named spaced and mountable in an already existing app)
|
25
30
|
- tested
|
26
31
|
- back to basics: few features
|
@@ -30,19 +35,20 @@ To know how to upgrade, see [UPGRADE.md](https://github.com/jipiboily/monologue/
|
|
30
35
|
- support for Google Analytics and Gaug.es tags
|
31
36
|
- few external dependencies (no Devise or Sorcery, etc…) so we don't face problem integrating with existing Rails app.([Rails mountable engines: dependency nightmare?](http://jipiboily.com/2012/rails-mountable-engines-dependency-nightmare))
|
32
37
|
- comments are handled by [disqus](http://disqus.com/)
|
33
|
-
- enforcing [Rails cache](http://edgeguides.rubyonrails.org/caching_with_rails.html) for better performance (only support file store for now). [Read this to enable it](https://github.com/jipiboily/monologue/wiki/Configure-Monologue's-cache).
|
34
38
|
- more in the [CHANGELOG](https://github.com/jipiboily/monologue/blob/master/CHANGELOG.md)
|
35
39
|
|
36
|
-
-
|
40
|
+
- Available extensions
|
41
|
+
- [monologue-markdown](https://github.com/jipiboily/monologue-markdown)
|
42
|
+
- [monologue_image_upload](https://github.com/msevestre/monologue_image_upload)
|
37
43
|
|
38
44
|
### missing features
|
39
45
|
- see [roadmap](https://github.com/jipiboily/monologue/wiki/Roadmap)!
|
40
46
|
|
41
47
|
|
42
48
|
## Installation
|
43
|
-
### 1. Add the gem to your `Gemfile
|
49
|
+
### 1. Add the gem to your `Gemfile`. This will get the latest version compatible with Rails 4 until we release a gem
|
44
50
|
```ruby
|
45
|
-
gem
|
51
|
+
gem 'monologue', github: 'jipiboily/monologue'
|
46
52
|
```
|
47
53
|
And run `bundle install` to fetch the gem and update your 'Gemfile.lock'.
|
48
54
|
|
@@ -81,34 +87,48 @@ This is all done in an initializer file, say `config/initializers/monologue.rb`.
|
|
81
87
|
### 6. Ready
|
82
88
|
Start your server and head on [http://localhost:3000/monologue](http://localhost:3000/monologue) to log in the admin section.
|
83
89
|
|
84
|
-
### Note to Heroku users
|
85
|
-
1. Additionnal step: turn caching off in `config/environments/production.rb`:
|
86
|
-
```ruby
|
87
|
-
config.action_controller.perform_caching = false
|
88
|
-
```
|
89
|
-
2. If you use compiled assets, I recommend you to add `gem "tinymce-rails"` to your Gemfile otherwise you might not be able to post an article.
|
90
90
|
|
91
91
|
### Note to users
|
92
92
|
Monologue is using his own tables. If you want to use your own tables with monologue (for example the User table)
|
93
93
|
this might help you to monkey patch [Monkey Patch](https://gist.github.com/jipiboily/776d907fc932640ac59a)
|
94
94
|
|
95
|
-
|
96
|
-
## Enable caching
|
97
|
-
[See full caching doc here.](https://github.com/jipiboily/monologue/wiki/Configure-Monologue's-cache)
|
98
|
-
|
99
95
|
## Customization
|
100
96
|
See the [Wiki - Customizations](https://github.com/jipiboily/monologue/wiki/Customizations).
|
101
97
|
|
102
98
|
## Requirements
|
103
|
-
- Rails
|
99
|
+
- Rails 4.0.4 +
|
104
100
|
- Database: MySQL & Postgres are supported but other databases might work too.
|
105
101
|
|
106
102
|
## Authors
|
107
103
|
* Jean-Philippe Boily, [@jipiboily](https://github.com/jipiboily)
|
108
104
|
* Michael Sevestre, [@msevestre](https://github.com/msevestre)
|
109
105
|
|
110
|
-
##
|
111
|
-
|
106
|
+
## Contributing
|
107
|
+
|
108
|
+
In the spirit of [free software][1], **everyone** is encouraged to help improve this project.
|
109
|
+
|
110
|
+
Here are some ways *you* can contribute:
|
111
|
+
|
112
|
+
* by using prerelease versions
|
113
|
+
* by reporting [bugs][2]
|
114
|
+
* by suggesting new features
|
115
|
+
* by writing or editing documentation
|
116
|
+
* by writing specifications
|
117
|
+
* by writing code (*no patch is too small*: fix typos, add comments, clean up inconsistent whitespace)
|
118
|
+
* by refactoring code
|
119
|
+
* by resolving [issues][2]
|
120
|
+
* by reviewing patches
|
121
|
+
|
122
|
+
Starting point:
|
123
|
+
|
124
|
+
* Fork the repo
|
125
|
+
* Clone your repo
|
126
|
+
* Run `bundle install`
|
127
|
+
* Run `bundle exec rake test_app` to create the test application in `spec/dummy`
|
128
|
+
* Make your changes
|
129
|
+
* Ensure specs pass by running `bundle exec rspec spec`
|
130
|
+
* Submit your pull request
|
131
|
+
|
112
132
|
|
113
133
|
You will need to install this before running the test suite:
|
114
134
|
- [https://github.com/thoughtbot/capybara-webkit/wiki/Installing-Qt-and-compiling-capybara-webkit](https://github.com/thoughtbot/capybara-webkit/wiki/Installing-Qt-and-compiling-capybara-webkit)
|
@@ -116,3 +136,7 @@ You will need to install this before running the test suite:
|
|
116
136
|
## Thanks to
|
117
137
|
|
118
138
|
Zurb for the "social foundicons".
|
139
|
+
|
140
|
+
|
141
|
+
[1]: http://www.fsf.org/licensing/essays/free-sw.html
|
142
|
+
[2]: https://github.com/jipiboily/monologue/issues
|
@@ -11,7 +11,8 @@
|
|
11
11
|
//= require monologue/bootstrap/bootstrap-datepicker-fr
|
12
12
|
//= require monologue/bootstrap/bootstrap-datepicker-pt
|
13
13
|
//= require monologue/bootstrap/bootstrap-datepicker-es
|
14
|
+
//= require ckeditor/override
|
14
15
|
//= require ckeditor/init
|
15
16
|
//= require monologue/admin/ckeditor-config
|
16
17
|
//= require monologue/admin/posts
|
17
|
-
//= require select2
|
18
|
+
//= require select2
|
@@ -0,0 +1,11 @@
|
|
1
|
+
$(function() {
|
2
|
+
$('.js-year').on('click', function(){
|
3
|
+
$(this).parent().find('>ul').toggle('fast');
|
4
|
+
$(this).toggleClass('active');
|
5
|
+
});
|
6
|
+
|
7
|
+
$('.js-month').on('click', function(){
|
8
|
+
$(this).parent().find('ul').toggle('fast');
|
9
|
+
$(this).toggleClass('active');
|
10
|
+
});
|
11
|
+
});
|
@@ -198,4 +198,31 @@ a.social {
|
|
198
198
|
display: inline;
|
199
199
|
/*margin: 0 40px 0 40px;*/
|
200
200
|
/*padding: 0 0 0 0;*/
|
201
|
+
}
|
202
|
+
|
203
|
+
/** archive css **/
|
204
|
+
.archive ul {
|
205
|
+
text-align: left;
|
206
|
+
list-style: none;
|
207
|
+
padding: 0;
|
208
|
+
margin: 0;
|
209
|
+
}
|
210
|
+
|
211
|
+
.archive ul li {
|
212
|
+
padding: 0;
|
213
|
+
margin: 0 0 0 10px;
|
214
|
+
cursor: pointer;
|
215
|
+
}
|
216
|
+
|
217
|
+
.archive ul.js-posts li {
|
218
|
+
margin-bottom: 10px;
|
219
|
+
}
|
220
|
+
|
221
|
+
.archive .blog-year:before, .archive .blog-month:before {
|
222
|
+
content: "+";
|
223
|
+
padding-right: 5px;
|
224
|
+
}
|
225
|
+
|
226
|
+
.archive .blog-year.active:before, .archive .blog-month.active:before {
|
227
|
+
content: "-";
|
201
228
|
}
|
@@ -1,12 +1,6 @@
|
|
1
1
|
class Monologue::Admin::BaseController < Monologue::ApplicationController
|
2
|
-
|
3
|
-
force_ssl if Monologue.admin_force_ssl # TODO: find a way to test that with capybara
|
2
|
+
include Monologue::ControllerHelpers::Auth
|
3
|
+
force_ssl if Monologue::Config.admin_force_ssl # TODO: find a way to test that with capybara
|
4
4
|
|
5
5
|
layout "layouts/monologue/admin"
|
6
|
-
|
7
|
-
def authenticate_user!
|
8
|
-
if monologue_current_user.nil?
|
9
|
-
redirect_to admin_login_url, alert: I18n.t("monologue.admin.login.need_auth")
|
10
|
-
end
|
11
|
-
end
|
12
6
|
end
|
@@ -1,6 +1,5 @@
|
|
1
1
|
class Monologue::Admin::PostsController < Monologue::Admin::BaseController
|
2
2
|
respond_to :html
|
3
|
-
cache_sweeper Monologue::PostsSweeper, only: [:create, :update, :destroy]
|
4
3
|
before_filter :load_post, only: [:edit, :update]
|
5
4
|
|
6
5
|
def index
|
@@ -10,20 +9,19 @@ class Monologue::Admin::PostsController < Monologue::Admin::BaseController
|
|
10
9
|
def new
|
11
10
|
@post = Monologue::Post.new
|
12
11
|
end
|
13
|
-
|
12
|
+
|
14
13
|
## Preview a post without saving.
|
15
14
|
def preview
|
16
15
|
# mockup our models for preview.
|
17
|
-
@post = Monologue::Post.new
|
16
|
+
@post = Monologue::Post.new post_params
|
18
17
|
@post.user_id = monologue_current_user.id
|
19
18
|
@post.published_at = Time.zone.now
|
20
|
-
|
21
19
|
# render it exactly as it would display when live.
|
22
|
-
render "/monologue/posts/show", layout: Monologue.layout || "/layouts/monologue/application"
|
20
|
+
render "/monologue/posts/show", layout: Monologue::Config.layout || "/layouts/monologue/application"
|
23
21
|
end
|
24
|
-
|
22
|
+
|
25
23
|
def create
|
26
|
-
@post = Monologue::Post.new
|
24
|
+
@post = Monologue::Post.new post_params
|
27
25
|
@post.user_id = monologue_current_user.id
|
28
26
|
if @post.save
|
29
27
|
prepare_flash_and_redirect_to_edit()
|
@@ -36,7 +34,7 @@ class Monologue::Admin::PostsController < Monologue::Admin::BaseController
|
|
36
34
|
end
|
37
35
|
|
38
36
|
def update
|
39
|
-
if @post.
|
37
|
+
if @post.update(post_params)
|
40
38
|
prepare_flash_and_redirect_to_edit()
|
41
39
|
else
|
42
40
|
render :edit
|
@@ -65,4 +63,8 @@ private
|
|
65
63
|
end
|
66
64
|
redirect_to edit_admin_post_path(@post)
|
67
65
|
end
|
68
|
-
|
66
|
+
|
67
|
+
def post_params
|
68
|
+
params.require(:post).permit(:published, :tag_list,:title,:content,:url,:published_at)
|
69
|
+
end
|
70
|
+
end
|
@@ -11,7 +11,7 @@ class Monologue::Admin::UsersController < Monologue::Admin::BaseController
|
|
11
11
|
end
|
12
12
|
|
13
13
|
def update
|
14
|
-
if @user.
|
14
|
+
if @user.update user_params
|
15
15
|
flash.notice = "User modified"
|
16
16
|
redirect_to admin_users_path
|
17
17
|
else
|
@@ -28,7 +28,7 @@ class Monologue::Admin::UsersController < Monologue::Admin::BaseController
|
|
28
28
|
end
|
29
29
|
|
30
30
|
def create
|
31
|
-
@user = Monologue::User.new
|
31
|
+
@user = Monologue::User.new user_params
|
32
32
|
if @user.save
|
33
33
|
flash.notice = I18n.t("monologue.admin.users.create.success")
|
34
34
|
redirect_to admin_users_path
|
@@ -46,4 +46,7 @@ class Monologue::Admin::UsersController < Monologue::Admin::BaseController
|
|
46
46
|
@user = Monologue::User.find(params[:id])
|
47
47
|
end
|
48
48
|
|
49
|
-
|
49
|
+
def user_params
|
50
|
+
params.require(:user).permit(:name, :email, :password, :password_confirmation)
|
51
|
+
end
|
52
|
+
end
|
@@ -1,15 +1,16 @@
|
|
1
1
|
class Monologue::ApplicationController < ApplicationController
|
2
|
+
include Monologue::ControllerHelpers::User
|
2
3
|
|
3
|
-
layout Monologue.layout if Monologue.layout # TODO: find a way to test that. It was asked in issue #54 (https://github.com/jipiboily/monologue/issues/54)
|
4
|
+
layout Monologue::Config.layout if Monologue::Config.layout # TODO: find a way to test that. It was asked in issue #54 (https://github.com/jipiboily/monologue/issues/54)
|
4
5
|
|
5
|
-
before_filter :recent_posts, :all_tags
|
6
|
+
before_filter :recent_posts, :all_tags, :archive_posts
|
6
7
|
|
7
8
|
def recent_posts
|
8
9
|
@recent_posts = Monologue::Post.published.limit(3)
|
9
10
|
end
|
10
11
|
|
11
12
|
def all_tags
|
12
|
-
@tags = Monologue::Tag.
|
13
|
+
@tags = Monologue::Tag.order("name").select{|t| t.frequency>0}
|
13
14
|
#could use minmax here but it's only supported with ruby > 1.9'
|
14
15
|
@tags_frequency_min = @tags.map{|t| t.frequency}.min
|
15
16
|
@tags_frequency_max = @tags.map{|t| t.frequency}.max
|
@@ -26,15 +27,18 @@ class Monologue::ApplicationController < ApplicationController
|
|
26
27
|
end
|
27
28
|
end
|
28
29
|
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
30
|
+
def archive_posts
|
31
|
+
@archive_posts = {}
|
32
|
+
@first_post_year = DateTime.now.year
|
33
|
+
|
34
|
+
# limit to 100 for safety reasons
|
35
|
+
posts = Monologue::Post.published.limit(100)
|
36
|
+
if posts.length > 0
|
37
|
+
@archive_posts = posts.group_by {
|
38
|
+
|post| post.published_at.beginning_of_month.strftime("%Y %-m")
|
39
|
+
}
|
40
|
+
@first_post_year = posts.last.published_at.year
|
37
41
|
end
|
42
|
+
end
|
38
43
|
|
39
|
-
helper_method :monologue_current_user, :monologue_page_cache_enabled?
|
40
44
|
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
require 'active_support/concern'
|
2
|
+
|
3
|
+
module Monologue
|
4
|
+
module ControllerHelpers
|
5
|
+
module Auth
|
6
|
+
extend ActiveSupport::Concern
|
7
|
+
include Monologue::ControllerHelpers::User
|
8
|
+
|
9
|
+
included do
|
10
|
+
before_filter :authenticate_user!
|
11
|
+
end
|
12
|
+
|
13
|
+
private
|
14
|
+
def authenticate_user!
|
15
|
+
if monologue_current_user.nil?
|
16
|
+
redirect_to monologue.admin_login_url, alert: I18n.t("monologue.admin.login.need_auth")
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
require 'active_support/concern'
|
2
|
+
|
3
|
+
module Monologue
|
4
|
+
module ControllerHelpers
|
5
|
+
module User
|
6
|
+
extend ActiveSupport::Concern
|
7
|
+
|
8
|
+
included do
|
9
|
+
helper_method :monologue_current_user
|
10
|
+
end
|
11
|
+
|
12
|
+
private
|
13
|
+
def monologue_current_user
|
14
|
+
@monologue_current_user ||= Monologue::User.find(session[:monologue_user_id]) if session[:monologue_user_id]
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
@@ -1,6 +1,4 @@
|
|
1
1
|
class Monologue::PostsController < Monologue::ApplicationController
|
2
|
-
caches_page :index, :show, :feed , if: Proc.new { monologue_page_cache_enabled? }
|
3
|
-
|
4
2
|
def index
|
5
3
|
@page = params[:page].nil? ? 1 : params[:page]
|
6
4
|
@posts = Monologue::Post.published.page(@page)
|
@@ -20,4 +18,4 @@ class Monologue::PostsController < Monologue::ApplicationController
|
|
20
18
|
def feed
|
21
19
|
@posts = Monologue::Post.published.limit(25)
|
22
20
|
end
|
23
|
-
end
|
21
|
+
end
|
@@ -1,5 +1,4 @@
|
|
1
1
|
class Monologue::TagsController < Monologue::ApplicationController
|
2
|
-
caches_page :show , if: Proc.new { monologue_page_cache_enabled? }
|
3
2
|
def show
|
4
3
|
@tag = retrieve_tag
|
5
4
|
if @tag
|
@@ -12,6 +11,6 @@ class Monologue::TagsController < Monologue::ApplicationController
|
|
12
11
|
|
13
12
|
private
|
14
13
|
def retrieve_tag
|
15
|
-
Monologue::Tag.where("lower(name) = ?", params[:tag].downcase).first
|
14
|
+
Monologue::Tag.where("lower(name) = ?", params[:tag].mb_chars.to_s.downcase).first
|
16
15
|
end
|
17
|
-
end
|
16
|
+
end
|
@@ -11,7 +11,7 @@ module Monologue
|
|
11
11
|
end
|
12
12
|
|
13
13
|
def monologue_accurate_title
|
14
|
-
content_for?(:title) ? ((content_for :title) + " | #{Monologue.site_name}") : Monologue.site_name
|
14
|
+
content_for?(:title) ? ((content_for :title) + " | #{Monologue::Config.site_name}") : Monologue::Config.site_name
|
15
15
|
end
|
16
16
|
|
17
17
|
def rss_head_link
|
@@ -19,27 +19,27 @@ module Monologue
|
|
19
19
|
end
|
20
20
|
|
21
21
|
def rss_icon
|
22
|
-
social_icon("rss", feed_url, Monologue.show_rss_icon)
|
22
|
+
social_icon("rss", feed_url, Monologue::Config.show_rss_icon)
|
23
23
|
end
|
24
24
|
|
25
25
|
def github_icon
|
26
|
-
social_icon("github", "http://github.com/#{Monologue.github_username}", Monologue.github_username)
|
26
|
+
social_icon("github", "http://github.com/#{Monologue::Config.github_username}", Monologue::Config.github_username)
|
27
27
|
end
|
28
28
|
|
29
29
|
def twitter_icon
|
30
|
-
social_icon("twitter", "http://twitter.com/#{Monologue.twitter_username}", Monologue.twitter_username)
|
30
|
+
social_icon("twitter", "http://twitter.com/#{Monologue::Config.twitter_username}", Monologue::Config.twitter_username)
|
31
31
|
end
|
32
32
|
|
33
33
|
def linkedin_icon
|
34
|
-
social_icon("linkedin", Monologue.linkedin_url, Monologue.linkedin_url)
|
34
|
+
social_icon("linkedin", Monologue::Config.linkedin_url, Monologue::Config.linkedin_url)
|
35
35
|
end
|
36
36
|
|
37
37
|
def googleplus_icon
|
38
|
-
social_icon("google-plus", Monologue.google_plus_account_url, Monologue.google_plus_account_url)
|
38
|
+
social_icon("google-plus", Monologue::Config.google_plus_account_url, Monologue::Config.google_plus_account_url)
|
39
39
|
end
|
40
40
|
|
41
41
|
def facebook_icon
|
42
|
-
social_icon("facebook", Monologue.facebook_url, Monologue.facebook_url)
|
42
|
+
social_icon("facebook", Monologue::Config.facebook_url, Monologue::Config.facebook_url)
|
43
43
|
end
|
44
44
|
|
45
45
|
def absolute_image_url(url)
|