diff --git a/lib/linguist/languages.yml b/lib/linguist/languages.yml index 6eb2a378..0102e2e2 100644 --- a/lib/linguist/languages.yml +++ b/lib/linguist/languages.yml @@ -945,6 +945,13 @@ Lasso: color: "#2584c3" primary_extension: .lasso +Latte: + type: markup + color: "#A8FF97" + group: HTML + lexer: Smarty + primary_extension: .latte + Less: type: markup group: CSS diff --git a/samples/Latte/layout.latte b/samples/Latte/layout.latte new file mode 100644 index 00000000..5e94975f --- /dev/null +++ b/samples/Latte/layout.latte @@ -0,0 +1,59 @@ +{** + * @param string $basePath web base path + * @param string $robots tell robots how to index the content of a page (optional) + * @param array $flashes flash messages + *} + + +
+ + + + + + + ++ published {$new->publishedAt|timeAgo}{* + *}{ifset $old}, + + {$new->textChange * 100|number} % text change{* + *}{* + *}{if $new->timeChange}, + + {$new->timeChange * 100|number} % timing change + + {/if} + {/ifset} +
+ {cache $new->id, expires => '+4 hours'} ++ {if isset($old) && $old->author->name !== $new->author->name} + {include author, author => $old->author, class => 'author-old'} + — + {include author, author => $new->author, class => 'author-new'} + {elseif isset($old)} + {include author, author => $new->author, class => 'author-new', postfix => 'authored both revisions'} + {else} + {include author, author => $new->author, class => 'author-new'} + {/if} +
+ {/cache} + + {var $threshold = 10} + {cache $new->id} + {var $done = $new->timeTranslated} + {var $outOf = $new->video->canonicalTimeTranslated} + {if $outOf} ++ Only {$done|time} translated out of {$outOf|time}, + {(1-$done/$outOf) * 100|number} % ({$outOf - $done|time}) left +
++ Seems complete: {$done|time} translated out of {$outOf|time} +
+ {elseif $done} ++ Although {$done|time} is translated, there are no English subtitles for comparison. +
+ {/if} + {/cache} + + {if $editor} + {var $ksid = $new->video->siteId} + {if $ksid} + + Video on khanovaskola.cz + {if $new->revision === $rev} + (on this revision) + {elseif $new->revision > $rev} + (on older revision #{$rev}) + {else} + (on newer revision #{$rev}) + {/if} + + {/if} + {/if} + +| + #{$revision->revision} + | +
+
+ |
+ + + {$revision->publishedAt|timeAgo} + + | ++ {* vars $outOf, $threshold already set *} + {default $outOf = $new->video->canonicalTimeTranslated} + {if $outOf} {* ignore if canonical time not set *} + {var $done = $revision->timeTranslated} + + {$done/$outOf * 100|number} % + + + ~100 % + + {/if} + | ++ {if $revision->incomplete || $revision->approved} + {var $i = $revision->incomplete} + + {if $i}incomplete{else}approved{/if} + + {/if} + | + {if $user->loggedIn && $revision->comments->count()} +||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
+
|
+ {/if}
+ {if $user->loggedIn && $new->id === $revision->id}
+ ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
+ {form commentForm}
+
+ {input text, class => "form-control", placeholder => "Comment this revision (only visible to other editors)"}
+
+
+
+
+ {/form}
+ |
+ {/if}
+ ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||