red_base 0.5.1 → 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (64) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +10 -10
  3. data/app/assets/javascripts/red_base/dashboard/app.js +10 -2
  4. data/app/assets/javascripts/red_base/dashboard/lib/ng-quick-date.js +297 -0
  5. data/app/assets/javascripts/red_base/dashboard/locale/translations.js~ +4 -0
  6. data/app/assets/javascripts/red_base/dashboard/modules/auth/user.js +1 -1
  7. data/app/assets/javascripts/red_base/dashboard/modules/list-view.js~ +20 -0
  8. data/app/assets/javascripts/red_base/dashboard/modules/user.js~ +4 -0
  9. data/app/assets/javascripts/red_base/dashboard/templates/application.handlebars.erb~ +39 -0
  10. data/app/assets/javascripts/red_base/dashboard/templates/auth/groups/details.handlebars.erb~ +15 -0
  11. data/app/assets/javascripts/red_base/dashboard/templates/auth/groups/index.handlebars.erb~ +7 -0
  12. data/app/assets/javascripts/red_base/dashboard/templates/auth/index.handlebars.erb~ +4 -0
  13. data/app/assets/javascripts/red_base/dashboard/{init.js~ → templates/auth/users/details.handlebars.erb~} +0 -0
  14. data/app/assets/javascripts/red_base/dashboard/templates/auth/users/index.handlebars.erb~ +7 -0
  15. data/app/assets/javascripts/red_base/dashboard/templates/auth/users/new.handlebars.erb~ +1 -0
  16. data/app/assets/javascripts/red_base/dashboard/templates/auth/users/new.handlebars~ +1 -0
  17. data/app/assets/javascripts/red_base/dashboard/templates/components/model-form.handlebars.erb~ +1 -0
  18. data/app/assets/javascripts/red_base/dashboard/templates/components/model-from.handlebars.erb~ +1 -0
  19. data/app/assets/javascripts/red_base/i18n.js~ +2 -0
  20. data/app/assets/javascripts/red_base/locale/fa.json~ +27 -0
  21. data/app/assets/stylesheets/red_base/#base.css.scss# +403 -0
  22. data/app/assets/stylesheets/red_base/application.ltr.css~ +4 -0
  23. data/app/assets/stylesheets/red_base/application.rtl.css~ +4 -0
  24. data/app/assets/stylesheets/red_base/dashboard/ltr/application.css +2 -0
  25. data/app/assets/stylesheets/red_base/dashboard/ltr/application.css~ +19 -0
  26. data/app/assets/stylesheets/red_base/dashboard/ltr/buttons.css.scss.erb~ +48 -0
  27. data/app/assets/stylesheets/red_base/dashboard/ltr/direction.css.scss~ +14 -0
  28. data/app/assets/stylesheets/red_base/dashboard/ltr/foundation_and_overrides.css.scss~ +1039 -0
  29. data/app/assets/stylesheets/red_base/dashboard/ng-quick-date-default-theme.css.scss +20 -0
  30. data/app/assets/stylesheets/red_base/dashboard/ng-quick-date.css.scss +19 -0
  31. data/app/assets/stylesheets/red_base/foundation_and_overrides.ltr.scss.erb~ +1012 -0
  32. data/app/assets/stylesheets/red_base/foundation_and_overrides.rtl.scss.erb~ +1012 -0
  33. data/app/assets/{stylesheets/red_base/dashboard/rtl/base.css.scss~ → templates/list-view/index.html~} +0 -0
  34. data/app/assets/templates/modules.html~ +1 -0
  35. data/app/controllers/red_base/omniauth/callbacks_controller.rb~ +46 -0
  36. data/app/views/angularjs_templates/#index.html# +8 -0
  37. data/app/views/layouts/red_base/dashboard.html.erb~ +17 -0
  38. data/config/initializers/fast_gettext.rb~ +4 -0
  39. data/lib/generators/red_base/js_scaffold_generator.rb +1 -0
  40. data/lib/generators/red_base/templates/angularjs/index.html.erb +1 -1
  41. data/lib/generators/red_base/templates/angularjs/new.html.erb +5 -1
  42. data/lib/generators/red_base/templates/fast_gettext.rb~ +4 -0
  43. data/lib/red_base/dashboard/{module.rb~ → controller.rb~} +2 -2
  44. data/lib/red_base/omniauth/callbacks.rb~ +44 -0
  45. data/lib/red_base/version.rb +1 -1
  46. data/lib/tasks/gettext.rb~ +7 -0
  47. data/{lib/generators/red_base/templates/angularjs/details.html.erb~ → spec/dummy/db/test.sqlite3} +0 -0
  48. data/{lib/generators/red_base/templates/views/index.json.jbuilder.erb~ → spec/dummy/log/development.log} +0 -0
  49. data/spec/dummy/log/test.log +15 -0
  50. data/spec/dummy/tmp/ember-rails/ember-data.js +10204 -0
  51. data/spec/dummy/tmp/ember-rails/ember.js +36991 -0
  52. metadata +246 -216
  53. data/app/assets/stylesheets/red_base/dashboard/ltr/base.css.scss~ +0 -15
  54. data/app/assets/stylesheets/red_base/mixins.css.scss~ +0 -7
  55. data/app/controllers/red_base/users/omniauth_callbacks_controller.rb~ +0 -2
  56. data/app/views/angularjs_templates/nav.html.erb~ +0 -43
  57. data/lib/devise_patch.rb~ +0 -5
  58. data/lib/generators/red_base/templates/README~ +0 -4
  59. data/lib/generators/red_base/templates/api/controller.rb.erb~ +0 -37
  60. data/lib/generators/red_base/templates/red_base.rb~ +0 -251
  61. data/lib/red_base/active_record.rb~ +0 -0
  62. data/lib/red_base/dashboard.rb~ +0 -18
  63. data/lib/red_base/omniauth.rb~ +0 -1
  64. data/lib/red_base/omniauth/callbakcs.rb~ +0 -7
