Skip to content

Commit

Permalink
Fixed a few issues before launch
Browse files Browse the repository at this point in the history
  • Loading branch information
Bodacious committed Jun 28, 2015
1 parent 2dfb0c1 commit 7dc01f7
Show file tree
Hide file tree
Showing 14 changed files with 44 additions and 24 deletions.
4 changes: 0 additions & 4 deletions Gemfile
@@ -1,9 +1,5 @@
source "http://rubygems.org"

warn "Still loading Blogit from gemfile"

gem "blogit", path: "~/KatanaCode/blogit"

# Declare your gem's dependencies in blogit.gemspec.
# Bundler will treat runtime dependencies like base dependencies, and
# development dependencies will be added by default to the :development group.
Expand Down
4 changes: 4 additions & 0 deletions app/assets/stylesheets/blogit/admin/blocks/_comments.sass
@@ -0,0 +1,4 @@
.blogit_admin_comment
margin: 1em 0
padding: 1em 0.5em
border-bottom: thin solid silver
Empty file.
3 changes: 1 addition & 2 deletions app/assets/stylesheets/blogit/admin/blocks/_forms.sass
Expand Up @@ -28,7 +28,6 @@
min-height: 10em
line-height: 1.56
@extend %editable_form_field



.blogit_admin_form-editable_text_area.is_epic_editor
display: none
2 changes: 1 addition & 1 deletion app/controllers/blogit/admin/application_controller.rb
Expand Up @@ -30,7 +30,7 @@ def authenticate_blogger
super
else
raise NotImplementedError,
"Please define :current_blogger in your ApplicationController.\
"Please define :authenticate_blogger in your ApplicationController.\
Blogit::Admin needs this to determine who's signed in."
end
end
Expand Down
1 change: 1 addition & 0 deletions app/controllers/blogit/admin/posts_controller.rb
Expand Up @@ -3,6 +3,7 @@ module Admin

class PostsController < ::Blogit::Admin::ApplicationController


if Rails::VERSION::MAJOR < 4
before_filter :authenticate_blogger
else
Expand Down
2 changes: 1 addition & 1 deletion app/views/blogit/admin/posts/_form.html.erb
Expand Up @@ -37,7 +37,7 @@
<%= f.field id: "new_blog_post_state_field" do %>
<%= f.label :state, t(:state, scope: 'blogit.admin.posts') %>
<%= f.collection_select(:state, (Blogit::Configuration::ACTIVE_STATES + Blogit::Configuration::HIDDEN_STATES), :to_s, :to_s) %>
<%= f.collection_select(:state, blogit_conf.active_states + blogit_conf.hidden_states, :to_s, :to_s) %>
<% end %>
<%= actions do %>
Expand Down
2 changes: 1 addition & 1 deletion app/views/blogit/admin/posts/index.html.erb
Expand Up @@ -17,7 +17,7 @@

<h2><%= t(:latest_comments, scope: "blogit.admin") %></h2>

<%= render(@latest_comments) ||
<%= render(partial: 'blogit/admin/comments/comment', collection: @latest_comments) or
muted_text(t(:no_comments_to_show, scope: "blogit.admin")) %>
<% end %>
2 changes: 1 addition & 1 deletion blogit-admin.gemspec
Expand Up @@ -18,7 +18,7 @@ Gem::Specification.new do |s|
s.test_files = Dir["spec/**/*"]


# s.add_dependency "blogit", "~> 1.0.0"
s.add_dependency "blogit", ">= 1.1.1"
s.add_dependency "epic-editor-rails"

s.add_development_dependency 'rails', '>= 4.2.0'
Expand Down
2 changes: 2 additions & 0 deletions config/initializers/extend_blogit_models.rb
@@ -1,3 +1,5 @@
require "blogit"

Blogit::Post.class_eval do
include Blogit::Admin::ModelExtensions::Post
end
Expand Down
2 changes: 2 additions & 0 deletions lib/blogit/admin.rb
Expand Up @@ -7,6 +7,8 @@
require "blogit/admin/model_extensions/comment"

require "epic-editor-rails"
require "kaminari"
require "acts-as-taggable-on"

Blogit::Configuration.class_eval do

Expand Down
33 changes: 28 additions & 5 deletions lib/blogit/admin/configuration.rb
Expand Up @@ -5,18 +5,41 @@ module Configuration
extend ActiveSupport::Concern

included do
config_accessor(:admin_layout) { "blogit_admin" }

config_accessor(:authentication_method) { :blogger_signed_in? }

##
# Which layout should blogit-admin load for the admin actions
# (default: "blogit_admin")
#
# Returns a String
config_accessor(:admin_layout) { "blogit_admin" }

##
# Restrict editing Posts to the original author only? (default: false)
#
# Returns true or false
config_accessor(:author_edits_only) { false }


##
# Which FormBuilder class should the admin forms use?
# (default: "Blogit::Admin::FormsHelper::FormBuilder")
#
# Returns a String
config_accessor(:admin_form_builder_class) {
"Blogit::Admin::FormsHelper::FormBuilder" }


##
# Which base controller should Blogit::Admin::ApplicationController inherit
# from? (default: "::ApplicationController")
#
# Returns a String
config_accessor(:admin_application_controller_base_class) {
"::ApplicationController" }

##
# Which WYSIWYG editor should **Blogit Admin** use in the posts form? Currently
# supported options include :epic_editor. (default: :epic_editor)
#
# Returns a Symbol
config_accessor(:admin_wysiwyg_editor) { :epic_editor }
end

Expand Down
9 changes: 0 additions & 9 deletions lib/blogit/admin/engine.rb
Expand Up @@ -5,16 +5,7 @@ class Engine < Rails::Engine
BLOGIT_ADMIN_ROOT = File.join(File.dirname(__FILE__), "..", "..", "..")

isolate_namespace Blogit::Admin

initializer "blogit-admin.extend_active_record" do

if defined?(::ActiveRecord::Base)
# ::ActiveRecord::Base.send(:include, Blogit::Blogs)
# ::ActiveRecord::Base.send(:include, Validators)
end

end


if Rails.env.development?
ActionDispatch::Callbacks.to_prepare do
Expand Down
2 changes: 2 additions & 0 deletions spec/dummy/app/controllers/application_controller.rb
Expand Up @@ -18,4 +18,6 @@ def login_required
end
end

def authenticate_blogger() login_required end

end

0 comments on commit 7dc01f7

Please sign in to comment.