fuel 0.3.21 → 0.3.22

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: f758ad113852efd458994dd705e619617d7991ca
4
- data.tar.gz: 32099ff464da5af1dbc13539897dd19c0f87d539
3
+ metadata.gz: d92d0d5ad55c1d570ec773365cb797443132eb82
4
+ data.tar.gz: 0916c94b1e4892e76bb9dcdeaca580a0fe02d074
5
5
  SHA512:
6
- metadata.gz: 1355cddbe2a6e5e6505d3494f2940bdf76d437f7ad8285d23b409a0cb6df2ffb00ab2de20c438dbeb498f2adba9597725acc2b414cb0e5013c8f0a2d593f28bb
7
- data.tar.gz: 4ce2e782c230385aad3e1ea0de8303744d9fa6404f2a7a75ec57b04a5fce979fc21cfc00da67a30a959cfdf8880549f5b967b9a4a4f67596b7e7e06270701b3e
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
- if Rails.version[0].to_i < 4
18
- @author = Fuel::Author.new(params[:fuel_author])
19
- else
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
- if Rails.version[0].to_i < 4
36
- @author.attributes = params[:fuel_author]
37
- else
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("first_name ASC")
73
+ @authors = Fuel::Author.order("start_date ASC")
72
74
  end
73
75
 
74
76
  def set_url
@@ -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
- <%= f.label :title %>
15
- <%= f.text_field :title %>
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>
@@ -0,0 +1,5 @@
1
+ class AddStartDateToAuthors < ActiveRecord::Migration
2
+ def change
3
+ add_column :fuel_authors, :start_date, :date
4
+ end
5
+ end
data/lib/fuel/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Fuel
2
- VERSION = "0.3.21"
2
+ VERSION = "0.3.22"
3
3
  end
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.21
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-08 00:00:00.000000000 Z
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