scms 4.4.0 → 4.4.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- NDkzNzVmNzViZDdiYTA3ZjZmNjRiNzY2ZTI4MTQyNGYxZTBiNzdhNA==
4
+ Mjk2MzY2MWNlY2EyODBlYjY3NDFiOWEzYjg0Y2VkNTA5ZmUyOGQ0ZA==
5
5
  data.tar.gz: !binary |-
6
- N2ZkMjY0NWViMWM4NjU4ZjYxMDI1NDJmZTc2ZjA2ZGEzODZmMjFkZg==
6
+ NmY3MWI2MDQ0NjY0YjE2YjMyNjViM2Y5YjhiNjEyOWJkMDU3N2UxNg==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- YjU4YzI2OWQxZTQyZjE2ZTk2YjU1ZTcwM2YyNzA1ODc4ZjI1NDkzMTYxOTk0
10
- MTE1NzcwOWJmYmE5Zjg0NTNmNDZmZjBjYWM3MDk5NWZmYTBjNmJmMGY0NzRi
11
- OTFiMDE3OWI4Yjc2YTJhZjc2YzcxYjEzYmNmYzVjOTYwZGNjZTc=
9
+ OGRiYzkxZDczM2U5MzA2YWEwMDJjNjViYjc5NThiNDRmN2Q2MmE4Yzc5Yzg4
10
+ ZjM5MDQxOTI3NmI5NzhlMjEyNTJlNDIxMzZjNDA4NzQ3ZmRiNWE4Y2NkYTY2
11
+ OWFhYWFiNjEyYmU0ZTI5YjA3OTdjNTMxZDZkZjM1OTQ0ZjgyYTg=
12
12
  data.tar.gz: !binary |-
13
- MzBmOTNiYjM5MTk3MjNhNGViYTFlZTA1MGRiMWNjYjVmODNjZWY3MTcxOTEz
14
- MTkzZDUxZjNhZjM2NzE1YWIwOWYwYjMwMDI2ODZjZGRmMmQyNzUwMjhkMGJj
15
- YmY3Mjk2MzBkNjg3NTZiMWFjNGM0N2EzYzgyZWE1MzY4M2NjODU=
13
+ MGEzMDExZDRlOTBjMTI4OTRlMmU2MTRjYTZjMDkzMDdjN2MyMTM5YzQ4NDM2
14
+ ZDExMDU0Njk5ZDJhZDhkNTVmYTFkOTFiMTg1ZTcwZjE4ODRlMjQ5OTdmOWJh
15
+ MmY0ZWViNTVmNDE5YzY1NDczMGEyZTgyMjQxOTU3ZGM3NTU3NmU=
data/.gitignore CHANGED
@@ -30,3 +30,4 @@ Desktop.ini
30
30
  /assets/blank-template/about.html
31
31
  /assets/blank-template/scripts/bootstrap.min-v2.1.1.js
32
32
  /assets/blank-template/stylesheets/style-1.0.css
33
+ assets/blank-template/getting-started.html
@@ -39,11 +39,7 @@
39
39
  <a class="navbar-brand" href="#">Project name</a>
40
40
  </div>
41
41
  <div class="navbar-collapse collapse">
42
- <ul class="nav navbar-nav">
43
- <li class="active"><a href="~/index.html">Home</a></li>
44
- <li><a href="~/getting-started.html">Getting started</a></li>
45
- <li><a href="#contact">Contact</a></li>
46
- </ul>
42
+ <%= Scms.includeView("_layouts/nav.erb", page) %>
47
43
  </div>
48
44
  </div>
49
45
  </div>
@@ -51,7 +47,7 @@
51
47
  </div>
52
48
  </div>
53
49
 
54
- <%= page.views["carousel"] %>
50
+ <%= Scms.renderView("carousel", page, "erb") %>
55
51
 
56
52
  <!-- Marketing messaging and featurettes
57
53
  ================================================== -->
@@ -59,7 +55,7 @@
59
55
 
60
56
  <div class="container marketing">
61
57
 
