cms-fortress 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.document +5 -0
- data/.rvmrc +1 -0
- data/Gemfile +15 -0
- data/Gemfile.lock +161 -0
- data/LICENSE.txt +20 -0
- data/README.rdoc +38 -0
- data/Rakefile +56 -0
- data/VERSION +1 -0
- data/app/assets/javascripts/cms/fortress/bootstrap-affix.js +117 -0
- data/app/assets/javascripts/cms/fortress/bootstrap-alert.js +99 -0
- data/app/assets/javascripts/cms/fortress/bootstrap-button.js +105 -0
- data/app/assets/javascripts/cms/fortress/bootstrap-carousel.js +207 -0
- data/app/assets/javascripts/cms/fortress/bootstrap-collapse.js +167 -0
- data/app/assets/javascripts/cms/fortress/bootstrap-dropdown.js +165 -0
- data/app/assets/javascripts/cms/fortress/bootstrap-modal.js +247 -0
- data/app/assets/javascripts/cms/fortress/bootstrap-popover.js +114 -0
- data/app/assets/javascripts/cms/fortress/bootstrap-scrollspy.js +162 -0
- data/app/assets/javascripts/cms/fortress/bootstrap-tab.js +144 -0
- data/app/assets/javascripts/cms/fortress/bootstrap-tooltip.js +361 -0
- data/app/assets/javascripts/cms/fortress/bootstrap-transition.js +60 -0
- data/app/assets/javascripts/cms/fortress/bootstrap-typeahead.js +335 -0
- data/app/assets/javascripts/cms/fortress/bootstrap.js +2276 -0
- data/app/assets/javascripts/cms/fortress/cms_fortress.js +14 -0
- data/app/assets/javascripts/html5shiv.js +8 -0
- data/app/assets/stylesheets/cms/fortress/admin_overrides.css +11 -0
- data/app/assets/stylesheets/cms/fortress/bootstrap-responsive.css +1109 -0
- data/app/assets/stylesheets/cms/fortress/bootstrap.css +6158 -0
- data/app/assets/stylesheets/cms/fortress/session.css +39 -0
- data/app/controllers/cms/fortress/admin_controller.rb +17 -0
- data/app/controllers/cms/fortress/roles_controller.rb +84 -0
- data/app/controllers/cms/fortress/users_controller.rb +89 -0
- data/app/helpers/cms/fortress/application_helper.rb +27 -0
- data/app/helpers/cms/fortress/roles_helper.rb +2 -0
- data/app/models/cms/fortress.rb +5 -0
- data/app/models/cms/fortress/role.rb +17 -0
- data/app/models/cms/fortress/role_detail.rb +6 -0
- data/app/models/cms/fortress/user.rb +14 -0
- data/app/models/cms_ability.rb +32 -0
- data/app/views/cms/fortress/admin/design.html.haml +1 -0
- data/app/views/cms/fortress/admin/roles.html.haml +1 -0
- data/app/views/cms/fortress/admin/settings.html.haml +1 -0
- data/app/views/cms/fortress/admin/users.html.haml +1 -0
- data/app/views/cms/fortress/roles/_form.html.haml +19 -0
- data/app/views/cms/fortress/roles/edit.html.haml +5 -0
- data/app/views/cms/fortress/roles/index.html.haml +20 -0
- data/app/views/cms/fortress/roles/new.html.haml +5 -0
- data/app/views/cms/fortress/roles/show.html.haml +12 -0
- data/app/views/cms/fortress/shared/_admin_topnav.html.haml +19 -0
- data/app/views/cms/fortress/shared/_navbar.html.erb +14 -0
- data/app/views/cms/fortress/users/_form.html.haml +27 -0
- data/app/views/cms/fortress/users/edit.html.haml +5 -0
- data/app/views/cms/fortress/users/index.html.haml +20 -0
- data/app/views/cms/fortress/users/new.html.haml +5 -0
- data/app/views/cms_users/sessions/new.html.erb +19 -0
- data/app/views/layouts/cms/fortress/default.html.erb +96 -0
- data/app/views/layouts/cms/fortress/session.html.erb +31 -0
- data/app/views/layouts/cms_admin/_body.html.haml +22 -0
- data/app/views/layouts/cms_admin/_head.html.haml +14 -0
- data/app/views/layouts/cms_admin/_left.html.haml +18 -0
- data/cms-fortress.gemspec +148 -0
- data/config/initializers/devise.rb +243 -0
- data/config/locales/en.yml +25 -0
- data/config/roles.yml +10 -0
- data/config/routes.rb +34 -0
- data/db/migrate/01_devise_create_cms_fortress_users.rb +56 -0
- data/db/migrate/02_create_cms_fortress_role_details.rb +15 -0
- data/db/migrate/03_create_cms_fortress_roles.rb +33 -0
- data/lib/cms-fortress.rb +9 -0
- data/lib/cms/fortress/application_controller_methods.rb +14 -0
- data/lib/cms/fortress/auth.rb +11 -0
- data/lib/cms/fortress/comfortable_mexican_sofa.rb +8 -0
- data/lib/cms/fortress/devise.rb +3 -0
- data/lib/cms/fortress/rails/engine.rb +19 -0
- data/lib/generators/cms/fortress/USAGE +8 -0
- data/lib/generators/cms/fortress/fortress_generator.rb +17 -0
- data/lib/generators/cms/fortress/templates/README +23 -0
- data/lib/generators/comfy/cms/cms_generator.rb +55 -0
- data/test/fixtures/cms/fortress/role_details.yml +17 -0
- data/test/fixtures/cms/fortress/roles.yml +9 -0
- data/test/functional/cms/fortress/roles_controller_test.rb +49 -0
- data/test/functional/cms/fortress/users_controller_test.rb +49 -0
- data/test/helper.rb +18 -0
- data/test/test_cms-fortress.rb +7 -0
- data/test/unit/cms/fortress/role_detail_test.rb +7 -0
- data/test/unit/cms/fortress/role_test.rb +7 -0
- data/test/unit/cms/fortress/role_user_test.rb +7 -0
- data/test/unit/helpers/cms/fortress/roles_helper_test.rb +4 -0
- data/test/unit/helpers/cms/fortress/users_helper_test.rb +4 -0
- metadata +226 -0
@@ -0,0 +1,14 @@
|
|
1
|
+
<div class="navbar navbar-inverse navbar-fixed-top">
|
2
|
+
<div class="navbar-inner">
|
3
|
+
<div class="container">
|
4
|
+
<button type="button" class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
|
5
|
+
<span class="icon-bar"></span>
|
6
|
+
<span class="icon-bar"></span>
|
7
|
+
<span class="icon-bar"></span>
|
8
|
+
</button>
|
9
|
+
<a class="brand" href="#">CMS Fortress</a>
|
10
|
+
<div class="nav-collapse collapse">
|
11
|
+
</div><!--/.nav-collapse -->
|
12
|
+
</div>
|
13
|
+
</div>
|
14
|
+
</div>
|
@@ -0,0 +1,27 @@
|
|
1
|
+
= form_for(@cms_fortress_user, :html => {:class => 'form-horizontal'}) do |f|
|
2
|
+
- if @cms_fortress_user.errors.any?
|
3
|
+
#error_explanation
|
4
|
+
%h2= "#{pluralize(@cms_fortress_user.errors.count, "error")} prohibited this user from being saved:"
|
5
|
+
%ul
|
6
|
+
- @cms_fortress_user.errors.full_messages.each do |msg|
|
7
|
+
%li= msg
|
8
|
+
.control-group
|
9
|
+
= f.label :email, :class => 'control-label'
|
10
|
+
.controls
|
11
|
+
= f.text_field :email
|
12
|
+
.control-group
|
13
|
+
= f.label :role_id, :class => 'control-label'
|
14
|
+
.controls
|
15
|
+
= f.select :role_id, Cms::Fortress::Role.all.collect {|role| [role.name, role.id]}
|
16
|
+
.control-group
|
17
|
+
= f.label :password, :class => 'control-label'
|
18
|
+
.controls
|
19
|
+
= f.password_field :password
|
20
|
+
.control-group
|
21
|
+
= f.label :password_confirmation, :class => 'control-label'
|
22
|
+
.controls
|
23
|
+
= f.password_field :password_confirmation
|
24
|
+
.form-actions
|
25
|
+
= f.submit 'Save', :class => 'btn btn-primary'
|
26
|
+
= link_to 'Cancel', cms_fortress_users_path, :class => 'btn'
|
27
|
+
|
@@ -0,0 +1,20 @@
|
|
1
|
+
.page-header
|
2
|
+
= link_to t('cms.fortress.users.new_link'), new_cms_fortress_user_path, :class => 'btn pull-right'
|
3
|
+
%h2= t('cms.fortress.users.title')
|
4
|
+
|
5
|
+
%table.table.table-hover.table-bordered
|
6
|
+
%tr
|
7
|
+
%th Email
|
8
|
+
%th Role
|
9
|
+
%th
|
10
|
+
|
11
|
+
|
12
|
+
- @cms_fortress_users.each do |cms_fortress_user|
|
13
|
+
%tr
|
14
|
+
%td= cms_fortress_user.email
|
15
|
+
%td= cms_fortress_user.role.name
|
16
|
+
%td
|
17
|
+
.btn-group.pull-right
|
18
|
+
= link_to 'Edit', edit_cms_fortress_user_path(cms_fortress_user), :class => 'btn btn-small btn-primary'
|
19
|
+
= link_to 'Destroy', cms_fortress_user, method: :delete, data: { confirm: 'Are you sure?' }, :class => 'btn btn-small btn-danger'
|
20
|
+
|
@@ -0,0 +1,19 @@
|
|
1
|
+
<%= render :partial => 'cms/fortress/shared/navbar' %>
|
2
|
+
|
3
|
+
<%= form_for(resource, :as => resource_name, :url => session_path(resource_name), :html => {:class => "form-signin" }) do |f| %>
|
4
|
+
<h3 class="form-signin-heading">Sign in</h3>
|
5
|
+
|
6
|
+
<%= f.email_field :email, :autofocus => true, :placeholder => "Email address", :class => "input-block-level" %>
|
7
|
+
<%= f.password_field :password, :placeholder => "Password", :class => "input-block-level" %>
|
8
|
+
|
9
|
+
<% if devise_mapping.rememberable? -%>
|
10
|
+
<label class="checkbox">
|
11
|
+
<%= f.check_box :remember_me %> Remember me
|
12
|
+
</label>
|
13
|
+
<% end -%>
|
14
|
+
|
15
|
+
<%= f.submit "Sign in", :class => "btn btn-primary" %>
|
16
|
+
|
17
|
+
<%= render "devise/shared/links" %>
|
18
|
+
<% end %>
|
19
|
+
|
@@ -0,0 +1,96 @@
|
|
1
|
+
|
2
|
+
<!DOCTYPE html>
|
3
|
+
<html lang="en">
|
4
|
+
<head>
|
5
|
+
<meta charset="utf-8">
|
6
|
+
<title>Sign in · Twitter Bootstrap</title>
|
7
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
8
|
+
<meta name="description" content="">
|
9
|
+
<meta name="author" content="">
|
10
|
+
|
11
|
+
<!-- Le styles -->
|
12
|
+
<link href="../assets/css/bootstrap.css" rel="stylesheet">
|
13
|
+
<style type="text/css">
|
14
|
+
body {
|
15
|
+
padding-top: 40px;
|
16
|
+
padding-bottom: 40px;
|
17
|
+
background-color: #f5f5f5;
|
18
|
+
}
|
19
|
+
|
20
|
+
.form-signin {
|
21
|
+
max-width: 300px;
|
22
|
+
padding: 19px 29px 29px;
|
23
|
+
margin: 0 auto 20px;
|
24
|
+
background-color: #fff;
|
25
|
+
border: 1px solid #e5e5e5;
|
26
|
+
-webkit-border-radius: 5px;
|
27
|
+
-moz-border-radius: 5px;
|
28
|
+
border-radius: 5px;
|
29
|
+
-webkit-box-shadow: 0 1px 2px rgba(0,0,0,.05);
|
30
|
+
-moz-box-shadow: 0 1px 2px rgba(0,0,0,.05);
|
31
|
+
box-shadow: 0 1px 2px rgba(0,0,0,.05);
|
32
|
+
}
|
33
|
+
.form-signin .form-signin-heading,
|
34
|
+
.form-signin .checkbox {
|
35
|
+
margin-bottom: 10px;
|
36
|
+
}
|
37
|
+
.form-signin input[type="text"],
|
38
|
+
.form-signin input[type="password"] {
|
39
|
+
font-size: 16px;
|
40
|
+
height: auto;
|
41
|
+
margin-bottom: 15px;
|
42
|
+
padding: 7px 9px;
|
43
|
+
}
|
44
|
+
|
45
|
+
</style>
|
46
|
+
<link href="../assets/css/bootstrap-responsive.css" rel="stylesheet">
|
47
|
+
|
48
|
+
<!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
|
49
|
+
<!--[if lt IE 9]>
|
50
|
+
<script src="../assets/js/html5shiv.js"></script>
|
51
|
+
<![endif]-->
|
52
|
+
|
53
|
+
<!-- Fav and touch icons -->
|
54
|
+
<link rel="apple-touch-icon-precomposed" sizes="144x144" href="../assets/ico/apple-touch-icon-144-precomposed.png">
|
55
|
+
<link rel="apple-touch-icon-precomposed" sizes="114x114" href="../assets/ico/apple-touch-icon-114-precomposed.png">
|
56
|
+
<link rel="apple-touch-icon-precomposed" sizes="72x72" href="../assets/ico/apple-touch-icon-72-precomposed.png">
|
57
|
+
<link rel="apple-touch-icon-precomposed" href="../assets/ico/apple-touch-icon-57-precomposed.png">
|
58
|
+
<link rel="shortcut icon" href="../assets/ico/favicon.png">
|
59
|
+
</head>
|
60
|
+
|
61
|
+
<body>
|
62
|
+
|
63
|
+
<div class="container">
|
64
|
+
|
65
|
+
<form class="form-signin">
|
66
|
+
<h2 class="form-signin-heading">Please sign in</h2>
|
67
|
+
<input type="text" class="input-block-level" placeholder="Email address">
|
68
|
+
<input type="password" class="input-block-level" placeholder="Password">
|
69
|
+
<label class="checkbox">
|
70
|
+
<input type="checkbox" value="remember-me"> Remember me
|
71
|
+
</label>
|
72
|
+
<button class="btn btn-large btn-primary" type="submit">Sign in</button>
|
73
|
+
</form>
|
74
|
+
|
75
|
+
</div> <!-- /container -->
|
76
|
+
|
77
|
+
<!-- Le javascript
|
78
|
+
================================================== -->
|
79
|
+
<!-- Placed at the end of the document so the pages load faster -->
|
80
|
+
<script src="../assets/js/jquery.js"></script>
|
81
|
+
<script src="../assets/js/bootstrap-transition.js"></script>
|
82
|
+
<script src="../assets/js/bootstrap-alert.js"></script>
|
83
|
+
<script src="../assets/js/bootstrap-modal.js"></script>
|
84
|
+
<script src="../assets/js/bootstrap-dropdown.js"></script>
|
85
|
+
<script src="../assets/js/bootstrap-scrollspy.js"></script>
|
86
|
+
<script src="../assets/js/bootstrap-tab.js"></script>
|
87
|
+
<script src="../assets/js/bootstrap-tooltip.js"></script>
|
88
|
+
<script src="../assets/js/bootstrap-popover.js"></script>
|
89
|
+
<script src="../assets/js/bootstrap-button.js"></script>
|
90
|
+
<script src="../assets/js/bootstrap-collapse.js"></script>
|
91
|
+
<script src="../assets/js/bootstrap-carousel.js"></script>
|
92
|
+
<script src="../assets/js/bootstrap-typeahead.js"></script>
|
93
|
+
|
94
|
+
</body>
|
95
|
+
</html>
|
96
|
+
|
@@ -0,0 +1,31 @@
|
|
1
|
+
|
2
|
+
<!DOCTYPE html>
|
3
|
+
<html lang="en">
|
4
|
+
<head>
|
5
|
+
<meta charset="utf-8">
|
6
|
+
<title>CMS Fortress</title>
|
7
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
8
|
+
<meta name="description" content="">
|
9
|
+
<meta name="author" content="">
|
10
|
+
|
11
|
+
<%= stylesheet_link_tag 'cms/fortress/session.css' %>
|
12
|
+
|
13
|
+
<!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
|
14
|
+
<!--[if lt IE 9]>
|
15
|
+
<%= javascript_include_tag 'html5shiv.js' %>
|
16
|
+
<![endif]-->
|
17
|
+
|
18
|
+
</head>
|
19
|
+
|
20
|
+
<body>
|
21
|
+
|
22
|
+
<div class="container">
|
23
|
+
|
24
|
+
<%= yield %>
|
25
|
+
</div>
|
26
|
+
|
27
|
+
<%= javascript_include_tag 'cms/fortress/cms_fortress' %>
|
28
|
+
</body>
|
29
|
+
</html>
|
30
|
+
|
31
|
+
|
@@ -0,0 +1,22 @@
|
|
1
|
+
%body#comfy{:class => "c-#{params[:controller].slugify} a-#{params[:action].slugify}"}
|
2
|
+
= cms_hook :header
|
3
|
+
|
4
|
+
.body-wrapper
|
5
|
+
.left-column
|
6
|
+
.left-column-content
|
7
|
+
= render :partial => 'layouts/cms_admin/left'
|
8
|
+
.right-column
|
9
|
+
.right-column-content
|
10
|
+
= render :partial => 'layouts/cms_admin/right'
|
11
|
+
.center-column
|
12
|
+
= render :partial => 'layouts/cms_admin/center'
|
13
|
+
|
14
|
+
#footer
|
15
|
+
.footer-container
|
16
|
+
%p.muted.credit
|
17
|
+
Powered by:
|
18
|
+
= link_to('ComfortableMexicanSofa', 'https://github.com/confy', :target => '_blank')
|
19
|
+
%span.version= ComfortableMexicanSofa::VERSION
|
20
|
+
|
21
|
+
|
22
|
+
|
@@ -0,0 +1,14 @@
|
|
1
|
+
%head
|
2
|
+
%meta{'http-equiv' => "Content-type", :content => "text/html; charset=utf-8"}
|
3
|
+
%title= ComfortableMexicanSofa.config.cms_title
|
4
|
+
= csrf_meta_tag
|
5
|
+
|
6
|
+
= stylesheet_link_tag 'comfortable_mexican_sofa/application'
|
7
|
+
= stylesheet_link_tag 'comfortable_mexican_sofa/admin/application'
|
8
|
+
= stylesheet_link_tag 'cms/fortress/admin_overrides'
|
9
|
+
= javascript_include_tag 'comfortable_mexican_sofa/application'
|
10
|
+
= javascript_include_tag 'comfortable_mexican_sofa/admin/application'
|
11
|
+
|
12
|
+
= yield :head
|
13
|
+
= cms_hook :html_head
|
14
|
+
|
@@ -0,0 +1,18 @@
|
|
1
|
+
%ul.navigation
|
2
|
+
|
3
|
+
- if admin_page?
|
4
|
+
%li= active_link_to t('cms_admin.base.sites'), cms_admin_sites_path, :active => ['cms_admin/sites']
|
5
|
+
%li= active_link_to t('cms.fortress.roles.title'), cms_fortress_roles_path
|
6
|
+
%li= active_link_to t('cms.fortress.users.title'), cms_fortress_users_path
|
7
|
+
- elsif design_page?
|
8
|
+
- if @site && !@site.new_record?
|
9
|
+
%li= active_link_to t('cms_admin.base.layouts'), cms_admin_site_layouts_path(@site)
|
10
|
+
%li= active_link_to t('cms_admin.base.snippets'), cms_admin_site_snippets_path(@site)
|
11
|
+
|
12
|
+
= cms_hook :design_navigation
|
13
|
+
- else
|
14
|
+
- if @site && !@site.new_record?
|
15
|
+
%li= active_link_to t('cms_admin.base.pages'), cms_admin_site_pages_path(@site)
|
16
|
+
%li= active_link_to t('cms_admin.base.files'), cms_admin_site_files_path(@site)
|
17
|
+
|
18
|
+
= cms_hook :navigation
|
@@ -0,0 +1,148 @@
|
|
1
|
+
# Generated by jeweler
|
2
|
+
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
+
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
|
+
# -*- encoding: utf-8 -*-
|
5
|
+
|
6
|
+
Gem::Specification.new do |s|
|
7
|
+
s.name = "cms-fortress"
|
8
|
+
s.version = "0.2.0"
|
9
|
+
|
10
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
|
+
s.authors = ["Melvin Sembrano"]
|
12
|
+
s.date = "2013-05-01"
|
13
|
+
s.description = "Comfortable Mexican Sofa (CMS) - User and role management extension"
|
14
|
+
s.email = "melvinsembrano@gmail.com"
|
15
|
+
s.extra_rdoc_files = [
|
16
|
+
"LICENSE.txt",
|
17
|
+
"README.rdoc"
|
18
|
+
]
|
19
|
+
s.files = [
|
20
|
+
".document",
|
21
|
+
".rvmrc",
|
22
|
+
"Gemfile",
|
23
|
+
"Gemfile.lock",
|
24
|
+
"LICENSE.txt",
|
25
|
+
"README.rdoc",
|
26
|
+
"Rakefile",
|
27
|
+
"VERSION",
|
28
|
+
"app/assets/javascripts/cms/fortress/bootstrap-affix.js",
|
29
|
+
"app/assets/javascripts/cms/fortress/bootstrap-alert.js",
|
30
|
+
"app/assets/javascripts/cms/fortress/bootstrap-button.js",
|
31
|
+
"app/assets/javascripts/cms/fortress/bootstrap-carousel.js",
|
32
|
+
"app/assets/javascripts/cms/fortress/bootstrap-collapse.js",
|
33
|
+
"app/assets/javascripts/cms/fortress/bootstrap-dropdown.js",
|
34
|
+
"app/assets/javascripts/cms/fortress/bootstrap-modal.js",
|
35
|
+
"app/assets/javascripts/cms/fortress/bootstrap-popover.js",
|
36
|
+
"app/assets/javascripts/cms/fortress/bootstrap-scrollspy.js",
|
37
|
+
"app/assets/javascripts/cms/fortress/bootstrap-tab.js",
|
38
|
+
"app/assets/javascripts/cms/fortress/bootstrap-tooltip.js",
|
39
|
+
"app/assets/javascripts/cms/fortress/bootstrap-transition.js",
|
40
|
+
"app/assets/javascripts/cms/fortress/bootstrap-typeahead.js",
|
41
|
+
"app/assets/javascripts/cms/fortress/bootstrap.js",
|
42
|
+
"app/assets/javascripts/cms/fortress/cms_fortress.js",
|
43
|
+
"app/assets/javascripts/html5shiv.js",
|
44
|
+
"app/assets/stylesheets/cms/fortress/admin_overrides.css",
|
45
|
+
"app/assets/stylesheets/cms/fortress/bootstrap-responsive.css",
|
46
|
+
"app/assets/stylesheets/cms/fortress/bootstrap.css",
|
47
|
+
"app/assets/stylesheets/cms/fortress/session.css",
|
48
|
+
"app/controllers/cms/fortress/admin_controller.rb",
|
49
|
+
"app/controllers/cms/fortress/roles_controller.rb",
|
50
|
+
"app/controllers/cms/fortress/users_controller.rb",
|
51
|
+
"app/helpers/cms/fortress/application_helper.rb",
|
52
|
+
"app/helpers/cms/fortress/roles_helper.rb",
|
53
|
+
"app/models/cms/fortress.rb",
|
54
|
+
"app/models/cms/fortress/role.rb",
|
55
|
+
"app/models/cms/fortress/role_detail.rb",
|
56
|
+
"app/models/cms/fortress/user.rb",
|
57
|
+
"app/models/cms_ability.rb",
|
58
|
+
"app/views/cms/fortress/admin/design.html.haml",
|
59
|
+
"app/views/cms/fortress/admin/roles.html.haml",
|
60
|
+
"app/views/cms/fortress/admin/settings.html.haml",
|
61
|
+
"app/views/cms/fortress/admin/users.html.haml",
|
62
|
+
"app/views/cms/fortress/roles/_form.html.haml",
|
63
|
+
"app/views/cms/fortress/roles/edit.html.haml",
|
64
|
+
"app/views/cms/fortress/roles/index.html.haml",
|
65
|
+
"app/views/cms/fortress/roles/new.html.haml",
|
66
|
+
"app/views/cms/fortress/roles/show.html.haml",
|
67
|
+
"app/views/cms/fortress/shared/_admin_topnav.html.haml",
|
68
|
+
"app/views/cms/fortress/shared/_navbar.html.erb",
|
69
|
+
"app/views/cms/fortress/users/_form.html.haml",
|
70
|
+
"app/views/cms/fortress/users/edit.html.haml",
|
71
|
+
"app/views/cms/fortress/users/index.html.haml",
|
72
|
+
"app/views/cms/fortress/users/new.html.haml",
|
73
|
+
"app/views/cms_users/sessions/new.html.erb",
|
74
|
+
"app/views/layouts/cms/fortress/default.html.erb",
|
75
|
+
"app/views/layouts/cms/fortress/session.html.erb",
|
76
|
+
"app/views/layouts/cms_admin/_body.html.haml",
|
77
|
+
"app/views/layouts/cms_admin/_head.html.haml",
|
78
|
+
"app/views/layouts/cms_admin/_left.html.haml",
|
79
|
+
"cms-fortress.gemspec",
|
80
|
+
"config/initializers/devise.rb",
|
81
|
+
"config/locales/en.yml",
|
82
|
+
"config/roles.yml",
|
83
|
+
"config/routes.rb",
|
84
|
+
"db/migrate/01_devise_create_cms_fortress_users.rb",
|
85
|
+
"db/migrate/02_create_cms_fortress_role_details.rb",
|
86
|
+
"db/migrate/03_create_cms_fortress_roles.rb",
|
87
|
+
"lib/cms-fortress.rb",
|
88
|
+
"lib/cms/fortress/application_controller_methods.rb",
|
89
|
+
"lib/cms/fortress/auth.rb",
|
90
|
+
"lib/cms/fortress/comfortable_mexican_sofa.rb",
|
91
|
+
"lib/cms/fortress/devise.rb",
|
92
|
+
"lib/cms/fortress/rails/engine.rb",
|
93
|
+
"lib/generators/cms/fortress/USAGE",
|
94
|
+
"lib/generators/cms/fortress/fortress_generator.rb",
|
95
|
+
"lib/generators/cms/fortress/templates/README",
|
96
|
+
"lib/generators/comfy/cms/cms_generator.rb",
|
97
|
+
"test/fixtures/cms/fortress/role_details.yml",
|
98
|
+
"test/fixtures/cms/fortress/roles.yml",
|
99
|
+
"test/functional/cms/fortress/roles_controller_test.rb",
|
100
|
+
"test/functional/cms/fortress/users_controller_test.rb",
|
101
|
+
"test/helper.rb",
|
102
|
+
"test/test_cms-fortress.rb",
|
103
|
+
"test/unit/cms/fortress/role_detail_test.rb",
|
104
|
+
"test/unit/cms/fortress/role_test.rb",
|
105
|
+
"test/unit/cms/fortress/role_user_test.rb",
|
106
|
+
"test/unit/helpers/cms/fortress/roles_helper_test.rb",
|
107
|
+
"test/unit/helpers/cms/fortress/users_helper_test.rb"
|
108
|
+
]
|
109
|
+
s.homepage = "http://github.com/melvinsembrano/cms-fortress"
|
110
|
+
s.licenses = ["MIT"]
|
111
|
+
s.require_paths = ["lib"]
|
112
|
+
s.rubygems_version = "1.8.10"
|
113
|
+
s.summary = "Comfortable Mexican Sofa (CMS) - User and role management extension"
|
114
|
+
|
115
|
+
if s.respond_to? :specification_version then
|
116
|
+
s.specification_version = 3
|
117
|
+
|
118
|
+
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
119
|
+
s.add_runtime_dependency(%q<rails>, [">= 0"])
|
120
|
+
s.add_runtime_dependency(%q<comfortable_mexican_sofa>, ["= 1.8.1"])
|
121
|
+
s.add_runtime_dependency(%q<devise>, [">= 1.5.4"])
|
122
|
+
s.add_runtime_dependency(%q<cancan>, [">= 1.6.9"])
|
123
|
+
s.add_development_dependency(%q<rdoc>, [">= 0"])
|
124
|
+
s.add_development_dependency(%q<bundler>, [">= 0"])
|
125
|
+
s.add_development_dependency(%q<jeweler>, [">= 0"])
|
126
|
+
s.add_development_dependency(%q<simplecov>, [">= 0"])
|
127
|
+
else
|
128
|
+
s.add_dependency(%q<rails>, [">= 0"])
|
129
|
+
s.add_dependency(%q<comfortable_mexican_sofa>, ["= 1.8.1"])
|
130
|
+
s.add_dependency(%q<devise>, [">= 1.5.4"])
|
131
|
+
s.add_dependency(%q<cancan>, [">= 1.6.9"])
|
132
|
+
s.add_dependency(%q<rdoc>, [">= 0"])
|
133
|
+
s.add_dependency(%q<bundler>, [">= 0"])
|
134
|
+
s.add_dependency(%q<jeweler>, [">= 0"])
|
135
|
+
s.add_dependency(%q<simplecov>, [">= 0"])
|
136
|
+
end
|
137
|
+
else
|
138
|
+
s.add_dependency(%q<rails>, [">= 0"])
|
139
|
+
s.add_dependency(%q<comfortable_mexican_sofa>, ["= 1.8.1"])
|
140
|
+
s.add_dependency(%q<devise>, [">= 1.5.4"])
|
141
|
+
s.add_dependency(%q<cancan>, [">= 1.6.9"])
|
142
|
+
s.add_dependency(%q<rdoc>, [">= 0"])
|
143
|
+
s.add_dependency(%q<bundler>, [">= 0"])
|
144
|
+
s.add_dependency(%q<jeweler>, [">= 0"])
|
145
|
+
s.add_dependency(%q<simplecov>, [">= 0"])
|
146
|
+
end
|
147
|
+
end
|
148
|
+
|
@@ -0,0 +1,243 @@
|
|
1
|
+
if defined?(Devise)
|
2
|
+
|
3
|
+
# Use this hook to configure devise mailer, warden hooks and so forth.
|
4
|
+
# Many of these configuration options can be set straight in your model.
|
5
|
+
Devise.setup do |config|
|
6
|
+
# ==> Mailer Configuration
|
7
|
+
# Configure the e-mail address which will be shown in Devise::Mailer,
|
8
|
+
# note that it will be overwritten if you use your own mailer class with default "from" parameter.
|
9
|
+
config.mailer_sender = "please-change-me-at-config-initializers-devise@example.com"
|
10
|
+
|
11
|
+
# Configure the class responsible to send e-mails.
|
12
|
+
# config.mailer = "Devise::Mailer"
|
13
|
+
|
14
|
+
# ==> ORM configuration
|
15
|
+
# Load and configure the ORM. Supports :active_record (default) and
|
16
|
+
# :mongoid (bson_ext recommended) by default. Other ORMs may be
|
17
|
+
# available as additional gems.
|
18
|
+
require 'devise/orm/active_record'
|
19
|
+
|
20
|
+
# ==> Configuration for any authentication mechanism
|
21
|
+
# Configure which keys are used when authenticating a user. The default is
|
22
|
+
# just :email. You can configure it to use [:username, :subdomain], so for
|
23
|
+
# authenticating a user, both parameters are required. Remember that those
|
24
|
+
# parameters are used only when authenticating and not when retrieving from
|
25
|
+
# session. If you need permissions, you should implement that in a before filter.
|
26
|
+
# You can also supply a hash where the value is a boolean determining whether
|
27
|
+
# or not authentication should be aborted when the value is not present.
|
28
|
+
# config.authentication_keys = [ :email ]
|
29
|
+
|
30
|
+
# Configure parameters from the request object used for authentication. Each entry
|
31
|
+
# given should be a request method and it will automatically be passed to the
|
32
|
+
# find_for_authentication method and considered in your model lookup. For instance,
|
33
|
+
# if you set :request_keys to [:subdomain], :subdomain will be used on authentication.
|
34
|
+
# The same considerations mentioned for authentication_keys also apply to request_keys.
|
35
|
+
# config.request_keys = []
|
36
|
+
|
37
|
+
# Configure which authentication keys should be case-insensitive.
|
38
|
+
# These keys will be downcased upon creating or modifying a user and when used
|
39
|
+
# to authenticate or find a user. Default is :email.
|
40
|
+
config.case_insensitive_keys = [ :email ]
|
41
|
+
|
42
|
+
# Configure which authentication keys should have whitespace stripped.
|
43
|
+
# These keys will have whitespace before and after removed upon creating or
|
44
|
+
# modifying a user and when used to authenticate or find a user. Default is :email.
|
45
|
+
config.strip_whitespace_keys = [ :email ]
|
46
|
+
|
47
|
+
# Tell if authentication through request.params is enabled. True by default.
|
48
|
+
# It can be set to an array that will enable params authentication only for the
|
49
|
+
# given strategies, for example, `config.params_authenticatable = [:database]` will
|
50
|
+
# enable it only for database (email + password) authentication.
|
51
|
+
# config.params_authenticatable = true
|
52
|
+
|
53
|
+
# Tell if authentication through HTTP Basic Auth is enabled. False by default.
|
54
|
+
# It can be set to an array that will enable http authentication only for the
|
55
|
+
# given strategies, for example, `config.http_authenticatable = [:token]` will
|
56
|
+
# enable it only for token authentication.
|
57
|
+
# config.http_authenticatable = false
|
58
|
+
|
59
|
+
# If http headers should be returned for AJAX requests. True by default.
|
60
|
+
# config.http_authenticatable_on_xhr = true
|
61
|
+
|
62
|
+
# The realm used in Http Basic Authentication. "Application" by default.
|
63
|
+
# config.http_authentication_realm = "Application"
|
64
|
+
|
65
|
+
# It will change confirmation, password recovery and other workflows
|
66
|
+
# to behave the same regardless if the e-mail provided was right or wrong.
|
67
|
+
# Does not affect registerable.
|
68
|
+
# config.paranoid = true
|
69
|
+
|
70
|
+
# By default Devise will store the user in session. You can skip storage for
|
71
|
+
# :http_auth and :token_auth by adding those symbols to the array below.
|
72
|
+
# Notice that if you are skipping storage for all authentication paths, you
|
73
|
+
# may want to disable generating routes to Devise's sessions controller by
|
74
|
+
# passing :skip => :sessions to `devise_for` in your config/routes.rb
|
75
|
+
config.skip_session_storage = [:http_auth]
|
76
|
+
|
77
|
+
# ==> Configuration for :database_authenticatable
|
78
|
+
# For bcrypt, this is the cost for hashing the password and defaults to 10. If
|
79
|
+
# using other encryptors, it sets how many times you want the password re-encrypted.
|
80
|
+
#
|
81
|
+
# Limiting the stretches to just one in testing will increase the performance of
|
82
|
+
# your test suite dramatically. However, it is STRONGLY RECOMMENDED to not use
|
83
|
+
# a value less than 10 in other environments.
|
84
|
+
config.stretches = Rails.env.test? ? 1 : 10
|
85
|
+
|
86
|
+
# Setup a pepper to generate the encrypted password.
|
87
|
+
# config.pepper = "3c78466023e3c2ec2e436cf7237ed5aa5eb70b438b187c43d2c391c5adb7b1ea552ac1176e18d3890b9771801e6e580188f02e93bade6840c5f736166f3953b9"
|
88
|
+
|
89
|
+
# ==> Configuration for :confirmable
|
90
|
+
# A period that the user is allowed to access the website even without
|
91
|
+
# confirming his account. For instance, if set to 2.days, the user will be
|
92
|
+
# able to access the website for two days without confirming his account,
|
93
|
+
# access will be blocked just in the third day. Default is 0.days, meaning
|
94
|
+
# the user cannot access the website without confirming his account.
|
95
|
+
# config.allow_unconfirmed_access_for = 2.days
|
96
|
+
|
97
|
+
# A period that the user is allowed to confirm their account before their
|
98
|
+
# token becomes invalid. For example, if set to 3.days, the user can confirm
|
99
|
+
# their account within 3 days after the mail was sent, but on the fourth day
|
100
|
+
# their account can't be confirmed with the token any more.
|
101
|
+
# Default is nil, meaning there is no restriction on how long a user can take
|
102
|
+
# before confirming their account.
|
103
|
+
# config.confirm_within = 3.days
|
104
|
+
|
105
|
+
# If true, requires any email changes to be confirmed (exactly the same way as
|
106
|
+
# initial account confirmation) to be applied. Requires additional unconfirmed_email
|
107
|
+
# db field (see migrations). Until confirmed new email is stored in
|
108
|
+
# unconfirmed email column, and copied to email column on successful confirmation.
|
109
|
+
config.reconfirmable = true
|
110
|
+
|
111
|
+
# Defines which key will be used when confirming an account
|
112
|
+
# config.confirmation_keys = [ :email ]
|
113
|
+
|
114
|
+
# ==> Configuration for :rememberable
|
115
|
+
# The time the user will be remembered without asking for credentials again.
|
116
|
+
# config.remember_for = 2.weeks
|
117
|
+
|
118
|
+
# If true, extends the user's remember period when remembered via cookie.
|
119
|
+
# config.extend_remember_period = false
|
120
|
+
|
121
|
+
# Options to be passed to the created cookie. For instance, you can set
|
122
|
+
# :secure => true in order to force SSL only cookies.
|
123
|
+
# config.rememberable_options = {}
|
124
|
+
|
125
|
+
# ==> Configuration for :validatable
|
126
|
+
# Range for password length. Default is 8..128.
|
127
|
+
config.password_length = 8..128
|
128
|
+
|
129
|
+
# Email regex used to validate email formats. It simply asserts that
|
130
|
+
# an one (and only one) @ exists in the given string. This is mainly
|
131
|
+
# to give user feedback and not to assert the e-mail validity.
|
132
|
+
# config.email_regexp = /\A[^@]+@[^@]+\z/
|
133
|
+
|
134
|
+
# ==> Configuration for :timeoutable
|
135
|
+
# The time you want to timeout the user session without activity. After this
|
136
|
+
# time the user will be asked for credentials again. Default is 30 minutes.
|
137
|
+
# config.timeout_in = 30.minutes
|
138
|
+
|
139
|
+
# If true, expires auth token on session timeout.
|
140
|
+
# config.expire_auth_token_on_timeout = false
|
141
|
+
|
142
|
+
# ==> Configuration for :lockable
|
143
|
+
# Defines which strategy will be used to lock an account.
|
144
|
+
# :failed_attempts = Locks an account after a number of failed attempts to sign in.
|
145
|
+
# :none = No lock strategy. You should handle locking by yourself.
|
146
|
+
# config.lock_strategy = :failed_attempts
|
147
|
+
|
148
|
+
# Defines which key will be used when locking and unlocking an account
|
149
|
+
# config.unlock_keys = [ :email ]
|
150
|
+
|
151
|
+
# Defines which strategy will be used to unlock an account.
|
152
|
+
# :email = Sends an unlock link to the user email
|
153
|
+
# :time = Re-enables login after a certain amount of time (see :unlock_in below)
|
154
|
+
# :both = Enables both strategies
|
155
|
+
# :none = No unlock strategy. You should handle unlocking by yourself.
|
156
|
+
# config.unlock_strategy = :both
|
157
|
+
|
158
|
+
# Number of authentication tries before locking an account if lock_strategy
|
159
|
+
# is failed attempts.
|
160
|
+
# config.maximum_attempts = 20
|
161
|
+
|
162
|
+
# Time interval to unlock the account if :time is enabled as unlock_strategy.
|
163
|
+
# config.unlock_in = 1.hour
|
164
|
+
|
165
|
+
# ==> Configuration for :recoverable
|
166
|
+
#
|
167
|
+
# Defines which key will be used when recovering the password for an account
|
168
|
+
# config.reset_password_keys = [ :email ]
|
169
|
+
|
170
|
+
# Time interval you can reset your password with a reset password key.
|
171
|
+
# Don't put a too small interval or your users won't have the time to
|
172
|
+
# change their passwords.
|
173
|
+
config.reset_password_within = 6.hours
|
174
|
+
|
175
|
+
# ==> Configuration for :encryptable
|
176
|
+
# Allow you to use another encryption algorithm besides bcrypt (default). You can use
|
177
|
+
# :sha1, :sha512 or encryptors from others authentication tools as :clearance_sha1,
|
178
|
+
# :authlogic_sha512 (then you should set stretches above to 20 for default behavior)
|
179
|
+
# and :restful_authentication_sha1 (then you should set stretches to 10, and copy
|
180
|
+
# REST_AUTH_SITE_KEY to pepper)
|
181
|
+
# config.encryptor = :sha512
|
182
|
+
|
183
|
+
# ==> Configuration for :token_authenticatable
|
184
|
+
# Defines name of the authentication token params key
|
185
|
+
# config.token_authentication_key = :auth_token
|
186
|
+
|
187
|
+
# ==> Scopes configuration
|
188
|
+
# Turn scoped views on. Before rendering "sessions/new", it will first check for
|
189
|
+
# "users/sessions/new". It's turned off by default because it's slower if you
|
190
|
+
# are using only default views.
|
191
|
+
# config.scoped_views = false
|
192
|
+
|
193
|
+
# Configure the default scope given to Warden. By default it's the first
|
194
|
+
# devise role declared in your routes (usually :user).
|
195
|
+
# config.default_scope = :user
|
196
|
+
|
197
|
+
# Set this configuration to false if you want /users/sign_out to sign out
|
198
|
+
# only the current scope. By default, Devise signs out all scopes.
|
199
|
+
# config.sign_out_all_scopes = true
|
200
|
+
|
201
|
+
# ==> Navigation configuration
|
202
|
+
# Lists the formats that should be treated as navigational. Formats like
|
203
|
+
# :html, should redirect to the sign in page when the user does not have
|
204
|
+
# access, but formats like :xml or :json, should return 401.
|
205
|
+
#
|
206
|
+
# If you have any extra navigational formats, like :iphone or :mobile, you
|
207
|
+
# should add them to the navigational formats lists.
|
208
|
+
#
|
209
|
+
# The "*/*" below is required to match Internet Explorer requests.
|
210
|
+
# config.navigational_formats = ["*/*", :html]
|
211
|
+
|
212
|
+
# The default HTTP method used to sign out a resource. Default is :delete.
|
213
|
+
config.sign_out_via = :delete
|
214
|
+
|
215
|
+
# ==> OmniAuth
|
216
|
+
# Add a new OmniAuth provider. Check the wiki for more information on setting
|
217
|
+
# up on your models and hooks.
|
218
|
+
# config.omniauth :github, 'APP_ID', 'APP_SECRET', :scope => 'user,public_repo'
|
219
|
+
|
220
|
+
# ==> Warden configuration
|
221
|
+
# If you want to use other strategies, that are not supported by Devise, or
|
222
|
+
# change the failure app, you can configure them inside the config.warden block.
|
223
|
+
#
|
224
|
+
# config.warden do |manager|
|
225
|
+
# manager.intercept_401 = false
|
226
|
+
# manager.default_strategies(:scope => :user).unshift :some_external_strategy
|
227
|
+
# end
|
228
|
+
|
229
|
+
# ==> Mountable engine configurations
|
230
|
+
# When using Devise inside an engine, let's call it `MyEngine`, and this engine
|
231
|
+
# is mountable, there are some extra configurations to be taken into account.
|
232
|
+
# The following options are available, assuming the engine is mounted as:
|
233
|
+
#
|
234
|
+
# mount MyEngine, at: "/my_engine"
|
235
|
+
#
|
236
|
+
# The router that invoked `devise_for`, in the example above, would be:
|
237
|
+
# config.router_name = :my_engine
|
238
|
+
#
|
239
|
+
# When using omniauth, Devise cannot automatically set Omniauth path,
|
240
|
+
# so you need to do it manually. For the users scope, it would be:
|
241
|
+
# config.omniauth_path_prefix = "/my_engine/users/auth"
|
242
|
+
end
|
243
|
+
end
|