monologue 0.4.1 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -13
- data/README.md +23 -18
- data/app/assets/javascripts/monologue/admin/application.js +0 -1
- data/app/controllers/monologue/admin/posts_controller.rb +2 -1
- data/app/controllers/monologue/posts_controller.rb +6 -1
- data/app/models/monologue/post.rb +16 -6
- data/app/views/layouts/monologue/admin.html.erb +1 -1
- data/app/views/layouts/monologue/application.html.erb +1 -1
- data/app/views/monologue/admin/posts/_pagination.html.erb +9 -0
- data/app/views/monologue/admin/posts/index.html.erb +4 -0
- data/app/views/monologue/posts/_post.html.erb +3 -3
- data/app/views/monologue/posts/_social_sharing.html.erb +17 -51
- data/app/views/monologue/posts/social/_facebook.html.erb +12 -0
- data/app/views/monologue/posts/social/_gplus.html.erb +16 -0
- data/app/views/monologue/posts/social/_pinterest.html.erb +16 -0
- data/app/views/monologue/posts/social/_twitter.html.erb +18 -0
- data/app/views/monologue/tags/_tag.html.erb +1 -1
- data/config/locales/de.yml +1 -1
- data/config/locales/en.yml +1 -1
- data/config/locales/es.yml +1 -1
- data/config/locales/fr.yml +1 -0
- data/config/locales/it.yml +1 -0
- data/config/locales/{pt.yml → pt-BR.yml} +2 -1
- data/config/locales/ro.yml +1 -0
- data/config/locales/tr.yml +1 -0
- data/config/routes.rb +1 -0
- data/lib/generators/monologue/views_generator.rb +27 -0
- data/lib/monologue/configuration.rb +30 -21
- data/lib/monologue/engine.rb +2 -0
- data/lib/monologue/version.rb +1 -1
- metadata +80 -46
checksums.yaml
CHANGED
@@ -1,15 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
|
5
|
-
data.tar.gz: !binary |-
|
6
|
-
NTY3MjY5OTE2OTJjNTgwZTdjMmQxNTBiMjY2MDJkMmYwOWFlNmVmMw==
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 13b62c70625552ac739c2cafbe6da15e4a75c850
|
4
|
+
data.tar.gz: c49b7d6db9a629fec6c67f303613669e9474ad42
|
7
5
|
SHA512:
|
8
|
-
metadata.gz:
|
9
|
-
|
10
|
-
YjVjZDhmZDAxZWNhMGJmNGU5ZmRmNjljYTM1MjUxM2YzNjc2YThhOTUyNTNk
|
11
|
-
ZjAzNmI5MTJmMWVmMTcxZDZjMTNiMzE4NGRjNTQ0MTg3YmM3YmU=
|
12
|
-
data.tar.gz: !binary |-
|
13
|
-
OTBlOGFhNDA4OGFlYzg3MTg2NjhmNzBkN2U0OWQzZDNlMTM1NzNjNDBmYmNl
|
14
|
-
MmNiZmE4NWNiOGU5M2IyYTBiYmNmODk5ODZhMDI0ODZmNmUwNGEwMzE1ZGU3
|
15
|
-
ZDQzZTM3YzAzMmVkMjVkYjJjNmQ4ZTU4MTA4OWI2ZmM1MGZmYmI=
|
6
|
+
metadata.gz: ecc8bbb9ef1d248be441017189247190f059a42ab9dc44b2da55a67847a21816ec4a3b9f91400ca9a903de2843fb7a1fd5c6590a68cfa719fb3bb9670ca9123d
|
7
|
+
data.tar.gz: 9e3d8e84fb732740ddf355bc9578830006f0544229d3f39e2a57e30e26d201ff24c6de1cfecc76cdbb63d2eb3399f291f54cbf4573b85c986ce89e17a90f06f1
|
data/README.md
CHANGED
@@ -8,15 +8,15 @@
|
|
8
8
|
|
9
9
|
-
|
10
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.
|
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.
|
12
12
|
|
13
13
|
## Version
|
14
14
|
|
15
|
-
This README is for
|
15
|
+
This README is for the latest version of Monologue (0-5-stable being the latest stable version).
|
16
16
|
|
17
17
|
## Upgrade and changes
|
18
18
|
|
19
|
-
To
|
19
|
+
To learn how to upgrade, see [UPGRADE.md](https://github.com/jipiboily/monologue/blob/master/UPGRADE.md) file. If you want to learn what changed since the last versions, see [CHANGELOG.md](https://github.com/jipiboily/monologue/blob/master/CHANGELOG.md).
|
20
20
|
|
21
21
|
## Questions? Problems? Documentation?
|
22
22
|
|
@@ -26,7 +26,7 @@ To know how to upgrade, see [UPGRADE.md](https://github.com/jipiboily/monologue/
|
|
26
26
|
- IRC channel (on Freenode): #monologue.
|
27
27
|
|
28
28
|
## Some features
|
29
|
-
- Rails mountable engine (fully
|
29
|
+
- Rails mountable engine (fully namespaced and mountable in an already existing app)
|
30
30
|
- tested
|
31
31
|
- back to basics: few features
|
32
32
|
- tags (or categories)
|
@@ -46,15 +46,15 @@ To know how to upgrade, see [UPGRADE.md](https://github.com/jipiboily/monologue/
|
|
46
46
|
|
47
47
|
|
48
48
|
## Installation
|
49
|
-
### 1. Add the gem to your `Gemfile`.
|
49
|
+
### 1. Add the gem to your `Gemfile`.
|
50
50
|
```ruby
|
51
|
-
gem 'monologue'
|
51
|
+
gem 'monologue'
|
52
52
|
```
|
53
53
|
And run `bundle install` to fetch the gem and update your 'Gemfile.lock'.
|
54
54
|
|
55
55
|
### 2. Route to Monologue
|
56
56
|
|
57
|
-
Add this to your route file (`config/
|
57
|
+
Add this to your route file (`config/routes.rb`)
|
58
58
|
```ruby
|
59
59
|
# This line mounts Monologue's routes at the root of your application.
|
60
60
|
# This means, any requests to URLs such as /my-post, will go to Monologue::PostsController.
|
@@ -70,33 +70,37 @@ be available at `/monologue`.
|
|
70
70
|
### 3. Migrate Monologue's database tables
|
71
71
|
Run these commands:
|
72
72
|
|
73
|
-
1. $`
|
74
|
-
2. $`
|
75
|
-
3. $`
|
73
|
+
1. $`bin/rake monologue:install:migrations`
|
74
|
+
2. $`bin/rake db:create` (only if this is a new project)
|
75
|
+
3. $`bin/rake db:migrate`
|
76
76
|
|
77
77
|
|
78
78
|
### 4. Create a user
|
79
|
-
Open your development console with `rails c`, then:
|
79
|
+
Open your development console with `bin/rails c`, then:
|
80
80
|
```ruby
|
81
81
|
Monologue::User.create(name: "monologue", email:"monologue@example.com", password:"my-password", password_confirmation: "my-password")
|
82
82
|
```
|
83
83
|
|
84
84
|
### 5. Configure Monologue.
|
85
|
-
This is all done in an initializer file,
|
85
|
+
This is all done in an initializer file, typically `config/initializers/monologue.rb`. More on this in the [Wiki - Configuration](https://github.com/jipiboily/monologue/wiki/Configuration).
|
86
86
|
|
87
87
|
### 6. Ready
|
88
|
-
Start your server and
|
88
|
+
Start your server and go to [http://localhost:3000/monologue](http://localhost:3000/monologue) to log in the admin section.
|
89
89
|
|
90
90
|
|
91
91
|
### Note to users
|
92
|
-
Monologue is using
|
93
|
-
this might help you to monkey patch
|
92
|
+
Monologue is using its own tables. If you want to use your own tables with monologue (for example the User table)
|
93
|
+
this might help you to [monkey patch](https://gist.github.com/jipiboily/776d907fc932640ac59a).
|
94
94
|
|
95
95
|
## Customization
|
96
96
|
See the [Wiki - Customizations](https://github.com/jipiboily/monologue/wiki/Customizations).
|
97
97
|
|
98
|
+
## Copy views
|
99
|
+
copy views like devise `rails g monologue:views`
|
100
|
+
or use scope: `rails g monologue:views blog`
|
101
|
+
|
98
102
|
## Requirements
|
99
|
-
- Rails 4.
|
103
|
+
- Rails 4.2.1 +
|
100
104
|
- Database: MySQL & Postgres are supported but other databases might work too.
|
101
105
|
|
102
106
|
## Authors
|
@@ -124,9 +128,10 @@ Starting point:
|
|
124
128
|
* Fork the repo
|
125
129
|
* Clone your repo
|
126
130
|
* Run `bundle install`
|
127
|
-
* Run `bundle exec rake
|
131
|
+
* Run `bundle exec rake db:migrate`
|
132
|
+
* Run `bundle exec rake db:setup`
|
128
133
|
* Make your changes
|
129
|
-
* Ensure specs pass by running `
|
134
|
+
* Ensure specs pass by running `bin/rspec spec`
|
130
135
|
* Submit your pull request
|
131
136
|
|
132
137
|
|
@@ -11,7 +11,6 @@
|
|
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
|
15
14
|
//= require ckeditor/init
|
16
15
|
//= require monologue/admin/ckeditor-config
|
17
16
|
//= require monologue/admin/posts
|
@@ -3,7 +3,8 @@ class Monologue::Admin::PostsController < Monologue::Admin::BaseController
|
|
3
3
|
before_filter :load_post, only: [:edit, :update]
|
4
4
|
|
5
5
|
def index
|
6
|
-
@
|
6
|
+
@page = params[:page].nil? ? 1 : params[:page]
|
7
|
+
@posts = Monologue::Post.listing_page(@page).includes(:user)
|
7
8
|
end
|
8
9
|
|
9
10
|
def new
|
@@ -1,7 +1,7 @@
|
|
1
1
|
class Monologue::PostsController < Monologue::ApplicationController
|
2
2
|
def index
|
3
3
|
@page = params[:page].nil? ? 1 : params[:page]
|
4
|
-
@posts = Monologue::Post.page(@page).published
|
4
|
+
@posts = Monologue::Post.page(@page).includes(:user).published
|
5
5
|
end
|
6
6
|
|
7
7
|
def show
|
@@ -17,5 +17,10 @@ class Monologue::PostsController < Monologue::ApplicationController
|
|
17
17
|
|
18
18
|
def feed
|
19
19
|
@posts = Monologue::Post.published.limit(25)
|
20
|
+
if params[:tags].present?
|
21
|
+
tags = Monologue::Tag.where(name: params[:tags].split(",")).pluck(:id)
|
22
|
+
@posts = @posts.joins(:taggings).where("monologue_taggings.tag_id in (?)", tags)
|
23
|
+
end
|
24
|
+
render 'feed', layout: false
|
20
25
|
end
|
21
26
|
end
|
@@ -37,11 +37,11 @@ class Monologue::Post < ActiveRecord::Base
|
|
37
37
|
end
|
38
38
|
|
39
39
|
def self.page p
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
40
|
+
paged_results(p, Monologue::Config.posts_per_page || 10, false)
|
41
|
+
end
|
42
|
+
|
43
|
+
def self.listing_page(p)
|
44
|
+
paged_results(p, Monologue::Config.admin_posts_per_page || 50, true)
|
45
45
|
end
|
46
46
|
|
47
47
|
def self.total_pages
|
@@ -54,6 +54,17 @@ class Monologue::Post < ActiveRecord::Base
|
|
54
54
|
|
55
55
|
private
|
56
56
|
|
57
|
+
def self.paged_results(p, per_page, admin)
|
58
|
+
set_total_pages(per_page)
|
59
|
+
p = (p.nil? ? 0 : p.to_i - 1)
|
60
|
+
offset = p * per_page
|
61
|
+
if admin
|
62
|
+
default.limit(per_page).offset(offset)
|
63
|
+
else
|
64
|
+
limit(per_page).offset(offset)
|
65
|
+
end
|
66
|
+
end
|
67
|
+
|
57
68
|
def generate_url
|
58
69
|
return unless self.url.blank?
|
59
70
|
year = self.published_at.class == ActiveSupport::TimeWithZone ? self.published_at.year : DateTime.now.year
|
@@ -63,5 +74,4 @@ class Monologue::Post < ActiveRecord::Base
|
|
63
74
|
def url_do_not_start_with_slash
|
64
75
|
errors.add(:url, I18n.t("activerecord.errors.models.monologue/post.attributes.url.start_with_slash")) if self.url.start_with?("/")
|
65
76
|
end
|
66
|
-
|
67
77
|
end
|
@@ -12,7 +12,7 @@
|
|
12
12
|
<% end %>
|
13
13
|
<div class="container">
|
14
14
|
<% flash.each do |name, msg| %>
|
15
|
-
<%= content_tag :div, msg, id: "flash_#{name}", class: (name ==
|
15
|
+
<%= content_tag :div, msg, id: "flash_#{name}", class: (name == 'notice' ? "alert alert-info" : "alert alert-error") %>
|
16
16
|
<% end %>
|
17
17
|
|
18
18
|
<%= yield %>
|
@@ -0,0 +1,9 @@
|
|
1
|
+
<div id="pagination">
|
2
|
+
<% if @posts.total_pages > 1 && @posts.total_pages != @page.to_i %>
|
3
|
+
<%= link_to t(".older_posts"), admin_posts_page_path(@page.to_i+1), class: "older_posts" %>
|
4
|
+
<% end %>
|
5
|
+
|
6
|
+
<% if @posts.total_pages > 1 && @page.to_i > 1 %>
|
7
|
+
<%= link_to t(".newer_posts"), admin_posts_page_path(@page.to_i-1), class: "newer_posts" %>
|
8
|
+
<% end %>
|
9
|
+
</div>
|
@@ -1,12 +1,12 @@
|
|
1
|
-
<section>
|
1
|
+
<section data-tags="<%= post.tags.map(&:name).join(' ') %>">
|
2
2
|
<%= render partial: 'monologue/posts/post_header', locals: {post: post} %>
|
3
3
|
|
4
4
|
<div class="content" data-monologue="content">
|
5
|
-
<%= truncate_html(post.content, length:
|
5
|
+
<%= truncate_html(post.content, length: Monologue::Config.preview_size, omission: '...') %>
|
6
6
|
</div>
|
7
7
|
|
8
8
|
<div class="tags" data-monologue="tags">
|
9
9
|
<%= render post.tags %>
|
10
10
|
</div>
|
11
11
|
<%= link_to t(".readmore"), post.full_url, class: "button" %>
|
12
|
-
</section>
|
12
|
+
</section>
|
@@ -1,51 +1,17 @@
|
|
1
|
-
<
|
2
|
-
<span class="social-tagline"><%= t(
|
3
|
-
<
|
4
|
-
<
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
</script>
|
19
|
-
<!-- /GOOGLE +1 -->
|
20
|
-
</div>
|
21
|
-
<div id="twitter">
|
22
|
-
<!-- TWITTER -->
|
23
|
-
<a href="https://twitter.com/share" class="twitter-share-button"
|
24
|
-
data-lang="<%= Monologue::Config.twitter_locale || "en" %>"
|
25
|
-
data-url="<%= request.protocol %><%= request.host_with_port %><%= request.path.gsub("//","/") %>"
|
26
|
-
data-via="<%=Monologue::Config.twitter_username%>"
|
27
|
-
data-text="<%=@post.title%>"
|
28
|
-
data-count="horizontal">Tweet</a>
|
29
|
-
|
30
|
-
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
|
31
|
-
<!-- /TWITTER -->
|
32
|
-
</div>
|
33
|
-
|
34
|
-
|
35
|
-
<div id="facebook">
|
36
|
-
<!-- FACEBOOK LIKE -->
|
37
|
-
<div id="fb-root"></div>
|
38
|
-
<script>(function(d, s, id) {
|
39
|
-
var js, fjs = d.getElementsByTagName(s)[0];
|
40
|
-
if (d.getElementById(id)) return;
|
41
|
-
js = d.createElement(s); js.id = id;
|
42
|
-
js.src = "//connect.facebook.net/<%= Monologue::Config.facebook_like_locale || "en_US" %>/all.js#xfbml=1&appId=288133081204194";
|
43
|
-
fjs.parentNode.insertBefore(js, fjs);
|
44
|
-
}(document, 'script', 'facebook-jssdk'));</script>
|
45
|
-
<div class="fb-like" data-send="false" data-width="450" data-show-faces="false"></div>
|
46
|
-
<!-- /FACEBOOK LIKE -->
|
47
|
-
</div>
|
48
|
-
|
49
|
-
|
50
|
-
</div>
|
51
|
-
</footer>
|
1
|
+
<div class="monologue-social-sharing" data-monologue="monologue-social-sharing">
|
2
|
+
<span class="social-tagline"><%= t('.tagline') %></span>
|
3
|
+
<ul id="social-share">
|
4
|
+
<li id="google-plus">
|
5
|
+
<%= render :partial => 'monologue/posts/social/pinterest' %>
|
6
|
+
</li>
|
7
|
+
<li id="twitter">
|
8
|
+
<%= render :partial => 'monologue/posts/social/twitter' %>
|
9
|
+
</li>
|
10
|
+
<li id="google-plus">
|
11
|
+
<%= render :partial => 'monologue/posts/social/gplus' %>
|
12
|
+
</li>
|
13
|
+
<li id="facebook">
|
14
|
+
<%= render :partial => 'monologue/posts/social/facebook' %>
|
15
|
+
</li>
|
16
|
+
</ul>
|
17
|
+
</div>
|
@@ -0,0 +1,12 @@
|
|
1
|
+
<% if Monologue::Config.facebook_app_id.present? %>
|
2
|
+
<div id="fb-root"></div>
|
3
|
+
<script>(function (d, s, id) {
|
4
|
+
var js, fjs = d.getElementsByTagName(s)[0];
|
5
|
+
if (d.getElementById(id)) return;
|
6
|
+
js = d.createElement(s);
|
7
|
+
js.id = id;
|
8
|
+
js.src = "//connect.facebook.net/<%= Monologue::Config.facebook_like_locale || "en_US" %>/all.js#xfbml=1&appId=<%= Monologue::Config.facebook_app_id %>";
|
9
|
+
fjs.parentNode.insertBefore(js, fjs);
|
10
|
+
}(document, 'script', 'facebook-jssdk'));</script>
|
11
|
+
<div class="fb-like" data-send="false" data-width="450" data-show-faces="false"></div>
|
12
|
+
<% end %>
|
@@ -0,0 +1,16 @@
|
|
1
|
+
<div id="google-plus">
|
2
|
+
<g:plusone size="medium"></g:plusone>
|
3
|
+
|
4
|
+
<script type="text/javascript">
|
5
|
+
window.___gcfg = {lang: '<%=Monologue::Config.google_plusone_locale || "en" %>'};
|
6
|
+
|
7
|
+
(function () {
|
8
|
+
var po = document.createElement('script');
|
9
|
+
po.type = 'text/javascript';
|
10
|
+
po.async = true;
|
11
|
+
po.src = 'https://apis.google.com/js/plusone.js';
|
12
|
+
var s = document.getElementsByTagName('script')[0];
|
13
|
+
s.parentNode.insertBefore(po, s);
|
14
|
+
})();
|
15
|
+
</script>
|
16
|
+
</div>
|
@@ -0,0 +1,16 @@
|
|
1
|
+
<% if Monologue::Config.use_pinterest.presence %>
|
2
|
+
<%= link_to"Pin It",
|
3
|
+
"http://pinterest.com/pin/create/button/?url=#{@post.url}",
|
4
|
+
:class => "pin-it-button",
|
5
|
+
"count-layout" => "none" %>
|
6
|
+
|
7
|
+
<script type="text/javascript">
|
8
|
+
(function (d) {
|
9
|
+
var f = d.getElementsByTagName('SCRIPT')[0], p = d.createElement('SCRIPT');
|
10
|
+
p.type = 'text/javascript';
|
11
|
+
p.async = true;
|
12
|
+
p.src = '//assets.pinterest.com/js/pinit.js';
|
13
|
+
f.parentNode.insertBefore(p, f);
|
14
|
+
}(document));
|
15
|
+
</script>
|
16
|
+
<% end %>
|
@@ -0,0 +1,18 @@
|
|
1
|
+
<% if Monologue::Config.twitter_username.present? %>
|
2
|
+
<a href="https://twitter.com/share" class="twitter-share-button"
|
3
|
+
data-lang="<%= Monologue::Config.twitter_locale || "en" %>"
|
4
|
+
data-url="<%= request.protocol %><%= request.host_with_port %><%= request.path.gsub("//", "/") %>"
|
5
|
+
data-via="<%= Monologue::Config.twitter_username %>"
|
6
|
+
data-text="<%= @post.title %>"
|
7
|
+
data-count="horizontal">Tweet</a>
|
8
|
+
|
9
|
+
<script>!function (d, s, id) {
|
10
|
+
var js, fjs = d.getElementsByTagName(s)[0];
|
11
|
+
if (!d.getElementById(id)) {
|
12
|
+
js = d.createElement(s);
|
13
|
+
js.id = id;
|
14
|
+
js.src = "//platform.twitter.com/widgets.js";
|
15
|
+
fjs.parentNode.insertBefore(js, fjs);
|
16
|
+
}
|
17
|
+
}(document, "script", "twitter-wjs");</script>
|
18
|
+
<% end %>
|
@@ -1 +1 @@
|
|
1
|
-
<span class='tag'><%=link_to tag.name, tag_url(tag) %></span>
|
1
|
+
<span class='tag tag-<%= tag.name.parameterize %>'><%=link_to tag.name, tag_url(tag) %></span>
|
data/config/locales/de.yml
CHANGED
@@ -58,6 +58,7 @@ de:
|
|
58
58
|
published: "Yes"
|
59
59
|
not_published: "Nicht veröffentlicht"
|
60
60
|
status: "Veröffentlichen ?"
|
61
|
+
author: "Autor"
|
61
62
|
new:
|
62
63
|
header: "Neuer Monologue"
|
63
64
|
create:
|
@@ -127,7 +128,6 @@ de:
|
|
127
128
|
blank: "'Veröffentlichen am' wird benötigt"
|
128
129
|
url:
|
129
130
|
start_with_slash: "URL darf nicht mit einem Schrägstrich anfangen ('/')"
|
130
|
-
|
131
131
|
monologue/user:
|
132
132
|
blank: "%{attribute} wird benötigt"
|
133
133
|
taken: "%{attribute} wurde schon benutzt"
|
data/config/locales/en.yml
CHANGED
@@ -58,6 +58,7 @@ en:
|
|
58
58
|
published: "Yes"
|
59
59
|
not_published: "Not published"
|
60
60
|
status: "Published ?"
|
61
|
+
author: "Author"
|
61
62
|
new:
|
62
63
|
header: "New monologue"
|
63
64
|
create:
|
@@ -127,7 +128,6 @@ en:
|
|
127
128
|
blank: "'Published at' is required"
|
128
129
|
url:
|
129
130
|
start_with_slash: "URL can't start with a slash ('/')"
|
130
|
-
|
131
131
|
monologue/user:
|
132
132
|
blank: "%{attribute} is required"
|
133
133
|
taken: "%{attribute} has already been taken"
|
data/config/locales/es.yml
CHANGED
@@ -58,6 +58,7 @@ es:
|
|
58
58
|
published: "Sí"
|
59
59
|
not_published: "No publicado"
|
60
60
|
status: "Publicado?"
|
61
|
+
author: "Autor"
|
61
62
|
new:
|
62
63
|
header: "Nuevo artículo"
|
63
64
|
create:
|
@@ -139,7 +140,6 @@ es:
|
|
139
140
|
blank: "'Publicado en' es obligatorio"
|
140
141
|
url:
|
141
142
|
start_with_slash: "URL no puede empezar con '/'"
|
142
|
-
|
143
143
|
monologue/user:
|
144
144
|
blank: "%{attribute} es obligatorio"
|
145
145
|
taken: "%{attribute} ya está en uso"
|
data/config/locales/fr.yml
CHANGED
data/config/locales/it.yml
CHANGED
data/config/locales/ro.yml
CHANGED
data/config/locales/tr.yml
CHANGED
data/config/routes.rb
CHANGED
@@ -7,6 +7,7 @@ Monologue::Engine.routes.draw do
|
|
7
7
|
|
8
8
|
namespace :admin, path: "monologue" do
|
9
9
|
get "/" => "posts#index", as: "" # responds to admin_url and admin_path
|
10
|
+
get "/page/:page", to: "posts#index", as: "posts_page"
|
10
11
|
get "logout" => "sessions#destroy"
|
11
12
|
get "login" => "sessions#new"
|
12
13
|
resources :sessions
|
@@ -0,0 +1,27 @@
|
|
1
|
+
require "rails/generators/base"
|
2
|
+
|
3
|
+
module Monologue
|
4
|
+
module Generators
|
5
|
+
class ViewsGenerator < Rails::Generators::Base
|
6
|
+
desc "Copies Monologue views to your application."
|
7
|
+
argument :scope, required: false, default: nil,
|
8
|
+
desc: "The scope to copy views to"
|
9
|
+
source_root File.expand_path("../../../../app/views", __FILE__)
|
10
|
+
|
11
|
+
def copy_views
|
12
|
+
view_directory :layouts
|
13
|
+
view_directory :monologue
|
14
|
+
end
|
15
|
+
|
16
|
+
protected
|
17
|
+
|
18
|
+
def view_directory(name)
|
19
|
+
directory name.to_s, "#{target_path}/#{name}"
|
20
|
+
end
|
21
|
+
|
22
|
+
def target_path
|
23
|
+
@target_path ||= "app/views/#{scope || ''}"
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
@@ -3,34 +3,43 @@ module Monologue
|
|
3
3
|
include ConfigurationExtensions
|
4
4
|
|
5
5
|
attr_accessor :disqus_shortname,
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
6
|
+
:site_name,
|
7
|
+
:site_subtitle,
|
8
|
+
:site_url,
|
9
|
+
:meta_description,
|
10
|
+
:meta_keyword,
|
11
11
|
|
12
|
-
|
12
|
+
:show_rss_icon,
|
13
13
|
|
14
|
-
|
15
|
-
|
14
|
+
:twitter_username,
|
15
|
+
:twitter_locale,
|
16
16
|
|
17
|
-
|
18
|
-
|
19
|
-
|
17
|
+
:facebook_like_locale,
|
18
|
+
:facebook_url,
|
19
|
+
:facebook_logo, #used in the open graph protocol to display an image when a post is liked
|
20
|
+
:facebook_app_id,
|
20
21
|
|
21
|
-
|
22
|
-
|
22
|
+
:google_plus_account_url,
|
23
|
+
:google_plusone_locale,
|
23
24
|
|
24
|
-
|
25
|
+
:use_pinterest, #display pinterest?
|
25
26
|
|
26
|
-
|
27
|
+
:linkedin_url,
|
27
28
|
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
29
|
+
:github_username,
|
30
|
+
|
31
|
+
:admin_force_ssl,
|
32
|
+
:posts_per_page,
|
33
|
+
:admin_posts_per_page,
|
34
|
+
:google_analytics_id,
|
35
|
+
:gauge_analytics_site_id,
|
36
|
+
:layout,
|
37
|
+
:sidebar,
|
38
|
+
:preview_size
|
39
|
+
|
40
|
+
def initialize
|
41
|
+
@preview_size = 1000;
|
42
|
+
end
|
34
43
|
|
35
44
|
end
|
36
45
|
|
data/lib/monologue/engine.rb
CHANGED
@@ -4,6 +4,7 @@ require "select2-rails"
|
|
4
4
|
require "jquery-rails"
|
5
5
|
require "sass-rails"
|
6
6
|
require "coffee-rails"
|
7
|
+
require "responders"
|
7
8
|
|
8
9
|
module Monologue
|
9
10
|
class Engine < Rails::Engine
|
@@ -20,6 +21,7 @@ module Monologue
|
|
20
21
|
app.config.assets.precompile += %w[
|
21
22
|
monologue/admin/ckeditor-config.js
|
22
23
|
ckeditor/*
|
24
|
+
*.eot* *.woff *.ttf
|
23
25
|
]
|
24
26
|
end
|
25
27
|
|
data/lib/monologue/version.rb
CHANGED
metadata
CHANGED
@@ -1,251 +1,279 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: monologue
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jean-Philippe Boily | @jipiboily
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-12-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: 4.0.4
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: 4.0.4
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: bcrypt
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - ~>
|
31
|
+
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: 3.1.7
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- - ~>
|
38
|
+
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: 3.1.7
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: coffee-rails
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- -
|
45
|
+
- - ">="
|
46
46
|
- !ruby/object:Gem::Version
|
47
47
|
version: 4.0.0
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- -
|
52
|
+
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: 4.0.0
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
|
-
name:
|
56
|
+
name: truncate_html
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- -
|
59
|
+
- - ">="
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version:
|
61
|
+
version: '0'
|
62
62
|
type: :runtime
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- -
|
66
|
+
- - ">="
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version:
|
68
|
+
version: '0'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
|
-
name:
|
70
|
+
name: jquery-rails
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
|
-
- -
|
73
|
+
- - ">="
|
74
74
|
- !ruby/object:Gem::Version
|
75
75
|
version: '0'
|
76
76
|
type: :runtime
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
|
-
- -
|
80
|
+
- - ">="
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '0'
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
|
-
name:
|
84
|
+
name: rails-i18n
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
|
-
- -
|
87
|
+
- - ">="
|
88
88
|
- !ruby/object:Gem::Version
|
89
89
|
version: '0'
|
90
90
|
type: :runtime
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
|
-
- -
|
94
|
+
- - ">="
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: '0'
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
98
|
name: ckeditor
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
100
100
|
requirements:
|
101
|
-
- - ~>
|
101
|
+
- - "~>"
|
102
102
|
- !ruby/object:Gem::Version
|
103
|
-
version: 4.
|
103
|
+
version: 4.1.1
|
104
104
|
type: :runtime
|
105
105
|
prerelease: false
|
106
106
|
version_requirements: !ruby/object:Gem::Requirement
|
107
107
|
requirements:
|
108
|
-
- - ~>
|
108
|
+
- - "~>"
|
109
109
|
- !ruby/object:Gem::Version
|
110
|
-
version: 4.
|
110
|
+
version: 4.1.1
|
111
111
|
- !ruby/object:Gem::Dependency
|
112
112
|
name: select2-rails
|
113
113
|
requirement: !ruby/object:Gem::Requirement
|
114
114
|
requirements:
|
115
|
-
- - ~>
|
115
|
+
- - "~>"
|
116
116
|
- !ruby/object:Gem::Version
|
117
117
|
version: '3.2'
|
118
118
|
type: :runtime
|
119
119
|
prerelease: false
|
120
120
|
version_requirements: !ruby/object:Gem::Requirement
|
121
121
|
requirements:
|
122
|
-
- - ~>
|
122
|
+
- - "~>"
|
123
123
|
- !ruby/object:Gem::Version
|
124
124
|
version: '3.2'
|
125
|
+
- !ruby/object:Gem::Dependency
|
126
|
+
name: sass-rails
|
127
|
+
requirement: !ruby/object:Gem::Requirement
|
128
|
+
requirements:
|
129
|
+
- - "~>"
|
130
|
+
- !ruby/object:Gem::Version
|
131
|
+
version: 5.0.0
|
132
|
+
type: :runtime
|
133
|
+
prerelease: false
|
134
|
+
version_requirements: !ruby/object:Gem::Requirement
|
135
|
+
requirements:
|
136
|
+
- - "~>"
|
137
|
+
- !ruby/object:Gem::Version
|
138
|
+
version: 5.0.0
|
139
|
+
- !ruby/object:Gem::Dependency
|
140
|
+
name: responders
|
141
|
+
requirement: !ruby/object:Gem::Requirement
|
142
|
+
requirements:
|
143
|
+
- - "~>"
|
144
|
+
- !ruby/object:Gem::Version
|
145
|
+
version: 2.1.0
|
146
|
+
type: :runtime
|
147
|
+
prerelease: false
|
148
|
+
version_requirements: !ruby/object:Gem::Requirement
|
149
|
+
requirements:
|
150
|
+
- - "~>"
|
151
|
+
- !ruby/object:Gem::Version
|
152
|
+
version: 2.1.0
|
125
153
|
- !ruby/object:Gem::Dependency
|
126
154
|
name: rspec-rails
|
127
155
|
requirement: !ruby/object:Gem::Requirement
|
128
156
|
requirements:
|
129
|
-
- - ~>
|
157
|
+
- - "~>"
|
130
158
|
- !ruby/object:Gem::Version
|
131
159
|
version: '2.8'
|
132
160
|
type: :development
|
133
161
|
prerelease: false
|
134
162
|
version_requirements: !ruby/object:Gem::Requirement
|
135
163
|
requirements:
|
136
|
-
- - ~>
|
164
|
+
- - "~>"
|
137
165
|
- !ruby/object:Gem::Version
|
138
166
|
version: '2.8'
|
139
167
|
- !ruby/object:Gem::Dependency
|
140
168
|
name: factory_girl_rails
|
141
169
|
requirement: !ruby/object:Gem::Requirement
|
142
170
|
requirements:
|
143
|
-
- - ~>
|
171
|
+
- - "~>"
|
144
172
|
- !ruby/object:Gem::Version
|
145
173
|
version: 1.4.0
|
146
174
|
type: :development
|
147
175
|
prerelease: false
|
148
176
|
version_requirements: !ruby/object:Gem::Requirement
|
149
177
|
requirements:
|
150
|
-
- - ~>
|
178
|
+
- - "~>"
|
151
179
|
- !ruby/object:Gem::Version
|
152
180
|
version: 1.4.0
|
153
181
|
- !ruby/object:Gem::Dependency
|
154
182
|
name: capybara
|
155
183
|
requirement: !ruby/object:Gem::Requirement
|
156
184
|
requirements:
|
157
|
-
- - ~>
|
185
|
+
- - "~>"
|
158
186
|
- !ruby/object:Gem::Version
|
159
187
|
version: 1.1.4
|
160
188
|
type: :development
|
161
189
|
prerelease: false
|
162
190
|
version_requirements: !ruby/object:Gem::Requirement
|
163
191
|
requirements:
|
164
|
-
- - ~>
|
192
|
+
- - "~>"
|
165
193
|
- !ruby/object:Gem::Version
|
166
194
|
version: 1.1.4
|
167
195
|
- !ruby/object:Gem::Dependency
|
168
196
|
name: capybara-webkit
|
169
197
|
requirement: !ruby/object:Gem::Requirement
|
170
198
|
requirements:
|
171
|
-
- -
|
199
|
+
- - ">="
|
172
200
|
- !ruby/object:Gem::Version
|
173
201
|
version: '0'
|
174
202
|
type: :development
|
175
203
|
prerelease: false
|
176
204
|
version_requirements: !ruby/object:Gem::Requirement
|
177
205
|
requirements:
|
178
|
-
- -
|
206
|
+
- - ">="
|
179
207
|
- !ruby/object:Gem::Version
|
180
208
|
version: '0'
|
181
209
|
- !ruby/object:Gem::Dependency
|
182
210
|
name: shoulda
|
183
211
|
requirement: !ruby/object:Gem::Requirement
|
184
212
|
requirements:
|
185
|
-
- -
|
213
|
+
- - ">="
|
186
214
|
- !ruby/object:Gem::Version
|
187
215
|
version: '0'
|
188
216
|
type: :development
|
189
217
|
prerelease: false
|
190
218
|
version_requirements: !ruby/object:Gem::Requirement
|
191
219
|
requirements:
|
192
|
-
- -
|
220
|
+
- - ">="
|
193
221
|
- !ruby/object:Gem::Version
|
194
222
|
version: '0'
|
195
223
|
- !ruby/object:Gem::Dependency
|
196
224
|
name: guard-rspec
|
197
225
|
requirement: !ruby/object:Gem::Requirement
|
198
226
|
requirements:
|
199
|
-
- -
|
227
|
+
- - ">="
|
200
228
|
- !ruby/object:Gem::Version
|
201
229
|
version: '0'
|
202
230
|
type: :development
|
203
231
|
prerelease: false
|
204
232
|
version_requirements: !ruby/object:Gem::Requirement
|
205
233
|
requirements:
|
206
|
-
- -
|
234
|
+
- - ">="
|
207
235
|
- !ruby/object:Gem::Version
|
208
236
|
version: '0'
|
209
237
|
- !ruby/object:Gem::Dependency
|
210
238
|
name: database_cleaner
|
211
239
|
requirement: !ruby/object:Gem::Requirement
|
212
240
|
requirements:
|
213
|
-
- - ~>
|
241
|
+
- - "~>"
|
214
242
|
- !ruby/object:Gem::Version
|
215
243
|
version: 0.9.1
|
216
244
|
type: :development
|
217
245
|
prerelease: false
|
218
246
|
version_requirements: !ruby/object:Gem::Requirement
|
219
247
|
requirements:
|
220
|
-
- - ~>
|
248
|
+
- - "~>"
|
221
249
|
- !ruby/object:Gem::Version
|
222
250
|
version: 0.9.1
|
223
251
|
- !ruby/object:Gem::Dependency
|
224
252
|
name: mysql2
|
225
253
|
requirement: !ruby/object:Gem::Requirement
|
226
254
|
requirements:
|
227
|
-
- -
|
255
|
+
- - ">="
|
228
256
|
- !ruby/object:Gem::Version
|
229
257
|
version: '0'
|
230
258
|
type: :development
|
231
259
|
prerelease: false
|
232
260
|
version_requirements: !ruby/object:Gem::Requirement
|
233
261
|
requirements:
|
234
|
-
- -
|
262
|
+
- - ">="
|
235
263
|
- !ruby/object:Gem::Version
|
236
264
|
version: '0'
|
237
265
|
- !ruby/object:Gem::Dependency
|
238
266
|
name: sqlite3
|
239
267
|
requirement: !ruby/object:Gem::Requirement
|
240
268
|
requirements:
|
241
|
-
- -
|
269
|
+
- - ">="
|
242
270
|
- !ruby/object:Gem::Version
|
243
271
|
version: '0'
|
244
272
|
type: :development
|
245
273
|
prerelease: false
|
246
274
|
version_requirements: !ruby/object:Gem::Requirement
|
247
275
|
requirements:
|
248
|
-
- -
|
276
|
+
- - ">="
|
249
277
|
- !ruby/object:Gem::Version
|
250
278
|
version: '0'
|
251
279
|
description: Monologue is a basic blogging engine. It is a Rails mountable engine
|
@@ -309,6 +337,7 @@ files:
|
|
309
337
|
- app/views/layouts/monologue/application/_twitter_cards.html.erb
|
310
338
|
- app/views/monologue/admin/comments/show.html.erb
|
311
339
|
- app/views/monologue/admin/posts/_form.html.erb
|
340
|
+
- app/views/monologue/admin/posts/_pagination.html.erb
|
312
341
|
- app/views/monologue/admin/posts/edit.html.erb
|
313
342
|
- app/views/monologue/admin/posts/index.html.erb
|
314
343
|
- app/views/monologue/admin/posts/new.html.erb
|
@@ -325,6 +354,10 @@ files:
|
|
325
354
|
- app/views/monologue/posts/feed.rss.builder
|
326
355
|
- app/views/monologue/posts/index.html.erb
|
327
356
|
- app/views/monologue/posts/show.html.erb
|
357
|
+
- app/views/monologue/posts/social/_facebook.html.erb
|
358
|
+
- app/views/monologue/posts/social/_gplus.html.erb
|
359
|
+
- app/views/monologue/posts/social/_pinterest.html.erb
|
360
|
+
- app/views/monologue/posts/social/_twitter.html.erb
|
328
361
|
- app/views/monologue/sidebar/_archive.html.erb
|
329
362
|
- app/views/monologue/sidebar/_categories.html.erb
|
330
363
|
- app/views/monologue/sidebar/_latest_posts.html.erb
|
@@ -337,7 +370,7 @@ files:
|
|
337
370
|
- config/locales/es.yml
|
338
371
|
- config/locales/fr.yml
|
339
372
|
- config/locales/it.yml
|
340
|
-
- config/locales/pt.yml
|
373
|
+
- config/locales/pt-BR.yml
|
341
374
|
- config/locales/ro.yml
|
342
375
|
- config/locales/tr.yml
|
343
376
|
- config/routes.rb
|
@@ -356,6 +389,7 @@ files:
|
|
356
389
|
- db/migrate/20130509015400_merge_revisions_into_posts.rb
|
357
390
|
- db/seeds.rb
|
358
391
|
- deprecations.rb
|
392
|
+
- lib/generators/monologue/views_generator.rb
|
359
393
|
- lib/monologue.rb
|
360
394
|
- lib/monologue/configuration.rb
|
361
395
|
- lib/monologue/configuration_extensions.rb
|
@@ -387,12 +421,12 @@ require_paths:
|
|
387
421
|
- lib
|
388
422
|
required_ruby_version: !ruby/object:Gem::Requirement
|
389
423
|
requirements:
|
390
|
-
- -
|
424
|
+
- - ">="
|
391
425
|
- !ruby/object:Gem::Version
|
392
426
|
version: '0'
|
393
427
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
394
428
|
requirements:
|
395
|
-
- -
|
429
|
+
- - ">="
|
396
430
|
- !ruby/object:Gem::Version
|
397
431
|
version: '0'
|
398
432
|
requirements: []
|