Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(893)

Unified Diff: utils/tests/template/realviews.tmpl

Issue 9695048: Template parser (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Siggi's comments Created 8 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « utils/tests/template/real_app.dart ('k') | utils/tests/template/run » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: utils/tests/template/realviews.tmpl
diff --git a/utils/tests/template/realviews.tmpl b/utils/tests/template/realviews.tmpl
new file mode 100644
index 0000000000000000000000000000000000000000..e2e9338f2f29b1a6baa78a7bd17f4bb7f160b395
--- /dev/null
+++ b/utils/tests/template/realviews.tmpl
@@ -0,0 +1,106 @@
+template DivisionSales(var divisions) {
+ css {
+ .division-item {
+ background-color: #bbb;
+ border-top: 2px solid white;
+ line-height: 20pt;
+ padding-left: 5px;
+ }
+ .product-item {
+ background-color: lightgray;
+ margin-left: 10px;
+ border-top: 2px solid white;
+ line-height: 20pt;
+ }
+ .product-title {
+ position: absolute;
+ left: 45px;
+ }
+ .product-name {
+ font-weight: bold;
+ position: absolute;
+ left: 100px;
+ }
+ .product-users {
+ position: absolute;
+ left: 150px;
+ font-style: italic;
+ color: gray;
+ width: 110px;
+ }
+ .expand-collapse {
+ margin-left: 5px;
+ margin-right: 5px;
+ vertical-align: top;
+ cursor: pointer;
+ }
+ .expand {
+ font-size: 9pt;
+ }
+ .collapse {
+ font-size: 8pt;
+ }
+ .show-sales {
+ display: inherit;
+ }
+ .hide-sales {
+ display: none;
+ }
+ .sales-item {
+ font-family: arial;
+ background-color: lightgray;
+ margin-left: 10px;
+ border-top: 1px solid white;
+ line-height: 18pt;
+ padding-left: 5px;
+ }
+ .ytd-sales {
+ position: absolute;
+ left: 100px;
+ }
+ }
+ <div>
+ ${#each divisions}
+ <div class="division-item">
+ <span>${name}</span>
+ <span>-</span>
+ <span>${id}</span>
+ </div>
+ <div>
+ ${#each divisions.products}
+ <div class="product-item">
+ <span var=productZippy class="expand-collapse expand">&#9660;</span>
+ <span class='product-title'>Product</span>
+ <span class="product-name">${name}</span>
+ <span class="product-users" align=right>${users}&nbsp;users</span>
+ <div class="show-sales">
+ ${#each products.sales}
+ <div class="sales-item">
+ <span>${country}</span>
+ <span class="ytd-sales">\$${yearly}</span>
+ </div>
+ ${/each}
+ </div>
+ </div>
+ ${/each}
+ </div>
+ ${/each}
+ </div>
+}
+
+template Header(String company, Date date) {
+ css {
+ .header {
+ background-color: slateGray;
+ font-family: arial;
+ color: lightgray;
+ font-weight: bold;
+ padding-top: 20px;
+ }
+ }
+ <div class='header' align=center>
+ <h2>${company}</h2>
+ <div align=right>${date}</div>
+ </div>
+}
+
« no previous file with comments | « utils/tests/template/real_app.dart ('k') | utils/tests/template/run » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698