blogelator 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/LICENSE +20 -0
- data/README.md +86 -0
- data/Rakefile +29 -0
- data/app/assets/images/blogelator/blogelator-logo.svg +15 -0
- data/app/assets/javascripts/blogelator/admin.js +19 -0
- data/app/assets/javascripts/blogelator/application.js +2 -0
- data/app/assets/javascripts/blogelator/components/markdown_editor_component.js +187 -0
- data/app/assets/javascripts/blogelator/components/save_button_component.js +76 -0
- data/app/assets/javascripts/blogelator/config/marked.js +10 -0
- data/app/assets/javascripts/blogelator/config/router.js +9 -0
- data/app/assets/javascripts/blogelator/config/routes.js +13 -0
- data/app/assets/javascripts/blogelator/config/serializer.js +10 -0
- data/app/assets/javascripts/blogelator/config/store.js +10 -0
- data/app/assets/javascripts/blogelator/controllers/application_controller.js +11 -0
- data/app/assets/javascripts/blogelator/controllers/posts/posts_edit_controller.js +97 -0
- data/app/assets/javascripts/blogelator/controllers/posts/posts_index_controller.js +9 -0
- data/app/assets/javascripts/blogelator/controllers/posts/posts_new_controller.js +6 -0
- data/app/assets/javascripts/blogelator/controllers/posts/posts_show_controller.js +37 -0
- data/app/assets/javascripts/blogelator/models/post.js +34 -0
- data/app/assets/javascripts/blogelator/routes/index_route.js +10 -0
- data/app/assets/javascripts/blogelator/routes/posts_edit_route.js +36 -0
- data/app/assets/javascripts/blogelator/routes/posts_index_route.js +20 -0
- data/app/assets/javascripts/blogelator/routes/posts_new_route.js +53 -0
- data/app/assets/javascripts/blogelator/routes/posts_route.js +10 -0
- data/app/assets/javascripts/blogelator/routes/posts_show_route.js +14 -0
- data/app/assets/javascripts/blogelator/templates/application.handlebars +23 -0
- data/app/assets/javascripts/blogelator/templates/components/markdown-editor.handlebars +8 -0
- data/app/assets/javascripts/blogelator/templates/components/save-button.handlebars +8 -0
- data/app/assets/javascripts/blogelator/templates/posts/_footer.handlebars +0 -0
- data/app/assets/javascripts/blogelator/templates/posts/_form.handlebars +6 -0
- data/app/assets/javascripts/blogelator/templates/posts/_form_action_bar.handlebars +22 -0
- data/app/assets/javascripts/blogelator/templates/posts/_show_action_bar.handlebars +20 -0
- data/app/assets/javascripts/blogelator/templates/posts/edit.handlebars +1 -0
- data/app/assets/javascripts/blogelator/templates/posts/index.handlebars +30 -0
- data/app/assets/javascripts/blogelator/templates/posts/new.handlebars +1 -0
- data/app/assets/javascripts/blogelator/templates/posts/show.handlebars +22 -0
- data/app/assets/stylesheets/blogelator/admin/all.scss +7 -0
- data/app/assets/stylesheets/blogelator/admin/components/markdown_editor.scss +142 -0
- data/app/assets/stylesheets/blogelator/admin/components/save_button.scss +121 -0
- data/app/assets/stylesheets/blogelator/admin/layout.scss +94 -0
- data/app/assets/stylesheets/blogelator/admin/posts/_form.scss +12 -0
- data/app/assets/stylesheets/blogelator/admin/posts/_form_action_bar.scss +84 -0
- data/app/assets/stylesheets/blogelator/admin/posts/_posts_list.scss +43 -0
- data/app/assets/stylesheets/blogelator/admin/posts/edit.scss +7 -0
- data/app/assets/stylesheets/blogelator/admin/posts/index.scss +14 -0
- data/app/assets/stylesheets/blogelator/admin/posts/new.scss +16 -0
- data/app/assets/stylesheets/blogelator/admin/posts/show.scss +17 -0
- data/app/assets/stylesheets/blogelator/application/all.scss +19 -0
- data/app/assets/stylesheets/blogelator/application/layout.scss +49 -0
- data/app/assets/stylesheets/blogelator/application/posts/index.scss +50 -0
- data/app/assets/stylesheets/blogelator/application/posts/show.scss +64 -0
- data/app/assets/stylesheets/blogelator/mixins/blogelator_button.scss +57 -0
- data/app/assets/stylesheets/blogelator/mixins/blogelator_logo.scss +12 -0
- data/app/assets/stylesheets/blogelator/shared/post.scss +161 -0
- data/app/assets/stylesheets/blogelator/shared/typography/code_highlighting.scss +111 -0
- data/app/assets/stylesheets/blogelator/shared/typography/forms.scss +94 -0
- data/app/assets/stylesheets/blogelator/shared/typography/headings.scss +22 -0
- data/app/assets/stylesheets/blogelator/shared/typography/lists.scss +25 -0
- data/app/controllers/blogelator/admin/application_controller.rb +15 -0
- data/app/controllers/blogelator/admin/images_controller.rb +40 -0
- data/app/controllers/blogelator/admin/posts_controller.rb +67 -0
- data/app/controllers/blogelator/application_controller.rb +5 -0
- data/app/controllers/blogelator/posts_controller.rb +37 -0
- data/app/controllers/concerns/blogelator/admin/auth.rb +23 -0
- data/app/helpers/blogelator/admin/posts_helper.rb +7 -0
- data/app/helpers/blogelator/posts_helper.rb +28 -0
- data/app/models/blogelator/ability.rb +11 -0
- data/app/models/blogelator/html_renderer.rb +10 -0
- data/app/models/blogelator/post.rb +63 -0
- data/app/models/blogelator/tag.rb +5 -0
- data/app/serializers/blogelator/post_serializer.rb +6 -0
- data/app/views/blogelator/admin/posts/index.html.erb +0 -0
- data/app/views/blogelator/posts/_post.html.erb +14 -0
- data/app/views/blogelator/posts/index.html.erb +39 -0
- data/app/views/blogelator/posts/show.html.erb +27 -0
- data/app/views/layouts/blogelator/_footer.html.erb +3 -0
- data/app/views/layouts/blogelator/_head.html.erb +7 -0
- data/app/views/layouts/blogelator/_header.html.erb +7 -0
- data/app/views/layouts/blogelator/admin.html.erb +14 -0
- data/app/views/layouts/blogelator/application.html.erb +14 -0
- data/config/jshint.json +43 -0
- data/config/routes.rb +15 -0
- data/db/migrate/20140221192000_create_blogelator_posts.rb +12 -0
- data/db/migrate/20140221204230_add_slug_and_change_user_to_author.rb +6 -0
- data/db/migrate/20140221212026_create_blogelator_tags.rb +10 -0
- data/db/migrate/20140224024607_change_posts_properties_to_have_defaults.rb +14 -0
- data/db/migrate/20140224175024_add_slugs_to_existing_posts.rb +16 -0
- data/db/migrate/20140224192058_add_published_at_to_posts.rb +13 -0
- data/db/migrate/20140303015004_add_summary_to_posts.rb +9 -0
- data/lib/assets/stylesheets/blogelator/_variables_sample.scss +38 -0
- data/lib/blogelator.rb +27 -0
- data/lib/blogelator/engine.rb +35 -0
- data/lib/blogelator/version.rb +3 -0
- data/lib/generators/blogelator/install_generator.rb +94 -0
- data/spec/dummy/README.rdoc +28 -0
- data/spec/dummy/Rakefile +6 -0
- data/spec/dummy/app/assets/javascripts/application.js +1 -0
- data/spec/dummy/app/assets/javascripts/features/user_visits_admin_page_spec.js +12 -0
- data/spec/dummy/app/assets/javascripts/features/user_visits_post_page_spec.js +12 -0
- data/spec/dummy/app/assets/javascripts/fixtures/post.js +17 -0
- data/spec/dummy/app/assets/javascripts/test_helper.js +12 -0
- data/spec/dummy/app/assets/stylesheets/application.css +12 -0
- data/spec/dummy/app/assets/stylesheets/blogelator/_variables.scss +38 -0
- data/spec/dummy/app/assets/stylesheets/blogelator/admin.css.scss +4 -0
- data/spec/dummy/app/assets/stylesheets/blogelator/application.css.scss +4 -0
- data/spec/dummy/app/assets/stylesheets/test_helper.css +21 -0
- data/spec/dummy/app/controllers/application_controller.rb +9 -0
- data/spec/dummy/app/helpers/application_helper.rb +2 -0
- data/spec/dummy/app/models/blogelator/ability.rb +9 -0
- data/spec/dummy/app/views/layouts/application.html.erb +14 -0
- data/spec/dummy/app/views/q_unit/rails/test/index.html.erb +17 -0
- data/spec/dummy/app/views/qunit/rails/test/index.html.erb +17 -0
- data/spec/dummy/bin/bundle +3 -0
- data/spec/dummy/bin/rails +4 -0
- data/spec/dummy/bin/rake +4 -0
- data/spec/dummy/config.ru +4 -0
- data/spec/dummy/config/application.rb +24 -0
- data/spec/dummy/config/boot.rb +5 -0
- data/spec/dummy/config/database.yml +25 -0
- data/spec/dummy/config/environment.rb +5 -0
- data/spec/dummy/config/environments/development.rb +32 -0
- data/spec/dummy/config/environments/production.rb +80 -0
- data/spec/dummy/config/environments/test.rb +36 -0
- data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/spec/dummy/config/initializers/blogelator.rb +6 -0
- data/spec/dummy/config/initializers/filter_parameter_logging.rb +4 -0
- data/spec/dummy/config/initializers/inflections.rb +16 -0
- data/spec/dummy/config/initializers/mime_types.rb +5 -0
- data/spec/dummy/config/initializers/secret_token.rb +12 -0
- data/spec/dummy/config/initializers/session_store.rb +3 -0
- data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
- data/spec/dummy/config/locales/en.yml +23 -0
- data/spec/dummy/config/routes.rb +3 -0
- data/spec/dummy/db/development.sqlite3 +0 -0
- data/spec/dummy/db/migrate/20140221215439_create_blogelator_posts.blogelator.rb +13 -0
- data/spec/dummy/db/migrate/20140221215440_add_slug_and_change_user_to_author.blogelator.rb +7 -0
- data/spec/dummy/db/migrate/20140224024931_create_blogelator_tags.blogelator.rb +11 -0
- data/spec/dummy/db/migrate/20140224025218_change_posts_properties_to_have_defaults.blogelator.rb +15 -0
- data/spec/dummy/db/migrate/20140224205646_add_slugs_to_existing_posts.blogelator.rb +17 -0
- data/spec/dummy/db/migrate/20140224205647_add_published_at_to_posts.blogelator.rb +14 -0
- data/spec/dummy/db/migrate/20140303015133_add_summary_to_posts.blogelator.rb +6 -0
- data/spec/dummy/db/production.sqlite3 +0 -0
- data/spec/dummy/db/schema.rb +37 -0
- data/spec/dummy/db/test.sqlite3 +0 -0
- data/spec/dummy/log/development.log +50393 -0
- data/spec/dummy/log/production.log +76 -0
- data/spec/dummy/log/test.log +11750 -0
- data/spec/dummy/public/404.html +58 -0
- data/spec/dummy/public/422.html +58 -0
- data/spec/dummy/public/500.html +57 -0
- data/spec/dummy/public/favicon.ico +0 -0
- data/spec/dummy/public/index.html.erb +14 -0
- data/spec/dummy/tmp/ember-rails/ember-data.js +11132 -0
- data/spec/dummy/tmp/ember-rails/ember.js +42882 -0
- data/spec/factories/post.rb +11 -0
- data/spec/features/user_visits_blog_post_spec.rb +44 -0
- data/spec/features/user_visits_blog_spec.rb +85 -0
- data/spec/models/blogelator/post_spec.rb +95 -0
- data/spec/qunit_runner.js +148 -0
- data/spec/spec_helper.rb +34 -0
- metadata +764 -0
@@ -0,0 +1,40 @@
|
|
1
|
+
require_dependency "blogelator/admin/application_controller"
|
2
|
+
|
3
|
+
module Blogelator
|
4
|
+
module Admin
|
5
|
+
class ImagesController < ApplicationController
|
6
|
+
before_action :authorize_user
|
7
|
+
respond_to :json
|
8
|
+
|
9
|
+
# POST /api/images
|
10
|
+
def create
|
11
|
+
if s3_bucket
|
12
|
+
file = params[:file]
|
13
|
+
s3_object = s3_bucket.objects.create(file.original_filename, file.tempfile, {
|
14
|
+
acl: :public_read
|
15
|
+
})
|
16
|
+
render json: { filename: s3_object.public_url.to_s }
|
17
|
+
else
|
18
|
+
throw Exception, "S3 not setup"
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
private
|
23
|
+
|
24
|
+
def authorize_user
|
25
|
+
authorize! :manage, Blogelator::Post
|
26
|
+
end
|
27
|
+
|
28
|
+
def s3_bucket
|
29
|
+
if Blogelator.s3_access_key_id && Blogelator.s3_secret_access_key && Blogelator.s3_bucket
|
30
|
+
s3 = AWS::S3.new(
|
31
|
+
access_key_id: Blogelator.s3_access_key_id,
|
32
|
+
secret_access_key: Blogelator.s3_secret_access_key
|
33
|
+
)
|
34
|
+
s3.buckets[Blogelator.s3_bucket]
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
@@ -0,0 +1,67 @@
|
|
1
|
+
require_dependency "blogelator/admin/application_controller"
|
2
|
+
|
3
|
+
module Blogelator
|
4
|
+
module Admin
|
5
|
+
class PostsController < ApplicationController
|
6
|
+
before_action :authorize_user
|
7
|
+
before_action :set_post, only: [:show, :edit, :update, :destroy]
|
8
|
+
respond_to :json
|
9
|
+
respond_to :html, only: [:index]
|
10
|
+
|
11
|
+
# POST /api/posts
|
12
|
+
def create
|
13
|
+
@post = Blogelator::Post.new(post_params)
|
14
|
+
@post.author = blogelator_current_user
|
15
|
+
|
16
|
+
if @post.save
|
17
|
+
render json: @post, status: :created
|
18
|
+
else
|
19
|
+
render json: @post, status: :unprocessable_entity
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
# DELETE /api/posts/1
|
24
|
+
def destroy
|
25
|
+
@post.destroy
|
26
|
+
head :no_content
|
27
|
+
end
|
28
|
+
|
29
|
+
# GET /api/posts
|
30
|
+
def index
|
31
|
+
@posts = Blogelator::Post.unpublished + Blogelator::Post.published
|
32
|
+
respond_with @posts
|
33
|
+
end
|
34
|
+
|
35
|
+
# GET /api/posts/1
|
36
|
+
def show
|
37
|
+
@title = @post.title
|
38
|
+
render json: @post
|
39
|
+
end
|
40
|
+
|
41
|
+
# PATCH/PUT /api/posts/1
|
42
|
+
def update
|
43
|
+
if @post.update(post_params)
|
44
|
+
render json: @post
|
45
|
+
else
|
46
|
+
render json: @post, status: :unprocessable_entity
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
50
|
+
private
|
51
|
+
|
52
|
+
def authorize_user
|
53
|
+
authorize! :manage, Blogelator::Post
|
54
|
+
end
|
55
|
+
|
56
|
+
# Use callbacks to share common setup or constraints between actions.
|
57
|
+
def set_post
|
58
|
+
@post = Blogelator::Post.find(params[:id])
|
59
|
+
end
|
60
|
+
|
61
|
+
# Only allow a trusted parameter "white list" through.
|
62
|
+
def post_params
|
63
|
+
params.require(:post).permit(:body_markdown, :custom_summary, :published_at, :title)
|
64
|
+
end
|
65
|
+
end
|
66
|
+
end
|
67
|
+
end
|
@@ -0,0 +1,37 @@
|
|
1
|
+
require_dependency "blogelator/application_controller"
|
2
|
+
|
3
|
+
module Blogelator
|
4
|
+
class PostsController < ApplicationController
|
5
|
+
before_action :set_post, only: [:show]
|
6
|
+
|
7
|
+
# GET /
|
8
|
+
def index
|
9
|
+
page = params[:page] ? params[:page].to_i : 1
|
10
|
+
per_page = Blogelator.posts_per_page
|
11
|
+
|
12
|
+
@posts = Blogelator::Post.published.page(page).per(per_page)
|
13
|
+
end
|
14
|
+
|
15
|
+
# GET /post-title
|
16
|
+
def show
|
17
|
+
@title = @post.title
|
18
|
+
end
|
19
|
+
|
20
|
+
private
|
21
|
+
|
22
|
+
def set_next_post
|
23
|
+
@next_post = Blogelator::Post.where("published_at > ?", @post.published_at).order("published_at ASC").first
|
24
|
+
end
|
25
|
+
|
26
|
+
# Use callbacks to share common setup or constraints between actions.
|
27
|
+
def set_post
|
28
|
+
@post = Blogelator::Post.find_by_slug(params[:id])
|
29
|
+
set_previous_post
|
30
|
+
set_next_post
|
31
|
+
end
|
32
|
+
|
33
|
+
def set_previous_post
|
34
|
+
@previous_post = Blogelator::Post.where("published_at < ?", @post.published_at).order("published_at DESC").first
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
module Blogelator
|
2
|
+
module Admin
|
3
|
+
module Auth
|
4
|
+
extend ActiveSupport::Concern
|
5
|
+
|
6
|
+
included do
|
7
|
+
check_authorization
|
8
|
+
rescue_from CanCan::AccessDenied do |exception|
|
9
|
+
redirect_to main_app.root_url, alert: exception.message
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
def blogelator_current_user
|
14
|
+
respond_to?(:current_user) ? current_user : nil
|
15
|
+
end
|
16
|
+
|
17
|
+
def current_ability
|
18
|
+
@current_ability ||= Blogelator::Ability.new(blogelator_current_user)
|
19
|
+
end
|
20
|
+
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
module Blogelator
|
2
|
+
module PostsHelper
|
3
|
+
include LocalTimeHelper
|
4
|
+
|
5
|
+
def body_class
|
6
|
+
@body_class ||= "default"
|
7
|
+
body_class = "blogelator"
|
8
|
+
body_class += " " + controller.controller_name
|
9
|
+
body_class += " " + controller.action_name
|
10
|
+
body_class += " " + @body_class
|
11
|
+
body_class
|
12
|
+
end
|
13
|
+
|
14
|
+
def page_title
|
15
|
+
page = @title
|
16
|
+
if page
|
17
|
+
"#{page} • #{site_title}"
|
18
|
+
else
|
19
|
+
site_title
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
def site_title
|
24
|
+
Blogelator.site_name || "Blogelator"
|
25
|
+
end
|
26
|
+
|
27
|
+
end
|
28
|
+
end
|
@@ -0,0 +1,63 @@
|
|
1
|
+
module Blogelator
|
2
|
+
class Post < ActiveRecord::Base
|
3
|
+
attr_accessor :custom_summary
|
4
|
+
|
5
|
+
has_many :tags
|
6
|
+
belongs_to :author, class_name: Blogelator.user_class
|
7
|
+
|
8
|
+
before_save :parse_markdown, :set_slug, :set_summary
|
9
|
+
|
10
|
+
scope :published, -> { where("published_at IS NOT NULL").order("published_at DESC") }
|
11
|
+
scope :unpublished, -> { where("published_at IS NULL").order("created_at DESC") }
|
12
|
+
|
13
|
+
validates_presence_of :title
|
14
|
+
|
15
|
+
def active_model_serializer
|
16
|
+
Blogelator::PostSerializer
|
17
|
+
end
|
18
|
+
|
19
|
+
def published?
|
20
|
+
!self.published_at.nil?
|
21
|
+
end
|
22
|
+
|
23
|
+
def to_param
|
24
|
+
self.slug
|
25
|
+
end
|
26
|
+
|
27
|
+
private
|
28
|
+
|
29
|
+
def markdown
|
30
|
+
@markdown ||= Redcarpet::Markdown.new(Blogelator::HTMLRenderer, {
|
31
|
+
autolink: true,
|
32
|
+
disable_indented_code_blocks: true,
|
33
|
+
fenced_code_blocks: true,
|
34
|
+
space_after_headers: true
|
35
|
+
})
|
36
|
+
end
|
37
|
+
|
38
|
+
def parse_markdown
|
39
|
+
self.body_html = markdown.render(self.body_markdown)
|
40
|
+
end
|
41
|
+
|
42
|
+
def set_summary
|
43
|
+
if @custom_summary.blank?
|
44
|
+
summary_text = self.body_markdown.split("\n\n").first.to_s.first(300).strip
|
45
|
+
summary_text += "..." if self.body_markdown.length > 300
|
46
|
+
summary_text = markdown.render(summary_text).to_s
|
47
|
+
self.summary = summary_text.gsub("<p>", "").gsub("</p>", "")
|
48
|
+
else
|
49
|
+
self.summary = markdown.render(@custom_summary)
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
53
|
+
def set_slug
|
54
|
+
if self.published_at && self.slug.nil?
|
55
|
+
self.slug = self.title.parameterize
|
56
|
+
existing_slug_count = self.class.where(slug: self.slug).count
|
57
|
+
if existing_slug_count > 0
|
58
|
+
self.slug = self.slug + "-#{existing_slug_count}"
|
59
|
+
end
|
60
|
+
end
|
61
|
+
end
|
62
|
+
end
|
63
|
+
end
|
File without changes
|
@@ -0,0 +1,14 @@
|
|
1
|
+
<% cache(post) do %>
|
2
|
+
<div class="post">
|
3
|
+
<h2><%= link_to post.title, post %></h2>
|
4
|
+
<div class="date">
|
5
|
+
<%= local_time(post.published_at, format: '%B %e, %Y') %>
|
6
|
+
</div>
|
7
|
+
<div class="summary">
|
8
|
+
<p>
|
9
|
+
<%=raw post.summary %>
|
10
|
+
<%= link_to raw("Continue reading »"), post, class: "continue" %>
|
11
|
+
</p>
|
12
|
+
</div>
|
13
|
+
</div>
|
14
|
+
<% end %>
|
@@ -0,0 +1,39 @@
|
|
1
|
+
<% cache(@posts) do %>
|
2
|
+
<% if @posts.length > 0 %>
|
3
|
+
<%= render @posts %>
|
4
|
+
<div class="pagination">
|
5
|
+
<%= link_to_next_page @posts, "Older", class: "older" %>
|
6
|
+
<%= link_to_previous_page @posts, "Newer", class: "newer" %>
|
7
|
+
</div>
|
8
|
+
<% else %>
|
9
|
+
<div class="post">
|
10
|
+
<h2>
|
11
|
+
<a href="https://github.com/codelation/blogelator">
|
12
|
+
Welcome to Blogelator
|
13
|
+
</a>
|
14
|
+
</h2>
|
15
|
+
<div class="date">
|
16
|
+
<%= local_time(Time.now, format: '%B %e, %Y') %>
|
17
|
+
</div>
|
18
|
+
<div class="summary">
|
19
|
+
<p>
|
20
|
+
Navigate to <%= link_to "#{File.join(request.path, "admin")}", blogelator.admin_path %>
|
21
|
+
to create your first blog post. You will need to have your authentication set up
|
22
|
+
already before you can access the Blogelator admin section.
|
23
|
+
</p>
|
24
|
+
<p>
|
25
|
+
For more information about setting up Blogelator, check out the Readme on GitHub:
|
26
|
+
</p>
|
27
|
+
<blockquote>
|
28
|
+
<a href="https://github.com/codelation/blogelator">https://github.com/codelation/blogelator</a>
|
29
|
+
</blockquote>
|
30
|
+
<p>
|
31
|
+
Thanks for using Blogelator,
|
32
|
+
</p>
|
33
|
+
<p>
|
34
|
+
<a href="http://twitter.com/brianpattison">@brianpattison</a>
|
35
|
+
</p>
|
36
|
+
</div>
|
37
|
+
</div>
|
38
|
+
<% end %>
|
39
|
+
<% end %>
|
@@ -0,0 +1,27 @@
|
|
1
|
+
<% cache(@post) do %>
|
2
|
+
<div class="post">
|
3
|
+
<h1><%= link_to @post.title, @post %></h1>
|
4
|
+
<div class="date">
|
5
|
+
<%= local_time(@post.published_at, format: '%B %e, %Y') %>
|
6
|
+
</div>
|
7
|
+
<div class="body">
|
8
|
+
<%=raw @post.body_html %>
|
9
|
+
</div>
|
10
|
+
</div>
|
11
|
+
<% end %>
|
12
|
+
|
13
|
+
<div class="more-posts">
|
14
|
+
<% if @previous_post %>
|
15
|
+
<%= link_to @previous_post, class: "previous" do %>
|
16
|
+
<%= @previous_post.title %><br />
|
17
|
+
<%= local_time(@previous_post.published_at, format: '%B %e, %Y') %>
|
18
|
+
<% end %>
|
19
|
+
<% end %>
|
20
|
+
|
21
|
+
<% if @next_post %>
|
22
|
+
<%= link_to @next_post, class: "next" do %>
|
23
|
+
<%= @next_post.title %><br />
|
24
|
+
<%= local_time(@next_post.published_at, format: '%B %e, %Y') %>
|
25
|
+
<% end %>
|
26
|
+
<% end %>
|
27
|
+
</div>
|
@@ -0,0 +1,7 @@
|
|
1
|
+
<head>
|
2
|
+
<title><%= page_title %></title>
|
3
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
4
|
+
<%= stylesheet_link_tag "blogelator/application", media: "all" %>
|
5
|
+
<%= javascript_include_tag "blogelator/application" %>
|
6
|
+
<%= csrf_meta_tags %>
|
7
|
+
</head>
|
@@ -0,0 +1,14 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title><%= page_title %></title>
|
5
|
+
<%= stylesheet_link_tag "blogelator/admin", media: "all" %>
|
6
|
+
<%= javascript_include_tag "blogelator/admin" %>
|
7
|
+
<%= csrf_meta_tags %>
|
8
|
+
</head>
|
9
|
+
<body class="<%= body_class %>">
|
10
|
+
|
11
|
+
<%= yield %>
|
12
|
+
|
13
|
+
</body>
|
14
|
+
</html>
|