tmatt_cms 0.1.1 → 0.1.2
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 +4 -4
- data/lib/generators/tmatt_cms/install_generator.rb +23 -7
- data/lib/generators/tmatt_cms/templates/controllers/pages_controller.rb +15 -0
- data/lib/generators/tmatt_cms/templates/css/application/mixin.css.scss +3 -2
- data/lib/generators/tmatt_cms/templates/gemfile/Gemfile +6 -7
- data/lib/generators/tmatt_cms/templates/views/layouts/application.html.haml +13 -0
- data/lib/generators/tmatt_cms/templates/views/pages/index.html.haml +1 -0
- data/lib/tmatt_cms/version.rb +1 -1
- metadata +4 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 767e941b3f5fd70702c2ff2aecfa6ae0e5ea73b5
|
4
|
+
data.tar.gz: 05103ddffd45cf360b17c4e49675aa59626be504
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9f499dcf84633597f5517b9d92a0dd376406d8fdcd91439ec91954e0ea4726af3b459a5fb18f188d7ef20b78a5db94c3e4694a62176494052efcec27b8985b97
|
7
|
+
data.tar.gz: 35743eba7a480cb2ee8ba3e2d8eb43e6d9f973975925b8a1c16f6d55d54c472ea96d6dc55b49d76916f2328bf225b3b3bfaa114d5b122c725d818ee5cdcac8f0
|
@@ -147,12 +147,8 @@ module TmattCms
|
|
147
147
|
copy_file 'js/application.js', 'app/assets/javascripts/application.js'
|
148
148
|
end
|
149
149
|
|
150
|
-
def
|
151
|
-
|
152
|
-
File.open(File.join('app', 'views', 'layouts', 'application.html.haml'), 'a+') do |f|
|
153
|
-
f.puts "\n\t\t= yield :custom_javascripts"
|
154
|
-
end
|
155
|
-
end
|
150
|
+
def copy_application_layout
|
151
|
+
copy_file 'views/layouts/application.html.haml', 'app/views/layouts/application.html.haml'
|
156
152
|
end
|
157
153
|
|
158
154
|
def config_seed_bank
|
@@ -161,6 +157,15 @@ module TmattCms
|
|
161
157
|
copy_file '.keep', 'db/seeds/resources/csv/.keep'
|
162
158
|
end
|
163
159
|
|
160
|
+
def add_polyfills_js
|
161
|
+
if File.readlines('config/initializers/assets.rb').grep(/polyfills/).size == 0
|
162
|
+
File.open(File.join('config', 'initializers', 'assets.rb'), 'a+') do |f|
|
163
|
+
f.puts "\n\n"
|
164
|
+
f.puts 'Rails.application.config.assets.precompile += %w( polyfills.js )'
|
165
|
+
end
|
166
|
+
end
|
167
|
+
end
|
168
|
+
|
164
169
|
def config_magnific_popup_rails
|
165
170
|
copy_file 'css/application/magnific_popup_rails.css.scss', 'app/assets/stylesheets/application/magnific_popup_rails.css.scss'
|
166
171
|
copy_file 'js/utils/magnificPopup.js', 'app/assets/javascripts/utils/magnificPopup.js'
|
@@ -261,7 +266,7 @@ module TmattCms
|
|
261
266
|
insert_at_line(filename, 4, ["require 'capistrano-db-tasks'"])
|
262
267
|
end
|
263
268
|
|
264
|
-
if File.readlines(filename).grep(/
|
269
|
+
if File.readlines(filename).grep(/project_name/).size == 0
|
265
270
|
line_count = get_line_count filename
|
266
271
|
insert_at_line(filename, line_count - 3, [
|
267
272
|
"\n\nproject_name = 'project_name'",
|
@@ -292,6 +297,17 @@ module TmattCms
|
|
292
297
|
end
|
293
298
|
end
|
294
299
|
|
300
|
+
def add_front_page
|
301
|
+
copy_file 'views/pages/index.html.haml', 'app/views/pages/index.html.haml'
|
302
|
+
copy_file 'controllers/pages_controller.rb', 'app/controllers/pages_controller.rb'
|
303
|
+
|
304
|
+
filename = 'config/routes.rb'
|
305
|
+
if File.readlines(filename).grep(/pages#index/).size == 0
|
306
|
+
line_count = get_line_count filename
|
307
|
+
insert_at_line(filename, line_count - 1, ["\n\troot 'pages#index'"])
|
308
|
+
end
|
309
|
+
end
|
310
|
+
|
295
311
|
private
|
296
312
|
|
297
313
|
def get_line_count(filename)
|
@@ -0,0 +1,15 @@
|
|
1
|
+
class PagesController < ApplicationController
|
2
|
+
|
3
|
+
def show
|
4
|
+
@page = Page.find params[:id]
|
5
|
+
if @page.nil?
|
6
|
+
redirect_to root_path
|
7
|
+
return
|
8
|
+
end
|
9
|
+
render params[:id].underscore if lookup_context.template_exists?(params[:id].underscore, "pages", false)
|
10
|
+
end
|
11
|
+
|
12
|
+
def index
|
13
|
+
|
14
|
+
end
|
15
|
+
end
|
@@ -33,11 +33,10 @@ gem 'uglifier', '>= 1.3.0'
|
|
33
33
|
# Use CoffeeScript for .js.coffee assets and views
|
34
34
|
gem 'coffee-rails', '~> 4.0.0'
|
35
35
|
|
36
|
-
gem
|
36
|
+
gem 'stringex'
|
37
37
|
|
38
38
|
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
|
39
39
|
gem 'therubyracer', platforms: :ruby
|
40
|
-
gem "less-rails" #Sprockets (what Rails 3.1 uses for its asset pipeline) supports LESS
|
41
40
|
gem 'bootstrap-sass', '~> 3.0.3.0'
|
42
41
|
|
43
42
|
# Use jquery as the JavaScript library
|
@@ -67,13 +66,13 @@ gem 'ancestry'
|
|
67
66
|
# App API
|
68
67
|
gem 'grape'
|
69
68
|
gem 'grape-rabl'
|
70
|
-
gem
|
69
|
+
gem 'hashie-forbidden_attributes'
|
71
70
|
|
72
71
|
group :development, :test do
|
73
72
|
# gem 'rspec'
|
74
73
|
gem 'rspec-rails', '~> 3.0'
|
75
74
|
gem 'simplecov'
|
76
|
-
gem
|
75
|
+
gem 'factory_girl_rails', '~> 4.0'
|
77
76
|
end
|
78
77
|
|
79
78
|
gem 'ckeditor'
|
@@ -107,10 +106,10 @@ group :development do
|
|
107
106
|
gem 'rvm-capistrano'
|
108
107
|
gem 'capistrano', '2.15.5'
|
109
108
|
gem 'capistrano-ext'
|
110
|
-
gem
|
109
|
+
gem 'capistrano-db-tasks', require: false, github: 'gkopylov/capistrano-db-tasks', ref: 'f3949cd'
|
111
110
|
gem 'quiet_assets'
|
112
|
-
gem
|
113
|
-
gem
|
111
|
+
gem 'better_errors'
|
112
|
+
gem 'binding_of_caller'
|
114
113
|
gem 'pixelforce_cms', '~> 2.4'
|
115
114
|
gem 'tmatt_cms'
|
116
115
|
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
!!!
|
2
|
+
- html_tag class: 'no-js', lang: 'en' do
|
3
|
+
= render 'head'
|
4
|
+
%body{ class: "#{controller.controller_name} #{controller.action_name}" }
|
5
|
+
#main
|
6
|
+
= render 'chromeframe'
|
7
|
+
= render 'header'
|
8
|
+
= yield
|
9
|
+
= render 'footer'
|
10
|
+
|
11
|
+
= render 'javascripts'
|
12
|
+
= yield :js
|
13
|
+
= yield :custom_javascripts
|
@@ -0,0 +1 @@
|
|
1
|
+
Welcome to Tmatt Cms
|
data/lib/tmatt_cms/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tmatt_cms
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Xingyu Ye
|
@@ -71,6 +71,7 @@ files:
|
|
71
71
|
- lib/generators/tmatt_cms/templates/config/locales/views/dashboard/zh.yml
|
72
72
|
- lib/generators/tmatt_cms/templates/config/locales/views/global/en.yml
|
73
73
|
- lib/generators/tmatt_cms/templates/config/locales/views/global/zh.yml
|
74
|
+
- lib/generators/tmatt_cms/templates/controllers/pages_controller.rb
|
74
75
|
- lib/generators/tmatt_cms/templates/css/application/application.css
|
75
76
|
- lib/generators/tmatt_cms/templates/css/application/ckeditor.css.scss
|
76
77
|
- lib/generators/tmatt_cms/templates/css/application/index.css.scss
|
@@ -94,7 +95,9 @@ files:
|
|
94
95
|
- lib/generators/tmatt_cms/templates/js/utils/magnificPopup.js
|
95
96
|
- lib/generators/tmatt_cms/templates/seed_bank/all.seeds.rb
|
96
97
|
- lib/generators/tmatt_cms/templates/views/dashboard/partial/_sidebar.html.haml
|
98
|
+
- lib/generators/tmatt_cms/templates/views/layouts/application.html.haml
|
97
99
|
- lib/generators/tmatt_cms/templates/views/layouts/dashboard.html.haml
|
100
|
+
- lib/generators/tmatt_cms/templates/views/pages/index.html.haml
|
98
101
|
- lib/generators/tmatt_cms/templates/views/utils/_image_cover.html.haml
|
99
102
|
- lib/tmatt_cms.rb
|
100
103
|
- lib/tmatt_cms/version.rb
|