-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from codelation/4-migrations-issue
Fixing copy file issues
- Loading branch information
Showing
15 changed files
with
306 additions
and
254 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
ActiveAdmin.register Blogelator::Author, as: "Author" do | ||
permit_params [ | ||
:bio_markdown, | ||
:cover_photo, | ||
:location, | ||
:meta_description, | ||
:meta_keywords, | ||
:name, | ||
:profile_photo, | ||
:slug, | ||
:website | ||
] | ||
|
||
controller do | ||
defaults finder: :find_by_slug! | ||
end | ||
|
||
filter :name | ||
filter :bio_html | ||
filter :location | ||
filter :website | ||
|
||
index do | ||
selectable_column | ||
column :id | ||
column :title do |author| | ||
link_to author.name, admin_author_path(author) | ||
end | ||
column :created_at | ||
column :updated_at | ||
end | ||
|
||
form do |f| | ||
inputs "#{t('activerecord.models.author', count: 1)} Details" do | ||
input :name, input_html: { class: "title-to-slug-title" } | ||
input :bio_markdown, as: :codemirror, codemirror: { mode: "gfm" } | ||
input :profile_photo, as: :file | ||
input :cover_photo, as: :file | ||
input :location | ||
input :website | ||
end | ||
|
||
inputs "Search Engine Optimization" do | ||
input :meta_keywords | ||
input :meta_description | ||
input :slug, input_html: { class: "title-to-slug-slug" } | ||
end | ||
|
||
actions | ||
end | ||
|
||
show do | ||
attributes_table do | ||
row :name | ||
row :bio do | ||
raw author.bio_html | ||
end | ||
row :profile_photo do | ||
if author.profile_photo.exists? | ||
img src: author.profile_photo.url(:small) | ||
else | ||
"No Profile Photo" | ||
end | ||
end | ||
row :cover_photo do | ||
if author.cover_photo.exists? | ||
img src: author.cover_photo.url(:small) | ||
else | ||
"No Cover Photo" | ||
end | ||
end | ||
row :location | ||
row :website | ||
row :created_at | ||
row :updated_at | ||
end | ||
active_admin_comments | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,125 @@ | ||
ActiveAdmin.register Blogelator::Post, as: "Post" do | ||
permit_params [ | ||
:author_id, | ||
:body_markdown, | ||
:featured, | ||
:image, | ||
:meta_description, | ||
:meta_keywords, | ||
:published_at, | ||
:slug, | ||
:status, | ||
:summary_markdown, | ||
:title, | ||
related_post_ids: [], | ||
tag_ids: [] | ||
] | ||
|
||
controller do | ||
defaults finder: :find_by_slug! | ||
end | ||
|
||
filter :title | ||
filter :body_html | ||
filter :published_at | ||
filter :tags | ||
|
||
index do | ||
selectable_column | ||
column :id | ||
column :title do |post| | ||
link_to post.title, admin_post_path(post) | ||
end | ||
column :published_at | ||
column :status do |post| | ||
post.status.titleize | ||
end | ||
end | ||
|
||
form do |f| | ||
inputs "#{t('activerecord.models.post', count: 1)} Details" do | ||
input :title, input_html: { class: "title-to-slug-title" } | ||
input :image, as: :file | ||
input :body_markdown, as: :codemirror, codemirror: { lineWrapping: true, mode: "gfm" } | ||
input :summary_markdown, as: :codemirror, codemirror: { lineWrapping: true, mode: "gfm" } | ||
end | ||
|
||
inputs "Publish Settings" do | ||
input :status, as: :select, collection: Blogelator::Post.statuses.map {|status| [status[0].titleize, status[0]] }, include_blank: false | ||
input :author, as: :select | ||
input :featured | ||
input :published_at, as: :datepicker | ||
end | ||
|
||
inputs "Tags" do | ||
input :tags, as: :check_boxes, label: false | ||
end | ||
|
||
inputs "Related Posts" do | ||
input :related_posts, as: :check_boxes, label: false | ||
end | ||
|
||
inputs "Search Engine Optimization" do | ||
input :meta_keywords | ||
input :meta_description | ||
input :slug, input_html: { class: "title-to-slug-slug" } | ||
end | ||
|
||
actions | ||
end | ||
|
||
show do | ||
attributes_table do | ||
row :title | ||
row :author | ||
row :status do | ||
post.status.titleize | ||
end | ||
row :url do | ||
a href: post.url, target: "_blank" do | ||
post.url | ||
end | ||
end | ||
row :published_at | ||
row :image do | ||
if post.image.exists? | ||
img src: post.image.url(:small) | ||
else | ||
"No Image" | ||
end | ||
end | ||
row :created_at | ||
row :updated_at | ||
row :tags do | ||
post.tags.each do |tag| | ||
a href: admin_tag_path(tag) do | ||
tag.name | ||
end | ||
end | ||
end | ||
row :summary do | ||
raw post.summary_html | ||
end | ||
row :content do | ||
raw post.body_html | ||
end | ||
end | ||
|
||
panel "Related Posts" do | ||
if post.related_posts.length > 0 | ||
ul do | ||
post.related_posts.each do |post| | ||
li do | ||
a href: admin_post_path(post) do | ||
post.title | ||
end | ||
end | ||
end | ||
end | ||
else | ||
para "No related posts" | ||
end | ||
end | ||
active_admin_comments | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
ActiveAdmin.register Blogelator::Tag, as: "Tag" do | ||
permit_params [ | ||
:name, | ||
:slug | ||
] | ||
|
||
controller do | ||
defaults finder: :find_by_slug! | ||
end | ||
|
||
filter :name | ||
|
||
index do | ||
selectable_column | ||
column :id | ||
column :name do |tag| | ||
link_to tag.name, admin_tag_path(tag) | ||
end | ||
column :created_at | ||
column :updated_at | ||
end | ||
|
||
form do |f| | ||
inputs "#{t('activerecord.models.tag', count: 1)} Details" do | ||
input :name, input_html: { class: "title-to-slug-title" } | ||
input :slug, input_html: { class: "title-to-slug-slug" } | ||
end | ||
|
||
actions | ||
end | ||
|
||
show do | ||
attributes_table do | ||
row :name | ||
row :slug | ||
row :created_at | ||
row :updated_at | ||
end | ||
active_admin_comments | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# Blogelator allows you to add a blog to a Rails app. | ||
module Blogelator | ||
def self.table_name_prefix | ||
"blogelator_" | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.