@@ -1,15 +0,0 @@
1
- @import "red_base/variables";
2
- @import "red_base/dashboard/rtl/foundation_and_overrides";
3
-
4
- input[type="integer"] {
5
- @include form-element;
6
- }
7
-
8
- select {
9
- @include form-element;
10
- min-height: 10em;
11
- }
12
-
13
- textarea {
14
- height: 10em !important;
15
- }
@@ -1,7 +0,0 @@
1
- @mixin transition ($a) {
2
- transition: $a;
3
- -moz-transition: $a;
4
- -webkit-transition: $a;
5
- -o-transition: $a;
6
- -ms-transition: $a;
7
- }
@@ -1,2 +0,0 @@
1
- class Users::OmniauthCallbacksController < Devise::OmniauthCallbacksController
2
- end
@@ -1,43 +0,0 @@
1
- <% environment.context_class.instance_eval { include ActionView::Helpers::UrlHelper } %>
2
- <% url = RedBase::Engine.routes.url_helpers %>
3
-
4
- <div class="">
5
- <div class="">
6
- <nav class="clearpadding top-bar">
7
- <section class="top-bar-section">
8
- <ul class="title-area">
9
- <li><a href="#"><i class="fa-cog fa icon-medium fa-2x"></i></a></li>
10
- <!-- Title Area -->
11
- <li class="name brand">
12
- <h1><%= RedBase::Engine.site_title %></h1>
13
-
14
- </li>
15
- <!-- Remove the class "menu-icon" to get rid of menu icon. Take out "Menu" to just have icon alone -->
16
- <li class="toggle-topbar menu-icon"><a href="#"><span translate>Menu</span></a></li>
17
- </ul>
18
-
19
- </section>
20
- <section class="top-bar-section">
21
- <ul class="float-right">
22
- <li class="has-dropdown"><a href="#" translate>Languages</a>
23
- <ul class="dropdown">
24
- <% ::I18n.available_locales.each do |locale| %>
25
- <li><a href="<%= "/#{locale.to_s}/#{RedBase::Engine.dashboard_namespace.to_s}/" %>"><%= locale %></a></li>
26
- <% end %>
27
- </ul>
28
- </li>
29
-
30
- <li class="has-dropdown"><a href="#">User{{ current_user.first_name }} {{ current_user.last_name }}</a>
31
-
32
- <ul class="dropdown">
33
- <li><a href="<%= url.dashboard_path %>" translate>Dashboard</a></li>
34
- <li><a href="" translate>Change Password</a></li>
35
- <li><a href="<%= url.destroy_user_session_path %>" data-method="delete" translate>Sign Out</a></li>
36
- </ul>
37
- </li>
38
- </ul>
39
- </section>
40
-
41
- </nav>
42
- </div>
43
- </div>
@@ -1,5 +0,0 @@
1
- module Devise
2
- def omniauth_services(*args)
3
-
4
- end
5
- end
@@ -1,4 +0,0 @@
1
- ==================================================
2
- Steps to finish up installation:
3
-
4
- 1. Make sure you take a look and configured conf/initializer/devise.rb
@@ -1,37 +0,0 @@
1
- require_dependency "red_base/api_controller"
2
-
3
- class API::V1::<%= resource.pluralize %>Controller < APIController
4
-
5
- load_and_authorize_resource :except => :destory
6
-
7
-
8
- # GET /api/v1/<%= resource.pluralize.underscore %>
9
- def index
10
- end
11
-
12
- def create
13
- if @<%= resource.underscore %>.save
14
- @<%= resource.underscore %>
15
- else
16
- @<%= resource.underscore %>.errors
17
- end
18
- end
19
-
20
- def show
21
- end
22
-
23
- def update
24
- if @<%= resource.underscore %>.update
25
- @<%= resource.underscore %>
26
- else
27
- @<%= resource.underscore %>.errors
28
- end
29
- end
30
-
31
- def destroy
32
- ids = params[:id].split(",")
33
- @<% resource.pluralize.underscore %> = <% resource.pluralize %>.where(:id => ids)
34
- authorize! :destory, @<% resource.pluralize.underscore %>
35
- @@<% resource.pluralize.underscore %>.destroy_all
36
- end
37
- end
@@ -1,251 +0,0 @@
1
- # Use this hook to configure devise mailer, warden hooks and so forth.
2
- # Many of these configuration options can be set straight in your model.
3
- Devise.setup do |config|
4
- # The secret key used by Devise. Devise uses this key to generate
5
- # random tokens. Changing this key will render invalid all existing
6
- # confirmation, reset password and unlock tokens in the database.
7
- config.secret_key = '<%= SecureRandom.hex(64) %>'
8
-
9
- # ==> Mailer Configuration
10
- # Configure the e-mail address which will be shown in Devise::Mailer,
11
- # note that it will be overwritten if you use your own mailer class
12
- # with default "from" parameter.
13
- config.mailer_sender = 'please-change-me-at-config-initializers-devise@example.com'
14
-
15
- # Configure the class responsible to send e-mails.
16
- # config.mailer = 'Devise::Mailer'
17
-
18
- # ==> ORM configuration
19
- # Load and configure the ORM. Supports :active_record (default) and
20
- # :mongoid (bson_ext recommended) by default. Other ORMs may be
21
- # available as additional gems.
22
- require 'devise/orm/<%= options[:orm] %>'
23
-
24
- # ==> Configuration for any authentication mechanism
25
- # Configure which keys are used when authenticating a user. The default is
26
- # just :email. You can configure it to use [:username, :subdomain], so for
27
- # authenticating a user, both parameters are required. Remember that those
28
- # parameters are used only when authenticating and not when retrieving from
29
- # session. If you need permissions, you should implement that in a before filter.
30
- # You can also supply a hash where the value is a boolean determining whether
31
- # or not authentication should be aborted when the value is not present.
32
- # config.authentication_keys = [ :email ]
33
-
34
- # Configure parameters from the request object used for authentication. Each entry
35
- # given should be a request method and it will automatically be passed to the
36
- # find_for_authentication method and considered in your model lookup. For instance,
37
- # if you set :request_keys to [:subdomain], :subdomain will be used on authentication.
38
- # The same considerations mentioned for authentication_keys also apply to request_keys.
39
- # config.request_keys = []
40
-
41
- # Configure which authentication keys should be case-insensitive.
42
- # These keys will be downcased upon creating or modifying a user and when used
43
- # to authenticate or find a user. Default is :email.
44
- config.case_insensitive_keys = [ :email ]
45
-
46
- # Configure which authentication keys should have whitespace stripped.
47
- # These keys will have whitespace before and after removed upon creating or
48
- # modifying a user and when used to authenticate or find a user. Default is :email.
49
- config.strip_whitespace_keys = [ :email ]
50
-
51
- # Tell if authentication through request.params is enabled. True by default.
52
- # It can be set to an array that will enable params authentication only for the
53
- # given strategies, for example, `config.params_authenticatable = [:database]` will
54
- # enable it only for database (email + password) authentication.
55
- # config.params_authenticatable = true
56
-
57
- # Tell if authentication through HTTP Auth is enabled. False by default.
58
- # It can be set to an array that will enable http authentication only for the
59
- # given strategies, for example, `config.http_authenticatable = [:database]` will
60
- # enable it only for database authentication. The supported strategies are:
61
- # :database = Support basic authentication with authentication key + password
62
- # config.http_authenticatable = false
63
-
64
- # If http headers should be returned for AJAX requests. True by default.
65
- # config.http_authenticatable_on_xhr = true
66
-
67
- # The realm used in Http Basic Authentication. 'Application' by default.
68
- # config.http_authentication_realm = 'Application'
69
-
70
- # It will change confirmation, password recovery and other workflows
71
- # to behave the same regardless if the e-mail provided was right or wrong.
72
- # Does not affect registerable.
73
- # config.paranoid = true
74
-
75
- # By default Devise will store the user in session. You can skip storage for
76
- # particular strategies by setting this option.
77
- # Notice that if you are skipping storage for all authentication paths, you
78
- # may want to disable generating routes to Devise's sessions controller by
79
- # passing :skip => :sessions to `devise_for` in your config/routes.rb
80
- config.skip_session_storage = [:http_auth]
81
-
82
- # By default, Devise cleans up the CSRF token on authentication to
83
- # avoid CSRF token fixation attacks. This means that, when using AJAX
84
- # requests for sign in and sign up, you need to get a new CSRF token
85
- # from the server. You can disable this option at your own risk.
86
- # config.clean_up_csrf_token_on_authentication = true
87
-
88
- # ==> Configuration for :database_authenticatable
89
- # For bcrypt, this is the cost for hashing the password and defaults to 10. If
90
- # using other encryptors, it sets how many times you want the password re-encrypted.
91
- #
92
- # Limiting the stretches to just one in testing will increase the performance of
93
- # your test suite dramatically. However, it is STRONGLY RECOMMENDED to not use
94
- # a value less than 10 in other environments.
95
- config.stretches = Rails.env.test? ? 1 : 10
96
-
97
- # Setup a pepper to generate the encrypted password.
98
- # config.pepper = '<%= SecureRandom.hex(64) %>'
99
-
100
- # ==> Configuration for :confirmable
101
- # A period that the user is allowed to access the website even without
102
- # confirming his account. For instance, if set to 2.days, the user will be
103
- # able to access the website for two days without confirming his account,
104
- # access will be blocked just in the third day. Default is 0.days, meaning
105
- # the user cannot access the website without confirming his account.
106
- # config.allow_unconfirmed_access_for = 2.days
107
-
108
- # A period that the user is allowed to confirm their account before their
109
- # token becomes invalid. For example, if set to 3.days, the user can confirm
110
- # their account within 3 days after the mail was sent, but on the fourth day
111
- # their account can't be confirmed with the token any more.
112
- # Default is nil, meaning there is no restriction on how long a user can take
113
- # before confirming their account.
114
- # config.confirm_within = 3.days
115
-
116
- # If true, requires any email changes to be confirmed (exactly the same way as
117
- # initial account confirmation) to be applied. Requires additional unconfirmed_email
118
- # db field (see migrations). Until confirmed new email is stored in
119
- # unconfirmed email column, and copied to email column on successful confirmation.
120
- config.reconfirmable = true
121
-
122
- # Defines which key will be used when confirming an account
123
- # config.confirmation_keys = [ :email ]
124
-
125
- # ==> Configuration for :rememberable
126
- # The time the user will be remembered without asking for credentials again.
127
- # config.remember_for = 2.weeks
128
-
129
- # If true, extends the user's remember period when remembered via cookie.
130
- # config.extend_remember_period = false
131
-
132
- # Options to be passed to the created cookie. For instance, you can set
133
- # :secure => true in order to force SSL only cookies.
134
- # config.rememberable_options = {}
135
-
136
- # ==> Configuration for :validatable
137
- # Range for password length. Default is 8..128.
138
- config.password_length = 8..128
139
-
140
- # Email regex used to validate email formats. It simply asserts that
141
- # one (and only one) @ exists in the given string. This is mainly
142
- # to give user feedback and not to assert the e-mail validity.
143
- # config.email_regexp = /\A[^@]+@[^@]+\z/
144
-
145
- # ==> Configuration for :timeoutable
146
- # The time you want to timeout the user session without activity. After this
147
- # time the user will be asked for credentials again. Default is 30 minutes.
148
- # config.timeout_in = 30.minutes
149
-
150
- # If true, expires auth token on session timeout.
151
- # config.expire_auth_token_on_timeout = false
152
-
153
- # ==> Configuration for :lockable
154
- # Defines which strategy will be used to lock an account.
155
- # :failed_attempts = Locks an account after a number of failed attempts to sign in.
156
- # :none = No lock strategy. You should handle locking by yourself.
157
- # config.lock_strategy = :failed_attempts
158
-
159
- # Defines which key will be used when locking and unlocking an account
160
- # config.unlock_keys = [ :email ]
161
-
162
- # Defines which strategy will be used to unlock an account.
163
- # :email = Sends an unlock link to the user email
164
- # :time = Re-enables login after a certain amount of time (see :unlock_in below)
165
- # :both = Enables both strategies
166
- # :none = No unlock strategy. You should handle unlocking by yourself.
167
- # config.unlock_strategy = :both
168
-
169
- # Number of authentication tries before locking an account if lock_strategy
170
- # is failed attempts.
171
- # config.maximum_attempts = 20
172
-
173
- # Time interval to unlock the account if :time is enabled as unlock_strategy.
174
- # config.unlock_in = 1.hour
175
-
176
- # ==> Configuration for :recoverable
177
- #
178
- # Defines which key will be used when recovering the password for an account
179
- # config.reset_password_keys = [ :email ]
180
-
181
- # Time interval you can reset your password with a reset password key.
182
- # Don't put a too small interval or your users won't have the time to
183
- # change their passwords.
184
- config.reset_password_within = 6.hours
185
-
186
- # ==> Configuration for :encryptable
187
- # Allow you to use another encryption algorithm besides bcrypt (default). You can use
188
- # :sha1, :sha512 or encryptors from others authentication tools as :clearance_sha1,
189
- # :authlogic_sha512 (then you should set stretches above to 20 for default behavior)
190
- # and :restful_authentication_sha1 (then you should set stretches to 10, and copy
191
- # REST_AUTH_SITE_KEY to pepper).
192
- #
193
- # Require the `devise-encryptable` gem when using anything other than bcrypt
194
- # config.encryptor = :sha512
195
-
196
- # ==> Scopes configuration
197
- # Turn scoped views on. Before rendering "sessions/new", it will first check for
198
- # "users/sessions/new". It's turned off by default because it's slower if you
199
- # are using only default views.
200
- # config.scoped_views = false
201
-
202
- # Configure the default scope given to Warden. By default it's the first
203
- # devise role declared in your routes (usually :user).
204
- # config.default_scope = :user
205
-
206
- # Set this configuration to false if you want /users/sign_out to sign out
207
- # only the current scope. By default, Devise signs out all scopes.
208
- # config.sign_out_all_scopes = true
209
-
210
- # ==> Navigation configuration
211
- # Lists the formats that should be treated as navigational. Formats like
212
- # :html, should redirect to the sign in page when the user does not have
213
- # access, but formats like :xml or :json, should return 401.
214
- #
215
- # If you have any extra navigational formats, like :iphone or :mobile, you
216
- # should add them to the navigational formats lists.
217
- #
218
- # The "*/*" below is required to match Internet Explorer requests.
219
- # config.navigational_formats = ['*/*', :html]
220
-
221
- # The default HTTP method used to sign out a resource. Default is :delete.
222
- config.sign_out_via = :delete
223
-
224
- # ==> OmniAuth
225
- # Add a new OmniAuth provider. Check the wiki for more information on setting
226
- # up on your models and hooks.
227
- # config.omniauth :github, 'APP_ID', 'APP_SECRET', :scope => 'user,public_repo'
228
-
229
- # ==> Warden configuration
230
- # If you want to use other strategies, that are not supported by Devise, or
231
- # change the failure app, you can configure them inside the config.warden block.
232
- #
233
- # config.warden do |manager|
234
- # manager.intercept_401 = false
235
- # manager.default_strategies(:scope => :user).unshift :some_external_strategy
236
- # end
237
-
238
- # ==> Mountable engine configurations
239
- # When using Devise inside an engine, let's call it `MyEngine`, and this engine
240
- # is mountable, there are some extra configurations to be taken into account.
241
- # The following options are available, assuming the engine is mounted as:
242
- #
243
- # mount MyEngine, at: '/my_engine'
244
- #
245
- # The router that invoked `devise_for`, in the example above, would be:
246
- # config.router_name = :my_engine
247
- #
248
- # When using omniauth, Devise cannot automatically set Omniauth path,
249
- # so you need to do it manually. For the users scope, it would be:
250
- # config.omniauth_path_prefix = '/my_engine/users/auth'
251
- end
File without changes
@@ -1,18 +0,0 @@
1
- # -----------------------------------------------------------------------------
2
- # Red Base - Basic website skel engine
3
- # Copyright (C) 2012-2013 Yellowen
4
- #
5
- # This program is free software; you can redistribute it and/or modify
6
- # it under the terms of the GNU General Public License as published by
7
- # the Free Software Foundation; either version 2 of the License, or
8
- # (at your option) any later version.
9
- #
10
- # This program is distributed in the hope that it will be useful,
11
- # but WITHOUT ANY WARRANTY; without even the implied warranty of
12
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
- # GNU General Public License for more details.
14
- #
15
- # You should have received a copy of the GNU General Public License along
16
- # with this program; if not, write to the Free Software Foundation, Inc.,
17
- # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18
- # -----------------------------------------------------------------------------
@@ -1 +0,0 @@
1
- require "red_base/omniauth/callbacks"
@@ -1,7 +0,0 @@
1
- module RedBase
2
- module omniauth
3
- class CallBacks
4
-
5
- end
6
- end
7
- end