fix widget

This commit is contained in:
m15o 2022-05-21 14:22:20 +02:00
parent 23282b94da
commit 512983a0ff
6 changed files with 21 additions and 19 deletions

View file

@ -12,6 +12,10 @@ body {
max-width: 500px;
}
.profile-picture {
max-width: 100px;
}
.flash {
background-color: lightgreen;
padding: 0.5em 1em;

View file

@ -112,7 +112,7 @@ var TplMap = map[string]string{
</table>
</form>
<p>Past this code into your HTML file:</p>
<textarea style="width: 100%; max-width: 500px; height: 75px;"><script src="https://status.cafe/current-status.js?name={{ .name }}"></script></textarea>
<textarea style="width: 100%; max-width: 500px; height: 75px;"><div id="statuscafe"><div id="statuscafe-username"></div><div id="statuscafe-content"></div></div><script src="https://status.cafe/current-status.js?name={{ .name }}" defer></script></textarea>
<p>Past this code into your CSS file:</p>
<textarea style="width: 100%; max-width: 500px; height: 175px;">#statuscafe {
padding: .5em;
@ -186,7 +186,6 @@ var TplMap = map[string]string{
</section>
<section>
<h2>Status stream</h2>
<p class="flash">The <a href="https://forum.status.cafe">forum</a> has opened! <a href="/forum-key">Generate your key</a> to <a href="https://forum.status.cafe/register">register</a>. Best viewed with a hot beverage.</p>
{{ range .statuses }}
<article class="status">
{{ template "status" . }}
@ -367,26 +366,26 @@ var TplMap = map[string]string{
<section>
<h2>{{ .user }}</h2>
{{ if .picture }}
<img src="{{ .picture }}" width="100" class="profile-picture"/>
<img src="{{ .picture }}" class="profile-picture"/>
{{ end }}
<p><a href="/users/{{ .user }}.atom">Subscribe via Atom</a></p>
<dl>
<dt>Homepage</dt>
<dd>
<dt class="homepage">Homepage</dt>
<dd class="homepage">
{{ if .homepage }}
<a href="{{ .homepage }}" target="_blank">{{ .homepage }}</a></dd>
{{ else }}
Not defined
{{ end }}
<dt>Email</dt>
<dd>
<dt class="email">Email</dt>
<dd class="email">
{{ if .email }}
<a href="mailto:{{ .email }}" target="_blank">{{ .email }}</a></dd>
{{ else }}
Not defined
{{ end }}
<dt>About</dt>
<dd>
<dt class="about">About</dt>
<dd class="about">
{{ if .about }}
{{ .about }}
{{ else }}

View file

@ -38,7 +38,7 @@
</table>
</form>
<p>Past this code into your HTML file:</p>
<textarea style="width: 100%; max-width: 500px; height: 75px;"><script src="https://status.cafe/current-status.js?name={{ .name }}"></script></textarea>
<textarea style="width: 100%; max-width: 500px; height: 75px;"><div id="statuscafe"><div id="statuscafe-username"></div><div id="statuscafe-content"></div></div><script src="https://status.cafe/current-status.js?name={{ .name }}" defer></script></textarea>
<p>Past this code into your CSS file:</p>
<textarea style="width: 100%; max-width: 500px; height: 175px;">#statuscafe {
padding: .5em;

View file

@ -29,7 +29,6 @@
</section>
<section>
<h2>Status stream</h2>
<p class="flash">The <a href="https://forum.status.cafe">forum</a> has opened! <a href="/forum-key">Generate your key</a> to <a href="https://forum.status.cafe/register">register</a>. Best viewed with a hot beverage.</p>
{{ range .statuses }}
<article class="status">
{{ template "status" . }}

View file

@ -9,26 +9,26 @@
<section>
<h2>{{ .user }}</h2>
{{ if .picture }}
<img src="{{ .picture }}" width="100" class="profile-picture"/>
<img src="{{ .picture }}" class="profile-picture"/>
{{ end }}
<p><a href="/users/{{ .user }}.atom">Subscribe via Atom</a></p>
<dl>
<dt>Homepage</dt>
<dd>
<dt class="homepage">Homepage</dt>
<dd class="homepage">
{{ if .homepage }}
<a href="{{ .homepage }}" target="_blank">{{ .homepage }}</a></dd>
{{ else }}
Not defined
{{ end }}
<dt>Email</dt>
<dd>
<dt class="email">Email</dt>
<dd class="email">
{{ if .email }}
<a href="mailto:{{ .email }}" target="_blank">{{ .email }}</a></dd>
{{ else }}
Not defined
{{ end }}
<dt>About</dt>
<dd>
<dt class="about">About</dt>
<dd class="about">
{{ if .about }}
{{ .about }}
{{ else }}

View file

@ -16,7 +16,7 @@ func (h *Handler) initTpl() {
for name, content := range TplMap {
views[name] = template.Must(template.New("main").Funcs(template.FuncMap{
"faces": func() []string {
return []string{"🙂", "😎", "😛", "🥰", "😂", "❤️", "👽", "😱", "🤔", "😶", "😯", "🤒", "😡", "🥺", "🥳", "🤖", "💀", "😴", "😭", "🤐", "💾", "👀", "☕", "🍺", "📖", "🔥", "❄️", "✨", "💡", "🎶", "✈️", "🚄", "🍿", "📰", "✏️", "🍱", "⛵", "🎁", "🌧️", "🌙", "🎨", "📺", "🍕", "✅", "🐶", "🐱"}
return []string{"🙂", "😎", "😛", "🥰", "😂", "❤️", "👽", "😱", "😭", "🤔", "😶", "😯", "🤒", "😡", "🥺", "🥳", "🤖", "💀", "😴", "😭", "🤐", "💾", "👀", "☕", "🍺", "📖", "🔥", "❄️", "✨", "💡", "🎶", "✈️", "🚄", "🍿", "📰", "✏️", "🍱", "⛵", "🎁", "🌧️", "🌙", "🎨", "📺", "🍕", "✅", "🐶", "🐱", "🌱"}
}}).Parse(commonTemplates + content))
}
}