Skip to content

REFERENCE PR #11

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 7 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
source 'http://rubygems.org'
git_source(:github) { |repo| "https://github.com/#{repo}.git" }

gem 'crummy', github: 'CirrusMD/crummy'

gemspec

Expand Down
2 changes: 1 addition & 1 deletion adminsimple.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Gem::Specification.new do |s|
s.test_files = Dir["{spec}/**/*"]

# Runtime Dependencies
s.add_dependency 'railties', ['>= 3.2.5','< 6']
s.add_dependency 'railties', ['>= 3.2.5','< 7']
s.add_dependency 'haml-rails'
s.add_dependency 'sass-rails'
s.add_dependency 'normalize-rails'
Expand Down
10 changes: 5 additions & 5 deletions app/assets/stylesheets/adminsimple/mixins/_mixins.sass
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@
+prefixme(transition, $properties, webkit moz ms o spec)

@mixin bar-gradient($start, $end)
background-image: -webkit-linear-gradient(top, $start, $end)
background-image: -moz-linear-gradient(top, $start, $end)
background-image: -ms-linear-gradient(top, $start, $end)
background-image: -o-linear-gradient(top, $start, $end)
background-image: linear-gradient(top, $start, $end)
background-image: -webkit-linear-gradient(to bottom, $start, $end)
background-image: -moz-linear-gradient(to bottom, $start, $end)
background-image: -ms-linear-gradient(to bottom, $start, $end)
background-image: -o-linear-gradient(to bottom, $start, $end)
background-image: linear-gradient(to bottom, $start, $end)


8 changes: 8 additions & 0 deletions app/helpers/adminsimple/modules/application_helper.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
module Adminsimple::Modules::ApplicationHelper
def rescued_csrf_meta_tags
csrf_meta_tags
rescue ArgumentError
request.reset_session
csrf_meta_tags
end
end
2 changes: 1 addition & 1 deletion app/views/layouts/adminsimple/application.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
%meta{ charset: "UTF-8" }
%meta{ name: "viewport", content: "width=device-width, initial-scale=1.0" }
= render partial: "/adminsimple/layout/head"
= csrf_meta_tags
= rescued_csrf_meta_tags
:javascript
if(typeof Storage !== undefined && localStorage.theme) {document.querySelector('html').setAttribute('id', "adminsimple_" + localStorage.theme);}
= stylesheet_link_tag 'adminsimple'
Expand Down
2 changes: 1 addition & 1 deletion app/views/layouts/adminsimple/devise.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
%title= t('adminsimple.site_name')
%meta{ charset: "UTF-8" }
%meta{ name: "viewport", content: "width=device-width, initial-scale=1.0" }
= csrf_meta_tags
= rescued_csrf_meta_tags
:javascript
if(typeof Storage !== undefined && localStorage.theme) {document.querySelector('html').setAttribute('id', "adminsimple_" + localStorage.theme);}
= stylesheet_link_tag 'adminsimple'
Expand Down
9 changes: 6 additions & 3 deletions lib/adminsimple/rails/engine.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,13 @@ class Engine < ::Rails::Engine
engine_name 'adminsimple'

initializer "adminsimple.view_helpers" do

ActiveSupport.on_load :action_view do
ActionView::Base.send :include, Adminsimple::ViewHelpers
ActionView::Base.send :include, Adminsimple::Modules::WidgetBoxHelpers
ActionView::Base.send :include, Adminsimple::Modules::PageHeaderHelpers
Rails.application.reloader.to_prepare do
ActionView::Base.send :include, Adminsimple::ViewHelpers
ActionView::Base.send :include, Adminsimple::Modules::WidgetBoxHelpers
ActionView::Base.send :include, Adminsimple::Modules::PageHeaderHelpers
end
end
end

Expand Down
2 changes: 1 addition & 1 deletion lib/adminsimple/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module Adminsimple
VERSION = '0.0.2'
VERSION = '0.0.4'
end