Files
linguist/samples/Latte/template.latte
2014-04-03 10:26:54 +02:00

244 lines
7.4 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{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}&thinsp;% text change{*
*}</span>{*
*}{if $new->timeChange},
<span>
{$new->timeChange * 100|number}&thinsp;% 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'}
&mdash;
{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}&thinsp;% ({$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}&nbsp;
</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}
&mdash; {$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}&thinsp;%
</span>
<span n:if="$outOf <= $done + $threshold" class="text-success">
~100&thinsp;%
</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>