Render polochon movies

This commit is contained in:
Grégoire Delattre 2016-11-05 15:56:45 +01:00
parent dab68faac6
commit d59064a82a
2 changed files with 31 additions and 12 deletions

View File

@ -96,7 +96,8 @@ func FromPolochon(env *web.Env, w http.ResponseWriter, r *http.Request) error {
env.Log.Info(movies) env.Log.Info(movies)
return nil web.SetData(r, "movies", movies)
return env.Rends(w, r, "movies/library")
} }
func ExplorePopular(env *web.Env, w http.ResponseWriter, r *http.Request) error { func ExplorePopular(env *web.Env, w http.ResponseWriter, r *http.Request) error {

View File

@ -1,6 +1,10 @@
{{ if $.Data.error }} {{ if $.Data.error }}
{{ if eq $.Data.error "Invalid address"}} {{ if eq $.Data.error "Invalid address"}}
<div class="alert alert-danger" role="alert">The polochon API adress specified in your configuration is invalid or unreachable, <a href="{{ URL "users.edit"}}">change it</a></div> <div class="alert alert-danger" role="alert">
The polochon API adress specified in your configuration is invalid or unreachable,
<a href="{{ URL "users.edit"}}">change it</a>
</div>
{{ end }} {{ end }}
{{ else }} {{ else }}
@ -22,7 +26,21 @@
<div class="col-xs-7 col-md-4"> <div class="col-xs-7 col-md-4">
{{ range $.Data.movies}} {{ range $.Data.movies}}
<div id="{{.ImdbID}}-detail" class="hidden movie-detail affix"> <div id="{{.ImdbID}}-detail" class="hidden movie-detail affix">
<h1>{{.Title}}</h1> <h1 class="hidden-xs">{{ .Title }}</h1>
<h3 class="visible-xs">{{ .Title }}</h3>
<h4 class="hidden-xs">{{ .Year }}</h4>
<p>
<i class="fa fa-clock-o"></i>
{{ .Runtime }} min
</p>
<p>
<i class="fa fa-star-o"></i>
{{ .Rating }} <small>({{ .Votes }} counts)</small>
</p>
<p>{{ .Plot }}</p>
</div> </div>
{{ end}} {{ end}}
</div> </div>