diff options
author | Vincent Tam <sere@live.hk> | 2019-07-27 13:43:33 +0300 |
---|---|---|
committer | Vincent Tam <sere@live.hk> | 2019-07-27 13:43:33 +0300 |
commit | 9a021a3ddcab1eaafa1fe7d0940cdef06d670d05 (patch) | |
tree | 6dfcb8684b766061680f2734323a224e8218cd81 | |
parent | 957cde2a1406011252fde8ebaa41b8b401c0b281 (diff) |
Added comment form info for email & required field
Norwaygian and Esperanto UI text from
1. https://www.kommunemannen.com/2019/02/de-nodvendige-samtalene/
2. https://www.carlocollodi.it/eo/periodici-in-cui-scrisse-collodi/tetate-de-il-lampione/
-rw-r--r-- | assets/css/staticman.css | 7 | ||||
-rw-r--r-- | exampleSite/resources/_gen/assets/css/css/staticman.css_d3f53f09220d597dac26fe7840c31fc9.content | 2 | ||||
-rw-r--r-- | i18n/br.yaml | 2 | ||||
-rw-r--r-- | i18n/de.yaml | 2 | ||||
-rw-r--r-- | i18n/en.yaml | 2 | ||||
-rw-r--r-- | i18n/eo.yaml | 2 | ||||
-rw-r--r-- | i18n/es.yaml | 2 | ||||
-rw-r--r-- | i18n/fr.yaml | 2 | ||||
-rw-r--r-- | i18n/it.yaml | 2 | ||||
-rw-r--r-- | i18n/ja.yaml | 2 | ||||
-rw-r--r-- | i18n/nb.yaml | 2 | ||||
-rw-r--r-- | i18n/nl.yaml | 2 | ||||
-rw-r--r-- | i18n/pl.yaml | 2 | ||||
-rw-r--r-- | i18n/ru.yaml | 2 | ||||
-rw-r--r-- | i18n/zh-CN.yaml | 2 | ||||
-rw-r--r-- | i18n/zh-TW.yaml | 2 | ||||
-rw-r--r-- | layouts/partials/staticman-comments.html | 98 |
17 files changed, 85 insertions, 50 deletions
diff --git a/assets/css/staticman.css b/assets/css/staticman.css index 9fe02af..a25791b 100644 --- a/assets/css/staticman.css +++ b/assets/css/staticman.css @@ -39,6 +39,13 @@ width: 100%; max-width: 100%; min-height: 5rem; + font-family: inherit; + font-size: inherit; +} + +.staticman-comments input[type="text"], .staticman-comments input[type="email"] { + font-family: inherit; + font-size: inherit; } .staticman-comments .comment-avatar { diff --git a/exampleSite/resources/_gen/assets/css/css/staticman.css_d3f53f09220d597dac26fe7840c31fc9.content b/exampleSite/resources/_gen/assets/css/css/staticman.css_d3f53f09220d597dac26fe7840c31fc9.content index f739d0c..ffc5632 100644 --- a/exampleSite/resources/_gen/assets/css/css/staticman.css_d3f53f09220d597dac26fe7840c31fc9.content +++ b/exampleSite/resources/_gen/assets/css/css/staticman.css_d3f53f09220d597dac26fe7840c31fc9.content @@ -1 +1 @@ -.staticman-comments form{margin-top:1rem}.staticman-comments .static-comment{padding:.5rem .3rem;margin:.6rem .3rem}.staticman-comments input{margin:.3rem 0;padding:.4rem .8rem;border:.1rem solid #768294;border-radius:3px;background-color:#fff;width:60%;max-width:95%;display:block}.staticman-comments input[type=submit],.staticman-comments input[type=reset]{background-color:#ebeffa;width:auto;display:inline}.staticman-comments .g-recaptcha{padding:.5rem 0}.staticman-comments textarea{margin:.3rem 0;padding:.2rem .4rem;border:.1rem solid #768294;border-radius:2px;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box;width:100%;max-width:100%;min-height:5rem}.staticman-comments .comment-avatar{float:left;width:3rem;height:3rem;margin-right:1rem}.staticman-comments .static-comment-reply{margin-left:1.5rem}.staticman-comments .reply-target::before{content:' ↷ '}.staticman-comments p.reply-notice img.comment-avatar{display:inline-block;float:none;width:2rem;height:2rem;margin:0 .6rem}.staticman-comments a.close-btn{margin:0 .6rem;color:#c34853}.staticman-comments a.close-btn:hover{text-decoration:none}.staticman-comments form:disabled,.staticman-comments input:disabled,.staticman-comments textarea:disabled{opacity:.5;cursor:not-allowed}.staticman-comments .js-notice .hidden,.staticman-comments input[type=submit].hidden,.staticman-comments p.reply-notice.hidden{display:none}
\ No newline at end of file +.staticman-comments form{margin-top:1rem}.staticman-comments .static-comment{padding:.5rem .3rem;margin:.6rem .3rem}.staticman-comments input{margin:.3rem 0;padding:.4rem .8rem;border:.1rem solid #768294;border-radius:3px;background-color:#fff;width:60%;max-width:95%;display:block}.staticman-comments input[type=submit],.staticman-comments input[type=reset]{background-color:#ebeffa;width:auto;display:inline}.staticman-comments .g-recaptcha{padding:.5rem 0}.staticman-comments textarea{margin:.3rem 0;padding:.2rem .4rem;border:.1rem solid #768294;border-radius:2px;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box;width:100%;max-width:100%;min-height:5rem;font-family:inherit;font-size:inherit}.staticman-comments input[type=text],.staticman-comments input[type=email]{font-family:inherit;font-size:inherit}.staticman-comments .comment-avatar{float:left;width:3rem;height:3rem;margin-right:1rem}.staticman-comments .static-comment-reply{margin-left:1.5rem}.staticman-comments .reply-target::before{content:' ↷ '}.staticman-comments p.reply-notice img.comment-avatar{display:inline-block;float:none;width:2rem;height:2rem;margin:0 .6rem}.staticman-comments a.close-btn{margin:0 .6rem;color:#c34853}.staticman-comments a.close-btn:hover{text-decoration:none}.staticman-comments form:disabled,.staticman-comments input:disabled,.staticman-comments textarea:disabled{opacity:.5;cursor:not-allowed}.staticman-comments .js-notice .hidden,.staticman-comments input[type=submit].hidden,.staticman-comments p.reply-notice.hidden{display:none}
\ No newline at end of file diff --git a/i18n/br.yaml b/i18n/br.yaml index 1b0af28..db6bb37 100644 --- a/i18n/br.yaml +++ b/i18n/br.yaml @@ -54,6 +54,8 @@ translation: "comentário" - id: moreComment translation: "comentários" +- id: commentFormInfo + translation: "Seu e-mail não será publicado. Os campos obrigatórios estão marcados" - id: useMarkdown translation: "Você pode usar sintaxe MarkDown" - id: yourName diff --git a/i18n/de.yaml b/i18n/de.yaml index fab47d9..a5c86b4 100644 --- a/i18n/de.yaml +++ b/i18n/de.yaml @@ -54,6 +54,8 @@ translation: "Kommentar" - id: moreComment translation: "Kommentare" +- id: commentFormInfo + translation: "Ihre E-Mail Adresse wird nicht veröffentlicht. Benötigte Felder sind markiert" - id: useMarkdown translation: "Sie können Markdown-Syntax verwenden" - id: yourName diff --git a/i18n/en.yaml b/i18n/en.yaml index 1cf5ef2..5af1c4e 100644 --- a/i18n/en.yaml +++ b/i18n/en.yaml @@ -54,6 +54,8 @@ translation: "comment" - id: moreComment translation: "comments" +- id: commentFormInfo + translation: "Your email address will not be published. Required fields are marked" - id: useMarkdown translation: "You can use Markdown syntax" - id: yourName diff --git a/i18n/eo.yaml b/i18n/eo.yaml index 82b4100..f18c0bb 100644 --- a/i18n/eo.yaml +++ b/i18n/eo.yaml @@ -54,6 +54,8 @@ translation: "komento" - id: moreComment translation: "komentoj" +- id: commentFormInfo + translation: "Via retpoŝta adreso ne estos publikigita. Bezonata kampoj markitaj" - id: useMarkdown translation: "Vi povus uzi Markdown-sintakson" - id: yourName diff --git a/i18n/es.yaml b/i18n/es.yaml index d08721b..93ef32c 100644 --- a/i18n/es.yaml +++ b/i18n/es.yaml @@ -54,6 +54,8 @@ translation: "comentario" - id: moreComment translation: "comentarios" +- id: commentFormInfo + translation: "Tu dirección de correo electrónico no se publicará. Los campos obligatorios están marcados" - id: useMarkdown translation: "Puedes usar la sintaxis de Markdown" - id: yourName diff --git a/i18n/fr.yaml b/i18n/fr.yaml index 498c565..33e3bb7 100644 --- a/i18n/fr.yaml +++ b/i18n/fr.yaml @@ -54,6 +54,8 @@ translation: "commentaire" - id: moreComment translation: "commentaires" +- id: commentFormInfo + translation: "Votre adresse email ne sera pas visible. Les champs obligatoires sont marqués" - id: useMarkdown translation: "Vous pouvez utiliser la syntaxe Markdown" - id: yourName diff --git a/i18n/it.yaml b/i18n/it.yaml index a9f8f73..293cd10 100644 --- a/i18n/it.yaml +++ b/i18n/it.yaml @@ -54,6 +54,8 @@ translation: "commento" - id: moreComment translation: "commenti" +- id: commentFormInfo + translation: "Il tuo indirizzo email non sarà pubblicato. Sono segnati i campi obbligatori" - id: useMarkdown translation: "Puoi usare la sintassi Markdown" - id: yourName diff --git a/i18n/ja.yaml b/i18n/ja.yaml index c838e5d..73bec32 100644 --- a/i18n/ja.yaml +++ b/i18n/ja.yaml @@ -54,6 +54,8 @@ translation: "件のコメント" - id: moreComment translation: "件のコメント" +- id: commentFormInfo + translation: "メールアドレスが公開されることはありません。次の印のある項目は必ず入力してください:" - id: useMarkdown translation: "Markdown を使用できます" - id: yourName diff --git a/i18n/nb.yaml b/i18n/nb.yaml index ac0e61e..5921c88 100644 --- a/i18n/nb.yaml +++ b/i18n/nb.yaml @@ -54,6 +54,8 @@ translation: "kommentar" - id: moreComment translation: "kommentarer" +- id: commentFormInfo + translation: "Din e-postadresse vil ikke bli publisert. Obligatoriske felt er merket med" - id: useMarkdown translation: "Du kan bruke Markdown syntax" - id: yourName diff --git a/i18n/nl.yaml b/i18n/nl.yaml index a25a406..2c3044f 100644 --- a/i18n/nl.yaml +++ b/i18n/nl.yaml @@ -54,6 +54,8 @@ translation: "reactie" - id: moreComment translation: "reacties" +- id: commentFormInfo + translation: "Uw e-mailadres wordt niet gepubliceerd. Verplichte velden zijn gemarkeerd" - id: useMarkdown translation: "Je kunt Markdown-syntax gebruiken" - id: yourName diff --git a/i18n/pl.yaml b/i18n/pl.yaml index 118c0d3..28ded5a 100644 --- a/i18n/pl.yaml +++ b/i18n/pl.yaml @@ -54,6 +54,8 @@ translation: "komentarz" - id: moreComment translation: "komentarzy" +- id: commentFormInfo + translation: "Twój adres email nie będzie udostępiony. Wymagane pola są oznaczone" - id: useMarkdown translation: "Możesz użyć składni Markdown" - id: yourName diff --git a/i18n/ru.yaml b/i18n/ru.yaml index 64c7a45..09c5e09 100644 --- a/i18n/ru.yaml +++ b/i18n/ru.yaml @@ -54,6 +54,8 @@ translation: "комментарий" - id: moreComment translation: "комментарии" +- id: commentFormInfo + translation: "Ваш адрес электронной почты не будет опубликован. Обязательные поля помечены" - id: useMarkdown translation: "Вы можете использовать синтаксис Markdown" - id: yourName diff --git a/i18n/zh-CN.yaml b/i18n/zh-CN.yaml index 32b7b95..ec97ef2 100644 --- a/i18n/zh-CN.yaml +++ b/i18n/zh-CN.yaml @@ -54,6 +54,8 @@ translation: "则评论" - id: moreComment translation: "则评论" +- id: commentFormInfo + translation: "您的电子邮箱地址并不会被展示. 必填部份已标记" - id: useMarkdown translation: "您可以使用Markdown语法" - id: yourName diff --git a/i18n/zh-TW.yaml b/i18n/zh-TW.yaml index 4cab443..dad9eee 100644 --- a/i18n/zh-TW.yaml +++ b/i18n/zh-TW.yaml @@ -54,6 +54,8 @@ translation: "則評論" - id: moreComment translation: "則評論" +- id: commentFormInfo + translation: "您的電子信箱不會被公開. 必填部份已標記" - id: useMarkdown translation: "您可以使用Markdown語法" - id: yourName diff --git a/layouts/partials/staticman-comments.html b/layouts/partials/staticman-comments.html index ac49778..1100431 100644 --- a/layouts/partials/staticman-comments.html +++ b/layouts/partials/staticman-comments.html @@ -1,4 +1,4 @@ -<section class="js-comments staticman-comments"> +<section class='js-comments staticman-comments'> {{ $slug := replace .RelPermalink "/" "" }} @@ -17,37 +17,36 @@ {{ $.Scratch.Set "hasComments" 0 }} {{ range $comments }} {{ if not .replyThread }} - {{ $.Scratch.Add "hasComments" 1 }} {{ $.Scratch.Set "threadID" ._id }} - <article id="{{ ._id }}" class="static-comment"> - <img class="comment-avatar" src="https://www.gravatar.com/avatar/{{ .email }}?s=48"> + <article id='{{ ._id }}' class='static-comment'> + <img class='comment-avatar' src='https://www.gravatar.com/avatar/{{ .email }}?s=48'> <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> + {{ 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="reply-btn" href="#comment-form" title="{{ ._id }}">{{ i18n "replyToMsg" }}</a> + <div class='comment-content'><p>{{ .comment | markdownify }}</p></div> + <a class='reply-btn' href='#comment-form' title='{{ ._id }}'>{{ i18n "replyToMsg" }}</a> </article> {{ range $comments }} {{ 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"> + <article id='{{ ._id }}' class='static-comment static-comment-reply'> + <img class='comment-avatar' src='https://www.gravatar.com/avatar/{{ .email }}?s=48'> <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 }}" class="reply-target">{{ .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> + {{ 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 }}' class='reply-target'>{{ .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="reply-btn" href="#comment-form" title="{{ .replyThread }}">{{ i18n "replyToMsg" }}</a> + <div class='comment-content'><p>{{ .comment | markdownify }}</p></div> + <a class='reply-btn' href='#comment-form' title='{{ .replyThread }}'>{{ i18n "replyToMsg" }}</a> </article> {{ end }} {{ end }} @@ -55,44 +54,45 @@ {{ end }} {{ end }} -<form id="comment-form" class="js-form form" method="post" action="https://example.com/"> +<form id='comment-form' class='js-form form' method='post' action='https://example.com/'> <!-- Start comment form display reply target --> - <p class="reply-notice hidden"> - <strong class="reply-arrow">↷</strong> - <strong class="reply-name"></strong> + <p class='reply-notice hidden'> + <strong class='reply-arrow'>↷</strong> + <strong class='reply-name'></strong> </p> <!-- End comment form display reply target --> - <input type="hidden" name="options[slug]" value="{{ replace .RelPermalink "/" "" }}"> - <input type="hidden" name="options[parent]" value=""> - <input type="hidden" name="fields[replyThread]" value=""> - <input type="hidden" name="fields[replyID]" value=""> - <input type="hidden" name="fields[replyName]" value=""> + <input type='hidden' name='options[slug]' value='{{ replace .RelPermalink "/" "" }}'> + <input type='hidden' name='options[parent]' value=''> + <input type='hidden' name='fields[replyThread]' value=''> + <input type='hidden' name='fields[replyID]' value=''> + <input type='hidden' name='fields[replyName]' value=''> - {{ if .Site.Params.staticman.recaptcha }} - <input type="hidden" name="options[reCaptcha][siteKey]" value="{{ .Site.Params.staticman.recaptcha.sitekey }}"> - <input type="hidden" name="options[reCaptcha][secret]" value="{{ .Site.Params.staticman.recaptcha.secret }}"> - {{ end }} + {{- with .Site.Params.staticman.recaptcha -}} + <input type='hidden' name='options[reCaptcha][siteKey]' value='{{ .sitekey }}'> + <input type='hidden' name='options[reCaptcha][secret]' value='{{ .secret }}'> + {{- end }} - <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" }}"> + <p class="small">{{ i18n "commentFormInfo" }} *.</p> + <textarea name='fields[comment]' placeholder='{{ i18n "useMarkdown" }}*' rows="6" cols="36"></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 }} - <div class="g-recaptcha" data-sitekey="{{ .Site.Params.staticman.recaptcha.sitekey }}"></div> - {{ end }} + {{ with .Site.Params.staticman.recaptcha -}} + <div class='g-recaptcha' data-sitekey='{{ .sitekey }}'></div> + {{- end }} <!-- Start comment form alert messaging --> - <p class="js-notice"> - <strong class="js-notice-text submit-success hidden">{{ i18n "successMsg" }}</strong> - <strong class="js-notice-text submit-failed hidden">{{ i18n "errorMsg" }}</strong> + <p class='js-notice'> + <strong class='js-notice-text submit-success hidden'>{{ i18n "successMsg" }}</strong> + <strong class='js-notice-text submit-failed hidden'>{{ i18n "errorMsg" }}</strong> </p> <!-- End comment form alert messaging --> - <input type="submit" value="{{ i18n "btnSubmit" }}" class="button"> - <input type="submit" value="{{ i18n "btnSubmitted" }}" class="button hidden" disabled> - <input type="reset" value="{{ i18n "btnReset" }}" class="button"> + <input type='submit' value='{{ i18n "btnSubmit" }}' class='button'> + <input type='submit' value='{{ i18n "btnSubmitted" }}' class='button hidden' disabled> + <input type='reset' value='{{ i18n "btnReset" }}' class='button'> </form> </section> |