georgia_blog 0.7.2 → 0.7.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 89e123475dda925b9c169a65d1f601ed968b3c15
|
4
|
+
data.tar.gz: 473fd88fca305cc99346b81c7dc1cc344818c394
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a74913b3d30df19b83ca65c423af085bdaa8c4adfba780ac94e508948f4e8a13280247b14509dd672ed359d06be794a4e2567a565e9fc81b52a9ce6572d2e88d
|
7
|
+
data.tar.gz: b3e14474cc363c198d6726a251b119c44c109fb952a75f29c58022dde6fbc23e1889f278e49fcf27f49687f2d3fe5ec387d9afcdeb46e7411f17af147b17f2ae
|
@@ -1,4 +1,12 @@
|
|
1
1
|
module Georgia
|
2
2
|
class PostsController < Georgia::PagesController
|
3
|
+
|
4
|
+
before_filter :prepare_post_data, only: [:update, :settings]
|
5
|
+
|
6
|
+
private
|
7
|
+
|
8
|
+
def prepare_post_data
|
9
|
+
@post_data ||= @page.build_post_data unless @page and @page.post_data
|
10
|
+
end
|
3
11
|
end
|
4
12
|
end
|
data/app/models/georgia/post.rb
CHANGED
@@ -5,7 +5,10 @@ module Georgia
|
|
5
5
|
Georgia::Indexer.register_extension(:tire, Georgia::Post)
|
6
6
|
include Georgia::Indexer::Adapter
|
7
7
|
|
8
|
-
has_one :post_data
|
8
|
+
has_one :post_data, foreign_key: :post_id
|
9
|
+
accepts_nested_attributes_for :post_data
|
10
|
+
attr_accessible :post_data_attributes
|
11
|
+
|
9
12
|
delegate :published_at, :month, :year, to: :post_data, prefix: false, allow_nil: true
|
10
13
|
|
11
14
|
scope :recent, order("post_data.published_at DESC")
|
@@ -3,11 +3,13 @@
|
|
3
3
|
<legend>Published Date</legend>
|
4
4
|
</div>
|
5
5
|
<div class="fieldset-fields">
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
<span class="
|
10
|
-
|
11
|
-
|
6
|
+
<%= f.fields_for :post_data do |pd| %>
|
7
|
+
<div class='input-group date'>
|
8
|
+
<%= pd.input_field :published_at, as: :string, class: "form-control js-datepicker", data: {format: "DD-MM-YYYY HH:mm"}, value: pd.object.try(:published_at).try(:strftime, '%d-%m-%Y %H:%M') %>
|
9
|
+
<span class="input-group-addon">
|
10
|
+
<span class="fa fa-calendar"></span>
|
11
|
+
</span>
|
12
|
+
</div>
|
13
|
+
<% end -%>
|
12
14
|
</div>
|
13
15
|
</fieldset>
|
data/lib/georgia_blog/engine.rb
CHANGED
data/lib/georgia_blog/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: georgia_blog
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.
|
4
|
+
version: 0.7.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mathieu Gagné
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-02-
|
11
|
+
date: 2014-02-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: georgia
|