kwartz 3.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (169) hide show
  1. data/COPYING +340 -0
  2. data/ChangeLog +103 -0
  3. data/README.txt +37 -0
  4. data/bin/kwartz +12 -0
  5. data/doc-api/classes/Kwartz.html +218 -0
  6. data/doc-api/classes/Kwartz/Assertion.html +140 -0
  7. data/doc-api/classes/Kwartz/AssertionError.html +148 -0
  8. data/doc-api/classes/Kwartz/AttrInfo.html +320 -0
  9. data/doc-api/classes/Kwartz/BaseError.html +206 -0
  10. data/doc-api/classes/Kwartz/BaseTranslator.html +331 -0
  11. data/doc-api/classes/Kwartz/CharacterType.html +212 -0
  12. data/doc-api/classes/Kwartz/CommandOptionError.html +154 -0
  13. data/doc-api/classes/Kwartz/CommandOptions.html +374 -0
  14. data/doc-api/classes/Kwartz/Config.html +150 -0
  15. data/doc-api/classes/Kwartz/ConvertError.html +191 -0
  16. data/doc-api/classes/Kwartz/Converter.html +252 -0
  17. data/doc-api/classes/Kwartz/CssStyleParser.html +483 -0
  18. data/doc-api/classes/Kwartz/DocumentRuleset.html +369 -0
  19. data/doc-api/classes/Kwartz/ElementExpander.html +325 -0
  20. data/doc-api/classes/Kwartz/ElementInfo.html +312 -0
  21. data/doc-api/classes/Kwartz/ElementRuleset.html +582 -0
  22. data/doc-api/classes/Kwartz/EperlHandler.html +338 -0
  23. data/doc-api/classes/Kwartz/EperlTranslator.html +167 -0
  24. data/doc-api/classes/Kwartz/ErubisHandler.html +113 -0
  25. data/doc-api/classes/Kwartz/ErubisTranslator.html +168 -0
  26. data/doc-api/classes/Kwartz/ErubyHandler.html +337 -0
  27. data/doc-api/classes/Kwartz/ErubyTranslator.html +167 -0
  28. data/doc-api/classes/Kwartz/ExpandStatement.html +227 -0
  29. data/doc-api/classes/Kwartz/Expression.html +119 -0
  30. data/doc-api/classes/Kwartz/Handler.html +558 -0
  31. data/doc-api/classes/Kwartz/JstlHandler.html +657 -0
  32. data/doc-api/classes/Kwartz/JstlTranslator.html +226 -0
  33. data/doc-api/classes/Kwartz/KwartzError.html +146 -0
  34. data/doc-api/classes/Kwartz/Main.html +384 -0
  35. data/doc-api/classes/Kwartz/NativeExpression.html +236 -0
  36. data/doc-api/classes/Kwartz/NativeStatement.html +254 -0
  37. data/doc-api/classes/Kwartz/Node.html +156 -0
  38. data/doc-api/classes/Kwartz/ParseError.html +148 -0
  39. data/doc-api/classes/Kwartz/PhpHandler.html +333 -0
  40. data/doc-api/classes/Kwartz/PhpTranslator.html +194 -0
  41. data/doc-api/classes/Kwartz/PresentationLogicParser.html +830 -0
  42. data/doc-api/classes/Kwartz/PrintStatement.html +221 -0
  43. data/doc-api/classes/Kwartz/RailsHandler.html +587 -0
  44. data/doc-api/classes/Kwartz/RailsTranslator.html +167 -0
  45. data/doc-api/classes/Kwartz/RubyStyleParser.html +558 -0
  46. data/doc-api/classes/Kwartz/Ruleset.html +117 -0
  47. data/doc-api/classes/Kwartz/Statement.html +119 -0
  48. data/doc-api/classes/Kwartz/StrutsTranslator.html +190 -0
  49. data/doc-api/classes/Kwartz/TagInfo.html +314 -0
  50. data/doc-api/classes/Kwartz/TextConverter.html +270 -0
  51. data/doc-api/classes/Kwartz/Translator.html +318 -0
  52. data/doc-api/classes/Test.html +107 -0
  53. data/doc-api/classes/Test/Unit.html +101 -0
  54. data/doc-api/created.rid +1 -0
  55. data/doc-api/files/__/README_txt.html +150 -0
  56. data/doc-api/files/kwartz/assert_rb.html +114 -0
  57. data/doc-api/files/kwartz/binding/eperl_rb.html +116 -0
  58. data/doc-api/files/kwartz/binding/erubis_rb.html +116 -0
  59. data/doc-api/files/kwartz/binding/eruby_rb.html +115 -0
  60. data/doc-api/files/kwartz/binding/jstl_rb.html +116 -0
  61. data/doc-api/files/kwartz/binding/php_rb.html +116 -0
  62. data/doc-api/files/kwartz/binding/rails_rb.html +115 -0
  63. data/doc-api/files/kwartz/binding/struts_rb.html +117 -0
  64. data/doc-api/files/kwartz/config_rb.html +107 -0
  65. data/doc-api/files/kwartz/converter_rb.html +119 -0
  66. data/doc-api/files/kwartz/error_rb.html +107 -0
  67. data/doc-api/files/kwartz/main_rb.html +124 -0
  68. data/doc-api/files/kwartz/node_rb.html +114 -0
  69. data/doc-api/files/kwartz/parser_rb.html +117 -0
  70. data/doc-api/files/kwartz/translator_rb.html +115 -0
  71. data/doc-api/files/kwartz/util/assert-text-equal_rb.html +115 -0
  72. data/doc-api/files/kwartz/util/testcase-helper_rb.html +115 -0
  73. data/doc-api/files/kwartz_rb.html +120 -0
  74. data/doc-api/fr_class_index.html +75 -0
  75. data/doc-api/fr_file_index.html +45 -0
  76. data/doc-api/fr_method_index.html +216 -0
  77. data/doc-api/index.html +24 -0
  78. data/doc-api/rdoc-style.css +208 -0
  79. data/doc/docstyle.css +188 -0
  80. data/doc/p-pattern.html +1207 -0
  81. data/doc/reference.html +3396 -0
  82. data/doc/users-guide.html +1670 -0
  83. data/examples/breadcrumbs1/Makefile +15 -0
  84. data/examples/breadcrumbs1/breadcrumbs.eruby.plogic +27 -0
  85. data/examples/breadcrumbs1/breadcrumbs.html +12 -0
  86. data/examples/breadcrumbs1/breadcrumbs.jstl.plogic +28 -0
  87. data/examples/breadcrumbs1/breadcrumbs.php.plogic +26 -0
  88. data/examples/breadcrumbs1/main.php +12 -0
  89. data/examples/breadcrumbs1/main.rb +12 -0
  90. data/examples/breadcrumbs2/Makefile +15 -0
  91. data/examples/breadcrumbs2/breadcrumbs.eruby.plogic +22 -0
  92. data/examples/breadcrumbs2/breadcrumbs.html +14 -0
  93. data/examples/breadcrumbs2/breadcrumbs.jstl.plogic +24 -0
  94. data/examples/breadcrumbs2/breadcrumbs.php.plogic +23 -0
  95. data/examples/breadcrumbs2/main.php +12 -0
  96. data/examples/breadcrumbs2/main.rb +12 -0
  97. data/examples/pagelayout/Makefile +47 -0
  98. data/examples/pagelayout/content.eruby.plogic +44 -0
  99. data/examples/pagelayout/content.jstl.plogic +36 -0
  100. data/examples/pagelayout/content.php.plogic +37 -0
  101. data/examples/pagelayout/content1.html +36 -0
  102. data/examples/pagelayout/content2.html +29 -0
  103. data/examples/pagelayout/design.css +40 -0
  104. data/examples/pagelayout/layout.html +50 -0
  105. data/examples/pagelayout/main.php +55 -0
  106. data/examples/pagelayout/main.rb +77 -0
  107. data/examples/pagelayout/menu.eruby.plogic +14 -0
  108. data/examples/pagelayout/menu.html +13 -0
  109. data/examples/pagelayout/menu.jstl.plogic +14 -0
  110. data/examples/pagelayout/menu.php.plogic +14 -0
  111. data/examples/rails1/Makefile +36 -0
  112. data/examples/rails1/README +19 -0
  113. data/examples/rails1/application_helper.rb +31 -0
  114. data/examples/rails1/edit.html +28 -0
  115. data/examples/rails1/edit.plogic +10 -0
  116. data/examples/rails1/form.html +52 -0
  117. data/examples/rails1/form.plogic +33 -0
  118. data/examples/rails1/layout.plogic +15 -0
  119. data/examples/rails1/link_to.plogic +19 -0
  120. data/examples/rails1/list.html +48 -0
  121. data/examples/rails1/list.plogic +28 -0
  122. data/examples/rails1/new.html +27 -0
  123. data/examples/rails1/new.plogic +10 -0
  124. data/examples/rails1/reader.plogic +29 -0
  125. data/examples/rails1/show.html +40 -0
  126. data/examples/rails1/show.plogic +4 -0
  127. data/examples/rails1/writer.plogic +8 -0
  128. data/examples/table1/Makefile +15 -0
  129. data/examples/table1/main.php +11 -0
  130. data/examples/table1/main.rb +11 -0
  131. data/examples/table1/table1.eruby.plogic +21 -0
  132. data/examples/table1/table1.html +16 -0
  133. data/examples/table1/table1.jstl.plogic +21 -0
  134. data/examples/table1/table1.php.plogic +22 -0
  135. data/kwartz.gemspec +55 -0
  136. data/lib/kwartz.rb +13 -0
  137. data/lib/kwartz/assert.rb +31 -0
  138. data/lib/kwartz/binding/eperl.rb +166 -0
  139. data/lib/kwartz/binding/erubis.rb +61 -0
  140. data/lib/kwartz/binding/eruby.rb +164 -0
  141. data/lib/kwartz/binding/jstl.rb +334 -0
  142. data/lib/kwartz/binding/php.rb +167 -0
  143. data/lib/kwartz/binding/rails.rb +295 -0
  144. data/lib/kwartz/binding/struts.rb +109 -0
  145. data/lib/kwartz/config.rb +28 -0
  146. data/lib/kwartz/converter.rb +920 -0
  147. data/lib/kwartz/error.rb +41 -0
  148. data/lib/kwartz/main.rb +464 -0
  149. data/lib/kwartz/node.rb +454 -0
  150. data/lib/kwartz/parser.rb +903 -0
  151. data/lib/kwartz/translator.rb +153 -0
  152. data/lib/kwartz/util/assert-text-equal.rb +44 -0
  153. data/lib/kwartz/util/testcase-helper.rb +112 -0
  154. data/setup.rb +1331 -0
  155. data/test/test-compile.rb +36 -0
  156. data/test/test-compile.yaml +178 -0
  157. data/test/test-converter.rb +34 -0
  158. data/test/test-converter.yaml +127 -0
  159. data/test/test-directives.rb +32 -0
  160. data/test/test-directives.yaml +1411 -0
  161. data/test/test-main.rb +464 -0
  162. data/test/test-parser.rb +54 -0
  163. data/test/test-parser.yaml +394 -0
  164. data/test/test-rails.rb +28 -0
  165. data/test/test-rails.yaml +301 -0
  166. data/test/test-ruleset.rb +36 -0
  167. data/test/test-ruleset.yaml +804 -0
  168. data/test/test.rb +44 -0
  169. 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,12 @@
1
+ <html>
2
+ <body>
3
+
4
+ <div id="mark:breadcrumbs">
5
+ <a href="/" id="mark:item">top</a> <span id="mark:separator"> &lt; </span>
6
+ <a href="/aaa">Aaa</a> &lt;
7
+ <a href="/aaa/bbb">Bbb</a> &lt;
8
+ ccc
9
+ </div>
10
+
11
+ </body>
12
+ </html>
@@ -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,14 @@
1
+ <html>
2
+ <body>
3
+
4
+ <div id="mark:breadcrumbs">
5
+ <span id="mark:item1">
6
+ <a href="/" id="mark:anchor">top</a> &lt;
7
+ </span>
8
+ <span id="mark:item2">
9
+ Kwartz
10
+ </span>
11
+ </div>
12
+
13
+ </body>
14
+ </html>
@@ -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
+ }