diff --git a/pkg/random/random.go b/pkg/random/random.go
index aead9330..00efd726 100644
--- a/pkg/random/random.go
+++ b/pkg/random/random.go
@@ -71,8 +71,16 @@ func MotDebileQuiSeMange() string {
func MotCool() string {
mots := []string{
- "cool", "sympa", "gentil", "genial", "excellent", "superbe", "super",
- "vraiment tres bien", "bien", "qui en a dans le pantalon", "top",
+ "cool", "sympa", "gentil", "génial", "excellent", "superbe", "super",
+ "vraiment très bien", "bien", "qui en a dans le pantalon", "top",
+ }
+ return mots[rand.Intn(len(mots))]
+}
+
+func MotCoolPluriel() string {
+ mots := []string{
+ "cools", "sympas", "gentils", "géniaux", "excellents", "superbes", "supers",
+ "vraiment très biens", "biens", "qui en ont dans le pantalon", "tops",
}
return mots[rand.Intn(len(mots))]
}
diff --git a/pkg/soundcloud/entities.go b/pkg/soundcloud/entities.go
index d43fea7d..98ccf3e4 100644
--- a/pkg/soundcloud/entities.go
+++ b/pkg/soundcloud/entities.go
@@ -1,6 +1,9 @@
package soundcloud
-import "fmt"
+import (
+ "fmt"
+ "strings"
+)
func (p *Playlist) IsMain() bool {
switch p.PlaylistType {
@@ -47,3 +50,7 @@ func (t *Track) URL() string {
func (t *Track) IsExternal() bool { return false }
func (t *Track) ImageURL() string { return t.ArtworkUrl }
+
+func (t *Track) Tags() []string {
+ return strings.Split(t.TagList, " ") // FIXME: use shell lexer
+}
diff --git a/templates/hackz.tmpl b/templates/hackz.tmpl
index 5fbd345d..4825069e 100644
--- a/templates/hackz.tmpl
+++ b/templates/hackz.tmpl
@@ -1,9 +1,6 @@
{{define "title"}}Hackz{{end}}
-
-{{/*
-{% block title %}Des hackz{% endblock %}
-{% block subtitle %}à l'unité{% endblock %}
-*/}}
+{{define "h1"}}Des hackz{{end}}
+{{define "h1small"}}à l'unité{{end}}
{{define "content"}}
{{ $columns := 3 }}
@@ -14,7 +11,7 @@
{{ range $entry := .hackz.Entries }}
-
-
Et plein d'autres..
+
+
+{{end}}
+
+
+{{define "secondary_column"}}
+
Hackzers les plus {{ mot_cool_pluriel }} (pour l'instant !)
+ Les scores sont cassés et reviendront bientôt
{{end}}
{{/*
{% block secondary_column %}
-
Hackzers les plus {{ mot_cool() }} (pour l'instant !)
{% for scor in hackzers %}
- #{{ loop.index }} {{ scor.login }} avec {{ scor.score }} {{ mot_debile_qui_se_mange() }}
diff --git a/templates/home.tmpl b/templates/home.tmpl
index 9804ab6d..84e507ac 100644
--- a/templates/home.tmpl
+++ b/templates/home.tmpl
@@ -1,9 +1,6 @@
{{define "fulltitle"}}Camembert au lait crew{{end}}
-
-{{/*
-{{ block title }}{{ images | length }} trucs{{ endblock }}
-{{ block subtitle }}au hasard{{ endblock }}
-*/}}
+{{define "h1"}}{{len .dashboard.Entries}} trucs {{mot_cool_pluriel}}{{end}}
+{{define "h1small"}}au hasard{{end}}
{{define "content"}}
diff --git a/templates/layout/base.tmpl b/templates/layout/base.tmpl
index c478fc53..16965d78 100644
--- a/templates/layout/base.tmpl
+++ b/templates/layout/base.tmpl
@@ -111,26 +111,25 @@
- {{ block "content" . }}{{end}}
- {{/*
- {{ if layout == 'two_columns' }}
-
-
{{ self.title() }} {{ self.subtitle() }}
- {{ block main_column }}{{ endblock }}
-
-
-
- {{ block secondary_column }}{{ endblock }}
-
- {{ else }} {# one column #}
-
-
{{ self.title() }} {{ self.subtitle() }}
- {{template "content" .}}
-
+
+ {{if eq .layout_mode "single_column"}}
+
+
{{ block "h1" . }}{{end}} {{ block "h1small" . }}{{end}}
+ {{ block "content" . }}{{end}}
+
+ {{end}}
+ {{if eq .layout_mode "two_columns"}}
+
+
{{ block "h1" . }}{{end}} {{ block "h1small" . }}{{end}}
+ {{ block "content" . }}{{end}}
+
+
+
+ {{ block "secondary_column" . }}{{ end }}
+
{{end}}
-*/}}
-
+
diff --git a/templates/muzik.tmpl b/templates/muzik.tmpl
index 42a583c1..7b0b4569 100644
--- a/templates/muzik.tmpl
+++ b/templates/muzik.tmpl
@@ -1,9 +1,7 @@
{{define "title"}}Muzik{{end}}
+{{define "h1"}}Des albums {{mot_cool_pluriel}}{{end}}
+{{define "h1small"}}pas au hasard{{end}}
-{{/*
-{% block title %}Des albums{% endblock %}
-{% block subtitle %}pas au hasard{% endblock %}
-*/}}
{{define "content"}}
{{ $columns := 2 }}
diff --git a/templates/track.tmpl b/templates/track.tmpl
index 9b243bc1..26acd1b4 100644
--- a/templates/track.tmpl
+++ b/templates/track.tmpl
@@ -2,8 +2,8 @@
{{define "h1"}}Du son {{ mot_cool }}{{end}}
{{define "h1small"}}{{.track.Title}}{{end}}
-{{define "content"}}
+{{define "content"}}