kwartz 3.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/COPYING +340 -0
- data/ChangeLog +103 -0
- data/README.txt +37 -0
- data/bin/kwartz +12 -0
- data/doc-api/classes/Kwartz.html +218 -0
- data/doc-api/classes/Kwartz/Assertion.html +140 -0
- data/doc-api/classes/Kwartz/AssertionError.html +148 -0
- data/doc-api/classes/Kwartz/AttrInfo.html +320 -0
- data/doc-api/classes/Kwartz/BaseError.html +206 -0
- data/doc-api/classes/Kwartz/BaseTranslator.html +331 -0
- data/doc-api/classes/Kwartz/CharacterType.html +212 -0
- data/doc-api/classes/Kwartz/CommandOptionError.html +154 -0
- data/doc-api/classes/Kwartz/CommandOptions.html +374 -0
- data/doc-api/classes/Kwartz/Config.html +150 -0
- data/doc-api/classes/Kwartz/ConvertError.html +191 -0
- data/doc-api/classes/Kwartz/Converter.html +252 -0
- data/doc-api/classes/Kwartz/CssStyleParser.html +483 -0
- data/doc-api/classes/Kwartz/DocumentRuleset.html +369 -0
- data/doc-api/classes/Kwartz/ElementExpander.html +325 -0
- data/doc-api/classes/Kwartz/ElementInfo.html +312 -0
- data/doc-api/classes/Kwartz/ElementRuleset.html +582 -0
- data/doc-api/classes/Kwartz/EperlHandler.html +338 -0
- data/doc-api/classes/Kwartz/EperlTranslator.html +167 -0
- data/doc-api/classes/Kwartz/ErubisHandler.html +113 -0
- data/doc-api/classes/Kwartz/ErubisTranslator.html +168 -0
- data/doc-api/classes/Kwartz/ErubyHandler.html +337 -0
- data/doc-api/classes/Kwartz/ErubyTranslator.html +167 -0
- data/doc-api/classes/Kwartz/ExpandStatement.html +227 -0
- data/doc-api/classes/Kwartz/Expression.html +119 -0
- data/doc-api/classes/Kwartz/Handler.html +558 -0
- data/doc-api/classes/Kwartz/JstlHandler.html +657 -0
- data/doc-api/classes/Kwartz/JstlTranslator.html +226 -0
- data/doc-api/classes/Kwartz/KwartzError.html +146 -0
- data/doc-api/classes/Kwartz/Main.html +384 -0
- data/doc-api/classes/Kwartz/NativeExpression.html +236 -0
- data/doc-api/classes/Kwartz/NativeStatement.html +254 -0
- data/doc-api/classes/Kwartz/Node.html +156 -0
- data/doc-api/classes/Kwartz/ParseError.html +148 -0
- data/doc-api/classes/Kwartz/PhpHandler.html +333 -0
- data/doc-api/classes/Kwartz/PhpTranslator.html +194 -0
- data/doc-api/classes/Kwartz/PresentationLogicParser.html +830 -0
- data/doc-api/classes/Kwartz/PrintStatement.html +221 -0
- data/doc-api/classes/Kwartz/RailsHandler.html +587 -0
- data/doc-api/classes/Kwartz/RailsTranslator.html +167 -0
- data/doc-api/classes/Kwartz/RubyStyleParser.html +558 -0
- data/doc-api/classes/Kwartz/Ruleset.html +117 -0
- data/doc-api/classes/Kwartz/Statement.html +119 -0
- data/doc-api/classes/Kwartz/StrutsTranslator.html +190 -0
- data/doc-api/classes/Kwartz/TagInfo.html +314 -0
- data/doc-api/classes/Kwartz/TextConverter.html +270 -0
- data/doc-api/classes/Kwartz/Translator.html +318 -0
- data/doc-api/classes/Test.html +107 -0
- data/doc-api/classes/Test/Unit.html +101 -0
- data/doc-api/created.rid +1 -0
- data/doc-api/files/__/README_txt.html +150 -0
- data/doc-api/files/kwartz/assert_rb.html +114 -0
- data/doc-api/files/kwartz/binding/eperl_rb.html +116 -0
- data/doc-api/files/kwartz/binding/erubis_rb.html +116 -0
- data/doc-api/files/kwartz/binding/eruby_rb.html +115 -0
- data/doc-api/files/kwartz/binding/jstl_rb.html +116 -0
- data/doc-api/files/kwartz/binding/php_rb.html +116 -0
- data/doc-api/files/kwartz/binding/rails_rb.html +115 -0
- data/doc-api/files/kwartz/binding/struts_rb.html +117 -0
- data/doc-api/files/kwartz/config_rb.html +107 -0
- data/doc-api/files/kwartz/converter_rb.html +119 -0
- data/doc-api/files/kwartz/error_rb.html +107 -0
- data/doc-api/files/kwartz/main_rb.html +124 -0
- data/doc-api/files/kwartz/node_rb.html +114 -0
- data/doc-api/files/kwartz/parser_rb.html +117 -0
- data/doc-api/files/kwartz/translator_rb.html +115 -0
- data/doc-api/files/kwartz/util/assert-text-equal_rb.html +115 -0
- data/doc-api/files/kwartz/util/testcase-helper_rb.html +115 -0
- data/doc-api/files/kwartz_rb.html +120 -0
- data/doc-api/fr_class_index.html +75 -0
- data/doc-api/fr_file_index.html +45 -0
- data/doc-api/fr_method_index.html +216 -0
- data/doc-api/index.html +24 -0
- data/doc-api/rdoc-style.css +208 -0
- data/doc/docstyle.css +188 -0
- data/doc/p-pattern.html +1207 -0
- data/doc/reference.html +3396 -0
- data/doc/users-guide.html +1670 -0
- data/examples/breadcrumbs1/Makefile +15 -0
- data/examples/breadcrumbs1/breadcrumbs.eruby.plogic +27 -0
- data/examples/breadcrumbs1/breadcrumbs.html +12 -0
- data/examples/breadcrumbs1/breadcrumbs.jstl.plogic +28 -0
- data/examples/breadcrumbs1/breadcrumbs.php.plogic +26 -0
- data/examples/breadcrumbs1/main.php +12 -0
- data/examples/breadcrumbs1/main.rb +12 -0
- data/examples/breadcrumbs2/Makefile +15 -0
- data/examples/breadcrumbs2/breadcrumbs.eruby.plogic +22 -0
- data/examples/breadcrumbs2/breadcrumbs.html +14 -0
- data/examples/breadcrumbs2/breadcrumbs.jstl.plogic +24 -0
- data/examples/breadcrumbs2/breadcrumbs.php.plogic +23 -0
- data/examples/breadcrumbs2/main.php +12 -0
- data/examples/breadcrumbs2/main.rb +12 -0
- data/examples/pagelayout/Makefile +47 -0
- data/examples/pagelayout/content.eruby.plogic +44 -0
- data/examples/pagelayout/content.jstl.plogic +36 -0
- data/examples/pagelayout/content.php.plogic +37 -0
- data/examples/pagelayout/content1.html +36 -0
- data/examples/pagelayout/content2.html +29 -0
- data/examples/pagelayout/design.css +40 -0
- data/examples/pagelayout/layout.html +50 -0
- data/examples/pagelayout/main.php +55 -0
- data/examples/pagelayout/main.rb +77 -0
- data/examples/pagelayout/menu.eruby.plogic +14 -0
- data/examples/pagelayout/menu.html +13 -0
- data/examples/pagelayout/menu.jstl.plogic +14 -0
- data/examples/pagelayout/menu.php.plogic +14 -0
- data/examples/rails1/Makefile +36 -0
- data/examples/rails1/README +19 -0
- data/examples/rails1/application_helper.rb +31 -0
- data/examples/rails1/edit.html +28 -0
- data/examples/rails1/edit.plogic +10 -0
- data/examples/rails1/form.html +52 -0
- data/examples/rails1/form.plogic +33 -0
- data/examples/rails1/layout.plogic +15 -0
- data/examples/rails1/link_to.plogic +19 -0
- data/examples/rails1/list.html +48 -0
- data/examples/rails1/list.plogic +28 -0
- data/examples/rails1/new.html +27 -0
- data/examples/rails1/new.plogic +10 -0
- data/examples/rails1/reader.plogic +29 -0
- data/examples/rails1/show.html +40 -0
- data/examples/rails1/show.plogic +4 -0
- data/examples/rails1/writer.plogic +8 -0
- data/examples/table1/Makefile +15 -0
- data/examples/table1/main.php +11 -0
- data/examples/table1/main.rb +11 -0
- data/examples/table1/table1.eruby.plogic +21 -0
- data/examples/table1/table1.html +16 -0
- data/examples/table1/table1.jstl.plogic +21 -0
- data/examples/table1/table1.php.plogic +22 -0
- data/kwartz.gemspec +55 -0
- data/lib/kwartz.rb +13 -0
- data/lib/kwartz/assert.rb +31 -0
- data/lib/kwartz/binding/eperl.rb +166 -0
- data/lib/kwartz/binding/erubis.rb +61 -0
- data/lib/kwartz/binding/eruby.rb +164 -0
- data/lib/kwartz/binding/jstl.rb +334 -0
- data/lib/kwartz/binding/php.rb +167 -0
- data/lib/kwartz/binding/rails.rb +295 -0
- data/lib/kwartz/binding/struts.rb +109 -0
- data/lib/kwartz/config.rb +28 -0
- data/lib/kwartz/converter.rb +920 -0
- data/lib/kwartz/error.rb +41 -0
- data/lib/kwartz/main.rb +464 -0
- data/lib/kwartz/node.rb +454 -0
- data/lib/kwartz/parser.rb +903 -0
- data/lib/kwartz/translator.rb +153 -0
- data/lib/kwartz/util/assert-text-equal.rb +44 -0
- data/lib/kwartz/util/testcase-helper.rb +112 -0
- data/setup.rb +1331 -0
- data/test/test-compile.rb +36 -0
- data/test/test-compile.yaml +178 -0
- data/test/test-converter.rb +34 -0
- data/test/test-converter.yaml +127 -0
- data/test/test-directives.rb +32 -0
- data/test/test-directives.yaml +1411 -0
- data/test/test-main.rb +464 -0
- data/test/test-parser.rb +54 -0
- data/test/test-parser.yaml +394 -0
- data/test/test-rails.rb +28 -0
- data/test/test-rails.yaml +301 -0
- data/test/test-ruleset.rb +36 -0
- data/test/test-ruleset.yaml +804 -0
- data/test/test.rb +44 -0
- metadata +236 -0
@@ -0,0 +1,15 @@
|
|
1
|
+
ALL = breadcrumbs.rhtml breadcrumbs.php breadcrumbs.jsp
|
2
|
+
|
3
|
+
all: ${ALL}
|
4
|
+
|
5
|
+
clean:
|
6
|
+
rm -f ${ALL}
|
7
|
+
|
8
|
+
breadcrumbs.rhtml: breadcrumbs.eruby.plogic breadcrumbs.html
|
9
|
+
kwartz -l eruby -p breadcrumbs.eruby.plogic breadcrumbs.html > breadcrumbs.rhtml
|
10
|
+
|
11
|
+
breadcrumbs.php: breadcrumbs.php.plogic breadcrumbs.html
|
12
|
+
kwartz -l php -p breadcrumbs.php.plogic breadcrumbs.html > breadcrumbs.php
|
13
|
+
|
14
|
+
breadcrumbs.jsp: breadcrumbs.jstl.plogic breadcrumbs.html
|
15
|
+
kwartz -l jstl -p breadcrumbs.jstl.plogic breadcrumbs.html > breadcrumbs.jsp
|
@@ -0,0 +1,27 @@
|
|
1
|
+
#breadcrumbs {
|
2
|
+
logic: {
|
3
|
+
i = 0
|
4
|
+
for item in breadcrumbs
|
5
|
+
i += 1
|
6
|
+
if i > 1
|
7
|
+
_content('separator')
|
8
|
+
end
|
9
|
+
_element('item')
|
10
|
+
end
|
11
|
+
}
|
12
|
+
}
|
13
|
+
|
14
|
+
#item {
|
15
|
+
value: item[:title];
|
16
|
+
attrs: "href" item[:path];
|
17
|
+
logic: {
|
18
|
+
if item[:path]
|
19
|
+
_stag
|
20
|
+
_cont
|
21
|
+
_etag
|
22
|
+
else
|
23
|
+
_cont
|
24
|
+
end
|
25
|
+
}
|
26
|
+
}
|
27
|
+
|
@@ -0,0 +1,28 @@
|
|
1
|
+
#breadcrumbs {
|
2
|
+
logic: {
|
3
|
+
<c:forEach var="item" items="${breadcrumbs}" varStatus="loop">
|
4
|
+
<c:if test="${loop.count != 1}">
|
5
|
+
_content('separator')
|
6
|
+
</c:if>
|
7
|
+
_element('item')
|
8
|
+
</c:forEach>
|
9
|
+
}
|
10
|
+
}
|
11
|
+
|
12
|
+
#item {
|
13
|
+
value: item.title;
|
14
|
+
attrs: "href" item.path;
|
15
|
+
logic: {
|
16
|
+
<c:choose>
|
17
|
+
<c:when test="${ !empty item.path }">
|
18
|
+
_stag
|
19
|
+
_cont
|
20
|
+
_etag
|
21
|
+
</c:when>
|
22
|
+
<c:otherwise>
|
23
|
+
_cont
|
24
|
+
</c:otherwise>
|
25
|
+
</c:choose>
|
26
|
+
}
|
27
|
+
}
|
28
|
+
|
@@ -0,0 +1,26 @@
|
|
1
|
+
#breadcrumbs {
|
2
|
+
logic: {
|
3
|
+
$i = 0;
|
4
|
+
foreach ($breadcrumbs as $item) {
|
5
|
+
if (++$i > 1) {
|
6
|
+
_content('separator');
|
7
|
+
}
|
8
|
+
_element('item');
|
9
|
+
}
|
10
|
+
}
|
11
|
+
}
|
12
|
+
|
13
|
+
#item {
|
14
|
+
value: $item['title'];
|
15
|
+
attrs: "href" $item['path'];
|
16
|
+
logic: {
|
17
|
+
if ($item['path']) {
|
18
|
+
_stag();
|
19
|
+
_cont();
|
20
|
+
_etag();
|
21
|
+
} else {
|
22
|
+
_cont();
|
23
|
+
}
|
24
|
+
}
|
25
|
+
}
|
26
|
+
|
@@ -0,0 +1,12 @@
|
|
1
|
+
<?php
|
2
|
+
|
3
|
+
$breadcrumbs = array(
|
4
|
+
array('title'=>'TOP', 'path'=>'/'),
|
5
|
+
array('title'=>'Kwartz', 'path'=>'/kwartz'),
|
6
|
+
array('title'=>'Examples', 'path'=>'/kwartz/examples'),
|
7
|
+
array('title'=>'breadcrumbs', 'path'=>null),
|
8
|
+
);
|
9
|
+
|
10
|
+
include('breadcrumbs.php');
|
11
|
+
|
12
|
+
?>
|
@@ -0,0 +1,12 @@
|
|
1
|
+
breadcrumbs = [
|
2
|
+
{ :title=>'TOP', :path=>'/' },
|
3
|
+
{ :title=>'Kwartz', :path=>'/kwartz' },
|
4
|
+
{ :title=>'Examples', :path=>'/kwartz/examples' },
|
5
|
+
{ :title=>'breadcrumbs', :path=>nil },
|
6
|
+
]
|
7
|
+
|
8
|
+
require 'erb'
|
9
|
+
str = File.read('breadcrumbs.rhtml')
|
10
|
+
trim_mode = 1
|
11
|
+
erb = ERB.new(str, $SAFE, trim_mode)
|
12
|
+
print erb.result(binding())
|
@@ -0,0 +1,15 @@
|
|
1
|
+
ALL = breadcrumbs.rhtml breadcrumbs.php breadcrumbs.jsp
|
2
|
+
|
3
|
+
all: ${ALL}
|
4
|
+
|
5
|
+
clean:
|
6
|
+
rm -f ${ALL}
|
7
|
+
|
8
|
+
breadcrumbs.rhtml: breadcrumbs.eruby.plogic breadcrumbs.html
|
9
|
+
kwartz -l eruby -p breadcrumbs.eruby.plogic breadcrumbs.html > breadcrumbs.rhtml
|
10
|
+
|
11
|
+
breadcrumbs.php: breadcrumbs.php.plogic breadcrumbs.html
|
12
|
+
kwartz -l php -p breadcrumbs.php.plogic breadcrumbs.html > breadcrumbs.php
|
13
|
+
|
14
|
+
breadcrumbs.jsp: breadcrumbs.jstl.plogic breadcrumbs.html
|
15
|
+
kwartz -l jstl -p breadcrumbs.jstl.plogic breadcrumbs.html > breadcrumbs.jsp
|
@@ -0,0 +1,22 @@
|
|
1
|
+
#breadcrumbs {
|
2
|
+
logic: {
|
3
|
+
last_index = breadcrumbs.length - 1
|
4
|
+
breadcrumbs.each_with_index do |item, i|
|
5
|
+
if i < last_index
|
6
|
+
_content('item1')
|
7
|
+
else
|
8
|
+
_content('item2')
|
9
|
+
end
|
10
|
+
end
|
11
|
+
}
|
12
|
+
}
|
13
|
+
|
14
|
+
#anchor {
|
15
|
+
value: item[:title];
|
16
|
+
attrs: "href" item[:path];
|
17
|
+
}
|
18
|
+
|
19
|
+
#item2 {
|
20
|
+
value: item[:title];
|
21
|
+
}
|
22
|
+
|
@@ -0,0 +1,24 @@
|
|
1
|
+
#breadcrumbs {
|
2
|
+
logic: {
|
3
|
+
<c:forEach var="item" items="${breadcrumbs}" varStatus="loop">
|
4
|
+
<c:choose>
|
5
|
+
<c:when test="${loop.last}">
|
6
|
+
_element('item2')
|
7
|
+
</c:when>
|
8
|
+
<c:otherwise>
|
9
|
+
_element('item1')
|
10
|
+
</c:otherwise>
|
11
|
+
</c:choose>
|
12
|
+
</c:forEach>
|
13
|
+
}
|
14
|
+
}
|
15
|
+
|
16
|
+
#anchor {
|
17
|
+
value: item.title;
|
18
|
+
attrs: "href" item.path;
|
19
|
+
}
|
20
|
+
|
21
|
+
#item2 {
|
22
|
+
value: item.title;
|
23
|
+
}
|
24
|
+
|
@@ -0,0 +1,23 @@
|
|
1
|
+
#breadcrumbs {
|
2
|
+
logic: {
|
3
|
+
$last_index = count($breadcrumbs) - 1;
|
4
|
+
$i = 0;
|
5
|
+
foreach ($breadcrumbs as $item) {
|
6
|
+
if ($i++ < $last_index) {
|
7
|
+
_content('item1');
|
8
|
+
} else {
|
9
|
+
_content('item2');
|
10
|
+
}
|
11
|
+
}
|
12
|
+
}
|
13
|
+
}
|
14
|
+
|
15
|
+
#anchor {
|
16
|
+
value: $item['title'];
|
17
|
+
attrs: "href" $item['path'];
|
18
|
+
}
|
19
|
+
|
20
|
+
#item2 {
|
21
|
+
value: $item['title'];
|
22
|
+
}
|
23
|
+
|
@@ -0,0 +1,12 @@
|
|
1
|
+
<?php
|
2
|
+
|
3
|
+
$breadcrumbs = array(
|
4
|
+
array('title'=>'TOP', 'path'=>'/'),
|
5
|
+
array('title'=>'Kwartz', 'path'=>'/kwartz'),
|
6
|
+
array('title'=>'Examples', 'path'=>'/kwartz/examples'),
|
7
|
+
array('title'=>'breadcrumbs', 'path'=>null),
|
8
|
+
);
|
9
|
+
|
10
|
+
include('breadcrumbs.php');
|
11
|
+
|
12
|
+
?>
|
@@ -0,0 +1,12 @@
|
|
1
|
+
breadcrumbs = [
|
2
|
+
{ :title=>'TOP', :path=>'/' },
|
3
|
+
{ :title=>'Kwartz', :path=>'/kwartz' },
|
4
|
+
{ :title=>'Examples', :path=>'/kwartz/examples' },
|
5
|
+
{ :title=>'breadcrumbs', :path=>nil },
|
6
|
+
]
|
7
|
+
|
8
|
+
require 'erb'
|
9
|
+
str = File.read('breadcrumbs.rhtml')
|
10
|
+
trim_mode = 1
|
11
|
+
erb = ERB.new(str, $SAFE, trim_mode)
|
12
|
+
print erb.result(binding())
|
@@ -0,0 +1,47 @@
|
|
1
|
+
ALL = content1.rhtml content2.rhtml content1.php content2.php content1.jsp content2.jsp
|
2
|
+
|
3
|
+
all: ${ALL}
|
4
|
+
|
5
|
+
clean:
|
6
|
+
rm -f ${ALL}
|
7
|
+
|
8
|
+
##
|
9
|
+
|
10
|
+
result1.eruby.html: main.rb result1.rhtml
|
11
|
+
ruby main.rb > result1.eruby.html
|
12
|
+
|
13
|
+
result2.eruby.html: main.rb result2.rhtml
|
14
|
+
ruby main.rb AAPL > result2.eruby.html
|
15
|
+
|
16
|
+
result1.php.html: main.php result1.rhtml
|
17
|
+
ruby main.php > result1.php.html
|
18
|
+
|
19
|
+
result2.php.html: main.php result2.rhtml
|
20
|
+
ruby main.php AAPL > result2.php.html
|
21
|
+
|
22
|
+
##
|
23
|
+
|
24
|
+
content1.rhtml: content.eruby.plogic content1.html \
|
25
|
+
menu.eruby.plogic menu.html layout.html
|
26
|
+
kwartz -l eruby -p content.eruby,menu.eruby -i menu.html -L layout.html content1.html > content1.rhtml
|
27
|
+
|
28
|
+
content2.rhtml: content.eruby.plogic content2.html \
|
29
|
+
menu.eruby.plogic menu.html layout.html
|
30
|
+
kwartz -l eruby -p content.eruby,menu.eruby -i menu.html -L layout.html content2.html > content2.rhtml
|
31
|
+
|
32
|
+
content1.php: content.php.plogic content1.html \
|
33
|
+
menu.php.plogic menu.html layout.html
|
34
|
+
kwartz -l php -p content.php,menu.php -i menu.html -L layout.html content1.html > content1.php
|
35
|
+
|
36
|
+
content2.php: content.php.plogic content2.html \
|
37
|
+
menu.php.plogic menu.html layout.html
|
38
|
+
kwartz -l php -p content.php,menu.php -i menu.html -L layout.html content2.html > content2.php
|
39
|
+
|
40
|
+
content1.jsp: content.jstl.plogic content1.html \
|
41
|
+
menu.jstl.plogic menu.html layout.html
|
42
|
+
kwartz -l jstl -p content.jstl,menu.jstl -i menu.html -L layout.html content1.html > content1.jsp
|
43
|
+
|
44
|
+
content2.jsp: content.jstl.plogic content2.html \
|
45
|
+
menu.jstl.plogic menu.html layout.html
|
46
|
+
kwartz -l jstl -p content.jstl,menu.jstl -i menu.html -L layout.html content2.html > content2.jsp
|
47
|
+
|
@@ -0,0 +1,44 @@
|
|
1
|
+
#stocks {
|
2
|
+
logic: {
|
3
|
+
@stocks.each do |stock|
|
4
|
+
_elem
|
5
|
+
end
|
6
|
+
}
|
7
|
+
}
|
8
|
+
|
9
|
+
#stock {
|
10
|
+
logic: {
|
11
|
+
stock = @stock
|
12
|
+
_elem
|
13
|
+
}
|
14
|
+
}
|
15
|
+
|
16
|
+
#stock_symbol {
|
17
|
+
value: stock[:symbol];
|
18
|
+
}
|
19
|
+
|
20
|
+
#stock_symbol_link {
|
21
|
+
value: stock[:symbol];
|
22
|
+
attrs: 'href' "?symbol=#{stock[:symbol]}";
|
23
|
+
}
|
24
|
+
|
25
|
+
#stock_company {
|
26
|
+
Value: stock[:company];
|
27
|
+
}
|
28
|
+
|
29
|
+
#stock_price {
|
30
|
+
value: stock[:price];
|
31
|
+
}
|
32
|
+
|
33
|
+
#stock_rate {
|
34
|
+
value: "#{stock[:rate]}%";
|
35
|
+
append: klass;
|
36
|
+
logic: {
|
37
|
+
if stock[:rate] < 0.0
|
38
|
+
klass = ' class="minus"'
|
39
|
+
else
|
40
|
+
klass = ''
|
41
|
+
end
|
42
|
+
_elem
|
43
|
+
}
|
44
|
+
}
|
@@ -0,0 +1,36 @@
|
|
1
|
+
#stocks {
|
2
|
+
logic: {
|
3
|
+
<c:forEach var="stock" items="${stocks}">
|
4
|
+
_elem;
|
5
|
+
</c:forEach>
|
6
|
+
}
|
7
|
+
}
|
8
|
+
|
9
|
+
#stock_symbol {
|
10
|
+
value: stock.symbol;
|
11
|
+
}
|
12
|
+
|
13
|
+
#stock_symbol_link {
|
14
|
+
value: stock.symbol;
|
15
|
+
attrs: 'href' "?symbol=${stock.symbol}";
|
16
|
+
}
|
17
|
+
|
18
|
+
#stock_company {
|
19
|
+
Value: stock.company;
|
20
|
+
}
|
21
|
+
|
22
|
+
#stock_price {
|
23
|
+
value: stock.price;
|
24
|
+
}
|
25
|
+
|
26
|
+
#stock_rate {
|
27
|
+
value: "${stock.rate}%";
|
28
|
+
append: klass;
|
29
|
+
logic: {
|
30
|
+
<c:set var="klass" value=""/>
|
31
|
+
<c:if test="${stock.rate lt 0.0}">
|
32
|
+
<c:set var="klass" value=" class='minus'"/>
|
33
|
+
</c:if>
|
34
|
+
_elem;
|
35
|
+
}
|
36
|
+
}
|
@@ -0,0 +1,37 @@
|
|
1
|
+
#stocks {
|
2
|
+
logic: {
|
3
|
+
foreach ($stocks as $stock) {
|
4
|
+
_elem();
|
5
|
+
}
|
6
|
+
}
|
7
|
+
}
|
8
|
+
|
9
|
+
#stock_symbol {
|
10
|
+
value: $stock['symbol'];
|
11
|
+
}
|
12
|
+
|
13
|
+
#stock_symbol_link {
|
14
|
+
value: $stock['symbol'];
|
15
|
+
attrs: 'href' "?symbol={$stock['symbol']}";
|
16
|
+
}
|
17
|
+
|
18
|
+
#stock_company {
|
19
|
+
Value: $stock['company'];
|
20
|
+
}
|
21
|
+
|
22
|
+
#stock_price {
|
23
|
+
value: $stock['price'];
|
24
|
+
}
|
25
|
+
|
26
|
+
#stock_rate {
|
27
|
+
value: "{$stock['rate']}%";
|
28
|
+
append: $klass;
|
29
|
+
logic: {
|
30
|
+
if ($stock['rate'] < 0.0) {
|
31
|
+
$klass = ' class="minus"';
|
32
|
+
} else {
|
33
|
+
$klass = '';
|
34
|
+
}
|
35
|
+
_elem();
|
36
|
+
}
|
37
|
+
}
|