snapuser 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8b68c03b024e5cb5dfa5eb265b3a91956bba8f31
4
- data.tar.gz: 42d487e79165055c859670013c03aa2b7ecd7e4f
3
+ metadata.gz: 769aeb325c8907c35953496418dbc9d9c4d60a2f
4
+ data.tar.gz: 8b26d64e64cba2493f490c3846830d926df39cda
5
5
  SHA512:
6
- metadata.gz: 84c708628437a8e2b5cc27999964e7c0163062f84987ddb3c97950b6dd168f013757ef462d79d61d0b17db0e765ab91786ca655b79679c04a3d4a01318b15de1
7
- data.tar.gz: 3d6ad9a363bea08144061f512649fcd4553cf00ab6b94df11ddfc3039beb29b0ed1fda70d8f46f56fbaa6bd4a7ba9355787d0517a6b28f58e716819c86013f12
6
+ metadata.gz: 2cc6dc2b8049ed21684b8b1ada5df7a891d735b67b1418fb9ac1ebb9206b23be68aacfe28d2a0090f22668fa39eb5696f085dbe21416a862b98220662cd176c8
7
+ data.tar.gz: 311945967a4b7745155a319200fc3d23360438812e3420e75a2b96c12973245ed7c63610e960e7415497ad0d986598f0ab742eaf359fc922a684db5377b2686a
@@ -0,0 +1,15 @@
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 any plugin's vendor/assets/stylesheets directory 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 bottom of the
9
+ * compiled file so the styles you add here take precedence over styles defined in any styles
10
+ * defined in the other CSS/SCSS files in this directory. It is generally better to create a new
11
+ * file per style scope.
12
+ *
13
+ *= require_tree ./snapuser
14
+ *= require_self
15
+ */
@@ -0,0 +1,3 @@
1
+ h1 {
2
+ font-family: sans-serif;
3
+ }
@@ -1,6 +1,6 @@
1
1
  class Admin::UsersController < ApplicationController
2
2
  before_action { |c| c.authorize_level(Snapuser.superuser_level) }
3
- layout 'admin'
3
+ layout Snapuser.layout
4
4
 
5
5
  def index
6
6
  @table = Table.new(self, User)
@@ -23,7 +23,7 @@ class SessionsController < ApplicationController
23
23
  private
24
24
 
25
25
  def redirect_if_connected
26
- redirect_to profile_path unless current_user.nil?
26
+ redirect_to Snapuser.redirect_url unless current_user.nil?
27
27
  end
28
28
 
29
29
  end
@@ -1,6 +1,6 @@
1
1
  class UsersController < ApplicationController
2
2
  before_action { |c| c.authorize_level(Snapuser.can_edit) }
3
- layout 'admin'
3
+ layout Snapuser.layout
4
4
 
5
5
  def edit
6
6
  @user = current_user
data/lib/snapuser.rb CHANGED
@@ -4,6 +4,8 @@ module Snapuser
4
4
  @@levels = {"superadmin" => "1", "admin" => "2"}
5
5
  @@superuser_level = 1
6
6
  @@can_edit = 2
7
+ @@redirect_url = "/profile"
8
+ @@layout = "admin"
7
9
 
8
- mattr_accessor :levels, :can_edit, :superuser_level
10
+ mattr_accessor :levels, :can_edit, :superuser_level, :redirect_url, :layout
9
11
  end
@@ -1,12 +1,15 @@
1
1
  module Snapuser
2
2
  class Engine < ::Rails::Engine
3
+ require 'snaptable'
3
4
 
4
5
  initializer "Snapuser.append_migrations" do |app|
5
- unless app.root.to_s.match root.to_s
6
- config.paths["db/migrate"].expanded.each do |expanded_path|
7
- app.config.paths["db/migrate"] << expanded_path
8
- end
6
+ config.paths["db/migrate"].expanded.each do |expanded_path|
7
+ app.config.paths["db/migrate"] << expanded_path
9
8
  end
10
9
  end
10
+
11
+ initializer 'Snapuser.action_controller' do |app|
12
+ ActionController::Base.send :include, SessionsHelper
13
+ end
11
14
  end
12
15
  end
@@ -1,3 +1,3 @@
1
1
  module Snapuser
2
- VERSION = "0.2.0"
2
+ VERSION = "0.2.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: snapuser
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - khcr
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-04-16 00:00:00.000000000 Z
11
+ date: 2015-05-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -52,6 +52,20 @@ dependencies:
52
52
  - - ">="
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: sass-rails
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: 4.0.3
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: 4.0.3
55
69
  - !ruby/object:Gem::Dependency
56
70
  name: sqlite3
57
71
  requirement: !ruby/object:Gem::Requirement
@@ -75,6 +89,8 @@ extra_rdoc_files: []
75
89
  files:
76
90
  - MIT-LICENSE
77
91
  - Rakefile
92
+ - app/assets/stylesheets/snapuser.css
93
+ - app/assets/stylesheets/snapuser/snapuser.css.scss
78
94
  - app/controllers/admin/users_controller.rb
79
95
  - app/controllers/sessions_controller.rb
80
96
  - app/controllers/users_controller.rb