tmatt_cms 0.1.2 → 0.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 767e941b3f5fd70702c2ff2aecfa6ae0e5ea73b5
4
- data.tar.gz: 05103ddffd45cf360b17c4e49675aa59626be504
3
+ metadata.gz: ff85cd2489095db214c790b4501780abf238be99
4
+ data.tar.gz: 131b75379db5f20bca3804d521ac11124a697567
5
5
  SHA512:
6
- metadata.gz: 9f499dcf84633597f5517b9d92a0dd376406d8fdcd91439ec91954e0ea4726af3b459a5fb18f188d7ef20b78a5db94c3e4694a62176494052efcec27b8985b97
7
- data.tar.gz: 35743eba7a480cb2ee8ba3e2d8eb43e6d9f973975925b8a1c16f6d55d54c472ea96d6dc55b49d76916f2328bf225b3b3bfaa114d5b122c725d818ee5cdcac8f0
6
+ metadata.gz: d6331e9cf6997ae69ecad63a2ebda9fe35c3fd6fd3a1bf2efcda6b45bc14809bd2198342cd8c5c95eec0eb3f314b52e03b4322b8b1b7d1f3e43a6a1eb6b6ea97
7
+ data.tar.gz: 8484e1351d0dab8130b8d18915308b7c02a32f283cfda44bb03ade9906856df4417c53f0227b50df47d10ae3d659c91082be6e062ac7509ac66ce129f3ab9c0a
data/binstubs/console ADDED
@@ -0,0 +1,17 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+ #
4
+ # This file was generated by Bundler.
5
+ #
6
+ # The application 'console' is installed as part of a gem, and
7
+ # this file is here to facilitate running it.
8
+ #
9
+
10
+ require "pathname"
11
+ ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
12
+ Pathname.new(__FILE__).realpath)
13
+
14
+ require "rubygems"
15
+ require "bundler/setup"
16
+
17
+ load Gem.bin_path("tmatt_cms", "console")
data/binstubs/rake ADDED
@@ -0,0 +1,17 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+ #
4
+ # This file was generated by Bundler.
5
+ #
6
+ # The application 'rake' is installed as part of a gem, and
7
+ # this file is here to facilitate running it.
8
+ #
9
+
10
+ require "pathname"
11
+ ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
12
+ Pathname.new(__FILE__).realpath)
13
+
14
+ require "rubygems"
15
+ require "bundler/setup"
16
+
17
+ load Gem.bin_path("rake", "rake")
data/binstubs/setup ADDED
@@ -0,0 +1,17 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+ #
4
+ # This file was generated by Bundler.
5
+ #
6
+ # The application 'setup' is installed as part of a gem, and
7
+ # this file is here to facilitate running it.
8
+ #
9
+
10
+ require "pathname"
11
+ ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
12
+ Pathname.new(__FILE__).realpath)
13
+
14
+ require "rubygems"
15
+ require "bundler/setup"
16
+
17
+ load Gem.bin_path("tmatt_cms", "setup")
@@ -51,11 +51,11 @@ module TmattCms
51
51
  if File.readlines(filename).grep(/smtp/).size == 0
52
52
  line_count = get_line_count filename
