Permalink
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
78 lines (71 sloc) 3.53 KB
<div class="line-separator"></div>
<div id="stacosys-comments">
{{ $restParam := (printf "/comments?token=%v&url=%v" .Site.Params.widgets.stacosys_token .URL) }}
{{ $resp := getJSON .Site.Params.widgets.stacosys_url $restParam }}
{{ range $resp.data }}
<div class="pure-g">
<div class="pure-u">
<img src="https://www.gravatar.com/avatar/{{ .avatar }}.jpg" style="float:left; margin-right:10px" height="32" width="32">
</div>
<div class="pure-u-3-4">
{{ if isset . "site" }}
<a href="{{ .site }}"></a>
{{ end }}
{{ if isset . "site" }}
</a>
{{ end }}
<span class="title">{{ .author }}</span>
<span> - {{ .date }}</span>
<p>{{ .content | markdownify }}</p>
</div>
</div>
{{ end }}
</div>
<div id="comment-form">
<strong>Votre commentaire</strong>
<form class="pure-form" role="form" action="/newcomment" autocomplete="off" method="post">
<fieldset class="pure-group">
<input class="pure-u-1-2" id="author" name="author" type="text" placeholder="Nom ou Surnom" required>
<input class="pure-u-1-2" id="site" name="site" type="text" placeholder="Site Web">
<input class="pure-u-1-2" style="display:none" id="email" name="email" type="text" placeholder="Adresse email pour Gravatar (non publié)" onchange="grabatar()">
<img src="" id="gravatar" height="32" width="32" style="display:none">
<input class="pure-u-1-2 hidden" id="token" name="token" type="text" placeholder="Blog" value="{{ .Site.Params.widgets.stacosys_token }}">
<input class="pure-u-1-2 hidden" id="url" name="url" type="text" placeholder="Article" value="{{ .URL }}">
<input class="pure-u-1-2 hidden" id="captcha" name="captcha" type="text" placeholder="Etes vous humain ?">
</fieldset>
<fieldset class="pure-group">
<textarea id="message" class="pure-u-1-2" name="message" rows="4" placeholder="Votre commentaire (texte simple ou Markdown)" required></textarea>
<div id="preview-container" style="display:none">
<p>Prévisualisation en :</p>
<div id="preview" class="pure-u-1-2 preview-markdown"></div>
</div>
</fieldset>
<fieldset>
<div>
<em>Le site Web est optionel</em><br>
<em>Le message peut être rédigé au format <a href="http://daringfireball.net/projects/markdown/" target="_blank">Markdown</a></em>
</div>
<div id="helpgravatar" style="display:none">
<em >L'e-mail sert uniquement à retrouver votre <a href="https://fr.gravatar.com/">Gravatar</a></em>
</div>
</fieldset>
<button type="submit" class="button-success pure-button">Envoyer</button>
<button id="markdown" style="display:none" onclick="preview_markdown(); return false" class="button-warning pure-button">Prévisualiser</button>
</form>
</div>
<script type="text/javascript"><!--
function grabatar() {
var gravatar = document.getElementById("gravatar");
var email = document.getElementById("email");
var md5avatar = md5(email.value);
gravatar.src = "http://www.gravatar.com/avatar/" + md5avatar + ".jpg";
email.value = md5avatar;
gravatar.style.display = '';
}
function showbonus() {
document.getElementById("email").style.display = '';
document.getElementById("markdown").style.display = '';
document.getElementById("helpgravatar").style.display = '';
}
window.onload = showbonus;
--></script>