File tree Expand file tree Collapse file tree 3 files changed +38
-2
lines changed
Expand file tree Collapse file tree 3 files changed +38
-2
lines changed Original file line number Diff line number Diff line change @@ -563,7 +563,11 @@ func indexHandler(w http.ResponseWriter, r *http.Request) {
563563 return seriesVideos [i ].CreatedAt .Before (seriesVideos [j ].CreatedAt )
564564 })
565565
566- tmpl , err := template .ParseFiles ("templates/index.html" )
566+ funcMap := template.FuncMap {
567+ "episodeNum" : extractEpisodeNumber ,
568+ }
569+
570+ tmpl , err := template .New ("index.html" ).Funcs (funcMap ).ParseFiles ("templates/index.html" )
567571 if err != nil {
568572 http .Error (w , err .Error (), http .StatusInternalServerError )
569573 return
Original file line number Diff line number Diff line change 5353 border-radius : 8px ;
5454 margin-bottom : 15px ;
5555 overflow : hidden;
56+ position : relative;
57+ }
58+
59+ .episode-badge-thumb {
60+ position : absolute;
61+ top : 0 ;
62+ right : 0 ;
63+ background-color : rgba (187 , 134 , 252 , 0.9 );
64+ color : black;
65+ padding : 4px 8px ;
66+ border-bottom-left-radius : 8px ;
67+ font-weight : bold;
68+ font-size : 1rem ;
69+ z-index : 5 ;
70+ }
71+
72+ .episode-tag {
73+ display : inline-block;
74+ background-color : # bb86fc ;
75+ color : black;
76+ padding : 2px 6px ;
77+ border-radius : 4px ;
78+ font-size : 0.8em ;
79+ margin-right : 8px ;
80+ vertical-align : middle;
5681}
5782
5883.video-thumbnail video {
Original file line number Diff line number Diff line change 6161 {{range .Videos}}
6262 < a href ="/play?id={{.ID}} " class ="video-card " tabindex ="0 ">
6363 < div class ="video-thumbnail ">
64+ {{$ep := episodeNum .Title}}
65+ {{if gt $ep 0}}
66+ < div class ="episode-badge-thumb "> {{printf "%02d" $ep}}</ div >
67+ {{end}}
6468 < video src ="{{.Path}} " preload ="metadata "> </ video >
6569 </ div >
6670 < div class ="video-info ">
67- < h2 > {{.Title}}</ h2 >
71+ < h2 >
72+ {{if gt $ep 0}}< span class ="episode-tag "> {{printf "%02d" $ep}}</ span > {{end}}
73+ {{.Title}}
74+ </ h2 >
6875 < p >
6976 < span class ="status-badge {{.Status}} " id ="status-{{.ID}} "> {{.Status}}</ span >
7077 {{.CreatedAt.Format "2006-01-02 15:04"}}
You can’t perform that action at this time.
0 commit comments