53
53
  insert_at_line(filename, line_count - 1, [
54
- "\n\tconfig.action_mailer.default_url_options = { :host => '0.0.0.0:3000' }",
54
+ "\n\tconfig.action_mailer.default_url_options = { :host => ENV['DEVELOPMENT_URL'] }",
55
55
  "\tconfig.action_mailer.delivery_method = :smtp",
56
56
  "\tconfig.action_mailer.smtp_settings = {",
57
- "\t\t:address => 'smtp.gmail.com',",
58
- "\t\t:port => 587,",
57
+ "\t\t:address => ENV['SMTP_ADDRESS'],",
58
+ "\t\t:port => ENV['SMTP_PORT'].to_i,",
59
59
  "\t\t:user_name => ENV['MAILER_EMAIL'],",
60
60
  "\t\t:password => ENV['MAILER_PASSWORD'],",
61
61
  "\t\t:authentication => :plain",
@@ -67,12 +67,12 @@ module TmattCms
67
67
  if File.readlines(filename).grep(/smtp/).size == 0
68
68
  line_count = get_line_count filename
69
69
  insert_at_line(filename, line_count - 1, [
70
- "\n\tconfig.action_mailer.default_url_options = { :host => 'tmatt.com.au' }",
71
- "\tconfig.action_mailer.asset_host = 'http://tmatt.com.au'",
70
+ "\n\tconfig.action_mailer.default_url_options = { :host => ENV['PRODUCTION_URL'] }",
71
+ "\tconfig.action_mailer.asset_host = \"\#{ENV['PROTOCOL']}\#{ENV['PRODUCTION_URL']}\"",
72
72
  "\tconfig.action_mailer.delivery_method = :smtp",
73
73
  "\tconfig.action_mailer.smtp_settings = {",
74
- "\t\t:address => 'smtp.gmail.com',",
75
- "\t\t:port => 587,",
74
+ "\t\t:address => ENV['SMTP_ADDRESS'],",
75
+ "\t\t:port => ENV['SMTP_PORT'].to_i,",
76
76
  "\t\t:user_name => ENV['MAILER_EMAIL'],",
77
77
  "\t\t:password => ENV['MAILER_PASSWORD'],",
78
78
  "\t\t:authentication => :plain,",
@@ -130,7 +130,7 @@ module TmattCms
130
130
  copy_file 'css/application/variables.css.scss', 'app/assets/stylesheets/application/variables.css.scss'
131
131
 
132
132
  remove_file 'app/assets/stylesheets/application/application.css'
133
- copy_file 'css/application/application.css', 'app/assets/stylesheets/application/application.css'
133
+ copy_file 'css/application/application.scss', 'app/assets/stylesheets/application/application.scss'
134
134
 
135
135
  remove_file 'app/assets/stylesheets/application/index.css.scss'
136
136
  copy_file 'css/application/index.css.scss', 'app/assets/stylesheets/application/index.css.scss'
@@ -268,13 +268,22 @@ module TmattCms
268
268
 
269
269
  if File.readlines(filename).grep(/project_name/).size == 0
270
270
  line_count = get_line_count filename
271
- insert_at_line(filename, line_count - 3, [
271
+ insert_at_line(filename, line_count - 8, [
272
+ "set :branch, 'master'",
273
+ "set :rails_env, 'production'",
274
+ "set :migrate_env, 'production'",
275
+ "set :use_sudo, false",
276
+ 'set :deploy_via, :remote_cache',
277
+ 'set :db_local_clean, true',
278
+ "set :locals_rails_env, 'development'",
272
279
  "\n\nproject_name = 'project_name'",
280
+ "server_address = 'server_address'",
281
+ "server_ip = 'server_ip'",
273
282
  "\n\nputs 'Enter rake command[db:migrate]: '",
274
283
  'db_cmd = STDIN.gets.chomp',
275
284
  "db_cmd = 'db:migrate' if db_cmd == ''",
276
- "\nset :server_address, 'tmatt.com.au'",
277
- "server '0.0.0.0', :app, :web, :db, :primary => true",
285
+ "\nset :server_address, server_address",
286
+ 'server server_ip, :app, :web, :db, :primary => true',
278
287
  "\nafter 'deploy:restart', 'deploy:cleanup'",
279
288
  "after 'deploy:restart', 'unicorn:restart'",
280
289
  "after 'deploy:restart', 'sidekiq:restart'",
@@ -308,6 +317,11 @@ module TmattCms
308
317
  end
309
318
  end
310
319
 
320
+ def config_devise_async
321
+ copy_file 'config/initializers/devise_async.rb', 'config/initializers/devise_async.rb'
322
+ copy_file 'config/sidekiq.yml', 'config/sidekiq.yml'
323
+ end
324
+
311
325
  private
312
326
 
313
327
  def get_line_count(filename)
@@ -0,0 +1,62 @@
1
+ require 'rails/generators'
2
+
3
+ module TmattCms
4
+ module Generators
5
+ class LocaleGenerator < Rails::Generators::Base
6
+
7
+ source_root File.expand_path('../templates', __FILE__)
8
+
9
+ argument :key, :type => :string
10
+ argument :zh_value, :type => :string
11
+ argument :en_value, :type => :string, :default => ''
12
+
13
+ def generate_locale
14
+ prefix_length = 45
15
+ blank_space = ' ' * (prefix_length - 2 - ("#{key}").length)
16
+
17
+ p "#{key} => #{zh_value} | #{en_value == '' ? key : en_value}"
18
+
19
+ if File.readlines('config/locales/views/global/en.yml').grep(/ #{key}: /).size == 0
20
+
21
+ File.open(File.join('config', 'locales', 'views', 'global', 'en.yml'), 'a+') do |f|
22
+ f.puts " #{key}:#{blank_space}\"#{en_value == '' ? key : en_value}\""
23
+ end
24
+
25
+ File.open(File.join('config', 'locales', 'views', 'global', 'zh.yml'), 'a+') do |f|
26
+ f.puts " #{key}:#{blank_space}\"#{zh_value}\""
27
+ end
28
+
29
+ else
30
+ p "#{key} exists!!! Override?(y/n) [n]:"
31
+ is_override = STDIN.gets.chomp
32
+
33
+ is_override = is_override == 'y' ? true : false
34
+
35
+ if is_override
36
+ line_number_en = get_line_number('config/locales/views/global/en.yml', " #{key}: ")
37
+ override_line('config/locales/views/global/en.yml', line_number_en, " #{key}:#{blank_space}\"#{en_value == '' ? key : en_value}\"")
38
+
39
+ line_number_zh = get_line_number('config/locales/views/global/zh.yml', " #{key}: ")
40
+ override_line('config/locales/views/global/zh.yml', line_number_zh, " #{key}:#{blank_space}\"#{zh_value}\"")
41
+ end
42
+ end
43
+ end
44
+
45
+ private
46
+
47
+ def get_line_number(file, word)
48
+ count = 0
49
+ File.open(file, "r") { |f| f.each_line { |line|
50
+ count += 1
51
+ return count if line =~ /#{word}/
52
+ }}
53
+ end
54
+
55
+ def override_line(file_path, line_number, new_line)
56
+ lines = File.readlines(file_path)
57
+ lines[line_number - 1] = new_line << $/
58
+ File.open(file_path, 'w') { |f| f.write(lines.join) }
59
+ end
60
+ end
61
+ end
62
+ end
@@ -3,6 +3,13 @@ default: &default
3
3
  MAILER_EMAIL: ''
4
4
  MAILER_PASSWORD: ''
5
5
  MAILER_DEFAULT_FROM: ''
6
+ SMTP_ADDRESS: 'smtp.gmail.com'
7
+ SMTP_PORT: '587'
8
+ DEVELOPMENT_URL: '0.0.0.0:3000'
9
+ PRODUCTION_URL: ''
10
+ PROTOCOL: 'http://'
11
+
12
+
6
13
 
7
14
 
8
15
  development:
@@ -0,0 +1,259 @@
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 = '835a7a7f51d573eb54c2de38b52aa1b349096d283ce163235301f76598e14de20d556ce7085fcf9345a4fd87b93378153ce626e42bdb6c77166c9e579a2c1e2c'
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/active_record'
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 401 status code 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. Note that, for bcrypt (the default
95
+ # encryptor), the cost increases exponentially with the number of stretches (e.g.
96
+ # a value of 20 is already extremely slow: approx. 60 seconds for 1 calculation).
97
+ config.stretches = Rails.env.test? ? 1 : 10
98
+
99
+ # Setup a pepper to generate the encrypted password.
100
+ # config.pepper = 'ab4d3412e761b379a494fce8ea0c4822fed17ff9264ba7b69a3185bf65a65964cfaa84cc29ea10047f8cd7e84e16f54c3f881206341c03b61769235b9d058f8c'
101
+
102
+ # ==> Configuration for :confirmable
103
+ # A period that the user is allowed to access the website even without
104
+ # confirming their account. For instance, if set to 2.days, the user will be
105
+ # able to access the website for two days without confirming their account,
106
+ # access will be blocked just in the third day. Default is 0.days, meaning
107
+ # the user cannot access the website without confirming their account.
108
+ # config.allow_unconfirmed_access_for = 2.days
109
+
110
+ # A period that the user is allowed to confirm their account before their
111
+ # token becomes invalid. For example, if set to 3.days, the user can confirm
112
+ # their account within 3 days after the mail was sent, but on the fourth day
113
+ # their account can't be confirmed with the token any more.
114
+ # Default is nil, meaning there is no restriction on how long a user can take
115
+ # before confirming their account.
116
+ # config.confirm_within = 3.days
117
+
118
+ # If true, requires any email changes to be confirmed (exactly the same way as
119
+ # initial account confirmation) to be applied. Requires additional unconfirmed_email
120
+ # db field (see migrations). Until confirmed, new email is stored in
121
+ # unconfirmed_email column, and copied to email column on successful confirmation.
122
+ config.reconfirmable = false
123
+
124
+ # Defines which key will be used when confirming an account
125
+ # config.confirmation_keys = [ :email ]
126
+
127
+ # ==> Configuration for :rememberable
128
+ # The time the user will be remembered without asking for credentials again.
129
+ # config.remember_for = 2.weeks
130
+
131
+ # Invalidates all the remember me tokens when the user signs out.
132
+ config.expire_all_remember_me_on_sign_out = true
133
+
134
+ # If true, extends the user's remember period when remembered via cookie.
135
+ # config.extend_remember_period = false
136
+
137
+ # Options to be passed to the created cookie. For instance, you can set
138
+ # secure: true in order to force SSL only cookies.
139
+ # config.rememberable_options = {}
140
+
141
+ # ==> Configuration for :validatable
142
+ # Range for password length.
143
+ config.password_length = 8..128
144
+
145
+ # Email regex used to validate email formats. It simply asserts that
146
+ # one (and only one) @ exists in the given string. This is mainly
147
+ # to give user feedback and not to assert the e-mail validity.
148
+ # config.email_regexp = /\A[^@]+@[^@]+\z/
149
+
150
+ # ==> Configuration for :timeoutable
151
+ # The time you want to timeout the user session without activity. After this
152
+ # time the user will be asked for credentials again. Default is 30 minutes.
153
+ # config.timeout_in = 30.minutes
154
+
155
+ # If true, expires auth token on session timeout.
156
+ # config.expire_auth_token_on_timeout = false
157
+
158
+ # ==> Configuration for :lockable
159
+ # Defines which strategy will be used to lock an account.
160
+ # :failed_attempts = Locks an account after a number of failed attempts to sign in.
161
+ # :none = No lock strategy. You should handle locking by yourself.
162
+ # config.lock_strategy = :failed_attempts
163
+
164
+ # Defines which key will be used when locking and unlocking an account
165
+ # config.unlock_keys = [ :email ]
166
+
167
+ # Defines which strategy will be used to unlock an account.
168
+ # :email = Sends an unlock link to the user email
169
+ # :time = Re-enables login after a certain amount of time (see :unlock_in below)
170
+ # :both = Enables both strategies
171
+ # :none = No unlock strategy. You should handle unlocking by yourself.
172
+ # config.unlock_strategy = :both
173
+
174
+ # Number of authentication tries before locking an account if lock_strategy
175
+ # is failed attempts.
176
+ # config.maximum_attempts = 20
177
+
178
+ # Time interval to unlock the account if :time is enabled as unlock_strategy.
179
+ # config.unlock_in = 1.hour
180
+
181
+ # Warn on the last attempt before the account is locked.
182
+ # config.last_attempt_warning = true
183
+
184
+ # ==> Configuration for :recoverable
185
+ #
186
+ # Defines which key will be used when recovering the password for an account
187
+ # config.reset_password_keys = [ :email ]
188
+
189
+ # Time interval you can reset your password with a reset password key.
190
+ # Don't put a too small interval or your users won't have the time to
191
+ # change their passwords.
192
+ config.reset_password_within = 6.hours
193
+
194
+ # ==> Configuration for :encryptable
195
+ # Allow you to use another encryption algorithm besides bcrypt (default). You can use
196
+ # :sha1, :sha512 or encryptors from others authentication tools as :clearance_sha1,
197
+ # :authlogic_sha512 (then you should set stretches above to 20 for default behavior)
198
+ # and :restful_authentication_sha1 (then you should set stretches to 10, and copy
199
+ # REST_AUTH_SITE_KEY to pepper).
200
+ #
201
+ # Require the `devise-encryptable` gem when using anything other than bcrypt
202
+ # config.encryptor = :sha512
203
+
204
+ # ==> Scopes configuration
205
+ # Turn scoped views on. Before rendering "sessions/new", it will first check for
206
+ # "users/sessions/new". It's turned off by default because it's slower if you
207
+ # are using only default views.
208
+ config.scoped_views = true
209
+
210
+ # Configure the default scope given to Warden. By default it's the first
211
+ # devise role declared in your routes (usually :user).
212
+ # config.default_scope = :user
213
+
214
+ # Set this configuration to false if you want /users/sign_out to sign out
215
+ # only the current scope. By default, Devise signs out all scopes.
216
+ # config.sign_out_all_scopes = true
217
+
218
+ # ==> Navigation configuration
219
+ # Lists the formats that should be treated as navigational. Formats like
220
+ # :html, should redirect to the sign in page when the user does not have
221
+ # access, but formats like :xml or :json, should return 401.
222
+ #
223
+ # If you have any extra navigational formats, like :iphone or :mobile, you
224
+ # should add them to the navigational formats lists.
225
+ #
226
+ # The "*/*" below is required to match Internet Explorer requests.
227
+ # config.navigational_formats = ['*/*', :html]
228
+
229
+ # The default HTTP method used to sign out a resource. Default is :delete.
230
+ config.sign_out_via = :delete
231
+
232
+ # ==> OmniAuth
233
+ # Add a new OmniAuth provider. Check the wiki for more information on setting
234
+ # up on your models and hooks.
235
+ # config.omniauth :github, 'APP_ID', 'APP_SECRET', scope: 'user,public_repo'
236
+
237
+ # ==> Warden configuration
238
+ # If you want to use other strategies, that are not supported by Devise, or
239
+ # change the failure app, you can configure them inside the config.warden block.
240
+ #
241
+ # config.warden do |manager|
242
+ # manager.intercept_401 = false
243
+ # manager.default_strategies(scope: :user).unshift :some_external_strategy
244
+ # end
245
+
246
+ # ==> Mountable engine configurations
247
+ # When using Devise inside an engine, let's call it `MyEngine`, and this engine
248
+ # is mountable, there are some extra configurations to be taken into account.
249
+ # The following options are available, assuming the engine is mounted as:
250
+ #
251
+ # mount MyEngine, at: '/my_engine'
252
+ #
253
+ # The router that invoked `devise_for`, in the example above, would be:
254
+ # config.router_name = :my_engine
255
+ #
256
+ # When using omniauth, Devise cannot automatically set Omniauth path,
257
+ # so you need to do it manually. For the users scope, it would be:
258
+ # config.omniauth_path_prefix = '/my_engine/users/auth'
259
+ end
@@ -0,0 +1,3 @@
1
+ # Supported options: :resque, :sidekiq, :delayed_job
2
+ Devise::Async.backend = :sidekiq
3
+ Devise::Async.queue = :devise_mailer
@@ -1,2 +1,2 @@
1
1
  en:
2
- language: "Language"
2
+ language: "language"
@@ -1,2 +1,2 @@
1
1
  zh:
2
- language: "语言"
2
+ language: "语言"
@@ -0,0 +1,11 @@
1
+ ---
2
+ :concurrency: 5
3
+ :pidfile: tmp/pids/sidekiq.pid
4
+ staging:
5
+ :concurrency: 10
6
+ production:
7
+ :concurrency: 20
8
+ :queues:
9
+ - default
10
+ - mailer
11
+ - [devise_mailer, 2]
@@ -0,0 +1,7 @@
1
+ @import "application/chromeframe";
2
+ @import "font-awesome";
3
+ @import "jquery-ui";
4
+ @import "owl.carousel";
5
+ @import "owl.theme";
6
+ @import "magnific-popup";
7
+ @import "material_icons";
@@ -37,6 +37,40 @@ ul {
37
37
  }
38
38
  }
39
39
 
40
+ ul, li {
41
+ padding: 0;
42
+ margin: 0;
43
+ list-style: none;
44
+ }
45
+
46
+ ol, ul {
47
+ margin-top: 0;
48
+ margin-bottom: 10px;
49
+ }
50
+
51
+
52
+ ul, menu, dir {
53
+ display: block;
54
+ list-style-type: disc;
55
+ -webkit-margin-before: 1rem;
56
+ -webkit-margin-after: 1rem;
57
+ -webkit-margin-start: 0;
58
+ -webkit-margin-end: 0;
59
+ -webkit-padding-start: 0;
60
+ }
61
+
62
+ a, a:hover {
63
+ outline: none;
64
+ text-decoration: none;
65
+ color: currentColor;
66
+ }
67
+
68
+ a:visited, a:hover, a:active, a:focus {
69
+ text-decoration: none;
70
+ outline: none;
71
+ color: currentColor;
72
+ }
73
+
40
74
  hr {
41
75
  margin: $gutter 0;
42
76
  border-top: 1px solid $light-gray;
@@ -48,36 +82,125 @@ abbr[title] { border: 0; }
48
82
  .block { display:block; }
49
83
  .inline-block { display:inline-block; }
50
84
  .relative { position:relative; }
85
+
86
+
51
87
  .m-c { margin:0 !important; }
88
+
52
89
  .m-a { margin:0 auto !important; }
90
+ .m-1-a { margin:$gutter auto !important; }
91
+ .m-2-a { margin:$gutter*2 auto !important; }
92
+ .m-3-a { margin:$gutter*3 auto !important; }
53
93
  .m-4-a { margin: $gutter*4 auto !important; }
94
+ .m-5-a { margin: $gutter*5 auto !important; }
95
+ .m-1_2-a { margin:$gutter/2 auto !important; }
96
+ .m-1_3-a { margin:$gutter/3 auto !important; }
97
+ .m-1_4-a { margin:$gutter/4 auto !important; }
98
+ .m-3_4-a { margin:$gutter*3/4 auto !important; }
99
+
54
100
  .m-b { margin-bottom: $gutter !important; }
101
+ .m-b-2 { margin-bottom: $gutter*2 !important; }
102
+ .m-b-3 { margin-bottom: $gutter*3 !important; }
103
+ .m-b-4 { margin-bottom: $gutter*4 !important; }
104
+ .m-b-5 { margin-bottom: $gutter*5 !important; }
55
105
  .m-b-1_2 { margin-bottom: $gutter/2 !important; }
106
+ .m-b-1_3 { margin-bottom: $gutter*1/3 !important; }
56
107
  .m-b-1_4 { margin-bottom: $gutter/4 !important; }
108
+ .m-b-3_4 { margin-bottom: $gutter*3/4 !important; }
57
109
  .m-b-c { margin-bottom:0 !important; }
58
- .m-t-1_2 { margin-top: $gutter/2; }
59
110
 
60
- .padd { padding: $gutter;}
61
- .padd-1_2 { padding: $gutter/2;}
62
- .padd-2 { padding: $gutter*2;}
111
+ .m-t { margin-top: $gutter !important; }
112
+ .m-t-2 { margin-top: $gutter*2 !important; }
113
+ .m-t-3 { margin-top: $gutter*3 !important; }
114
+ .m-t-4 { margin-top: $gutter*4 !important; }
115
+ .m-t-5 { margin-top: $gutter*5 !important; }
116
+ .m-t-1_2 { margin-top: $gutter/2 !important; }
117
+ .m-t-1_3 { margin-top: $gutter*1/3 !important; }
118
+ .m-t-1_4 { margin-top: $gutter/4 !important; }
119
+ .m-t-3_4 { margin-top: $gutter*3/4 !important; }
120
+ .m-t-c { margin-top:0 !important; }
121
+
122
+
123
+ .padd { padding: $gutter; }
124
+ .padd-2 { padding: $gutter*2; }
125
+ .padd-3 { padding: $gutter*3; }
126
+ .padd-4 { padding: $gutter*4; }
127
+ .padd-5 { padding: $gutter*5; }
128
+ .padd-1_2 { padding: $gutter/2; }
129
+ .padd-1_3 { padding: $gutter/3; }
130
+ .padd-1_4 { padding: $gutter/4; }
131
+ .padd-3_4 { padding: $gutter*3/4; }
132
+ .padd-c { padding: 0; }
133
+
63
134
  .padd-side { padding: 0 $gutter;}
64
- .padd-side-c { padding-left: 0 !important; padding-right: 0 !important; }
65
- .padd-side-1_2 { padding: 0 $gutter/2; }
66
- .padd-side-3_4 { padding: 0 $gutter/4*3; }
67
135
  .padd-side-2 { padding: 0 $gutter*2; }
68
136
  .padd-side-3 { padding: 0 $gutter*3; }
137
+ .padd-side-4 { padding: 0 $gutter*4; }
138
+ .padd-side-5 { padding: 0 $gutter*5; }
139
+ .padd-side-1_2 { padding: 0 $gutter/2; }
140
+ .padd-side-1_3 { padding: 0 $gutter/3; }
141
+ .padd-side-1_4 { padding: 0 $gutter/4; }
142
+ .padd-side-3_4 { padding: 0 $gutter*3/4; }
143
+ .padd-side-c { padding-left: 0; padding-right: 0; }
144
+
145
+ .padd-l { padding-left: $gutter; }
146
+ .padd-l-2 { padding-left: $gutter*2; }
69
147
  .padd-l-3 { padding-left: $gutter*3; }
148
+ .padd-l-4 { padding-left: $gutter*4; }
149
+ .padd-l-5 { padding-left: $gutter*5; }
150
+ .padd-l-1_2 { padding-left: $gutter/2; }
151
+ .padd-l-1_3 { padding-left: $gutter/3; }
152
+ .padd-l-1_4 { padding-left: $gutter/4; }
153
+ .padd-l-3_4 { padding-left: $gutter*3/4; }
154
+ .padd-l-c { padding-left: 0; }
155
+
156
+ .padd-r { padding-right: $gutter; }
157
+ .padd-r-2 { padding-right: $gutter*2; }
158
+ .padd-r-3 { padding-right: $gutter*3; }
159
+ .padd-r-4 { padding-right: $gutter*4; }
160
+ .padd-r-5 { padding-right: $gutter*5; }
161
+ .padd-r-1_2 { padding-right: $gutter/2; }
162
+ .padd-r-1_3 { padding-right: $gutter/3; }
163
+ .padd-r-1_4 { padding-right: $gutter/4; }
164
+ .padd-r-3_4 { padding-right: $gutter*3/4; }
165
+ .padd-r-c { padding-right: 0; }
166
+
70
167
  .padd-t { padding-top: $gutter; }
71
- .padd-t-1_2 { padding-top: $gutter/2; }
168
+ .padd-t-2 { padding-top: $gutter*2; }
72
169
  .padd-t-3 { padding-top: $gutter*3; }
170
+ .padd-t-4 { padding-top: $gutter*4; }
171
+ .padd-t-5 { padding-top: $gutter*5; }
172
+ .padd-t-1_2 { padding-top: $gutter/2; }
173
+ .padd-t-1_3 { padding-top: $gutter/3; }
174
+ .padd-t-1_4 { padding-top: $gutter/4; }
175
+ .padd-t-3_4 { padding-top: $gutter*3/4; }
176
+ .padd-t-c { padding-top: 0; }
177
+
73
178
  .padd-b { padding-bottom: $gutter; }
74
- .padd-b-1_2 { padding-bottom: $gutter/2; }
75
- .padd-b-1_4 { padding-bottom: $gutter/4; }
76
179
  .padd-b-2 { padding-bottom: $gutter*2; }
180
+ .padd-b-3 { padding-bottom: $gutter*3; }
181
+ .padd-b-4 { padding-bottom: $gutter*4; }
77
182
  .padd-b-5 { padding-bottom: $gutter*5; }
78
- .padd-t-b-c { padding-top: 0 !important; padding-bottom: 0 !important; }
183
+ .padd-b-1_2 { padding-bottom: $gutter/2; }
184
+ .padd-b-1_3 { padding-bottom: $gutter/3; }
185
+ .padd-b-1_4 { padding-bottom: $gutter/4; }
186
+ .padd-b-3_4 { padding-bottom: $gutter*3/4; }
187
+ .padd-b-c { padding-bottom: 0; }
188
+
189
+ .padd-t-b { padding: $gutter 0; }
190
+ .padd-t-b-2 { padding: $gutter*2 0; }
79
191
  .padd-t-b-3 { padding: $gutter*3 0; }
192
+ .padd-t-b-4 { padding: $gutter*4 0; }
80
193
  .padd-t-b-5 { padding: $gutter*5 0; }
194
+ .padd-t-b-1_2 { padding: $gutter/2 0; }
195
+ .padd-t-b-1_3 { padding: $gutter/3 0; }
196
+ .padd-t-b-1_4 { padding: $gutter/4 0; }
197
+ .padd-t-b-3_4 { padding: $gutter*3/4 0; }
198
+ .padd-t-b-c { padding-top: 0; padding-bottom: 0; }
199
+
200
+ .btn_padding_mid {
201
+ padding: $gutter/4 $gutter*2;
202
+ @extend .font-medium;
203
+ }
81
204
 
82
205
  .bordered { border:0.1rem solid #ddd; }
83
206
 
@@ -130,6 +253,11 @@ abbr[title] { border: 0; }
130
253
  .font-4xlarge { font-size:5.0rem !important; }
131
254
  .font-5xlarge { font-size:6.0rem !important; }
132
255
 
256
+ .font-light { font-weight: 100; }
257
+ .font-300 { font-weight: 300; }
258
+ .font-bold { font-weight: 700; }
259
+ .font-italic { font-style: italic; }
260
+
133
261
  .text-primary { color: $blue !important; }
134
262
  .text-danger { color: $red !important; }
135
263
 
@@ -137,6 +265,7 @@ abbr[title] { border: 0; }
137
265
  .text-black { color: $black !important; }
138
266
  .text-orange { color: $orange !important; }
139
267
  .text-blue { color: $blue !important; }
268
+ .text-grey { color: $gray; }
140
269
 
141
270
  .pull-none { float: none; }
142
271
  .media > .pull-left { margin-right: $gutter*2; }
@@ -200,43 +329,17 @@ abbr[title] { border: 0; }
200
329
  background-repeat: no-repeat;background-size: cover;
201
330
  }
202
331
 
203
- .sccsa_link:hover, .sccsa_link.active {
204
- color: $blue !important;
205
- border-bottom: 0.2rem solid $blue;
206
- text-decoration: none;
207
- }
208
-
209
-
210
- ul, li {
211
- padding: 0;
212
- margin: 0;
213
- list-style: none;
214
- }
215
-
216
- ol, ul {
217
- margin-top: 0;
218
- margin-bottom: 10px;
332
+ .fa-lg {
333
+ font-size: 1.3333333333em;
334
+ line-height: 0.75em;
335
+ vertical-align: -15%;
219
336
  }
220
337
 
221
-
222
- ul, menu, dir {
223
- display: block;
224
- list-style-type: disc;
225
- -webkit-margin-before: 1rem;
226
- -webkit-margin-after: 1rem;
227
- -webkit-margin-start: 0;
228
- -webkit-margin-end: 0;
229
- -webkit-padding-start: 0;
230
- }
231
-
232
- a, a:hover {
233
- outline: none;
234
- text-decoration: none;
235
- color: currentColor;
236
- }
237
-
238
- a:visited, a:hover, a:active, a:focus {
239
- text-decoration: none;
240
- outline: none;
241
- color: currentColor;
338
+ .fa {
339
+ display: inline-block;
340
+ font: normal normal normal 1.4rem/1 FontAwesome;
341
+ font-size: inherit;
342
+ text-rendering: auto;
343
+ -webkit-font-smoothing: antialiased;
344
+ -moz-osx-font-smoothing: grayscale;
242
345
  }
@@ -4,6 +4,8 @@ source 'https://rubygems.org'
4
4
  # Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
5
5
  gem 'rails', '4.2.6'
6
6
 
7
+ gem 'thor', '0.19.1', '!=0.19.2', '!=0.19.3', '!=0.19.4'
8
+
7
9
  gem 'pg'
8
10
 
9
11
  # SEO pack
@@ -44,6 +46,7 @@ gem 'jquery-rails'
44
46
  gem 'jquery-ui-rails'
45
47
 
46
48
  gem 'devise', '~> 3.4.1'
49
+ gem 'devise-async'
47
50
  gem 'omniauth-facebook'
48
51
 
49
52
 
@@ -124,4 +127,7 @@ gem 'nokogiri'
124
127
  gem 'geocoder'
125
128
 
126
129
  # Owl Carousel
127
- gem 'owlcarousel-rails'
130
+ gem 'owlcarousel-rails'
131
+
132
+ # Material Icon
133
+ gem 'material_icons'
@@ -1,3 +1,3 @@
1
1
  module TmattCms
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.3"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tmatt_cms
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Xingyu Ye
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-04-13 00:00:00.000000000 Z
11
+ date: 2017-04-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -58,21 +58,27 @@ files:
58
58
  - Rakefile
59
59
  - bin/console
60
60
  - bin/setup
61
+ - binstubs/console
62
+ - binstubs/rake
63
+ - binstubs/setup
61
64
  - lib/generators/tmatt_cms/install_generator.rb
65
+ - lib/generators/tmatt_cms/locale_generator.rb
62
66
  - lib/generators/tmatt_cms/templates/.keep
63
67
  - lib/generators/tmatt_cms/templates/concerns/db_init.rb
64
68
  - lib/generators/tmatt_cms/templates/concerns/pretty_url.rb
65
69
  - lib/generators/tmatt_cms/templates/concerns/string_addition.rb
66
70
  - lib/generators/tmatt_cms/templates/concerns/translatable.rb
67
- - lib/generators/tmatt_cms/templates/config/application.rb
68
71
  - lib/generators/tmatt_cms/templates/config/application.yml
69
72
  - lib/generators/tmatt_cms/templates/config/initializers/active_job.rb
73
+ - lib/generators/tmatt_cms/templates/config/initializers/devise.rb
74
+ - lib/generators/tmatt_cms/templates/config/initializers/devise_async.rb
70
75
  - lib/generators/tmatt_cms/templates/config/locales/views/dashboard/en.yml
71
76
  - lib/generators/tmatt_cms/templates/config/locales/views/dashboard/zh.yml
72
77
  - lib/generators/tmatt_cms/templates/config/locales/views/global/en.yml
73
78
  - lib/generators/tmatt_cms/templates/config/locales/views/global/zh.yml
79
+ - lib/generators/tmatt_cms/templates/config/sidekiq.yml
74
80
  - lib/generators/tmatt_cms/templates/controllers/pages_controller.rb
75
- - lib/generators/tmatt_cms/templates/css/application/application.css
81
+ - lib/generators/tmatt_cms/templates/css/application/application.scss
76
82
  - lib/generators/tmatt_cms/templates/css/application/ckeditor.css.scss
77
83
  - lib/generators/tmatt_cms/templates/css/application/index.css.scss
78
84
  - lib/generators/tmatt_cms/templates/css/application/magnific_popup_rails.css.scss
@@ -1,41 +0,0 @@
1
- require File.expand_path('../boot', __FILE__)
2
-
3
- require 'rails/all'
4
-
5
- # Require the gems listed in Gemfile, including any gems
6
- # you've limited to :test, :development, or :production.
7
- Bundler.require(*Rails.groups)
8
-
9
- ENV.update YAML.load_file('config/application.yml')[Rails.env] rescue {}
10
-
11
- module LannisterWebsite
12
- class Application < Rails::Application
13
- # Settings in config/environments/* take precedence over those specified here.
14
- # Application configuration should go into files in config/initializers
15
- # -- all .rb files in that directory are automatically loaded.
16
-
17
- # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
18
- # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
19
- # config.time_zone = 'Central Time (US & Canada)'
20
-
21
- config.autoload_paths += %W(#{config.root}/app/models/concerns)
22
-
23
- # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
24
- # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
25
- # config.i18n.default_locale = :de
26
- config.i18n.enforce_available_locales = false
27
- config.i18n.fallbacks = true
28
-
29
- Time::DATE_FORMATS[:aus] = '%l:%M %p on %d %B %Y'
30
- Date::DATE_FORMATS[:aus] = '%d %B %Y'
31
-
32
- Time::DATE_FORMATS[:zh] = '%l:%M %p on %d %B %Y'
33
- Date::DATE_FORMATS[:zh] = '%d %B %Y'
34
- config.i18n.load_path += Dir[Rails.root.join('config', 'locales', '**', '*.{rb,yml}').to_s]
35
-
36
- config.i18n.default_locale = 'en'
37
-
38
-
39
- config.assets.precompile += %w( ckeditor/* )
40
- end
41
- end
@@ -1,18 +0,0 @@
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 vendor/assets/stylesheets of plugins, if any, 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 top of the
9
- * compiled file, but it's generally better to create a new file per style scope.
10
- *
11
-
12
- *= require application/chromeframe
13
- *= require font-awesome
14
- *= require jquery-ui
15
- *= require owl.carousel
16
- *= require owl.theme
17
- *= require magnific-popup
18
- */