tzispa_rig 0.4.2 → 0.4.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: 4cd09f61d15166b4d143e917b9aa1d28957685b4
4
- data.tar.gz: 17264385d89f93c1ff1cd3b387ca5499a352545c
3
+ metadata.gz: 953838ad7ff4dc81e2d53ab993ea62f1f61dcfad
4
+ data.tar.gz: ae90857aed0a33de9ca50e7d88a7deb53c9ab989
5
5
  SHA512:
6
- metadata.gz: 5b4e9b77f6e96c2b746fad05846b1f235a47682bb3d3e65c2c6fce7c873a07409627b3e07bd370f8ef6f0a49bdf4f4d35a9e1dbef2c7bfab5468dbe7b1abacee
7
- data.tar.gz: b4ee7c671154e99818d103334cec470526a11cc0e06e8b98aed5378ca5b61bc654c15e348ec0504684f2cdc868ce78f54ca51ec422a55252af0d697bc4932a42
6
+ metadata.gz: da5cf6bbeb89a01411e741fdf07ba4ee4af9a88f3a01ad0bc3345203fc41b6ccecdbe5b15518cb3df497166a00276e3753a36fccbc04814d56ca2baf1cf444ec
7
+ data.tar.gz: 73d8d78d7a2177af5693e9c393f3686bfdba6113ec5dec1ea6fd0b354363c9395c52d79dcd726ae18ad9ca375b26888858618d7c16d21fdb792217952179cc22
data/CHANGELOG.md CHANGED
@@ -2,6 +2,10 @@ Tzispa Rig
2
2
 
3
3
  Rig templates implementation
4
4
 
5
+ ## v0.4.3
6
+ - add config and repository delegators into context
7
+ - updated rig templates documentation
8
+
5
9
  ## v0.4.2
6
10
  - add support for metavars in purl/url tag id
7
11
 
data/README.md CHANGED
@@ -50,12 +50,14 @@ metavariables are used to make runtime template tags replacements
50
50
  <label for='skey'>Código</label>
51
51
  <input type='text' name='skey' id='skey' maxlength="16" value='<var:skey/>'/>
52
52
  </div>
53
- <a href='<purl:site[layout=brand_edit,title=edit-brand,id0={%idb%}]/>'><i class='fa fa-edit'></i></a>
53
+ <a href='<purl:brand_edit[title=edit-brand,id0={%idb%}]/>'><i class='fa fa-edit'></i></a>
54
54
  </div>
55
55
  ```
56
56
 
57
57
  in the template binder
58
58
  ```ruby
59
+
60
+
59
61
  def bind!
60
62
  @idb = context.router_params[:id0]
61
63
  load_brand if idb
@@ -128,7 +130,7 @@ To repeat a part in the template use loop tag
128
130
  <td><var:skey/></td>
129
131
  <td><var:name/></td>
130
132
  <td class='text-right'>
131
- <a href='<purl:site[layout=brand_edit,title=edit-brand,id0={%id%}]/>'><i class='fa fa-edit'></i></a>
133
+ <a href='<purl:brand_edit[title=edit-brand,id0={%id%}]/>'><i class='fa fa-edit'></i></a>
132
134
  <a href='javascript:delete_brand("<sapi:brand:delete:{%id%}/>")'><i class='fa fa-trash'></i></a>
133
135
  </td>
134
136
  <tr>
@@ -163,7 +165,7 @@ Rig templates can build urls for you. There are 2 url types:
163
165
 
164
166
  ### purl
165
167
 
166
- Site urls: used to provide links to site pages
168
+ Site path urls: used to provide links to site pages (layouts)
167
169
 
168
170
  ```
169
171
  <purl:route_id/>
@@ -171,15 +173,50 @@ Site urls: used to provide links to site pages
171
173
  ```
172
174
 
173
175
  ```html
174
- <purl:site[layout=brands,title=brand-list]/>
176
+ <purl:brands[title=brand-list]/>
175
177
  <purl:index/>
176
178
  ```
177
- The route_id's area defined in the start.ru file
179
+
180
+ ### url
181
+
182
+ Site full urls: used to provide links to site pages (layouts)
183
+
184
+ ```
185
+ <url:route_id/>
186
+ <url:route_id[param1=value,param2=value]/>
187
+ ```
188
+
189
+ ```html
190
+ <url:brand_edit[title=brand-edit,idb={%brand_id%}]/>
191
+ <url:index/>
192
+ ```
193
+
194
+ The purl/url route_id/layout's must be defined in the start.ru file with route_rig_layout(layout_id, path_pattern)
195
+
196
+ ```ruby
197
+
198
+ route_rig_layout :brands, '/:title/:layout(.:format)'
199
+ route_rig_layout :brand_edit, '/:title/:idb/:layout(.:format)'
200
+
201
+ ```
178
202
 
179
203
  ### api
180
204
 
181
205
  Api urls: used to provide urls to the application Api
182
206
 
207
+ ```
208
+ <api:handler:verb/>
209
+ <api:handler:verb:predicate/>
210
+ ```
211
+
212
+ ```html
213
+ <api:customer:add:address/>
214
+
215
+ <api:brand:{%verb%}/>
216
+ ```
217
+
218
+ You can also use 'sapi' to automagically provide signed api urls in your apps
219
+
183
220
  ```
184
221
  <sapi:handler:verb/>
185
222
  <sapi:handler:verb:predicate/>
@@ -191,6 +228,7 @@ Api urls: used to provide urls to the application Api
191
228
  <sapi:brand:{%verb%}/>
192
229
  ```
193
230
 
231
+
194
232
  ## Building templates
195
233
 
196
234
  You can include block and static rig templates using these tags:
@@ -16,7 +16,7 @@ module Tzispa
16
16
 
17
17
  attr_reader :context, :dataStruct, :tags, :parser
18
18
  def_delegators :@parser, :attribute_tags
19
- def_delegators :@context, :app, :request, :response
19
+ def_delegators :@context, :app, :request, :response, :repository, :config
20
20
 
21
21
 
22
22
  def initialize(parser, context)
@@ -3,7 +3,7 @@
3
3
  module Tzispa
4
4
  module Rig
5
5
 
6
- VERSION = '0.4.2'
6
+ VERSION = '0.4.3'
7
7
  GEM_NAME = 'tzispa_rig'
8
8
 
9
9
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tzispa_rig
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.2
4
+ version: 0.4.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Juan Antonio Piñero
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-10-24 00:00:00.000000000 Z
11
+ date: 2016-11-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: tzispa_helpers