62
- <%= page.views["main"] %>
58
+ <%= Scms.renderView("main", page) %>
63
59
 
64
60
  <hr class="featurette-divider">
65
61
 
@@ -1 +1 @@
1
- <!DOCTYPE html>
2
1
  <head>
3
2
  <meta charset="utf-8">
4
3
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
5
4
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
5
  <meta name="description" content="">
7
6
  <meta name="author" content="">
8
7
  <title><%= page.title %></title>
9
8
  <!-- Bootstrap core CSS -->
10
9
  <link href="~/css/bootstrap.min.css" rel="stylesheet">
11
10
  <!-- Layout extras -->
12
11
  <link href="~/css/layout.css" rel="stylesheet">
13
12
  <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
14
13
  <!--[if lt IE 9]>
15
14
  <script src="//oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
16
15
  <script src="//oss.maxcdn.com/libs/respond.js/1.3.0/respond.min.js"></script>
17
16
  <![endif]-->
18
17
  <script src="~/js/jquery-1.10.2.min.js"></script>
19
18
  </head>
20
19
  <body>
21
20
  <a class="sr-only" href="#content">Skip to main content</a>
22
21
  <!-- Docs master nav -->
23
22
  <header class="navbar navbar-inverse navbar-fixed-top bs-docs-nav" role="banner">
24
23
  <div class="container">
25
24
  <div class="navbar-header">
26
25
  <button class="navbar-toggle" type="button" data-toggle="collapse" data-target=".bs-navbar-collapse">
27
26
  <span class="sr-only">Toggle navigation</span>
28
27
  <span class="icon-bar"></span>
29
28
  <span class="icon-bar"></span>
30
29
  <span class="icon-bar"></span>
31
30
  </button>
32
31
  <a href="~/" class="navbar-brand">Project name</a>
33
32
  </div>
34
33
  <nav class="collapse navbar-collapse bs-navbar-collapse" role="navigation">
35
34
  <ul class="nav navbar-nav">
36
35
  <li><a href="~/getting-started.html">Getting started</a></li>
37
36
  <li><a href="#contact">Contact</a></li>
38
37
  </ul>
39
38
  <ul class="nav navbar-nav navbar-right">
40
39
  <li class="active">
41
40
  <a href="http://cprobert.github.io/Static-CMS/">Help</a>
42
41
  </li>
43
42
  </ul>
44
43
  </nav>
45
44
  </div>
46
45
  </header>
47
46
  <!-- Docs page layout -->
48
47
  <div class="bs-header" id="content">
49
48
  <div class="container">
50
49
  <%= Scms.getView("intro", page) %>
51
50
  </div>
52
51
  </div>
53
52
  <!-- Callout for the old docs link -->
54
53
  <div class="bs-old-docs">
55
54
  <div class="container">
56
55
  <%= Scms.getView("leadin", page) %>
57
56
  </div>
58
57
  </div>
59
58
  <div class="container bs-docs-container">
60
59
  <div class="row">
61
60
  <div class="col-md-3">
62
61
  <div class="bs-sidebar hidden-print" role="complementary">
63
62
  <%= page.views["sidenav"] %>
64
63
  </div>
65
64
  </div>
66
65
  <div class="col-md-9" role="main">
67
66
  <%= Scms.getView("main", page) %>
68
67
  </div>
69
68
  </div>
70
69
  </div>
71
70
  <!-- Footer
72
71
  ================================================== -->
73
72
  <footer class="bs-footer" role="contentinfo">
74
73
  <div class="container">
75
74
  <p>Designed and built with all the love in the world by <a href="http://twitter.com/mdo" target="_blank">@mdo</a> and <a href="http://twitter.com/fat" target="_blank">@fat</a>.</p>
76
75
  <p>Code licensed under <a href="http://www.apache.org/licenses/LICENSE-2.0" target="_blank">Apache License v2.0</a>, documentation under <a href="http://creativecommons.org/licenses/by/3.0/">CC BY 3.0</a>.</p>
77
76
  <ul class="footer-links">
78
77
  <li>Currently v3.0.1</li>
