go_blog 0.1.4 → 0.1.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: fb6bfb2449235be656dc7ce3b75badba94ba7f0d
4
- data.tar.gz: eea8b106187bf50d0a145e316b036230484e2808
3
+ metadata.gz: 474e51e949bcf0873b4013ac6b8c84c6c261faf5
4
+ data.tar.gz: 0f5c9f29133524911ffcf2301fd7622bd27547df
5
5
  SHA512:
6
- metadata.gz: 8bf78a5192bad9cce53e6dc5a8150df6079b1d8b0cc6193d236d758e1e2a3450efc55cdc5f4391af938d4f93b5f15a1dc8bf640db30465c6e6048c8dee9e4b45
7
- data.tar.gz: ac2cd29b119d9b72966d37f6e113de70bbea2d0a73c2f488fc6baadd814a23edef3dbf66af2d9c0ca45ae4685c5b9d7727bb2addcc94fbeb502d349726ba445e
6
+ metadata.gz: c7e907412e971e431235ae8e8dea0a1fb172e2bea5549c0358cf2217750dbc3e7d96f4633c9eb6affa035f694f0cc0dd4e25f3dd7016a7307d795e1a3f5eb73e
7
+ data.tar.gz: 40b0106b2b41206949480b5e191cfaa33b843c147ffc0aee7e09410a93d24ff14f8fa89ce6a0a0e05e0a80c7280ffe4f8ddb0da3e30c1572418df214b1ab8a89
@@ -2,5 +2,11 @@ module Blog
2
2
  class Post < ApplicationRecord
3
3
  validates_presence_of :title, :user_id, :body
4
4
  belongs_to :user
5
+
6
+ def list_text
7
+ return '' if !teaser.blank? and !body.blank?
8
+ teaser if !teaser.blank?
9
+ body if !body.blank?
10
+ end
5
11
  end
6
12
  end
@@ -1,12 +1,10 @@
1
1
  <% collection.each do |resource| %>
2
2
  <tr id="<%= dom_id(resource) %>">
3
3
  <td><%= resource.title %></td>
4
- <td><%= truncate_with_hover(resource.teaser.html_safe,30) %></td>
5
- <td><%= truncate_with_hover(resource.body.html_safe,30) %></td>
4
+ <td><%= truncate_with_hover(resource.teaser.html_safe, 30) %></td>
6
5
  <td><%= resource.draft %></td>
7
- <td><%= resource.published_at %></td>
6
+ <td><%= converte_date(resource.published_at) %></td>
8
7
  <td><%= resource.user_id %></td>
9
- <td><%= resource.custom_url %></td>
10
8
  <td><%= resource.access_count %></td>
11
9
  <td class="text-center">
12
10
  <% if current_user and current_user.admin? %>
@@ -14,7 +14,7 @@
14
14
  </div>
15
15
  <h4 class="text-uppercase push-10">
16
16
  <%= resource.decorate.link_to_title %></h4>
17
- <p class="push-20"><%= resource.teaser.html_safe %></p>
17
+ <p class="push-20"><%= truncate_with_hover(resource.teaser.html_safe,30) %></p>
18
18
  <div class="btn-group btn-group-sm">
19
19
  <!--<a class="btn btn-default" href="javascript:void(0)"><i class="fa fa-share-alt push-5-r"></i> Compartilhar</a>-->
20
20
  <%= resource.decorate.link_to_read_more %>
@@ -27,9 +27,11 @@
27
27
  <table class="table table-striped">
28
28
  <thead>
29
29
  <tr>
30
- <th><%=t 'activerecord.attributes.blog_post.name' %></th>
31
- <th><%=t 'activerecord.attributes.blog_post.link' %></th>
32
- <th><%=t 'activerecord.attributes.blog_post.link_category' %></th>
30
+ <th><%=t 'activerecord.attributes.blog_post.title' %></th>
31
+ <th><%=t 'activerecord.attributes.blog_post.teaser' %></th>
32
+ <th><%=t 'activerecord.attributes.blog_post.draft' %></th>
33
+ <th><%=t 'activerecord.attributes.blog_post.published_at' %></th>
34
+ <th><%=t 'activerecord.attributes.blog_post.access_count' %></th>
33
35
  <th class="text-center" style="width: 150px;"><%=t 'misc.actions' %></th>
34
36
  </tr>
35
37
  </thead>
@@ -0,0 +1,18 @@
1
+ pt-BR:
2
+ activerecord:
3
+ models:
4
+ blog_post:
5
+ one: "teste"
6
+ other: "teste"
7
+ explain: "teste"
8
+
9
+ attributes:
10
+ blog_post:
11
+ title: "Titulo"
12
+ teaser: "name"
13
+ draft: "name"
14
+ published_at: "name"
15
+ access_count: "name"
16
+ id: ID
17
+ created_at: Criado em
18
+ updated_at: Atualizado em
@@ -0,0 +1,35 @@
1
+ pt-BR:
2
+ blog_post:
3
+ default: &default
4
+ h1: Link
5
+ header: "Lista de links"
6
+ block_header: links
7
+ index:
8
+ <<: *default
9
+ header: "Lista de links"
10
+ block_header: links
11
+ show:
12
+ <<: *default
13
+ header: "Detalhes: %{resource}"
14
+ edit:
15
+ <<: *default
16
+ header: "Editar: %{resource}"
17
+ new:
18
+ <<: *default
19
+ header: "Cadastrar Link"
20
+ title: "Cadastrar Link"
21
+ create:
22
+ alert: "Link não pode ser cadastrado."
23
+ notice: "Link cadastrado com sucesso."
24
+ update:
25
+ alert: "Link não pode ser atualizado."
26
+ notice: "Link atualizado com sucesso."
27
+ destroy:
28
+ alert: "Link não pode ser excluído."
29
+ notice: "Link excluído com sucesso."
30
+
31
+ helpers:
32
+ submit:
33
+ link:
34
+ create: "Cadastrar %{model}"
35
+ update: "Atualizar %{model}"
@@ -1,7 +1,7 @@
1
-
2
1
  require 'rails/all'
3
2
  module GoBlog
4
3
  class Engine < ::Rails::Engine
4
+
5
5
  initializer :append_migrations do |app|
6
6
  # This prevents migrations from being loaded twice from the inside of the
7
7
  # gem itself (dummy test app)
@@ -11,5 +11,14 @@ module GoBlog
11
11
  end
12
12
  end
13
13
  end
14
+
15
+ config.i18n.default_locale = :'pt-BR'
16
+ config.autoload_paths += %W(#{config.root}/lib)
17
+ config.time_zone = 'Brasilia'
18
+ config.i18n.load_path += Dir[config.root.join('config', 'locales','**', '*.{rb,yml}').to_s]
19
+ config.encoding = "utf-8"
20
+
21
+
14
22
  end
23
+
15
24
  end
@@ -1,3 +1,3 @@
1
1
  module GoBlog
2
- VERSION = '0.1.4'
2
+ VERSION = '0.1.5'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: go_blog
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - João Carlos Ottobboni
@@ -93,6 +93,8 @@ files:
93
93
  - app/views/blog/posts/edit.html.erb
94
94
  - app/views/blog/posts/index.html.erb
95
95
  - app/views/blog/posts/list.html.erb
96
+ - app/views/blog/posts/locales/model_locale.yml
97
+ - app/views/blog/posts/locales/view_locale.yml
96
98
  - app/views/blog/posts/new.html.erb
97
99
  - app/views/blog/posts/show.html.erb
98
100
  - app/views/blog/posts/show_list.html.erb