fuel 0.3.3 → 0.3.20
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/Rakefile +2 -2
- data/app/assets/images/fuel/icon-test.png +0 -0
- data/app/assets/images/fuel/icons/application-icons.svg +1 -0
- data/app/assets/images/fuel/icons/calendar-icon.svg +1 -0
- data/app/assets/images/fuel/icons/dropdown-arrow-icon.svg +10 -0
- data/app/assets/images/fuel/icons/navigation-icons.svg +1 -0
- data/app/assets/javascripts/fuel/admin.js.erb +17 -17
- data/app/assets/javascripts/fuel/application.js +8 -0
- data/app/assets/javascripts/fuel/datepicker.js +11 -0
- data/app/assets/javascripts/fuel/facebook.js +12 -0
- data/app/assets/javascripts/fuel/posts.js.erb +16 -0
- data/app/assets/javascripts/fuel/rich-text.js +9 -0
- data/app/assets/javascripts/fuel/sliding-panel.js +11 -0
- data/app/assets/stylesheets/fuel/_page-layout.scss +61 -0
- data/app/assets/stylesheets/fuel/_post-list.scss +70 -0
- data/app/assets/stylesheets/fuel/application.css.scss +27 -2
- data/app/assets/stylesheets/fuel/base/_base.scss +5 -0
- data/app/assets/stylesheets/fuel/base/_layout.scss +54 -0
- data/app/assets/stylesheets/fuel/base/_typography.scss +102 -0
- data/app/assets/stylesheets/fuel/components/_alerts.scss +27 -0
- data/app/assets/stylesheets/fuel/components/_animations.scss +26 -0
- data/app/assets/stylesheets/fuel/components/_application-icons.scss +42 -0
- data/app/assets/stylesheets/fuel/components/_buttons.scss +106 -0
- data/app/assets/stylesheets/fuel/components/_card.scss +39 -0
- data/app/assets/stylesheets/fuel/components/_components.scss +13 -0
- data/app/assets/stylesheets/fuel/components/_forms.scss +90 -0
- data/app/assets/stylesheets/fuel/components/_navbar.scss +45 -0
- data/app/assets/stylesheets/fuel/components/_navigation-icons.scss +41 -0
- data/app/assets/stylesheets/fuel/components/_page-sidebar.scss +60 -0
- data/app/assets/stylesheets/fuel/components/_sliding-panel.scss +59 -0
- data/app/assets/stylesheets/fuel/settings/_reset.scss +46 -0
- data/app/assets/stylesheets/fuel/settings/_settings.scss +19 -0
- data/app/assets/stylesheets/fuel/settings/mixins/_layout.scss +20 -0
- data/app/assets/stylesheets/fuel/settings/mixins/_misc.scss +27 -0
- data/app/assets/stylesheets/fuel/settings/mixins/_rem.scss +46 -0
- data/app/assets/stylesheets/fuel/settings/mixins/_typography.scss +64 -0
- data/app/assets/stylesheets/fuel/settings/variables/_alerts.scss +9 -0
- data/app/assets/stylesheets/fuel/settings/variables/_buttons.scss +8 -0
- data/app/assets/stylesheets/fuel/settings/variables/_colors.scss +55 -0
- data/app/assets/stylesheets/fuel/settings/variables/_typography.scss +25 -0
- data/app/controllers/fuel/admin/admin_controller.rb +7 -0
- data/app/controllers/fuel/admin/authors_controller.rb +80 -0
- data/app/controllers/fuel/admin/posts_controller.rb +68 -54
- data/app/controllers/fuel/fuel_controller.rb +5 -0
- data/app/controllers/fuel/posts_controller.rb +13 -7
- data/app/controllers/fuel_controller.rb +5 -0
- data/app/helpers/fuel/posts_helper.rb +28 -1
- data/app/models/fuel.rb +5 -0
- data/app/models/fuel/author.rb +18 -0
- data/app/models/fuel/post.rb +32 -2
- data/app/views/fuel/admin/authors/_authors.html.erb +24 -0
- data/app/views/fuel/admin/authors/_form.html.erb +52 -0
- data/app/views/fuel/admin/authors/edit.html.erb +9 -0
- data/app/views/fuel/admin/authors/index.html.erb +7 -0
- data/app/views/fuel/admin/authors/new.html.erb +6 -0
- data/app/views/fuel/admin/posts/_content.html.erb +5 -0
- data/app/views/fuel/admin/posts/_form.html.erb +56 -0
- data/app/views/fuel/admin/posts/_post_preview.html.erb +12 -0
- data/app/views/fuel/admin/posts/_posts.html.erb +23 -0
- data/app/views/fuel/admin/posts/edit.html.erb +11 -0
- data/app/views/fuel/admin/posts/index.html.erb +6 -0
- data/app/views/fuel/admin/posts/new.html.erb +9 -0
- data/app/views/fuel/components/_navbar.html.erb +22 -0
- data/app/views/fuel/posts/_additional_info.html.erb +7 -0
- data/app/views/fuel/posts/_facebook_sdk.html.erb +17 -0
- data/app/views/fuel/posts/_tweet.html.erb +1 -1
- data/app/views/fuel/posts/index.html.erb +27 -6
- data/app/views/fuel/posts/show.html.erb +19 -2
- data/app/views/layouts/fuel/application.html.erb +19 -12
- data/config/routes.rb +18 -10
- data/db/migrate/20141114201953_add_featured_image_field.rb +5 -0
- data/db/migrate/20141118162158_add_teaser_to_posts.rb +5 -0
- data/db/migrate/20141217174229_add_featured_image_to_posts.rb +10 -0
- data/db/migrate/20150414220732_add_seo_fields_to_post.rb +6 -0
- data/db/migrate/20150529201715_add_posted_at_to_posts.rb +5 -0
- data/db/migrate/20150529202105_create_fuel_authors.rb +13 -0
- data/db/migrate/20150530180444_add_author_id_to_posts.rb +5 -0
- data/db/migrate/20150603205232_add_contact_methods_to_authors.rb +8 -0
- data/db/migrate/20150604155028_add_published_at_to_fuel_posts.rb +5 -0
- data/db/migrate/20150604161900_remove_posted_at_from_fuel_posts.rb +5 -0
- data/lib/blog_importer.rb +82 -0
- data/lib/example_author.rb +108 -0
- data/lib/fuel.rb +7 -1
- data/lib/fuel/configuration.rb +16 -1
- data/lib/fuel/engine.rb +13 -1
- data/lib/fuel/version.rb +1 -1
- data/lib/generators/fuel/install_generator.rb +4 -0
- data/lib/generators/fuel/views_generator.rb +1 -1
- data/lib/generators/templates/fuel.rb +22 -0
- data/lib/kaminari/helpers/tag.rb +16 -0
- data/lib/tasks/fuel_tasks.rake +35 -4
- data/test/fixtures/fuel/authors.yml +11 -0
- data/test/models/fuel/author_test.rb +7 -0
- metadata +191 -15
- data/app/assets/stylesheets/fuel/admin.css.sass +0 -91
- data/app/assets/stylesheets/fuel/posts.css.sass +0 -23
- data/app/controllers/fuel/application_controller.rb +0 -4
- data/app/helpers/fuel/application_helper.rb +0 -34
- data/app/views/fuel/admin/posts/_content.html.slim +0 -3
- data/app/views/fuel/admin/posts/_form.html.slim +0 -28
- data/app/views/fuel/admin/posts/edit.html.slim +0 -4
- data/app/views/fuel/admin/posts/index.html.slim +0 -18
- data/app/views/fuel/admin/posts/new.html.slim +0 -4
- data/app/views/fuel/posts/_post.html.erb +0 -19
|
@@ -1,72 +1,86 @@
|
|
|
1
1
|
module Fuel
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
module Admin
|
|
3
|
+
class PostsController < AdminController
|
|
4
|
+
layout "fuel/application"
|
|
5
|
+
before_filter :find_posts
|
|
6
|
+
before_filter :find_post, only: [:edit, :update, :destroy]
|
|
7
|
+
before_filter :set_url, only: [:new, :create, :edit, :update]
|
|
5
8
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
end
|
|
9
|
+
def index
|
|
10
|
+
end
|
|
9
11
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
12
|
+
def new
|
|
13
|
+
@post = Fuel::Post.new
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
def create
|
|
17
|
+
@params_hash = Rails.version[0].to_i < 4 ? params[:fuel_post] : post_params
|
|
18
|
+
@post = Fuel::Post.new(@params_hash)
|
|
19
|
+
update_published
|
|
13
20
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
@post.title = post_params["title"]
|
|
20
|
-
update_published
|
|
21
|
-
|
|
22
|
-
if @post.save
|
|
23
|
-
redirect_to admin_posts_path, notice: "Your blog post was successfully #{@message}."
|
|
24
|
-
else
|
|
25
|
-
render action: "new"
|
|
21
|
+
if @post.save
|
|
22
|
+
redirect_to fuel.admin_posts_path, notice: "Your blog post was successfully #{@message}."
|
|
23
|
+
else
|
|
24
|
+
render action: "new"
|
|
25
|
+
end
|
|
26
26
|
end
|
|
27
|
-
end
|
|
28
27
|
|
|
29
|
-
|
|
30
|
-
@post = Fuel::Post.find_by_slug(params[:id])
|
|
31
|
-
end
|
|
28
|
+
def edit
|
|
32
29
|
|
|
33
|
-
def update
|
|
34
|
-
@post = Fuel::Post.find_by_slug(params[:id])
|
|
35
|
-
@post.tag = post_params["tag"]
|
|
36
|
-
@post.author = post_params["author"]
|
|
37
|
-
@post.content = post_params["content"]
|
|
38
|
-
@post.title = post_params["title"]
|
|
39
|
-
update_published
|
|
40
|
-
if @post.save
|
|
41
|
-
redirect_to admin_posts_path, notice: "Post was updated and #{@message}"
|
|
42
|
-
else
|
|
43
|
-
render action: "edit"
|
|
44
30
|
end
|
|
45
|
-
end
|
|
46
31
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
end
|
|
32
|
+
def update
|
|
33
|
+
@params_hash = Rails.version[0].to_i < 4 ? params[:fuel_post] : post_params
|
|
34
|
+
@post.attributes = @params_hash
|
|
35
|
+
update_published
|
|
52
36
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
37
|
+
if @post.save
|
|
38
|
+
redirect_to fuel.edit_admin_post_path(@post), notice: "Post was updated and #{@message}"
|
|
39
|
+
else
|
|
40
|
+
render "edit"
|
|
41
|
+
end
|
|
57
42
|
end
|
|
58
|
-
end
|
|
59
43
|
|
|
60
|
-
|
|
44
|
+
def destroy
|
|
45
|
+
@post.destroy
|
|
46
|
+
redirect_to fuel.admin_posts_path, notice: "Post was successfully deleted"
|
|
47
|
+
end
|
|
61
48
|
|
|
62
|
-
def
|
|
63
|
-
params
|
|
49
|
+
def preview
|
|
50
|
+
@content = params[:fuel_post][:content]
|
|
51
|
+
respond_to do |format|
|
|
52
|
+
format.js
|
|
53
|
+
end
|
|
64
54
|
end
|
|
65
55
|
|
|
66
|
-
def
|
|
67
|
-
@post.published = params[:commit] == "Save Draft" ? false : true
|
|
68
|
-
@message = @post.published ? "posted" : "saved"
|
|
56
|
+
def show
|
|
69
57
|
end
|
|
70
58
|
|
|
59
|
+
private
|
|
60
|
+
|
|
61
|
+
def post_params
|
|
62
|
+
params.require(:fuel_post).permit(:tag, :author_id, :content, :title, :teaser, :featured_image, :published, :published_at)
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
def update_published
|
|
66
|
+
published_at_string = @params_hash[:published_at]
|
|
67
|
+
published_at_datetime = DateTime.strptime(published_at_string, "%m/%d/%Y")
|
|
68
|
+
@post.published_at = published_at_datetime if published_at_datetime
|
|
69
|
+
@message = @post.published ? "posted" : "saved"
|
|
70
|
+
end
|
|
71
|
+
|
|
72
|
+
def find_post
|
|
73
|
+
@post = Fuel::Post.find_by_slug(params[:id])
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
def find_posts
|
|
77
|
+
@posts = Fuel::Post.order("created_at DESC")
|
|
78
|
+
end
|
|
79
|
+
|
|
80
|
+
def set_url
|
|
81
|
+
@url = ["new", "create"].include?(action_name) ? fuel.admin_posts_path : fuel.admin_post_path(@post)
|
|
82
|
+
end
|
|
83
|
+
|
|
84
|
+
end
|
|
71
85
|
end
|
|
72
|
-
end
|
|
86
|
+
end
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
require_dependency "fuel/application_controller"
|
|
2
|
-
|
|
3
1
|
module Fuel
|
|
4
|
-
class PostsController <
|
|
2
|
+
class PostsController < FuelController
|
|
5
3
|
include ActionView::Helpers::TextHelper
|
|
6
4
|
layout Fuel.configuration.layout if Fuel.configuration.layout
|
|
7
5
|
before_filter :define_title
|
|
@@ -12,12 +10,14 @@ module Fuel
|
|
|
12
10
|
|
|
13
11
|
def index
|
|
14
12
|
@posts = Fuel::Post.recent_published_posts.page(params[:page])
|
|
13
|
+
@title = Fuel.configuration.blog_title
|
|
14
|
+
@description = Fuel.configuration.blog_description
|
|
15
15
|
end
|
|
16
16
|
|
|
17
17
|
def show
|
|
18
|
-
|
|
19
|
-
@
|
|
20
|
-
@
|
|
18
|
+
@post = Fuel::Post.find_by_slug(params[:id]) || Fuel::Post.find_by_id(params[:id]) || not_found
|
|
19
|
+
@title = truncate_on_space(@post.seo_title, 70)
|
|
20
|
+
@description = @post.seo_description
|
|
21
21
|
@disqus_name = Fuel.configuration.disqus_name
|
|
22
22
|
end
|
|
23
23
|
|
|
@@ -28,10 +28,16 @@ module Fuel
|
|
|
28
28
|
end
|
|
29
29
|
end
|
|
30
30
|
|
|
31
|
+
def redirect
|
|
32
|
+
post = Fuel::Post.find_by_slug(params[:id]) || Fuel::Post.find_by_id(params[:id])
|
|
33
|
+
return redirect_to fuel.post_path(post)
|
|
34
|
+
end
|
|
35
|
+
|
|
31
36
|
private
|
|
32
37
|
|
|
33
|
-
def truncate_on_space(text, length)
|
|
38
|
+
def truncate_on_space(text = "", length)
|
|
34
39
|
truncate(text, length: length, separator: ' ')
|
|
35
40
|
end
|
|
41
|
+
|
|
36
42
|
end
|
|
37
43
|
end
|
|
@@ -1,5 +1,32 @@
|
|
|
1
1
|
module Fuel
|
|
2
2
|
module PostsHelper
|
|
3
|
+
Fuel.configuration.helpers.each do |helper|
|
|
4
|
+
include "::#{helper}".constantize
|
|
5
|
+
end
|
|
6
|
+
|
|
7
|
+
def markdown(text)
|
|
8
|
+
markdown = Redcarpet::Markdown.new(Redcarpet::Render::HTML,
|
|
9
|
+
:autolink => true, :space_after_headers => true)
|
|
10
|
+
raw markdown.render(text)
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
def method_missing method, *args, &block
|
|
14
|
+
fuel.send(method, *args)
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
def embedded_svg filename, options={}
|
|
18
|
+
file = File.read(Rails.root.join('app', 'assets', 'images', filename))
|
|
19
|
+
doc = Nokogiri::HTML::DocumentFragment.parse file
|
|
20
|
+
svg = doc.at_css 'svg'
|
|
21
|
+
if options[:class].present?
|
|
22
|
+
svg['class'] = options[:class]
|
|
23
|
+
end
|
|
24
|
+
doc.to_html.html_safe
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
def hide_published_at(post)
|
|
28
|
+
@post.is_published ? '' : 'display:none;'
|
|
29
|
+
end
|
|
3
30
|
|
|
4
31
|
end
|
|
5
|
-
end
|
|
32
|
+
end
|
data/app/models/fuel.rb
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
module Fuel
|
|
2
|
+
class Author < ActiveRecord::Base
|
|
3
|
+
|
|
4
|
+
has_many :posts
|
|
5
|
+
|
|
6
|
+
if Rails.version[0].to_i < 4
|
|
7
|
+
attr_accessible :first_name, :last_name, :title, :bio, :avatar, :email, :twitter, :github, :dribbble
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
def full_name
|
|
11
|
+
[first_name, last_name].compact.join(" ")
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
has_attached_file :avatar, :styles => { :medium => Fuel.configuration.avatar_settings[:styles][:medium], :thumb => Fuel.configuration.avatar_settings[:styles][:thumb] }, :default_url => "/images/:style/missing.png"
|
|
15
|
+
validates_attachment_content_type :avatar, :content_type => /\Aimage\/.*\Z/
|
|
16
|
+
|
|
17
|
+
end
|
|
18
|
+
end
|
data/app/models/fuel/post.rb
CHANGED
|
@@ -1,16 +1,32 @@
|
|
|
1
1
|
module Fuel
|
|
2
2
|
class Post < ActiveRecord::Base
|
|
3
|
+
include ActionView::Helpers::OutputSafetyHelper
|
|
4
|
+
|
|
3
5
|
extend FriendlyId
|
|
4
6
|
friendly_id :title, use: :slugged
|
|
5
7
|
|
|
8
|
+
belongs_to :author
|
|
9
|
+
|
|
6
10
|
if Rails.version[0].to_i < 4
|
|
7
|
-
attr_accessible :tag, :
|
|
11
|
+
attr_accessible :tag, :author_id, :content, :title, :teaser, :featured_image, :seo_title, :seo_description, :published_at
|
|
8
12
|
end
|
|
9
13
|
|
|
10
|
-
|
|
14
|
+
has_attached_file :featured_image, :styles => { :medium => Fuel.configuration.featured_image_settings[:styles][:medium], :thumb => Fuel.configuration.featured_image_settings[:styles][:thumb] }, :default_url => "/images/:style/missing.png"
|
|
15
|
+
validates_attachment_content_type :featured_image, :content_type => /\Aimage\/.*\Z/
|
|
16
|
+
|
|
17
|
+
validates_presence_of :title, :content, :author_id, if: :is_published
|
|
11
18
|
paginates_per Fuel.configuration.paginates_per.to_i
|
|
12
19
|
|
|
13
20
|
scope :recent_published_posts, -> { where(published: true).order("created_at DESC") }
|
|
21
|
+
scope :recent, -> { order("created_at DESC") }
|
|
22
|
+
|
|
23
|
+
def next
|
|
24
|
+
self.class.recent.where("created_at <= ? AND id != ?", created_at, id).first
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
def previous
|
|
28
|
+
self.class.recent.where("created_at >= ? AND id != ?", created_at, id).last
|
|
29
|
+
end
|
|
14
30
|
|
|
15
31
|
def should_generate_new_friendly_id?
|
|
16
32
|
new_record? #Don't generate new id on edit
|
|
@@ -24,5 +40,19 @@ module Fuel
|
|
|
24
40
|
self.published
|
|
25
41
|
end
|
|
26
42
|
|
|
43
|
+
def prioritized_featured_image_url(type = :original)
|
|
44
|
+
featured_image_file_name.present? ? featured_image.url(type) : featured_image_url
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
def teaser_content
|
|
48
|
+
teaser.present? ? teaser : content
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
def to_html
|
|
52
|
+
markdown = Redcarpet::Markdown.new(Redcarpet::Render::HTML,
|
|
53
|
+
:autolink => true, :space_after_headers => true)
|
|
54
|
+
raw markdown.render(content)
|
|
55
|
+
end
|
|
56
|
+
|
|
27
57
|
end
|
|
28
58
|
end
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
<aside class="page-sidebar author-sidebar">
|
|
2
|
+
<header class="page-sidebar--header">
|
|
3
|
+
<div class="header-container--left">
|
|
4
|
+
<h5 class="header--title">Authors</h5>
|
|
5
|
+
</div>
|
|
6
|
+
<div class="header-container--right">
|
|
7
|
+
<ul class="header-container--right__actions">
|
|
8
|
+
<!-- <li><i class="search-icon">Search</i></li> -->
|
|
9
|
+
<li><%= link_to 'New Author', fuel.new_admin_author_path, class: 'add-icon' %></li>
|
|
10
|
+
</ul>
|
|
11
|
+
</div>
|
|
12
|
+
</header>
|
|
13
|
+
<ul class="resource-list author-list">
|
|
14
|
+
<% @authors.each do |author| %>
|
|
15
|
+
<%= link_to fuel.edit_admin_author_path(author) do %>
|
|
16
|
+
<li class="resource-item author-item <%= 'active' if @author && @author == author %>">
|
|
17
|
+
<%= image_tag author.avatar.url, class: 'author-avatar' %>
|
|
18
|
+
<p class="author-item--title"><%= author.title.html_safe %></p>
|
|
19
|
+
<h5 class="author-item--name"><%= author.full_name %></h5>
|
|
20
|
+
</li>
|
|
21
|
+
<% end %>
|
|
22
|
+
<% end %>
|
|
23
|
+
</ul>
|
|
24
|
+
</aside>
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
<%= form_for @author, url: @url, html: { multipart: true } do |f| %>
|
|
2
|
+
<div class="form-container--left">
|
|
3
|
+
<fieldset>
|
|
4
|
+
<div class="form-group-half">
|
|
5
|
+
<%= f.label :first_name %>
|
|
6
|
+
<%= f.text_field :first_name %>
|
|
7
|
+
</div>
|
|
8
|
+
<div class="form-group-half">
|
|
9
|
+
<%= f.label :last_name %>
|
|
10
|
+
<%= f.text_field :last_name %>
|
|
11
|
+
</div>
|
|
12
|
+
</fieldset>
|
|
13
|
+
<fieldset>
|
|
14
|
+
<%= f.label :title %>
|
|
15
|
+
<%= f.text_field :title %>
|
|
16
|
+
</fieldset>
|
|
17
|
+
<fieldset>
|
|
18
|
+
<%= f.label :bio, 'Author Bio' %>
|
|
19
|
+
<%= f.text_area :bio %>
|
|
20
|
+
</fieldset>
|
|
21
|
+
<fieldset>
|
|
22
|
+
<div class="form-group-half">
|
|
23
|
+
<%= f.label :email %>
|
|
24
|
+
<%= f.email_field :email, placeholder: "ryan@example.com" %>
|
|
25
|
+
</div>
|
|
26
|
+
<div class="form-group-half">
|
|
27
|
+
<%= f.label :twitter %>
|
|
28
|
+
<%= f.text_field :twitter, placeholder: "ryan_p_francis" %>
|
|
29
|
+
</div>
|
|
30
|
+
</fieldset>
|
|
31
|
+
<fieldset>
|
|
32
|
+
<div class="form-group-half">
|
|
33
|
+
<%= f.label :github %>
|
|
34
|
+
<%= f.text_field :github, placeholder: "francirp" %>
|
|
35
|
+
</div>
|
|
36
|
+
<div class="form-group-half">
|
|
37
|
+
<%= f.label :dribbble %>
|
|
38
|
+
<%= f.text_field :dribbble, placeholder: "ryan_p_francis" %>
|
|
39
|
+
</div>
|
|
40
|
+
</fieldset>
|
|
41
|
+
<fieldset class="fieldset">
|
|
42
|
+
<%= f.submit class: 'button button--secondary' %>
|
|
43
|
+
</fieldset>
|
|
44
|
+
</div>
|
|
45
|
+
<div class="form-container--right card">
|
|
46
|
+
<%= f.label :avatar, 'Updated Author Picture' %>
|
|
47
|
+
<div class="card-image card-image--avatar">
|
|
48
|
+
<%= image_tag @author.avatar.url if @author.avatar.present? %>
|
|
49
|
+
</div>
|
|
50
|
+
<%= f.file_field :avatar %>
|
|
51
|
+
</div>
|
|
52
|
+
<% end %>
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
<%= render "authors" %>
|
|
2
|
+
<section class="page-area">
|
|
3
|
+
<div class="no-content-container">
|
|
4
|
+
<p class="no-content-message">Select an author from the list on the left or <%= link_to 'add', new_admin_author_path, class: 'link-primary' %> a new author.</p>
|
|
5
|
+
</div>
|
|
6
|
+
<p></p>
|
|
7
|
+
</section>
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
<%= form_for @post, url: @url, html: { multipart: true } do |f| %>
|
|
2
|
+
<% if @post.errors.any? %>
|
|
3
|
+
<div class="alert alert--warning">
|
|
4
|
+
<p class="alert--content"><%= @post.errors.full_messages.to_sentence %></h2></p>
|
|
5
|
+
<%= link_to '#', class: 'alert--trigger' do %>
|
|
6
|
+
<%= embedded_svg 'icons/alert-icon.svg', class: 'alert--close-icon' %>
|
|
7
|
+
<% end %>
|
|
8
|
+
</div>
|
|
9
|
+
<% end %>
|
|
10
|
+
<div class="form-container--left">
|
|
11
|
+
<fieldset>
|
|
12
|
+
<%= f.label :title %>
|
|
13
|
+
<%= f.text_field :title %>
|
|
14
|
+
</fieldset>
|
|
15
|
+
<fieldset>
|
|
16
|
+
<div class="form-group-half">
|
|
17
|
+
<%= f.label :author_id %>
|
|
18
|
+
<%= f.select :author_id, options_from_collection_for_select(Fuel::Author.all, :id, :full_name, @post.author_id) %>
|
|
19
|
+
</div>
|
|
20
|
+
<div class="form-group-half">
|
|
21
|
+
<%= f.label :tag %>
|
|
22
|
+
<%= f.select :tag, options_for_select(Fuel.configuration.tags, @post.tag) %>
|
|
23
|
+
</div>
|
|
24
|
+
</fieldset>
|
|
25
|
+
<fieldset>
|
|
26
|
+
<div class="half-group">
|
|
27
|
+
<%= f.label :published, 'Published' %>
|
|
28
|
+
<%= f.select :published, options_for_select({"Yes" => true, "No" => false}, @post.is_published) %>
|
|
29
|
+
</div>
|
|
30
|
+
<div class="half-group" id="publishedAtGroup" style="<%= hide_published_at(@post) %>">
|
|
31
|
+
<%= f.label :published_at, 'Published At' %>
|
|
32
|
+
<%= f.text_field :published_at, data: { value: (@post.published_at || DateTime.now).strftime("%m/%d/%Y") }, class: 'datepicker', disabled: !@post.is_published %>
|
|
33
|
+
</div>
|
|
34
|
+
</fieldset>
|
|
35
|
+
<fieldset>
|
|
36
|
+
<%= f.label :teaser, 'Post Tease' %>
|
|
37
|
+
<%= f.text_area :teaser, class: 'tease' %>
|
|
38
|
+
</fieldset>
|
|
39
|
+
</div>
|
|
40
|
+
<div class="form-container--right card">
|
|
41
|
+
<%= f.label :featured_image, 'Featured Image' %>
|
|
42
|
+
<div class="card-image card-image--featured_image">
|
|
43
|
+
<%= image_tag @post.featured_image.url(:medium) if @post.featured_image.present? %>
|
|
44
|
+
</div>
|
|
45
|
+
<%= f.file_field :featured_image %>
|
|
46
|
+
</div>
|
|
47
|
+
<div class="form-container--full">
|
|
48
|
+
<fieldset>
|
|
49
|
+
<%= f.label :content, 'Your Post' %>
|
|
50
|
+
<%= f.text_area :content, class: 'post' %>
|
|
51
|
+
</fieldset>
|
|
52
|
+
<fieldset>
|
|
53
|
+
<%= f.submit (action_name == "edit" ? "Update Post" : "Create Post"), class: 'button button--secondary' %>
|
|
54
|
+
</fieldset>
|
|
55
|
+
</div>
|
|
56
|
+
<% end %>
|