79
78
  <li class="muted">&middot;</li>
80
79
  <li><a href="../2.3.2/">Bootstrap 2.3.2 docs</a></li>
81
80
  <li class="muted">&middot;</li>
82
81
  <li><a href="http://blog.getbootstrap.com">Blog</a></li>
83
82
  <li class="muted">&middot;</li>
84
83
  <li><a href="https://github.com/twbs/bootstrap/issues?state=open">Issues</a></li>
85
84
  <li class="muted">&middot;</li>
86
85
  <li><a href="https://github.com/twbs/bootstrap/releases">Releases</a></li>
87
86
  </ul>
88
87
  </div>
89
88
  </footer>
90
89
  <!-- Bootstrap core JavaScript
91
90
  ================================================== -->
92
91
  <!-- Placed at the end of the document so the pages load faster -->
93
92
  <script src="~/js/bootstrap.min.js"></script>
94
93
  <script src="~/js/shims/holder.js"></script>
95
94
  <script src="~/js/application.js"></script>
96
95
  <%= page.monkeyhook %>
97
96
  <%= page.livereload %>
98
97
  </body>
98
+ <!DOCTYPE html>
99
99
  <head>
100
100
  <meta charset="utf-8">
101
101
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
102
102
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
103
103
  <meta name="description" content="">
104
104
  <meta name="author" content="">
105
105
  <title><%= page.title %></title>
106
106
  <!-- Bootstrap core CSS -->
107
107
  <link href="~/css/bootstrap.min.css" rel="stylesheet">
108
108
  <!-- Layout extras -->
109
109
  <link href="~/css/layout.css" rel="stylesheet">
110
110
  <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
111
111
  <!--[if lt IE 9]>
112
112
  <script src="//oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
113
113
  <script src="//oss.maxcdn.com/libs/respond.js/1.3.0/respond.min.js"></script>
114
114
  <![endif]-->
115
115
  <script src="~/js/jquery-1.10.2.min.js"></script>
116
116
  </head>
117
117
  <body>
118
118
  <a class="sr-only" href="#content">Skip to main content</a>
119
119
  <!-- Docs master nav -->
120
120
  <header class="navbar navbar-inverse navbar-fixed-top bs-docs-nav" role="banner">
121
121
  <div class="container">
122
122
  <div class="navbar-header">
123
123
  <button class="navbar-toggle" type="button" data-toggle="collapse" data-target=".bs-navbar-collapse">
124
124
  <span class="sr-only">Toggle navigation</span>
125
125
  <span class="icon-bar"></span>
126
126
  <span class="icon-bar"></span>
127
127
  <span class="icon-bar"></span>
128
128
  </button>
129
129
  <a href="~/" class="navbar-brand">Project name</a>
130
130
  </div>
131
131
  <nav class="collapse navbar-collapse bs-navbar-collapse" role="navigation">
132
132
  <%= Scms.includeView("_layouts/nav.erb", page) %>
133
133
  <ul class="nav navbar-nav navbar-right">
134
134
  <li class="active">
135
135
  <a href="http://cprobert.github.io/Static-CMS/">Help</a>
136
136
  </li>
137
137
  </ul>
138
138
  </nav>
139
139
  </div>
140
140
  </header>
141
141
  <!-- Docs page layout -->
142
142
  <div class="bs-header" id="content">
143
143
  <div class="container">
144
144
  <%= Scms.renderView("intro", page) %>
145
145
  </div>
146
146
  </div>
147
147
  <!-- Callout for the old docs link -->
148
148
  <div class="bs-old-docs">
149
149
  <div class="container">
150
150
  <%= Scms.renderView("leadin", page) %>
151
151
  </div>
152
152
  </div>
153
153
  <div class="container bs-docs-container">
154
154
  <div class="row">
155
155
  <div class="col-md-3">
156
156
  <div class="bs-sidebar hidden-print" role="complementary">
157
157
  <%= Scms.renderView("sidenav", page, "erb") %>
158
158
  </div>
159
159
  </div>
