blogo 0.0.8 → 0.0.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.markdown +2 -0
- data/app/controllers/blogo/admin/images_controller.rb +1 -1
- data/app/controllers/blogo/admin/posts_controller.rb +3 -3
- data/app/controllers/blogo/admin/sessions_controller.rb +3 -3
- data/app/views/blogo/admin/comments/index.html.erb +1 -1
- data/app/views/blogo/admin/posts/_form.html.erb +10 -10
- data/app/views/blogo/admin/posts/_post_li.html.erb +5 -5
- data/app/views/blogo/admin/posts/edit.html.erb +1 -1
- data/app/views/blogo/admin/posts/index.html.erb +5 -5
- data/app/views/blogo/admin/posts/new.html.erb +1 -1
- data/app/views/blogo/admin/sessions/new.html.erb +4 -4
- data/app/views/blogo/admin/shared/_nav_bar.html.erb +4 -4
- data/app/views/blogo/posts/_disqus_comments.html.erb +2 -2
- data/app/views/blogo/posts/_post_header.html.erb +1 -1
- data/app/views/blogo/posts/_post_overview.html.erb +1 -1
- data/app/views/blogo/shared/_aside.html.erb +2 -2
- data/config/locales/en.yml +47 -0
- data/config/locales/pt-BR.yml +47 -0
- data/lib/blogo/version.rb +1 -1
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: db848f7682345fd76f34c90d5ed1184fc72045fb
|
4
|
+
data.tar.gz: c4d0905aa90ee12b1c3ba2f878c93e91590650e3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9a746ee3d6a05df89e43f129f0772afc28ba07496c57334c84f8eab985ae88c02c7c71aa219d9ac7e1bd594b0f773beeed6dee39a571f01d3b72d4265af0a4c4
|
7
|
+
data.tar.gz: 3783b7bc6c741984e0451d77b27626e4c77fb3838394643c07fd34d6f785a0a4da40d27ee657e4ca0fb713ad95379761661b1f49394d702875f1b004f6fba6c7
|
data/README.markdown
CHANGED
@@ -64,6 +64,7 @@ Go to http://localhost::3000/blog to take a look at your posts.
|
|
64
64
|
* SEO optimized: generates meta description, keywords, meta tags for facebook([OpenGraph](http://ogp.me/)) and twitter
|
65
65
|
* Can be customized for your own needs.
|
66
66
|
* Very few external dependencies
|
67
|
+
* Localization support
|
67
68
|
|
68
69
|
|
69
70
|
## Markup Formats
|
@@ -81,6 +82,7 @@ add necessary dependencies to your Gemfile manually.
|
|
81
82
|
## Credits
|
82
83
|
|
83
84
|
* [Sergey Potapov](https://github.com/greyblake) - creator and maintainer
|
85
|
+
* [Diego Souza](https://github.com/diegosouza) - I18n support
|
84
86
|
|
85
87
|
## License
|
86
88
|
|
@@ -18,7 +18,7 @@ module Blogo::Admin
|
|
18
18
|
file_path = Rails.root.join('public', image_directory, image_name)
|
19
19
|
|
20
20
|
if File.exists?(file_path)
|
21
|
-
@error =
|
21
|
+
@error = I18n.translate('blogo.admin.image_already_exists', image_name: image_name)
|
22
22
|
else
|
23
23
|
dir = File.dirname(file_path)
|
24
24
|
FileUtils.mkdir_p(dir) unless File.exists?(dir)
|
@@ -21,7 +21,7 @@ module Blogo::Admin
|
|
21
21
|
|
22
22
|
if service.create!
|
23
23
|
@post = service.post
|
24
|
-
flash[:notice] =
|
24
|
+
flash[:notice] = I18n.translate('blogo.admin.post_created')
|
25
25
|
redirect_to blogo_admin_posts_path
|
26
26
|
else
|
27
27
|
@post = service.post
|
@@ -42,7 +42,7 @@ module Blogo::Admin
|
|
42
42
|
service = Blogo::UpdatePostService.new(@post, post_params)
|
43
43
|
|
44
44
|
if service.update!
|
45
|
-
flash[:notice] =
|
45
|
+
flash[:notice] = I18n.translate('blogo.admin.post_updated')
|
46
46
|
redirect_to blogo_admin_posts_path
|
47
47
|
else
|
48
48
|
render 'edit'
|
@@ -55,7 +55,7 @@ module Blogo::Admin
|
|
55
55
|
post = Blogo::Post.find(params[:id])
|
56
56
|
Blogo::DestroyPostService.new(post).destroy!
|
57
57
|
|
58
|
-
flash[:notice] =
|
58
|
+
flash[:notice] = I18n.translate('blogo.admin.post_removed')
|
59
59
|
redirect_to blogo_admin_posts_path
|
60
60
|
end
|
61
61
|
|
@@ -17,9 +17,9 @@ module Blogo::Admin
|
|
17
17
|
user = Blogo::User.find_by_email(params[:email])
|
18
18
|
if user && user.authenticate(params[:password])
|
19
19
|
session[:blogo_user_id] = user.id
|
20
|
-
redirect_to blogo_admin_url, notice:
|
20
|
+
redirect_to blogo_admin_url, notice: I18n.translate('blogo.admin.logged_in')
|
21
21
|
else
|
22
|
-
flash.now.alert =
|
22
|
+
flash.now.alert = I18n.translate('blogo.admin.login_fail')
|
23
23
|
render "new"
|
24
24
|
end
|
25
25
|
end
|
@@ -29,7 +29,7 @@ module Blogo::Admin
|
|
29
29
|
#
|
30
30
|
def destroy
|
31
31
|
session[:blogo_user_id] = nil
|
32
|
-
redirect_to blogo_admin_url, notice:
|
32
|
+
redirect_to blogo_admin_url, notice: I18n.translate('blogo.admin.logged_out')
|
33
33
|
end
|
34
34
|
end
|
35
35
|
end
|
@@ -1,5 +1,5 @@
|
|
1
1
|
<div id="recent-comments">
|
2
|
-
<h1 class="admin-header"
|
2
|
+
<h1 class="admin-header"><%= t('blogo.admin.recent_comments') %></h1>
|
3
3
|
<script type="text/javascript" src="//<%= Blogo.config.disqus_shortname%>.disqus.com/recent_comments_widget.js?num_items=20&avatar_size=48&excerpt_length=500"></script>
|
4
4
|
</div>
|
5
5
|
|
@@ -3,41 +3,41 @@
|
|
3
3
|
<div class="pure-g-r form-new-post">
|
4
4
|
<div class="pure-u-17-24">
|
5
5
|
<div class="left-fields"^>
|
6
|
-
<%= f.text_field :title, required: true, id: 'post-title', placeholder: '
|
6
|
+
<%= f.text_field :title, required: true, id: 'post-title', placeholder: t('blogo.admin.post_title') %>
|
7
7
|
|
8
8
|
<%= f.text_area :raw_content, class: 'ckeditor', required: true %>
|
9
9
|
|
10
|
-
<%= f.text_field :tags_string, placeholder: '
|
10
|
+
<%= f.text_field :tags_string, placeholder: t('blogo.admin.tags_separated_with_commas') %>
|
11
11
|
</div>
|
12
12
|
</div>
|
13
13
|
|
14
14
|
<div class="pure-u-7-24">
|
15
|
-
<%= f.text_field :permalink, class: 'pure-input-1', required: true, id: 'permalink', placeholder: '
|
15
|
+
<%= f.text_field :permalink, class: 'pure-input-1', required: true, id: 'permalink', placeholder: t('blogo.admin.unique_permalink') %>
|
16
16
|
|
17
|
-
<%= f.label :published_at, '
|
18
|
-
<%= f.text_field :published_at, class: 'pure-input-1', id: 'input-datepicker', placeholder: '
|
17
|
+
<%= f.label :published_at, t('blogo.admin.published_on') %>
|
18
|
+
<%= f.text_field :published_at, class: 'pure-input-1', id: 'input-datepicker', placeholder: t('blogo.admin.today') %>
|
19
19
|
|
20
20
|
<%= f.label :published, class: 'pure-checkbox' do %>
|
21
21
|
<%= f.check_box :published %>
|
22
|
-
|
22
|
+
<%= t('blogo.admin.publish') %>
|
23
23
|
<% end %>
|
24
24
|
|
25
25
|
</div>
|
26
26
|
</div>
|
27
27
|
|
28
28
|
<br />
|
29
|
-
<%= f.button
|
30
|
-
<%= f.button
|
29
|
+
<%= f.button t('blogo.admin.save_post_button') , class: 'pure-button button-success', id: 'button-save' %>
|
30
|
+
<%= f.button t('blogo.admin.preview_post_button') , class: 'pure-button button-secondary', id: 'button-preview' %>
|
31
31
|
|
32
32
|
|
33
33
|
<section class="semantic-content" id="modal-preview" tabindex="-1" role="dialog" aria-labelledby="modal-label" aria-hidden="true">
|
34
34
|
<div class="modal-inner">
|
35
35
|
<header id="modal-label">
|
36
|
-
<h1
|
36
|
+
<h1><%= t('blogo.admin.preview_press_esc') %></h1>
|
37
37
|
</header>
|
38
38
|
<div class="modal-content"><iframe></iframe></div>
|
39
39
|
</div>
|
40
|
-
<a href="#!" class="modal-close" title="
|
40
|
+
<a href="#!" class="modal-close" title="<%= t('blogo.admin.modal_title_close_preview') %>" data-close="Close" data-dismiss="modal">×</a>
|
41
41
|
</section>
|
42
42
|
|
43
43
|
|
@@ -1,14 +1,14 @@
|
|
1
1
|
<%
|
2
|
-
confirm_message =
|
2
|
+
confirm_message = t('blogo.admin.modal_confirm_delete_post', post_title: post.title)
|
3
3
|
%>
|
4
4
|
|
5
5
|
<tr>
|
6
6
|
<td><%= link_to post.title, edit_blogo_admin_post_path(post) %></td>
|
7
|
-
<td><%= post.status %></td>
|
7
|
+
<td><%= t("blogo.admin.post_status_#{post.status}") %></td>
|
8
8
|
<td><%= post.user.name %></td>
|
9
|
-
<td><%= post.published_at.to_date %></td>
|
9
|
+
<td><%= l(post.published_at.to_date) %></td>
|
10
10
|
<td>
|
11
|
-
<%= link_to '
|
12
|
-
<%= link_to '
|
11
|
+
<%= link_to t('blogo.admin.edit_post_button'), edit_blogo_admin_post_path(post), class: "pure-button button-secondary" %>
|
12
|
+
<%= link_to t('blogo.admin.delete_post_button'), blogo_admin_post_path(post), method: :delete, data: {confirm: confirm_message}, class: "pure-button button-warning" %>
|
13
13
|
</td>
|
14
14
|
</tr>
|
@@ -1,4 +1,4 @@
|
|
1
|
-
<h1 class="admin-header"
|
1
|
+
<h1 class="admin-header"><%= t('blogo.admin.edit_post') %></h1>
|
2
2
|
|
3
3
|
<%= blogo_form_for [:blogo, :admin, @post], method: :patch, html: {id: 'post-form', class: 'pure-form pure-form-stacked'} do |f| %>
|
4
4
|
<%= render partial: 'form', locals: {f: f} %>
|
@@ -1,12 +1,12 @@
|
|
1
|
-
<h1 class="admin-header"
|
1
|
+
<h1 class="admin-header"><%= t('blogo.admin.posts') %></h1>
|
2
2
|
|
3
3
|
<table class="pure-table pure-table-striped">
|
4
4
|
<thead>
|
5
5
|
<tr>
|
6
|
-
<th><%= '
|
7
|
-
<th><%= '
|
8
|
-
<th><%= '
|
9
|
-
<th><%= '
|
6
|
+
<th><%= t('blogo.admin.title') %></th>
|
7
|
+
<th><%= t('blogo.admin.status') %></th>
|
8
|
+
<th><%= t('blogo.admin.author') %></th>
|
9
|
+
<th><%= t('blogo.admin.published_on') %></th>
|
10
10
|
<th></th>
|
11
11
|
</tr>
|
12
12
|
</thead>
|
@@ -1,4 +1,4 @@
|
|
1
|
-
<h1 class="admin-header"
|
1
|
+
<h1 class="admin-header"><%= t('blogo.admin.add_new_post') %></h1>
|
2
2
|
|
3
3
|
<%= blogo_form_for @post, :url => blogo_admin_posts_path, html: {id: 'post-form', class: 'pure-form pure-form-stacked'} do |f| %>
|
4
4
|
<%= render partial: 'form', locals: {f: f} %>
|
@@ -1,14 +1,14 @@
|
|
1
1
|
<%= form_tag blogo_admin_sessions_path, class: 'pure-form pure-form-stacked' do %>
|
2
2
|
<fieldset>
|
3
3
|
|
4
|
-
<legend
|
4
|
+
<legend><%= t('blogo.admin.login') %></legend>
|
5
5
|
|
6
|
-
<%= label_tag :email %>
|
6
|
+
<%= label_tag :email, t('blogo.admin.email') %>
|
7
7
|
<%= text_field_tag :email, params[:email] %>
|
8
8
|
|
9
|
-
<%= label_tag :password %>
|
9
|
+
<%= label_tag :password, t('blogo.admin.password') %>
|
10
10
|
<%= password_field_tag :password %>
|
11
11
|
|
12
|
-
<%= submit_tag
|
12
|
+
<%= submit_tag t('blogo.admin.login_button'), class: 'pure-button' %>
|
13
13
|
<fieldset>
|
14
14
|
<% end %>
|
@@ -1,10 +1,10 @@
|
|
1
1
|
<div class="pure-menu pure-menu-open pure-menu-horizontal nav">
|
2
2
|
<ul>
|
3
|
-
<li><%= link_to "Blogo"
|
4
|
-
<li><%= link_to
|
5
|
-
<li><%= link_to
|
3
|
+
<li><%= link_to "Blogo" , blogo_admin_path %> </li>
|
4
|
+
<li><%= link_to t('blogo.admin.new_post'), new_blogo_admin_post_path %></li>
|
5
|
+
<li><%= link_to t('blogo.admin.comments'), blogo_admin_comments_path %></li>
|
6
6
|
</ul>
|
7
7
|
<ul class="pull-right">
|
8
|
-
<li><%= link_to
|
8
|
+
<li><%= link_to t('blogo.admin.sign_out'), blogo_admin_logout_path %></li>
|
9
9
|
</ul>
|
10
10
|
</div>
|
@@ -1,8 +1,8 @@
|
|
1
1
|
<% if Blogo.config.disqus_shortname %>
|
2
2
|
<section id='disqus-comments'>
|
3
|
-
<h1
|
3
|
+
<h1><%= t('blogo.user.comments') %></h1>
|
4
4
|
<div id="disqus_thread" aria-live="polite"></div>
|
5
|
-
<noscript
|
5
|
+
<noscript><%= t('blogo.user.please_enable_javascript') %></noscript>
|
6
6
|
</section>
|
7
7
|
|
8
8
|
|
@@ -1,7 +1,7 @@
|
|
1
1
|
<aside>
|
2
2
|
<% if @recent_posts %>
|
3
3
|
<header>
|
4
|
-
<h1
|
4
|
+
<h1><%= t('blogo.user.recent_posts') %></h1>
|
5
5
|
</header>
|
6
6
|
<ul class="blogo-recent-posts">
|
7
7
|
<% @recent_posts.each do |post| %>
|
@@ -14,7 +14,7 @@
|
|
14
14
|
|
15
15
|
|
16
16
|
<header>
|
17
|
-
<h1
|
17
|
+
<h1><%= t('blogo.user.tags') %></h1>
|
18
18
|
</header>
|
19
19
|
<div class="tags">
|
20
20
|
<% @tags.each do |tag| %>
|
@@ -0,0 +1,47 @@
|
|
1
|
+
en:
|
2
|
+
blogo:
|
3
|
+
user:
|
4
|
+
comments: 'Comments'
|
5
|
+
please_enable_javascript: 'Please enable JavaScript to view the comments.'
|
6
|
+
post_by: 'By'
|
7
|
+
read_post: 'Read ➞'
|
8
|
+
recent_posts: 'Recent posts'
|
9
|
+
tags: 'Tags'
|
10
|
+
|
11
|
+
admin:
|
12
|
+
add_new_post: 'Add a new post'
|
13
|
+
author: 'Author'
|
14
|
+
comments: 'Comments'
|
15
|
+
delete_post_button: 'delete'
|
16
|
+
edit_post: 'Edit post'
|
17
|
+
edit_post_button: 'edit'
|
18
|
+
email: 'Email'
|
19
|
+
image_already_exists: 'Image with name "%{image_name}" already exists'
|
20
|
+
logged_in: 'You have logged in'
|
21
|
+
logged_out: 'You have logged out'
|
22
|
+
login: 'Login'
|
23
|
+
login_button: 'Login'
|
24
|
+
login_fail: 'Incorrect email or password'
|
25
|
+
modal_confirm_delete_post: 'Are you sure you want to delete "%{post_title}"?'
|
26
|
+
modal_title_close_preview: 'Close preview'
|
27
|
+
new_post: 'New Post'
|
28
|
+
password: 'Password'
|
29
|
+
post_created: 'The post is created'
|
30
|
+
post_removed: 'The post is removed'
|
31
|
+
post_status_draft: 'draft'
|
32
|
+
post_status_published: 'published'
|
33
|
+
post_title: 'Post Title'
|
34
|
+
post_updated: 'The post is updated'
|
35
|
+
posts: 'Posts'
|
36
|
+
preview_post_button: 'Preview'
|
37
|
+
preview_press_esc: 'Preview. Press ESC to back.'
|
38
|
+
publish: 'Publish'
|
39
|
+
published_on: 'Published on'
|
40
|
+
save_post_button: 'Save'
|
41
|
+
sign_out: 'Sign out'
|
42
|
+
status: 'Status'
|
43
|
+
tags_separated_with_commas: 'Tags separated with commas'
|
44
|
+
title: 'Title'
|
45
|
+
today: 'Today'
|
46
|
+
unique_permalink: 'unique-permalink'
|
47
|
+
recent_comments: 'Recent comments'
|
@@ -0,0 +1,47 @@
|
|
1
|
+
pt-BR:
|
2
|
+
blogo:
|
3
|
+
user:
|
4
|
+
comments: 'Comentários'
|
5
|
+
please_enable_javascript: 'Por favor, habilite o JavaScript para visualizar os comentários.'
|
6
|
+
post_by: 'Postado por'
|
7
|
+
read_post: 'Ler ➞'
|
8
|
+
recent_posts: 'Postagens recentes'
|
9
|
+
tags: 'Tags'
|
10
|
+
|
11
|
+
admin:
|
12
|
+
add_new_post: 'Criar uma nova postagem'
|
13
|
+
author: 'Autor'
|
14
|
+
comments: 'Comentários'
|
15
|
+
delete_post_button: 'apagar'
|
16
|
+
edit_post: 'Editar postagem'
|
17
|
+
edit_post_button: 'editar'
|
18
|
+
email: 'Email'
|
19
|
+
image_already_exists: 'Já existe uma imagem com o nome "%{image_name}"'
|
20
|
+
logged_in: 'Você está logado'
|
21
|
+
logged_out: 'A sessão foi encerrada'
|
22
|
+
login: 'Login'
|
23
|
+
login_button: 'Entrar'
|
24
|
+
login_fail: 'Email ou senha incorreta'
|
25
|
+
modal_confirm_delete_post: 'Tem certeza que deseja apagar "%{post_title}"?'
|
26
|
+
modal_title_close_preview: 'Fechar a pré-visualização'
|
27
|
+
new_post: 'Nova Postagem'
|
28
|
+
password: 'Senha'
|
29
|
+
post_created: 'A postagem foi salva'
|
30
|
+
post_removed: 'A postagem foi removida'
|
31
|
+
post_status_draft: 'rascunho'
|
32
|
+
post_status_published: 'publicado'
|
33
|
+
post_title: 'Título da Postagem'
|
34
|
+
post_updated: 'A postagem foi atualizada'
|
35
|
+
posts: 'Postagens'
|
36
|
+
preview_post_button: 'Pré-visualizar'
|
37
|
+
preview_press_esc: 'Pré-visualização. Pressione ESC para voltar.'
|
38
|
+
publish: 'Publicar'
|
39
|
+
published_on: 'Publicado em'
|
40
|
+
save_post_button: 'Salvar'
|
41
|
+
sign_out: 'Sair'
|
42
|
+
status: 'Estado'
|
43
|
+
tags_separated_with_commas: 'Tags separadas por vírgula'
|
44
|
+
title: 'Título'
|
45
|
+
today: 'Hoje'
|
46
|
+
unique_permalink: 'link-permanente-unico'
|
47
|
+
recent_comments: 'Comentários recentes'
|
data/lib/blogo/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: blogo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sergey Potapov
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-06-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -150,6 +150,8 @@ files:
|
|
150
150
|
- app/views/layouts/blogo/admin.html.erb
|
151
151
|
- app/views/layouts/blogo/blog.html.erb
|
152
152
|
- config/environment.rb
|
153
|
+
- config/locales/en.yml
|
154
|
+
- config/locales/pt-BR.yml
|
153
155
|
- db/migrate/20140218134508_create_blogo_users.rb
|
154
156
|
- db/migrate/20140218134512_create_blogo_tags.rb
|
155
157
|
- db/migrate/20140218134550_create_blogo_posts.rb
|