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 +4 -4
- data/CHANGELOG.md +4 -0
- data/README.md +43 -5
- data/lib/tzispa/rig/binder.rb +1 -1
- data/lib/tzispa/rig/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 953838ad7ff4dc81e2d53ab993ea62f1f61dcfad
|
|
4
|
+
data.tar.gz: ae90857aed0a33de9ca50e7d88a7deb53c9ab989
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: da5cf6bbeb89a01411e741fdf07ba4ee4af9a88f3a01ad0bc3345203fc41b6ccecdbe5b15518cb3df497166a00276e3753a36fccbc04814d56ca2baf1cf444ec
|
|
7
|
+
data.tar.gz: 73d8d78d7a2177af5693e9c393f3686bfdba6113ec5dec1ea6fd0b354363c9395c52d79dcd726ae18ad9ca375b26888858618d7c16d21fdb792217952179cc22
|
data/CHANGELOG.md
CHANGED
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:
|
|
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:
|
|
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:
|
|
176
|
+
<purl:brands[title=brand-list]/>
|
|
175
177
|
<purl:index/>
|
|
176
178
|
```
|
|
177
|
-
|
|
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:
|
data/lib/tzispa/rig/binder.rb
CHANGED
|
@@ -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)
|
data/lib/tzispa/rig/version.rb
CHANGED
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.
|
|
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-
|
|
11
|
+
date: 2016-11-07 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: tzispa_helpers
|