fuel 0.3.1 → 0.3.2
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/assets/javascripts/fuel/admin.js.erb +17 -0
- data/app/assets/javascripts/fuel/application.js +2 -1
- data/app/assets/stylesheets/fuel/admin.css.sass +91 -0
- data/app/assets/stylesheets/fuel/application.css.scss +2 -0
- data/app/assets/stylesheets/fuel/posts.css.sass +23 -0
- data/app/controllers/fuel/admin/posts_controller.rb +8 -2
- data/app/controllers/fuel/posts_controller.rb +8 -1
- data/app/models/fuel/post.rb +3 -1
- data/app/views/fuel/admin/posts/_content.html.slim +3 -0
- data/app/views/fuel/admin/posts/_form.html.slim +28 -0
- data/app/views/fuel/admin/posts/edit.html.slim +4 -0
- data/app/views/fuel/admin/posts/index.html.slim +18 -0
- data/app/views/fuel/admin/posts/new.html.slim +4 -0
- data/app/views/fuel/admin/posts/preview.js.erb +1 -0
- data/config/routes.rb +7 -1
- data/lib/fuel.rb +3 -0
- data/lib/fuel/configuration.rb +2 -1
- data/lib/fuel/version.rb +1 -1
- data/lib/generators/fuel/install_generator.rb +7 -1
- data/lib/generators/templates/fuel.rb +4 -1
- metadata +82 -10
- data/app/assets/javascripts/fuel/posts.js +0 -2
- data/app/assets/stylesheets/fuel/application.css +0 -57
- data/app/assets/stylesheets/fuel/posts.css +0 -0
- data/app/assets/stylesheets/fuel/reset.css +0 -48
- data/app/views/fuel/admin/posts/_form.html.erb +0 -23
- data/app/views/fuel/admin/posts/edit.html.erb +0 -5
- data/app/views/fuel/admin/posts/index.html.erb +0 -25
- data/app/views/fuel/admin/posts/new.html.erb +0 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 831c1818de7ca969dab85674fc056400e5ac2828
|
4
|
+
data.tar.gz: ce470ab04b2ee4cd54c532beb7f5b08efff8466c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6bcf4fafa6ccda2b1e50f6719683fe46989db23e4a9e92cf1a3f4013c07e88f18b2623f6b8241b789454bad92a9a4179b5a681d4465fd4022ebbb85c463f7d37
|
7
|
+
data.tar.gz: 5613058dcd2f2de76262ba8c6de9d55dc2990a306dbde85b4138427779cc2852acc72f45e8444d6733d3a2b903ae088b5838055e5b73cff50bf8ea5f0862d7a2
|
@@ -0,0 +1,17 @@
|
|
1
|
+
$(function() {
|
2
|
+
$(".edit-preview-toggle").click(function(e) {
|
3
|
+
e.preventDefault();
|
4
|
+
var id = $(this).data('id');
|
5
|
+
if (id == "preview") {
|
6
|
+
var content = $("#post_content").serialize();
|
7
|
+
$.ajax({
|
8
|
+
url: 'preview',
|
9
|
+
data: content
|
10
|
+
});
|
11
|
+
}
|
12
|
+
$(".content-area").hide();
|
13
|
+
$("#content-" + id).show();
|
14
|
+
$(".edit-preview-toggle").removeClass("active");
|
15
|
+
$(this).addClass("active");
|
16
|
+
});
|
17
|
+
});
|
@@ -0,0 +1,91 @@
|
|
1
|
+
/* ALL FUEL */
|
2
|
+
.fuel
|
3
|
+
h1
|
4
|
+
margin-bottom: 10px
|
5
|
+
font-size: 2.5em
|
6
|
+
|
7
|
+
/* ADMIN */
|
8
|
+
.fuel-admin
|
9
|
+
margin-top: 20px
|
10
|
+
width: 90%
|
11
|
+
float: left
|
12
|
+
margin-left: 4%
|
13
|
+
font-family: sans-serif
|
14
|
+
margin-bottom: 100px
|
15
|
+
input[type="text"]
|
16
|
+
width: 50%
|
17
|
+
height: 2em
|
18
|
+
font-size: 1.2em
|
19
|
+
margin-top: 5px
|
20
|
+
margin-bottom: 20px
|
21
|
+
display: block
|
22
|
+
textarea
|
23
|
+
font-size: 1.2em
|
24
|
+
width: 100%
|
25
|
+
height: 400px
|
26
|
+
margin: 0
|
27
|
+
padding-top: 10px
|
28
|
+
border: none
|
29
|
+
.content-area
|
30
|
+
padding: 0
|
31
|
+
width: 80%
|
32
|
+
min-height: 400px
|
33
|
+
max-height: 500px
|
34
|
+
overflow: auto
|
35
|
+
border: thin solid #ccc
|
36
|
+
.preview-links
|
37
|
+
margin-top: 10px
|
38
|
+
.edit-preview-toggle
|
39
|
+
padding: 10px
|
40
|
+
&.active
|
41
|
+
color: #686868
|
42
|
+
cursor: default
|
43
|
+
text-decoration: none
|
44
|
+
font-weight: bold
|
45
|
+
label
|
46
|
+
font-weight: bold
|
47
|
+
font-size: 1.5em
|
48
|
+
input[type="submit"]
|
49
|
+
font-size: 2em
|
50
|
+
font-weight: bold
|
51
|
+
h1.header
|
52
|
+
margin-top: 40px
|
53
|
+
margin-bottom: 30px
|
54
|
+
.markdown
|
55
|
+
width: 400px
|
56
|
+
float: left
|
57
|
+
tr
|
58
|
+
text-align: left
|
59
|
+
border-bottom: 1px solid #ddd
|
60
|
+
table
|
61
|
+
border: thin solid #ccc
|
62
|
+
margin-top: 20px
|
63
|
+
th
|
64
|
+
padding: 2px 20px
|
65
|
+
border-bottom: 1px solid #444
|
66
|
+
font-size: 1.2em
|
67
|
+
font-weight: bold
|
68
|
+
td
|
69
|
+
padding: 10px 20px
|
70
|
+
&.date
|
71
|
+
width: 140px
|
72
|
+
&.post
|
73
|
+
width: 500px
|
74
|
+
.draft
|
75
|
+
color: green
|
76
|
+
.save
|
77
|
+
margin-left: 40px
|
78
|
+
background-color: #777
|
79
|
+
.post-contact-area
|
80
|
+
margin-top: 50px
|
81
|
+
.twitter-follow-button
|
82
|
+
margin-top: 5px
|
83
|
+
fieldset
|
84
|
+
border: none
|
85
|
+
margin-top: none
|
86
|
+
.markdown-panel
|
87
|
+
padding: 40px
|
88
|
+
background-color: #777
|
89
|
+
|
90
|
+
|
91
|
+
|
@@ -0,0 +1,23 @@
|
|
1
|
+
// BLOG
|
2
|
+
.fuel-posts
|
3
|
+
.fuel-post-title
|
4
|
+
font-size: 1.8em
|
5
|
+
margin-top: 20px
|
6
|
+
h1, h2, h3, h4, h5, h6
|
7
|
+
font-weight: bold
|
8
|
+
padding: 20px
|
9
|
+
.fuel-post-additional-info
|
10
|
+
margin-top: 5px
|
11
|
+
display: block
|
12
|
+
.fuel-post-author
|
13
|
+
display: inline
|
14
|
+
font-size: 1em
|
15
|
+
color: #999
|
16
|
+
|
17
|
+
.fuel-post-date
|
18
|
+
display: inline
|
19
|
+
font-size: 1em
|
20
|
+
color: #999
|
21
|
+
|
22
|
+
.fuel-posts .fuel-post-content
|
23
|
+
margin-top: 20px
|
@@ -11,7 +11,6 @@ module Fuel
|
|
11
11
|
end
|
12
12
|
|
13
13
|
def create
|
14
|
-
# raise Fuel::Post.new.inspect
|
15
14
|
@post = Fuel::Post.new
|
16
15
|
@post.tag = post_params["tag"]
|
17
16
|
@post.author = post_params["author"]
|
@@ -20,7 +19,7 @@ module Fuel
|
|
20
19
|
update_published
|
21
20
|
|
22
21
|
if @post.save
|
23
|
-
redirect_to
|
22
|
+
redirect_to admin_posts_path, notice: "Your blog post was successfully #{@message}."
|
24
23
|
else
|
25
24
|
render action: "new"
|
26
25
|
end
|
@@ -50,6 +49,13 @@ module Fuel
|
|
50
49
|
redirect_to admin_posts_path, notice: "Post was successfully deleted"
|
51
50
|
end
|
52
51
|
|
52
|
+
def preview
|
53
|
+
@content = params[:post][:content]
|
54
|
+
respond_to do |format|
|
55
|
+
format.js
|
56
|
+
end
|
57
|
+
end
|
58
|
+
|
53
59
|
private
|
54
60
|
|
55
61
|
def post_params
|
@@ -11,7 +11,7 @@ module Fuel
|
|
11
11
|
end
|
12
12
|
|
13
13
|
def index
|
14
|
-
@posts = Fuel::Post.
|
14
|
+
@posts = Fuel::Post.recent_published_posts.page(params[:page])
|
15
15
|
end
|
16
16
|
|
17
17
|
def show
|
@@ -21,6 +21,13 @@ module Fuel
|
|
21
21
|
@disqus_name = Fuel.configuration.disqus_name
|
22
22
|
end
|
23
23
|
|
24
|
+
def preview
|
25
|
+
@content = params[:content]
|
26
|
+
respond_to do |format|
|
27
|
+
format.js
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
24
31
|
private
|
25
32
|
|
26
33
|
def truncate_on_space(text, length)
|
data/app/models/fuel/post.rb
CHANGED
@@ -8,7 +8,9 @@ module Fuel
|
|
8
8
|
end
|
9
9
|
|
10
10
|
validates_presence_of :title, :content, :author, if: :is_published
|
11
|
-
paginates_per
|
11
|
+
paginates_per Fuel.configuration.paginates_per.to_i
|
12
|
+
|
13
|
+
scope :recent_published_posts, -> { where(published: true).order("created_at DESC") }
|
12
14
|
|
13
15
|
def should_generate_new_friendly_id?
|
14
16
|
new_record? #Don't generate new id on edit
|
@@ -0,0 +1,28 @@
|
|
1
|
+
= form_for [:admin, @post] do |f|
|
2
|
+
- if @post.errors.any?
|
3
|
+
#error_explanation
|
4
|
+
h2
|
5
|
+
=> pluralize(@post.errors.count, "error")
|
6
|
+
| prohibited this post from being saved:
|
7
|
+
ul
|
8
|
+
- @post.errors.full_messages.each do |msg|
|
9
|
+
li= msg
|
10
|
+
= f.label :title
|
11
|
+
= f.text_field :title
|
12
|
+
= f.label :tag
|
13
|
+
= f.text_field :tag
|
14
|
+
= f.label :author
|
15
|
+
= f.text_field :author
|
16
|
+
= f.label :content
|
17
|
+
br
|
18
|
+
.preview-links
|
19
|
+
= link_to 'Edit', '#', data: { id: "edit" }, class: "edit-preview-toggle active"
|
20
|
+
= link_to 'Preview', '#', data: { id: "preview" }, class: "edit-preview-toggle"
|
21
|
+
#content-edit.content-area
|
22
|
+
= f.text_area :content, cols: "80", rows: "20"
|
23
|
+
#content-preview.content-area style="display:none;"
|
24
|
+
= render 'content', content: @post.content
|
25
|
+
= f.submit 'Publish'
|
26
|
+
= f.submit 'Save Draft'
|
27
|
+
= form_tag('preview', method: "post", id: "preview_form") do
|
28
|
+
= hidden_field_tag :content
|
@@ -0,0 +1,18 @@
|
|
1
|
+
.fuel.fuel-admin.index
|
2
|
+
h1 Blog Admin Panel
|
3
|
+
=> link_to 'New Blog Post', new_admin_post_path
|
4
|
+
| | #{link_to 'View Blog', posts_path}
|
5
|
+
table.table
|
6
|
+
thead
|
7
|
+
tr
|
8
|
+
th Published On
|
9
|
+
th Title
|
10
|
+
th
|
11
|
+
th
|
12
|
+
tbody
|
13
|
+
- @posts.each do |post|
|
14
|
+
tr
|
15
|
+
td= post.published ? post.created_at.strftime('%m/%d/%Y') : 'Draft'
|
16
|
+
td= link_to post.title, post_path(post)
|
17
|
+
td= link_to "Edit", edit_admin_post_path(post)
|
18
|
+
td= link_to "Delete", admin_post_path(post), method: :delete, data: { confirm: "Are you sure you want to delete this post?" }
|
@@ -0,0 +1 @@
|
|
1
|
+
$("#render-content").replaceWith("<%= j render('content.html.slim', content: @content) %>")
|
data/config/routes.rb
CHANGED
@@ -5,7 +5,13 @@ Fuel::Engine.routes.draw do
|
|
5
5
|
|
6
6
|
namespace :admin do
|
7
7
|
root to: 'posts#index'
|
8
|
-
|
8
|
+
get "posts/preview" => 'posts#preview'
|
9
|
+
get "posts/:slug/preview" => 'posts#preview'
|
10
|
+
resources :posts do
|
11
|
+
member do
|
12
|
+
get 'content'
|
13
|
+
end
|
14
|
+
end
|
9
15
|
end
|
10
16
|
|
11
17
|
end
|
data/lib/fuel.rb
CHANGED
data/lib/fuel/configuration.rb
CHANGED
@@ -2,7 +2,7 @@ module Fuel
|
|
2
2
|
class Configuration
|
3
3
|
|
4
4
|
# What kind of comments do you want to add to your blog ? (:active_record, :disqus or :no)
|
5
|
-
attr_accessor :layout, :blog_title, :disqus_name, :twitter, :username, :password, :helpers
|
5
|
+
attr_accessor :layout, :blog_title, :disqus_name, :twitter, :username, :password, :helpers, :paginates_per
|
6
6
|
|
7
7
|
def initialize
|
8
8
|
@layout = "application"
|
@@ -12,6 +12,7 @@ module Fuel
|
|
12
12
|
@username = "admin"
|
13
13
|
@password = "password"
|
14
14
|
@helpers = ["ApplicationHelper"]
|
15
|
+
@paginates_per = 5
|
15
16
|
end
|
16
17
|
|
17
18
|
end
|
data/lib/fuel/version.rb
CHANGED
@@ -3,8 +3,14 @@ module Fuel
|
|
3
3
|
class InstallGenerator < Rails::Generators::Base
|
4
4
|
|
5
5
|
source_root File.expand_path('../../templates', __FILE__)
|
6
|
+
desc "Creates a Fuel initializer in config/initializers, adds/migrates Fuel migration files and migrates the files, and adds the appropriate route to config/routes"
|
6
7
|
|
7
|
-
|
8
|
+
def install
|
9
|
+
run 'bundle install'
|
10
|
+
route "mount Fuel::Engine => '/blog'"
|
11
|
+
rake 'fuel:install:migrations'
|
12
|
+
rake 'db:migrate'
|
13
|
+
end
|
8
14
|
|
9
15
|
def copy_initializer
|
10
16
|
template "fuel.rb", "config/initializers/fuel.rb"
|
@@ -11,7 +11,10 @@ Fuel.configure do |config|
|
|
11
11
|
config.username = "admin"
|
12
12
|
|
13
13
|
# Change admin password
|
14
|
-
config.
|
14
|
+
config.password = "password"
|
15
|
+
|
16
|
+
# Change number of posts to show per page on blog
|
17
|
+
config.paginates_per = 5
|
15
18
|
|
16
19
|
config.helpers = ["ApplicationHelper",
|
17
20
|
#"another_helper",
|
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.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryan Francis
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-07-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -66,6 +66,48 @@ dependencies:
|
|
66
66
|
- - ">="
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: jquery-rails
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :runtime
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: sass-rails
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ">="
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
type: :runtime
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ">="
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: slim
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - ">="
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0'
|
104
|
+
type: :runtime
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - ">="
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0'
|
69
111
|
- !ruby/object:Gem::Dependency
|
70
112
|
name: sqlite3
|
71
113
|
requirement: !ruby/object:Gem::Requirement
|
@@ -108,6 +150,34 @@ dependencies:
|
|
108
150
|
- - ">="
|
109
151
|
- !ruby/object:Gem::Version
|
110
152
|
version: '0'
|
153
|
+
- !ruby/object:Gem::Dependency
|
154
|
+
name: codeclimate-test-reporter
|
155
|
+
requirement: !ruby/object:Gem::Requirement
|
156
|
+
requirements:
|
157
|
+
- - ">="
|
158
|
+
- !ruby/object:Gem::Version
|
159
|
+
version: '0'
|
160
|
+
type: :development
|
161
|
+
prerelease: false
|
162
|
+
version_requirements: !ruby/object:Gem::Requirement
|
163
|
+
requirements:
|
164
|
+
- - ">="
|
165
|
+
- !ruby/object:Gem::Version
|
166
|
+
version: '0'
|
167
|
+
- !ruby/object:Gem::Dependency
|
168
|
+
name: database_cleaner
|
169
|
+
requirement: !ruby/object:Gem::Requirement
|
170
|
+
requirements:
|
171
|
+
- - ">="
|
172
|
+
- !ruby/object:Gem::Version
|
173
|
+
version: '0'
|
174
|
+
type: :development
|
175
|
+
prerelease: false
|
176
|
+
version_requirements: !ruby/object:Gem::Requirement
|
177
|
+
requirements:
|
178
|
+
- - ">="
|
179
|
+
- !ruby/object:Gem::Version
|
180
|
+
version: '0'
|
111
181
|
description: Fuel's goal is to be a simple yet customizable blogging gem.
|
112
182
|
email:
|
113
183
|
- ryan.p.francis@gmail.com
|
@@ -118,21 +188,23 @@ files:
|
|
118
188
|
- MIT-LICENSE
|
119
189
|
- README.rdoc
|
120
190
|
- Rakefile
|
191
|
+
- app/assets/javascripts/fuel/admin.js.erb
|
121
192
|
- app/assets/javascripts/fuel/application.js
|
122
|
-
- app/assets/
|
123
|
-
- app/assets/stylesheets/fuel/application.css
|
124
|
-
- app/assets/stylesheets/fuel/posts.css
|
125
|
-
- app/assets/stylesheets/fuel/reset.css
|
193
|
+
- app/assets/stylesheets/fuel/admin.css.sass
|
194
|
+
- app/assets/stylesheets/fuel/application.css.scss
|
195
|
+
- app/assets/stylesheets/fuel/posts.css.sass
|
126
196
|
- app/controllers/fuel/admin/posts_controller.rb
|
127
197
|
- app/controllers/fuel/application_controller.rb
|
128
198
|
- app/controllers/fuel/posts_controller.rb
|
129
199
|
- app/helpers/fuel/application_helper.rb
|
130
200
|
- app/helpers/fuel/posts_helper.rb
|
131
201
|
- app/models/fuel/post.rb
|
132
|
-
- app/views/fuel/admin/posts/
|
133
|
-
- app/views/fuel/admin/posts/
|
134
|
-
- app/views/fuel/admin/posts/
|
135
|
-
- app/views/fuel/admin/posts/
|
202
|
+
- app/views/fuel/admin/posts/_content.html.slim
|
203
|
+
- app/views/fuel/admin/posts/_form.html.slim
|
204
|
+
- app/views/fuel/admin/posts/edit.html.slim
|
205
|
+
- app/views/fuel/admin/posts/index.html.slim
|
206
|
+
- app/views/fuel/admin/posts/new.html.slim
|
207
|
+
- app/views/fuel/admin/posts/preview.js.erb
|
136
208
|
- app/views/fuel/posts/_disqus.html.erb
|
137
209
|
- app/views/fuel/posts/_post.html.erb
|
138
210
|
- app/views/fuel/posts/_tweet.html.erb
|
@@ -1,57 +0,0 @@
|
|
1
|
-
/*
|
2
|
-
* This is a manifest file that'll be compiled into application.css, which will include all the files
|
3
|
-
* listed below.
|
4
|
-
*
|
5
|
-
* Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
|
6
|
-
* or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path.
|
7
|
-
*
|
8
|
-
* You're free to add application-wide styles to this file and they'll appear at the top of the
|
9
|
-
* compiled file, but it's generally better to create a new file per style scope.
|
10
|
-
*
|
11
|
-
*= require_self
|
12
|
-
*# require_posts
|
13
|
-
*/
|
14
|
-
/* ALL FUEL */
|
15
|
-
.fuel h1 { margin-bottom: 10px; font-size: 2.5em; }
|
16
|
-
|
17
|
-
/* ADMIN */
|
18
|
-
.fuel-admin { margin-top: 20px; width: 90%; float: left; margin-left: 4%; font-family: sans-serif; margin-bottom: 100px;}
|
19
|
-
.fuel-admin input[type="text"], textarea {
|
20
|
-
width: 50%;
|
21
|
-
height: 2em;
|
22
|
-
font-size: 1.2em;
|
23
|
-
margin-top: 5px;
|
24
|
-
margin-bottom: 20px;
|
25
|
-
display: block;
|
26
|
-
}
|
27
|
-
.fuel-admin textarea {
|
28
|
-
width: 100%;
|
29
|
-
height: 400px;
|
30
|
-
}
|
31
|
-
.fuel-admin label {
|
32
|
-
font-weight: bold;
|
33
|
-
font-size: 1.5em;
|
34
|
-
}
|
35
|
-
.fuel-admin input[type="submit"] { font-size: 2em; font-weight: bold; }
|
36
|
-
.fuel-admin h1 { margin-top: 40px; margin-bottom: 30px;}
|
37
|
-
.fuel-admin .markdown{ width: 400px; float: left; }
|
38
|
-
.fuel-admin tr { text-align: left; border-bottom: 1px solid #ddd; }
|
39
|
-
.fuel-admin table { border: thin solid #ccc; margin-top: 20px;}
|
40
|
-
.fuel-admin th { padding: 2px 20px; border-bottom: 1px solid #444; font-size: 1.2em; font-weight: bold;}
|
41
|
-
.fuel-admin td { padding: 10px 20px; }
|
42
|
-
.fuel-admin td.date { width: 140px; }
|
43
|
-
.fuel-admin td.post { width: 500px; }
|
44
|
-
.fuel-admin .draft { color: green; }
|
45
|
-
.fuel-admin .save{ margin-left: 40px; background-color: #777; }
|
46
|
-
.fuel-admin .post-contact-area{ margin-top: 50px; }
|
47
|
-
.fuel-admin .twitter-follow-button{ margin-top: 5px; }
|
48
|
-
.fuel-admin fieldset { border: none; margin-top: none; }
|
49
|
-
|
50
|
-
/* Blog */
|
51
|
-
.fuel-posts .fuel-post-title { font-size: 1.8em; margin-top: 20px; }
|
52
|
-
|
53
|
-
.fuel-posts h1, .fuel-posts h2, .fuel-posts h3, .fuel-posts h4, .fuel-posts h5, .fuel-posts h6 { font-weight: bold; }
|
54
|
-
.fuel-posts { padding: 20px; }
|
55
|
-
.fuel-posts .fuel-post-additional-info { margin-top: 5px; display: block; }
|
56
|
-
.fuel-posts .fuel-post-author, .fuel-post-date { display: inline; font-size: 1em; color: #999;}
|
57
|
-
.fuel-posts .fuel-post-content { margin-top: 20px; }
|
File without changes
|
@@ -1,48 +0,0 @@
|
|
1
|
-
/* http://meyerweb.com/eric/tools/css/reset/
|
2
|
-
v2.0 | 20110126
|
3
|
-
License: none (public domain)
|
4
|
-
*/
|
5
|
-
|
6
|
-
html, body, div, span, applet, object, iframe,
|
7
|
-
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
|
8
|
-
a, abbr, acronym, address, big, cite, code,
|
9
|
-
del, dfn, em, img, ins, kbd, q, s, samp,
|
10
|
-
small, strike, strong, sub, sup, tt, var,
|
11
|
-
b, u, i, center,
|
12
|
-
dl, dt, dd, ol, ul, li,
|
13
|
-
fieldset, form, label, legend,
|
14
|
-
table, caption, tbody, tfoot, thead, tr, th, td,
|
15
|
-
article, aside, canvas, details, embed,
|
16
|
-
figure, figcaption, footer, header, hgroup,
|
17
|
-
menu, nav, output, ruby, section, summary,
|
18
|
-
time, mark, audio, video {
|
19
|
-
margin: 0;
|
20
|
-
padding: 0;
|
21
|
-
border: 0;
|
22
|
-
font-size: 100%;
|
23
|
-
font: inherit;
|
24
|
-
vertical-align: baseline;
|
25
|
-
}
|
26
|
-
/* HTML5 display-role reset for older browsers */
|
27
|
-
article, aside, details, figcaption, figure,
|
28
|
-
footer, header, hgroup, menu, nav, section {
|
29
|
-
display: block;
|
30
|
-
}
|
31
|
-
body {
|
32
|
-
line-height: 1;
|
33
|
-
}
|
34
|
-
ol, ul {
|
35
|
-
list-style: none;
|
36
|
-
}
|
37
|
-
blockquote, q {
|
38
|
-
quotes: none;
|
39
|
-
}
|
40
|
-
blockquote:before, blockquote:after,
|
41
|
-
q:before, q:after {
|
42
|
-
content: '';
|
43
|
-
content: none;
|
44
|
-
}
|
45
|
-
table {
|
46
|
-
border-collapse: collapse;
|
47
|
-
border-spacing: 0;
|
48
|
-
}
|
@@ -1,23 +0,0 @@
|
|
1
|
-
<%= form_for [:admin, @post] do |f| %>
|
2
|
-
<% if @post.errors.any? %>
|
3
|
-
<div id="error_explanation">
|
4
|
-
<h2><%= pluralize(@post.errors.count, "error") %> prohibited this post from being saved:</h2>
|
5
|
-
|
6
|
-
<ul>
|
7
|
-
<% @post.errors.full_messages.each do |msg| %>
|
8
|
-
<li><%= msg %></li>
|
9
|
-
<% end %>
|
10
|
-
</ul>
|
11
|
-
</div>
|
12
|
-
<% end %>
|
13
|
-
<%= f.label :title %>
|
14
|
-
<%= f.text_field :title %>
|
15
|
-
<%= f.label :tag %>
|
16
|
-
<%= f.text_field :tag %>
|
17
|
-
<%= f.label :author %>
|
18
|
-
<%= f.text_field :author %>
|
19
|
-
<%= f.label :content %>
|
20
|
-
<%= f.text_area :content %>
|
21
|
-
<%= f.submit 'Publish' %>
|
22
|
-
<%= f.submit 'Save Draft' %>
|
23
|
-
<% end %>
|
@@ -1,25 +0,0 @@
|
|
1
|
-
<div class="fuel fuel-admin index">
|
2
|
-
<h1>Blog Admin Panel</h1>
|
3
|
-
|
4
|
-
<%= link_to 'New Post', new_admin_post_path %> | <%= link_to 'View Blog', posts_path %>
|
5
|
-
<table class="table">
|
6
|
-
<thead>
|
7
|
-
<tr>
|
8
|
-
<th>Published On</th>
|
9
|
-
<th>Title</th>
|
10
|
-
<th></th>
|
11
|
-
<th></th>
|
12
|
-
</tr>
|
13
|
-
</thead>
|
14
|
-
<tbody>
|
15
|
-
<% @posts.each do |post| %>
|
16
|
-
<tr>
|
17
|
-
<td><%= post.published ? post.created_at.strftime('%m/%d/%Y') : 'Draft' %></td>
|
18
|
-
<td><%= link_to post.title, post_path(post) %></td>
|
19
|
-
<td><%= link_to "Edit", edit_admin_post_path(post) %></td>
|
20
|
-
<td><%= link_to "Delete", admin_post_path(post), method: :delete, data: { confirm: "Are you sure you want to delete this post?" } %></td>
|
21
|
-
</tr>
|
22
|
-
<% end %>
|
23
|
-
</tbody>
|
24
|
-
</table>
|
25
|
-
</div>
|