From 60e23ab42c86fbc74a6e16d6fd29fcc6761bfb36 Mon Sep 17 00:00:00 2001 From: Alex Yatskov Date: Sun, 8 Jan 2017 22:44:13 -0800 Subject: simplify templates --- tmpl/kanji-list.html | 53 +++++++++++++++++++++++++++++++++++- tmpl/kanji.html | 48 --------------------------------- tmpl/term-definition.html | 16 ----------- tmpl/term-grouped-list.html | 8 ------ tmpl/term-grouped.html | 37 -------------------------- tmpl/term-list.html | 65 ++++++++++++++++++++++++++++++++++++++++++++- tmpl/term.html | 29 -------------------- 7 files changed, 116 insertions(+), 140 deletions(-) delete mode 100644 tmpl/kanji.html delete mode 100644 tmpl/term-definition.html delete mode 100644 tmpl/term-grouped-list.html delete mode 100644 tmpl/term-grouped.html delete mode 100644 tmpl/term.html (limited to 'tmpl') diff --git a/tmpl/kanji-list.html b/tmpl/kanji-list.html index 1df22e68..ffc25c24 100644 --- a/tmpl/kanji-list.html +++ b/tmpl/kanji-list.html @@ -1,7 +1,58 @@ +{{#*inline kanji}} +
+
+ {{#if addable}} + + {{/if}} +
+ +
{{character}}
+ +
+ + + + + + + + + +
Kunyomi: + {{#each kunyomi}} + {{.}}{{#unless @last}}, {{/unless}} + {{/each}} +
Onyomi: + {{#each onyomi}} + {{.}}{{#unless @last}}, {{/unless}} + {{/each}} +
+
+ +
+ {{#each tags}} + {{name}} + {{/each}} +
+ +
+ {{#if glossary.[1]}} +
    + {{#each glossary}} +
  1. {{.}}
  2. + {{/each}} +
+ {{else}} +
{{glossary.[0]}}
+ {{/if}} +
+
+{{/inline}} + {{#if definitions}} {{#each definitions}} {{#unless @first}}
{{/unless}} - {{> kanji.html addable=../addable root=../root}} + {{> kanji addable=../addable root=../root}} {{/each}} {{else}}

No results found

diff --git a/tmpl/kanji.html b/tmpl/kanji.html deleted file mode 100644 index bb4ce61f..00000000 --- a/tmpl/kanji.html +++ /dev/null @@ -1,48 +0,0 @@ -
-
- {{#if addable}} - - {{/if}} -
- -
{{character}}
- -
- - - - - - - - - -
Kunyomi: - {{#each kunyomi}} - {{.}}{{#unless @last}}, {{/unless}} - {{/each}} -
Onyomi: - {{#each onyomi}} - {{.}}{{#unless @last}}, {{/unless}} - {{/each}} -
-
- -
- {{#each tags}} - {{name}} - {{/each}} -
- -
- {{#if glossary.[1]}} -
    - {{#each glossary}} -
  1. {{.}}
  2. - {{/each}} -
- {{else}} -
{{glossary.[0]}}
- {{/if}} -
-
diff --git a/tmpl/term-definition.html b/tmpl/term-definition.html deleted file mode 100644 index 03356a59..00000000 --- a/tmpl/term-definition.html +++ /dev/null @@ -1,16 +0,0 @@ -{{#if tags}} -
- {{#each tags}} - {{name}} - {{/each}} -
-{{/if}} -{{#if glossary.[1]}} - -{{else}} -
{{glossary.[0]}}
-{{/if}} diff --git a/tmpl/term-grouped-list.html b/tmpl/term-grouped-list.html deleted file mode 100644 index 4bc9406c..00000000 --- a/tmpl/term-grouped-list.html +++ /dev/null @@ -1,8 +0,0 @@ -{{#if definitions}} - {{#each definitions}} - {{#unless @first}}
{{/unless}} - {{> term-grouped.html addable=../addable playback=../playback}} - {{/each}} -{{else}} -

No results found

-{{/if}} diff --git a/tmpl/term-grouped.html b/tmpl/term-grouped.html deleted file mode 100644 index 93281ee9..00000000 --- a/tmpl/term-grouped.html +++ /dev/null @@ -1,37 +0,0 @@ -
-
- {{#if addable}} - - - {{/if}} - {{#if playback}} - - {{/if}} -
- - {{#if reading}} -
{{#kanjiLinks}}{{expression}}{{/kanjiLinks}}{{reading}}
- {{else}} -
{{#kanjiLinks}}{{expression}}{{/kanjiLinks}}
- {{/if}} - - {{#if reasons}} -
- {{#each reasons}} - {{.}} {{#unless @last}}«{{/unless}} - {{/each}} -
- {{/if}} - -
- {{#if definitions.[1]}} -
    - {{#each definitions}} -
  1. {{> term-definition.html}}
  2. - {{/each}} -
- {{else}} - {{> term-definition.html definitions.[0]}} - {{/if}} -
-
diff --git a/tmpl/term-list.html b/tmpl/term-list.html index 1315d132..3c85b547 100644 --- a/tmpl/term-list.html +++ b/tmpl/term-list.html @@ -1,7 +1,70 @@ +{{#*inline "definition"}} + {{#if tags}} +
+ {{#each tags}} + {{name}} + {{/each}} +
+ {{/if}} + {{#if glossary.[1]}} + + {{else}} +
{{glossary.[0]}}
+ {{/if}} +{{/inline}} + +{{#*inline "term"}} +
+
+ {{#if addable}} + + + {{/if}} + {{#if playback}} + + {{/if}} +
+ + {{#if reading}} +
{{#kanjiLinks}}{{expression}}{{/kanjiLinks}}{{reading}}
+ {{else}} +
{{#kanjiLinks}}{{expression}}{{/kanjiLinks}}
+ {{/if}} + + {{#if reasons}} +
+ {{#each reasons}} + {{.}} {{#unless @last}}«{{/unless}} + {{/each}} +
+ {{/if}} + +
+ {{#if grouped}} + {{#if definitions.[1]}} +
    + {{#each definitions}} +
  1. {{> definition}}
  2. + {{/each}} +
+ {{else}} + {{> definition definitions.[0]}} + {{/if}} + {{else}} + {{> definition}} + {{/if}} +
+
+{{/inline}} + {{#if definitions}} {{#each definitions}} {{#unless @first}}
{{/unless}} - {{> term.html addable=../addable playback=../playback}} + {{> term grouped=../grouped addable=../addable playback=../playback}} {{/each}} {{else}}

No results found

diff --git a/tmpl/term.html b/tmpl/term.html deleted file mode 100644 index 0e19dbf4..00000000 --- a/tmpl/term.html +++ /dev/null @@ -1,29 +0,0 @@ -
-
- {{#if addable}} - - - {{/if}} - {{#if playback}} - - {{/if}} -
- - {{#if reading}} -
{{#kanjiLinks}}{{expression}}{{/kanjiLinks}}{{reading}}
- {{else}} -
{{#kanjiLinks}}{{expression}}{{/kanjiLinks}}
- {{/if}} - - {{#if reasons}} -
- {{#each reasons}} - {{.}} {{#unless @last}}«{{/unless}} - {{/each}} -
- {{/if}} - -
- {{> term-definition.html}} -
-
-- cgit v1.2.3