fuel 0.3.21 → 0.3.22
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 +4 -4
- data/app/controllers/fuel/admin/authors_controller.rb +14 -12
- data/app/models/fuel/author.rb +1 -1
- data/app/views/fuel/admin/authors/_form.html.erb +8 -2
- data/app/views/fuel/posts/_additional_info.html.erb +1 -1
- data/db/migrate/20150608221309_add_start_date_to_authors.rb +5 -0
- data/lib/fuel/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d92d0d5ad55c1d570ec773365cb797443132eb82
|
4
|
+
data.tar.gz: 0916c94b1e4892e76bb9dcdeaca580a0fe02d074
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c37c873ff701c0dd1c62776db9e285f55af854803facab0383f90e841e74213f8cb305cf9bd8d4d2b14b3c870e5d1af84e472a4fc967174267285a22ff641af5
|
7
|
+
data.tar.gz: f12aab0950beee7594802c3875e932a00d98d4494f63ef1527a7c47dbaf2bf8740688fc093dd6fb9c51f25e0c2086f7178bdfbcad310d2f9153132e0f180c216
|
@@ -14,11 +14,9 @@ module Fuel
|
|
14
14
|
end
|
15
15
|
|
16
16
|
def create
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
@author = Fuel::Author.new(author_params)
|
21
|
-
end
|
17
|
+
@params_hash = Rails.version[0].to_i < 4 ? params[:fuel_author] : author_params
|
18
|
+
@author = Fuel::Author.new(@params_hash)
|
19
|
+
set_start_date
|
22
20
|
|
23
21
|
if @author.save
|
24
22
|
redirect_to fuel.admin_authors_path, notice: "Your author was successfully #{@message}."
|
@@ -32,11 +30,9 @@ module Fuel
|
|
32
30
|
end
|
33
31
|
|
34
32
|
def update
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
@author.attributes = author_params
|
39
|
-
end
|
33
|
+
@params_hash = Rails.version[0].to_i < 4 ? params[:fuel_author] : author_params
|
34
|
+
@author.attributes = @params_hash
|
35
|
+
set_start_date
|
40
36
|
|
41
37
|
if @author.save
|
42
38
|
redirect_to fuel.admin_authors_path, notice: "Author was updated and #{@message}"
|
@@ -59,8 +55,14 @@ module Fuel
|
|
59
55
|
|
60
56
|
private
|
61
57
|
|
58
|
+
def set_start_date
|
59
|
+
start_date_string = @params_hash[:start_date]
|
60
|
+
start_datetime = DateTime.strptime(start_date_string, "%m/%d/%Y")
|
61
|
+
@author.start_date = start_datetime if start_datetime
|
62
|
+
end
|
63
|
+
|
62
64
|
def author_params
|
63
|
-
params.require(:fuel_author).permit(:first_name, :last_name, :title, :bio, :avatar, :email, :twitter, :github, :dribbble)
|
65
|
+
params.require(:fuel_author).permit(:first_name, :last_name, :title, :bio, :avatar, :email, :twitter, :github, :dribbble, :start_date)
|
64
66
|
end
|
65
67
|
|
66
68
|
def find_author
|
@@ -68,7 +70,7 @@ module Fuel
|
|
68
70
|
end
|
69
71
|
|
70
72
|
def find_authors
|
71
|
-
@authors = Fuel::Author.order("
|
73
|
+
@authors = Fuel::Author.order("start_date ASC")
|
72
74
|
end
|
73
75
|
|
74
76
|
def set_url
|
data/app/models/fuel/author.rb
CHANGED
@@ -4,7 +4,7 @@ module Fuel
|
|
4
4
|
has_many :posts
|
5
5
|
|
6
6
|
if Rails.version[0].to_i < 4
|
7
|
-
attr_accessible :first_name, :last_name, :title, :bio, :avatar, :email, :twitter, :github, :dribbble
|
7
|
+
attr_accessible :first_name, :last_name, :title, :bio, :avatar, :email, :twitter, :github, :dribbble, :start_date
|
8
8
|
end
|
9
9
|
|
10
10
|
def full_name
|
@@ -11,8 +11,14 @@
|
|
11
11
|
</div>
|
12
12
|
</fieldset>
|
13
13
|
<fieldset>
|
14
|
-
|
15
|
-
|
14
|
+
<div class="form-group-half">
|
15
|
+
<%= f.label :title %>
|
16
|
+
<%= f.text_field :title %>
|
17
|
+
</div>
|
18
|
+
<div class="form-group-half">
|
19
|
+
<%= f.label :start_date %>
|
20
|
+
<%= f.text_field :start_date, data: { value: @author.start_date.try(:strftime, "%m/%d/%Y") }, class: 'datepicker' %>
|
21
|
+
</div>
|
16
22
|
</fieldset>
|
17
23
|
<fieldset>
|
18
24
|
<%= f.label :bio, 'Author Bio' %>
|
@@ -1,6 +1,6 @@
|
|
1
1
|
<div class="fuel-post-additional-info">
|
2
2
|
<!-- <span class="fuel_post_date"><%= post.created_at.strftime('%b %d, %Y') %> - </span> -->
|
3
|
-
<span class="fuel-post-author">By <%= post.author.full_name %></span>
|
3
|
+
<span class="fuel-post-author">By <%= post.author.full_name %> | <%= post.author.title.html_safe %></span>
|
4
4
|
<span class="fuel-social-buttons">
|
5
5
|
<%= render 'tweet', post: post if action_name == "show" && Fuel.configuration.twitter %>
|
6
6
|
</span>
|
data/lib/fuel/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fuel
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.22
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryan Francis
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-06-
|
11
|
+
date: 2015-06-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -384,6 +384,7 @@ files:
|
|
384
384
|
- db/migrate/20150603205232_add_contact_methods_to_authors.rb
|
385
385
|
- db/migrate/20150604155028_add_published_at_to_fuel_posts.rb
|
386
386
|
- db/migrate/20150604161900_remove_posted_at_from_fuel_posts.rb
|
387
|
+
- db/migrate/20150608221309_add_start_date_to_authors.rb
|
387
388
|
- lib/blog_importer.rb
|
388
389
|
- lib/example_author.rb
|
389
390
|
- lib/fuel.rb
|