diff options
author | Vincent Tam <sere@live.hk> | 2019-05-20 20:40:18 +0300 |
---|---|---|
committer | Vincent Tam <sere@live.hk> | 2019-05-20 20:40:18 +0300 |
commit | 14771fcb347f4c0101a3606f8a4cf8cd6ca7db9b (patch) | |
tree | 7fdc71c3c6df901fab9210bbabab1d59d9d02f7b /layouts | |
parent | c446cb28ae1a40899acfaa92abdca47ec87573a0 (diff) |
Affichage en cours d'amélioration
Diffstat (limited to 'layouts')
-rw-r--r-- | layouts/partials/staticman-comments.html | 85 |
1 files changed, 37 insertions, 48 deletions
diff --git a/layouts/partials/staticman-comments.html b/layouts/partials/staticman-comments.html index ba6cc77..411da53 100644 --- a/layouts/partials/staticman-comments.html +++ b/layouts/partials/staticman-comments.html @@ -5,7 +5,7 @@ {{ if .Site.Data.comments }} {{ $comments := index $.Site.Data.comments $slug }} {{ if $comments }} - {{ if gt (len $comments) 1 }} + {{ if gt (len $comments) 1 }} <h3>{{ len $comments }} {{ i18n "moreComment" }}</h3> {{ else }} <h3>{{ len $comments }} {{ i18n "oneComment" }}</h3> @@ -21,12 +21,14 @@ {{ $.Scratch.Set "threadID" ._id }} <article id="{{ ._id }}" class="static-comment"> <img class="comment-avatar" src="https://www.gravatar.com/avatar/{{ .email }}?s=48"> - {{ if .website }} - <h4 class="comment-author"><a rel="external nofollow" href="{{ .website }}">{{ .name }}</a></h4> - {{ else }} - <h4 class="comment-author">{{ .name }}</h4> - {{ end }} - <div class="comment-timestamp"><a href="#{{ ._id }}" title="Permalink to this comment"><time datetime="{{ .date }}">{{ dateFormat (default (i18n "shortdateFormat") .Site.Params.dateformat) .date }}</time></a></div> + <h4> + {{- if .website -}} + <span class="comment-author"><a rel="external nofollow" href="{{ .website }}">{{ .name }}</a></span> + {{- else -}} + <span class="comment-author">{{ .name }}</span> + {{- end -}} + <a href="#{{ ._id }}" title="Permalink to this comment"><time datetime="{{ dateFormat "02 Jan 06 15:04 +01:00" .date }}">{{ dateFormat "02/01/2006 15:04" .date }}</time></a> + </h4> <div class="comment-content"><p>{{ .comment | markdownify }}</p></div> <a class="btn" href="#comment-form" title="{{ ._id }}">{{ i18n "replyToMsg" }}</a> </article> @@ -35,13 +37,15 @@ {{ if eq .replyThread ($.Scratch.Get "threadID") }} <article id="{{ ._id }}" class="static-comment static-comment-reply"> <img class="comment-avatar" src="https://www.gravatar.com/avatar/{{ .email }}?s=48"> - {{ if .website }} - <h4 class="comment-author"><a rel="external nofollow" href="{{ .website }}">{{ .name }}</a></h4> - {{ else }} - <h4 class="comment-author">{{ .name }}</h4> - {{ end }} - <h5 class="comment-reply-target"><a href="#{{ .replyID }}"> ↶ {{ .replyName }}</a></h5> - <div class="comment-timestamp"><a href="#{{ ._id }}" title="Permalink to this comment"><time datetime="{{ .date }}">{{ dateFormat (default (i18n "shortdateFormat") .Site.Params.dateformat) .date }}</time></a></div> + <h4> + {{- if .website -}} + <span class="comment-author"><a rel="external nofollow" href="{{ .website }}">{{ .name }}</a></span> + {{- else -}} + <span class="comment-author">{{ .name }}</span> + {{- end -}} + ↷ <a href="#{{ .replyID }}">{{ .replyName }}</a> + <a href="#{{ ._id }}" title="Permalink to this comment"><time datetime="{{ dateFormat "02 Jan 06 15:04 +01:00" .date }}">{{ dateFormat "02/01/2006 15:04" .date }}</time></a> + </h4> <div class="comment-content"><p>{{ .comment | markdownify }}</p></div> <a class="btn" href="#comment-form" title="{{ .replyThread }}">{{ i18n "replyToMsg" }}</a> </article> @@ -51,9 +55,15 @@ {{ end }} {{ end }} +<form id="comment-form" class="js-form form" method="post" + action="{{ .Site.Params.staticman.endpoint | default "https://staticman-frama.herokuapp.com" }}/v3/entry/{{ .Site.Params.staticman.gitProvider }}/{{ .Site.Params.staticman.repo }}/{{ .Site.Params.staticman.branch }}/comments"> + <!-- Start comment form display reply target --> + <p class="hidden reply-notice"> + <strong class="reply-notice-text"></strong> + </p> + <!-- End comment form display reply target --> -<form id="comment-form" class="js-form form" method="post" action="{{ .Site.Params.staticman.api }}"> <input type="hidden" name="options[slug]" value="{{ replace .RelPermalink "/" "" }}"> <input type="hidden" name="options[parent]" value=""> <input type="hidden" name="fields[replyThread]" value=""> @@ -65,44 +75,23 @@ <input type="hidden" name="options[reCaptcha][secret]" value="{{ .Site.Params.staticman.recaptcha.secret }}"> {{ end }} - <fieldset> - <div class="textfield"> - <textarea name="fields[comment]" placeholder="{{ i18n "useMarkdown" }}"></textarea> - </div> - </fieldset> - - <fieldset> - <div class="textfield"> - <input name="fields[name]" type="text" placeholder="{{ i18n "yourName" }}"/> - </div> - </fieldset> - - <fieldset> - <div class="textfield"> - <input type="email" name="fields[email]" placeholder="{{ i18n "yourEmail" }}"/> - </div> - </fieldset> - - <fieldset> - <div class="textfield"> - <input type="text" name="fields[website]" placeholder="{{ i18n "yourWebsite" }}"/> - </div> - </fieldset> + <textarea name="fields[comment]" placeholder="{{ i18n "useMarkdown" }}"></textarea> + <input type="text" name="fields[name]" placeholder="{{ i18n "yourName" }}"/> + <input type="email" name="fields[email]" placeholder="{{ i18n "yourEmail" }}"/> + <input type="text" name="fields[website]" placeholder="{{ i18n "yourWebsite" }}"/> {{ if .Site.Params.staticman.recaptcha }} - <fieldset> <div class="g-recaptcha" data-sitekey="{{ .Site.Params.staticman.recaptcha.sitekey }}"></div> - </fieldset> {{ end }} - <fieldset> - <button type="submit" class="button"> - Submit - </button> - <button type="reset" value="Reset"> - Reset - </button> - </fieldset> + <!-- Start comment form alert messaging --> + <p class="hidden js-notice"> + <strong class="js-notice-text"></strong> + </p> + <!-- End comment form alert messaging --> + + <input type="submit" value="Submit" class="button"> + <input type="reset" value="Reset" class="button"> </form> </section> |