mirror of
https://github.com/KevinMidboe/linguist.git
synced 2025-10-29 09:40:21 +00:00
Added support for Latte
This commit is contained in:
@@ -945,6 +945,13 @@ Lasso:
|
|||||||
color: "#2584c3"
|
color: "#2584c3"
|
||||||
primary_extension: .lasso
|
primary_extension: .lasso
|
||||||
|
|
||||||
|
Latte:
|
||||||
|
type: markup
|
||||||
|
color: "#A8FF97"
|
||||||
|
group: HTML
|
||||||
|
lexer: Smarty
|
||||||
|
primary_extension: .latte
|
||||||
|
|
||||||
Less:
|
Less:
|
||||||
type: markup
|
type: markup
|
||||||
group: CSS
|
group: CSS
|
||||||
|
|||||||
59
samples/Latte/layout.latte
Normal file
59
samples/Latte/layout.latte
Normal file
@@ -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
|
||||||
|
*}
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<meta name="description" content="">
|
||||||
|
<meta name="author" content="">
|
||||||
|
<meta name="robots" content="{$robots}" n:ifset="$robots">
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
|
||||||
|
<title>{ifset $title}{$title} › {/ifset}Translation report</title>
|
||||||
|
|
||||||
|
<link rel="stylesheet" media="screen,projection,tv" href="{$cdnUrl}/css/style.css?v={$cssHash}">
|
||||||
|
<link rel="shortcut icon" href="{$cdnUrl}/favicon.png">
|
||||||
|
<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
|
||||||
|
<!--[if lt IE 9]>
|
||||||
|
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
|
||||||
|
<script src="https://oss.maxcdn.com/libs/respond.js/1.3.0/respond.min.js"></script>
|
||||||
|
<![endif]-->
|
||||||
|
<script n:syntax="off">
|
||||||
|
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
|
||||||
|
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
|
||||||
|
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
|
||||||
|
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
|
||||||
|
ga('create', 'UA-33892654-4', 'khanovaskola.cz');
|
||||||
|
ga('send', 'pageview');
|
||||||
|
</script>
|
||||||
|
{block #head}{/block}
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body class="amara-guest history-empty">
|
||||||
|
<script> document.documentElement.className+=' js' </script>
|
||||||
|
|
||||||
|
{block #navbar}
|
||||||
|
{include _navbar.latte}
|
||||||
|
{/block}
|
||||||
|
|
||||||
|
<div class="container">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-8 col-md-offset-2" n:inner-foreach="$flashes as $flash">
|
||||||
|
{include _flash.latte, flash => $flash}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{include #content}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<footer>
|
||||||
|
</footer>
|
||||||
|
|
||||||
|
<script src="{$cdnUrl}/js/compiled.js?v={$jsHash}"></script>
|
||||||
|
{block #scripts}{/block}
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
243
samples/Latte/template.latte
Normal file
243
samples/Latte/template.latte
Normal file
@@ -0,0 +1,243 @@
|
|||||||
|
{var $title => "⚐ {$new->title}"}
|
||||||
|
{define author}
|
||||||
|
<a n:href="Author: authorId => $author->id" class="black">
|
||||||
|
<img src="{$author->avatar}" width="32" height="32" class="img-rounded">
|
||||||
|
<span class="{$class}">{$author->name|trim}</span>
|
||||||
|
</a>
|
||||||
|
<span data-toggle="tooltip" title="Total time {$author->shortName} translated on all videos.">
|
||||||
|
{$author->estimatedTimeTranslated|secondsToTime}{*
|
||||||
|
*}</span>{if $author->joined}, {/if}
|
||||||
|
{if $author->joined}joined {$author->joined|timeAgo}{/if}{*
|
||||||
|
*}{ifset $postfix}, {$postfix}{/ifset}
|
||||||
|
{/define}
|
||||||
|
{block #scripts}
|
||||||
|
<script src="{$amaraCallbackLink}"></script>
|
||||||
|
{/block}
|
||||||
|
{block #content}
|
||||||
|
|
||||||
|
{if isset($old)}
|
||||||
|
<h1>Diffing revision #{$old->revision} and #{$new->revision}</h1>
|
||||||
|
{else}
|
||||||
|
<h1>First revision</h1>
|
||||||
|
{/if}
|
||||||
|
|
||||||
|
{var $editor = $user->loggedIn && $new->language === 'cs'}
|
||||||
|
{var $rev = $new->video->siteRevision}
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-7">
|
||||||
|
<p>
|
||||||
|
published <b>{$new->publishedAt|timeAgo}</b>{*
|
||||||
|
*}{ifset $old},
|
||||||
|
<span>
|
||||||
|
{$new->textChange * 100|number} % text change{*
|
||||||
|
*}</span>{*
|
||||||
|
*}{if $new->timeChange},
|
||||||
|
<span>
|
||||||
|
{$new->timeChange * 100|number} % timing change
|
||||||
|
</span>
|
||||||
|
{/if}
|
||||||
|
{/ifset}
|
||||||
|
</p>
|
||||||
|
{cache $new->id, expires => '+4 hours'}
|
||||||
|
<p>
|
||||||
|
{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}
|
||||||
|
</p>
|
||||||
|
{/cache}
|
||||||
|
|
||||||
|
{var $threshold = 10}
|
||||||
|
{cache $new->id}
|
||||||
|
{var $done = $new->timeTranslated}
|
||||||
|
{var $outOf = $new->video->canonicalTimeTranslated}
|
||||||
|
{if $outOf}
|
||||||
|
<p n:if="$outOf > $done + $threshold" class="alert alert-warning">
|
||||||
|
Only {$done|time} translated out of {$outOf|time},
|
||||||
|
{(1-$done/$outOf) * 100|number} % ({$outOf - $done|time}) left
|
||||||
|
</p>
|
||||||
|
<p n:if="$outOf <= $done + $threshold" class="alert alert-success">
|
||||||
|
Seems complete: {$done|time} translated out of {$outOf|time}
|
||||||
|
</p>
|
||||||
|
{elseif $done}
|
||||||
|
<p n:if="$outOf <= $done + $threshold" class="alert alert-info">
|
||||||
|
Although {$done|time} is translated, there are no English subtitles for comparison.
|
||||||
|
</p>
|
||||||
|
{/if}
|
||||||
|
{/cache}
|
||||||
|
|
||||||
|
{if $editor}
|
||||||
|
{var $ksid = $new->video->siteId}
|
||||||
|
{if $ksid}
|
||||||
|
<a href="https://khanovaskola.cz/watch/default/?vid={$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}
|
||||||
|
</a>
|
||||||
|
{/if}
|
||||||
|
{/if}
|
||||||
|
|
||||||
|
<h3 class="diff">{$diffs->title|noescape}</h3>
|
||||||
|
<div class="lead diff">{$diffs->description|noescape}</div>
|
||||||
|
<div class="diff subtitles">
|
||||||
|
<div n:foreach="$diffs->text as $line" class="line" data-context="{$line->context}">
|
||||||
|
{$line->text|noescape}
|
||||||
|
</div>
|
||||||
|
<div class="splitter template">
|
||||||
|
<span data-toggle="tooltip" data-placement="bottom" title="Expand">
|
||||||
|
<i class="fa fa-sort"></i> <i class="fa fa-ellipsis-h"></i>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{if $editor}
|
||||||
|
{if $new->approved}
|
||||||
|
<span class="text-success">
|
||||||
|
Revision has been approved{if $new->editor} by {$new->editor->name}{/if}.
|
||||||
|
</span>
|
||||||
|
<a n:href="amaraEdit, amaraId => $new->video->amaraId" n:block="editButton" class="btn btn-default">
|
||||||
|
<i class="fa fa-edit"></i>
|
||||||
|
Edit on Amara
|
||||||
|
</a>
|
||||||
|
<a n:href="khanAcademy" n:block="kaButton" class="btn btn-link">
|
||||||
|
on Khan Academy
|
||||||
|
</a>
|
||||||
|
|
||||||
|
{elseif $new->incomplete}
|
||||||
|
<span class="text-info">
|
||||||
|
Revision has been marked as incomplete by {if $new->editor}{$new->editor->name}{/if}.
|
||||||
|
</span>
|
||||||
|
{include editButton}
|
||||||
|
{include kaButton}
|
||||||
|
|
||||||
|
{* else $new->status === UNSET: *}
|
||||||
|
{elseif $new->video->siteId}
|
||||||
|
<div class="btn-group">
|
||||||
|
<a n:href="approve!" class="btn btn-default">
|
||||||
|
<i class="fa fa-thumbs-o-up"></i>
|
||||||
|
Approve (update kš)
|
||||||
|
</a>
|
||||||
|
<a n:href="markIncomplete!" class="btn btn-default">
|
||||||
|
<i class="fa fa-thumbs-o-down"></i>
|
||||||
|
Mark as incomplete
|
||||||
|
</a>
|
||||||
|
{include editButton}
|
||||||
|
</div>
|
||||||
|
{include kaButton}
|
||||||
|
|
||||||
|
{else}
|
||||||
|
<div class="btn-group">
|
||||||
|
<a n:href="redirectToAdd!" class="btn btn-default">
|
||||||
|
<i class="fa fa-plus-square-o"></i>
|
||||||
|
Approve (add to kš)
|
||||||
|
</a>
|
||||||
|
<a n:href="markIncomplete!" class="btn btn-default">
|
||||||
|
<i class="fa fa-thumbs-o-down"></i>
|
||||||
|
Mark as incomplete
|
||||||
|
</a>
|
||||||
|
{include editButton}
|
||||||
|
</div>
|
||||||
|
{include kaButton}
|
||||||
|
<div>
|
||||||
|
<h5>Filed under category:</h5>
|
||||||
|
{foreach $new->video->categories as $list}
|
||||||
|
— {$list|implode:' › '}{sep}<br>{/sep}
|
||||||
|
{/foreach}
|
||||||
|
</div>
|
||||||
|
{/if}
|
||||||
|
{/if}
|
||||||
|
</div>
|
||||||
|
<div class="col-md-5">
|
||||||
|
<h4>All revisions:</h4>
|
||||||
|
<table class="table table-condensed revisions">
|
||||||
|
{foreach $new->video->getRevisionsIn($new->language) as $revision}
|
||||||
|
<tr n:class="$revision->revision === $new->revision ? 'active'">
|
||||||
|
<td class="revision">
|
||||||
|
<a n:href="this, revId => $revision->id">#{$revision->revision}</a>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<a n:href="Author: authorId => $revision->author->id" class="black">
|
||||||
|
<img src="{$revision->author->avatar}" width="32" height="32" class="img-rounded">
|
||||||
|
{$revision->author->name}
|
||||||
|
</a>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<span class="secondary">
|
||||||
|
{$revision->publishedAt|timeAgo}
|
||||||
|
</span>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
{* vars $outOf, $threshold already set *}
|
||||||
|
{default $outOf = $new->video->canonicalTimeTranslated}
|
||||||
|
{if $outOf} {* ignore if canonical time not set *}
|
||||||
|
{var $done = $revision->timeTranslated}
|
||||||
|
<span n:if="$outOf > $done + $threshold" class="text-warning"
|
||||||
|
data-toggle="tooltip" title="Percent of lines translated">
|
||||||
|
{$done/$outOf * 100|number} %
|
||||||
|
</span>
|
||||||
|
<span n:if="$outOf <= $done + $threshold" class="text-success">
|
||||||
|
~100 %
|
||||||
|
</span>
|
||||||
|
{/if}
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
{if $revision->incomplete || $revision->approved}
|
||||||
|
{var $i = $revision->incomplete}
|
||||||
|
<span n:class="$i ? 'text-warning' : 'text-success'">
|
||||||
|
{if $i}incomplete{else}approved{/if}
|
||||||
|
</span>
|
||||||
|
{/if}
|
||||||
|
</td>
|
||||||
|
{if $user->loggedIn && $revision->comments->count()}
|
||||||
|
</tr>
|
||||||
|
<tr class="row-noborder">
|
||||||
|
<td colspan="99">
|
||||||
|
<table class="comments">
|
||||||
|
<tr n:foreach="$revision->comments as $comment">
|
||||||
|
<td class="col-comment-author">
|
||||||
|
<span class="secondary" data-toggle="tooltip" data-placement="left"
|
||||||
|
title="{$comment->createdAt|timeAgo}">
|
||||||
|
{$comment->user->name}:
|
||||||
|
</span>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<span>
|
||||||
|
{$comment->text}
|
||||||
|
</span>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</td>
|
||||||
|
{/if}
|
||||||
|
{if $user->loggedIn && $new->id === $revision->id}
|
||||||
|
</tr>
|
||||||
|
<tr class="row-noborder">
|
||||||
|
<td colspan="99">
|
||||||
|
{form commentForm}
|
||||||
|
<div class="input-group comment-input">
|
||||||
|
{input text, class => "form-control", placeholder => "Comment this revision (only visible to other editors)"}
|
||||||
|
<span class="input-group-btn">
|
||||||
|
<button class="btn btn-default" n:name="save">
|
||||||
|
<i class="fa fa-share"></i>
|
||||||
|
</button>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
{/form}
|
||||||
|
</td>
|
||||||
|
{/if}
|
||||||
|
</tr>
|
||||||
|
{/foreach}
|
||||||
|
</table>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
Reference in New Issue
Block a user