160
160
  <div class="col-md-9" role="main">
161
161
  <%= Scms.renderView("main", page) %>
162
162
  </div>
163
163
  </div>
164
164
  </div>
165
165
  <!-- Footer
166
166
  ================================================== -->
167
167
  <footer class="bs-footer" role="contentinfo">
168
168
  <div class="container">
169
169
  <p>Designed and built with all the love in the world by <a href="http://twitter.com/mdo" target="_blank">@mdo</a> and <a href="http://twitter.com/fat" target="_blank">@fat</a>.</p>
170
170
  <p>Code licensed under <a href="http://www.apache.org/licenses/LICENSE-2.0" target="_blank">Apache License v2.0</a>, documentation under <a href="http://creativecommons.org/licenses/by/3.0/">CC BY 3.0</a>.</p>
171
171
  <ul class="footer-links">
172
172
  <li>Currently v3.0.1</li>
173
173
  <li class="muted">&middot;</li>
174
174
  <li><a href="../2.3.2/">Bootstrap 2.3.2 docs</a></li>
175
175
  <li class="muted">&middot;</li>
176
176
  <li><a href="http://blog.getbootstrap.com">Blog</a></li>
177
177
  <li class="muted">&middot;</li>
178
178
  <li><a href="https://github.com/twbs/bootstrap/issues?state=open">Issues</a></li>
179
179
  <li class="muted">&middot;</li>
180
180
  <li><a href="https://github.com/twbs/bootstrap/releases">Releases</a></li>
181
181
  </ul>
182
182
  </div>
183
183
  </footer>
184
184
  <!-- Bootstrap core JavaScript
185
185
  ================================================== -->
186
186
  <!-- Placed at the end of the document so the pages load faster -->
187
187
  <script src="~/js/bootstrap.min.js"></script>
188
188
  <script src="~/js/shims/holder.js"></script>
189
189
  <script src="~/js/application.js"></script>
190
190
  <%= page.monkeyhook %>
191
191
  <%= page.livereload %>
192
192
  </body>
@@ -0,0 +1,5 @@
1
+ <ul class="nav navbar-nav">
2
+ <li class="active"><a href="~/index.html">Home</a></li>
3
+ <li><a href="~/getting-started.html">Getting started</a></li>
4
+ <li><a href="#contact">Contact</a></li>
5
+ </ul>
@@ -30,15 +30,15 @@ module Scms
30
30
  end
31
31
 
32
32
  def resource= resource
33
- @resource = resource
33
+ @resource = resource
34
34
  end
35
35
 
36
36
  def handler= handler
37
- @handler = handler
37
+ @handler = handler
38
38
  end
39
39
 
40
40
  def allowEdit= allowEdit
41
- @allowEdit = allowEdit
41
+ @allowEdit = allowEdit
42
42
  end
43
43
 
44
44
  def initialize (name, website, pageconfig, siteConfig)
data/lib/scms/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Scms
2
- VERSION = "4.4.0"
2
+ VERSION = "4.4.1"
3
3
  end
data/lib/scms.rb CHANGED
@@ -101,7 +101,7 @@ module Scms
101
101
  viewname = File.basename(view, ".*")
102
102
  viewpath = Pathname.new(view).relative_path_from(Pathname.new(website)).to_s
103
103
  viewmodel = Scms.getViewModel(viewname, viewpath, website, pageOptions, options)
104
- views[viewname] = Scms.renderView(viewpath, viewmodel)
104
+ views[viewname] = Scms.includeView(viewpath, viewmodel)
105
105
  end
106
106
  Scms.savePage(settings, website, pageOptions, views, options)
107
107
  end
@@ -142,7 +142,7 @@ module Scms
142
142
  viewData = Hash[viewqs.split('&').map{ |q| q.split('=') }] if viewqs != nil
143
143
 
144
144
  viewmodel = Scms.getViewModel(viewname, viewpath, website, pageOptions, options, viewData)
145
- views[viewname] = Scms.renderView(viewpath, viewmodel)
145
+ views[viewname] = Scms.includeView(viewpath, viewmodel)
146
146
  end
