summaryrefslogtreecommitdiff
path: root/tmpl
diff options
context:
space:
mode:
Diffstat (limited to 'tmpl')
-rw-r--r--tmpl/footer.html3
-rw-r--r--tmpl/header.html18
-rw-r--r--tmpl/kanji-link.html1
-rw-r--r--tmpl/kanji-list.html56
-rw-r--r--tmpl/kanji.html50
-rw-r--r--tmpl/model.html2
-rw-r--r--tmpl/term-list.html68
-rw-r--r--tmpl/term.html41
8 files changed, 119 insertions, 120 deletions
diff --git a/tmpl/footer.html b/tmpl/footer.html
deleted file mode 100644
index 3840600f..00000000
--- a/tmpl/footer.html
+++ /dev/null
@@ -1,3 +0,0 @@
- <script src="{{root}}/js/frame.js"></script>
- </body>
-</html>
diff --git a/tmpl/header.html b/tmpl/header.html
deleted file mode 100644
index b7fad070..00000000
--- a/tmpl/header.html
+++ /dev/null
@@ -1,18 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
- <head>
- <meta charset="UTF-8">
- <title></title>
- <style>
- @font-face {
- font-family: kanji-stroke-orders;
- src: url('{{root}}/ttf/kanji-stroke-orders.ttf');
- }
- @font-face {
- font-family: vl-gothic-regular;
- src: url('{{root}}/ttf/vl-gothic-regular.ttf');
- }
- </style>
- <link rel="stylesheet" href="{{root}}/css/frame.css">
- </head>
- <body>
diff --git a/tmpl/kanji-link.html b/tmpl/kanji-link.html
deleted file mode 100644
index f4f8dc69..00000000
--- a/tmpl/kanji-link.html
+++ /dev/null
@@ -1 +0,0 @@
-<a href="#" class="kanji-link">{{kanji}}</a>
diff --git a/tmpl/kanji-list.html b/tmpl/kanji-list.html
index af38d485..3f6d8084 100644
--- a/tmpl/kanji-list.html
+++ b/tmpl/kanji-list.html
@@ -1,9 +1,59 @@
-{{> header.html}}
+{{#*inline "kanji"}}
+<div class="kanji-definition">
+ <div class="action-bar">
+ {{#if addable}}
+ <a href="#" title="Add Kanji" class="action-add-note pending disabled" data-mode="kanji" data-index="{{@index}}"><img src="img/add_kanji.png"></a>
+ {{/if}}
+ </div>
+
+ <div class="kanji-glyph">{{character}}</div>
+
+ <div class="kanji-reading">
+ <table>
+ <tr>
+ <th>Kunyomi:</th>
+ <td>
+ {{#each kunyomi}}
+ {{.}}{{#unless @last}}, {{/unless}}
+ {{/each}}
+ </td>
+ </tr>
+ <tr>
+ <th>Onyomi:</th>
+ <td>
+ {{#each onyomi}}
+ {{.}}{{#unless @last}}, {{/unless}}
+ {{/each}}
+ </td>
+ </tr>
+ </table>
+ </div>
+
+ <div class="kanji-tags">
+ {{#each tags}}
+ <span class="tag tag-{{category}}" title="{{notes}}">{{name}}</span>
+ {{/each}}
+ </div>
+
+ <div class="kanji-glossary">
+ {{#if glossary.[1]}}
+ <ol "kanji-glossary-group">
+ {{#each glossary}}
+ <li><span class="kanji-glossary-item">{{#multiLine}}{{.}}{{/multiLine}}</span></li>
+ {{/each}}
+ </ol>
+ {{else}}
+ <div class="kanji-glossary-group kanji-glossary-item">{{#multiLine}}{{glossary.[0]}}{{/multiLine}}</div>
+ {{/if}}
+ </div>
+</div>
+{{/inline}}
+
{{#if definitions}}
{{#each definitions}}
- {{> kanji.html addable=../addable root=../root options=../options sequence=../sequence}}
+ {{#unless @first}}<hr>{{/unless}}
+ {{> kanji addable=../addable root=../root}}
{{/each}}
{{else}}
<p>No results found</p>
{{/if}}
-{{> footer.html}}
diff --git a/tmpl/kanji.html b/tmpl/kanji.html
deleted file mode 100644
index e22dd660..00000000
--- a/tmpl/kanji.html
+++ /dev/null
@@ -1,50 +0,0 @@
-<div class="kanji-definition">
- <div class="action-bar" data-sequence="{{sequence}}">
- {{#if addable}}
- <a href="#" title="Add Kanji" class="action-add-note disabled" data-mode="kanji" data-index="{{@index}}"><img src="{{root}}/img/add_kanji.png"></a>
- {{/if}}
- </div>
-
- <div class="kanji-glyph">{{character}}</div>
-
- <div class="kanji-reading">
- <table>
- <tr>
- <th>Kunyomi:</th>
- <td>
- {{#each kunyomi}}
- {{.}}{{#unless @last}}, {{/unless}}
- {{/each}}
- </td>
- </tr>
- <tr>
- <th>Onyomi:</th>
- <td>
- {{#each onyomi}}
- {{.}}{{#unless @last}}, {{/unless}}
- {{/each}}
- </td>
- </tr>
- </table>
- </div>
-
- <div class="kanji-tags">
- {{#each tags}}
- <span class="tag tag-{{category}}" title="{{notes}}">{{name}}</span>
- {{/each}}
- </div>
-
- <div class="kanji-glossary">
- {{#if glossary.[1]}}
- <ol>
- {{#each glossary}}
- <li><span>{{.}}</span></li>
- {{/each}}
- </ol>
- {{else}}
- <p>
- {{glossary.[0]}}
- </p>
- {{/if}}
- </div>
-</div>
diff --git a/tmpl/model.html b/tmpl/model.html
index 94772316..acff44a0 100644
--- a/tmpl/model.html
+++ b/tmpl/model.html
@@ -9,7 +9,7 @@
</button>
<ul class="dropdown-menu dropdown-menu-right">
{{#each markers}}
- <li><a class="marker-link" href="#">{{.}}</a></li>
+ <li><a class="marker-link" href="#">{{.}}</a></li>
{{/each}}
</ul>
</div>
diff --git a/tmpl/term-list.html b/tmpl/term-list.html
index 2088ac71..aae365c7 100644
--- a/tmpl/term-list.html
+++ b/tmpl/term-list.html
@@ -1,9 +1,71 @@
-{{> header.html}}
+{{#*inline "definition"}}
+ {{#if tags}}
+ <div class="term-tags">
+ {{#each tags}}
+ <span class="tag tag-{{category}}" title="{{notes}}">{{name}}</span>
+ {{/each}}
+ </div>
+ {{/if}}
+ {{#if glossary.[1]}}
+ <ul class="term-glossary-group">
+ {{#each glossary}}
+ <li><span class="term-glossary-item">{{#multiLine}}{{.}}{{/multiLine}}</span></li>
+ {{/each}}
+ </ul>
+ {{else}}
+ <div class="term-glossary-group term-glossary-item">{{#multiLine}}{{glossary.[0]}}{{/multiLine}}</div>
+ {{/if}}
+{{/inline}}
+
+{{#*inline "term"}}
+<div class="term-definition">
+ <div class="action-bar">
+ {{#if addable}}
+ <a href="#" title="Add term as expression" class="action-add-note pending disabled" data-mode="term_kanji" data-index="{{@index}}"><img src="img/add_term_kanji.png"></a>
+ <a href="#" title="Add term as reading" class="action-add-note pending disabled" data-mode="term_kana" data-index="{{@index}}"><img src="img/add_term_kana.png"></a>
+ {{/if}}
+ {{#if playback}}
+ <a href="#" title="Play audio" class="action-play-audio" data-index="{{@index}}"><img src="img/play_audio.png"></a>
+ {{/if}}
+ </div>
+
+ {{#if reading}}
+ <div class="term-expression"><ruby>{{#kanjiLinks}}{{expression}}{{/kanjiLinks}}<rt>{{reading}}</rt></ruby></div>
+ {{else}}
+ <div class="term-expression">{{#kanjiLinks}}{{expression}}{{/kanjiLinks}}</div>
+ {{/if}}
+
+ {{#if reasons}}
+ <div class="term-reasons">
+ {{#each reasons}}
+ <span class="reasons">{{.}}</span> {{#unless @last}}&laquo;{{/unless}}
+ {{/each}}
+ </div>
+ {{/if}}
+
+ <div class="term-glossary">
+ {{#if grouped}}
+ {{#if definitions.[1]}}
+ <ol>
+ {{#each definitions}}
+ <li>{{> definition}}</li>
+ {{/each}}
+ </ol>
+ {{else}}
+ {{> definition definitions.[0]}}
+ {{/if}}
+ {{else}}
+ {{> definition}}
+ {{/if}}
+ </div>
+</div>
+{{/inline}}
+
{{#if definitions}}
{{#each definitions}}
- {{> term.html addable=../addable root=../root options=../options sequence=../sequence}}
+ {{#unless @first}}<hr>{{/unless}}
+ {{> term grouped=../grouped addable=../addable playback=../playback}}
{{/each}}
{{else}}
<p>No results found</p>
{{/if}}
-{{> footer.html}}
diff --git a/tmpl/term.html b/tmpl/term.html
deleted file mode 100644
index e4a0d02b..00000000
--- a/tmpl/term.html
+++ /dev/null
@@ -1,41 +0,0 @@
-<div class="term-definition">
- <div class="action-bar" data-sequence="{{sequence}}">
- {{#if options.enableAudioPlayback}}
- <a href="#" title="Play audio" class="action-play-audio" data-index="{{@index}}"><img src="{{root}}/img/play_audio.png"></a>
- {{/if}}
- {{#if addable}}
- <a href="#" title="Add term as expression" class="action-add-note disabled" data-mode="term_kanji" data-index="{{@index}}"><img src="{{root}}/img/add_term_kanji.png"></a>
- <a href="#" title="Add term as reading" class="action-add-note disabled" data-mode="term_kana" data-index="{{@index}}"><img src="{{root}}/img/add_term_kana.png"></a>
- {{/if}}
- </div>
-
- {{#if reading}}
- <div class="term-expression"><ruby>{{#kanjiLinks}}{{expression}}{{/kanjiLinks}}<rt>{{reading}}</rt></ruby></div>
- {{else}}
- <div class="term-expression">{{#kanjiLinks}}{{expression}}{{/kanjiLinks}}</div>
- {{/if}}
-
- <div class="term-reasons">
- {{#each reasons}}
- <span class="reasons">{{.}}</span> {{#unless @last}}&laquo;{{/unless}}
- {{/each}}
- </div>
-
- <div class="term-tags">
- {{#each tags}}
- <span class="tag tag-{{category}}" title="{{notes}}">{{name}}</span>
- {{/each}}
- </div>
-
- <div class="term-glossary">
- {{#if glossary.[1]}}
- <ol>
- {{#each glossary}}
- <li><span>{{.}}</span></li>
- {{/each}}
- </ol>
- {{else}}
- <p>{{glossary.[0]}}</p>
- {{/if}}
- </div>
-</div>