147
147
  end
148
148
  return views
@@ -469,6 +469,7 @@ module Scms
469
469
  end
470
470
  end
471
471
 
472
+ #Methods for use in views
472
473
  #public
473
474
  def Scms.getView(viewname, page = OpenStruct.new, ext = "html")
474
475
  if page.views != nil
@@ -492,12 +493,8 @@ module Scms
492
493
  end
493
494
  end
494
495
 
495
- #public #legasy
496
- def Scms.renderView(viewpath, hash = Hash.new)
497
- return Scms.getSnippet(viewpath, hash)
498
- end
499
496
  #public
500
- def Scms.getSnippet(viewpath, hash = Hash.new)
497
+ def Scms.includeView(viewpath, hash = Hash.new)
501
498
  #puts "** Rendering: #{viewpath} **"
502
499
 
503
500
  htmlsnipet = ""
@@ -530,4 +527,14 @@ module Scms
530
527
  parser = ScmsParser.new(template, hash)
531
528
  return parser.parse(viewpath)
532
529
  end
530
+
531
+ #public
532
+ def Scms.renderView(viewpath, hash = Hash.new, ext = "html")
533
+ viewExt = File.extname(viewpath)
534
+ if viewExt.nil? || viewExt.empty?
535
+ return Scms.getView(viewpath, hash, ext)
536
+ else
537
+ return Scms.includeView(viewpath, hash)
538
+ end
539
+ end
533
540
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: scms
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.4.0
4
+ version: 4.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Courtenay Probert
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-02-16 00:00:00.000000000 Z
11
+ date: 2014-02-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cprobert-s3sync
@@ -230,6 +230,7 @@ files:
230
230
  - assets/blank-template/_config.yml
231
231
  - assets/blank-template/_layouts/home-layout.erb
232
232
  - assets/blank-template/_layouts/layout.erb
233
+ - assets/blank-template/_layouts/nav.erb
233
234
  - assets/blank-template/_pages/getting-started/_config.yml
234
235
  - assets/blank-template/_pages/getting-started/intro.md
235
236
  - assets/blank-template/_pages/getting-started/leadin.txt
@@ -261,8 +262,6 @@ files:
261
262
  - assets/blank-template/js/shims/html5shiv.js
262
263
  - assets/blank-template/js/shims/respond.min.js
263
264
  - assets/mime.types
264
- - assets/scms help.txt
265
- - assets/yuicompressor/readme
266
265
  - bin/scms
267
266
  - bin/scms-server
268
267
  - build commands.txt
@@ -1,57 +0,0 @@
1
- PageConfig:
2
-
3
- root config
4
-
5
- port
6
- template
7
- rooturl
8
- bootstrap
9
- pages
10
- navigation
11
- navigation_meta
12
- nav
13
- text
14
- url
15
- meta
16
- bundles
17
-
18
- page config
19
-
20
- template
21
- cleanurl
22
- url / generate (depreciated)
23
- title
24
- keywords
25
- description
26
- handler
27
- resource
28
- allowEdit
29
-
30
-
31
- viewmodel = {
32
- :name => pageOptions.name,
33
- :title => pageOptions.title,
34
- :url => pageOptions.url,
35
- :resource => pageOptions.resource,
36
- :rootdir => website,
37
- :view => {
38
- :name => viewname,
39
- :path => viewfullpath,
40
- :model => viewModel
41
- }
42
- }
43
-
44
- pagemodel = {
45
- :name => pageOptions.name,
46
- :title => pageOptions.title,
47
- :description => pageOptions.description,
48
- :keywords => pageOptions.keywords,
49
- :url => pageOptions.url,
50
- :resource => pageOptions.resource,
51
- :bundles => bundleModel,
52
- :navigation => navModel,
53
- :views => views,
54
- :rootdir => website,
55
- :monkeyhook => monkeyhook,
56
- :livereload => livereload
57
- }
@@ -1 +0,0 @@
1
- Add yuicompressor-2.4.7.jar here to able to use the Yui minimise