Albirew/nyaa-pantsu
Archivé
1
0
Bifurcation 0

Fixing call to flag method

Cette révision appartient à :
akuma06 2017-07-11 22:48:52 +02:00 révisé par ewhal
Parent e1d6e7df20
révision 21767877b1
11 fichiers modifiés avec 13 ajouts et 12 suppressions

Voir le fichier

@ -56,7 +56,7 @@ func walkDirTest(dir string, t *testing.T) {
}, },
"edit.jet.html": func(vars jet.VarMap) jet.VarMap { "edit.jet.html": func(vars jet.VarMap) jet.VarMap {
vars.Set("Form", &torrentValidator.TorrentRequest{}) vars.Set("Form", &torrentValidator.TorrentRequest{})
vars.Set("Languages", publicSettings.Languages{{"", ""}}) vars.Set("Languages", publicSettings.Languages{{"", "", ""}})
return vars return vars
}, },
"upload.jet.html": func(vars jet.VarMap) jet.VarMap { "upload.jet.html": func(vars jet.VarMap) jet.VarMap {
@ -69,7 +69,7 @@ func walkDirTest(dir string, t *testing.T) {
return vars return vars
}, },
"settings.jet.html": func(vars jet.VarMap) jet.VarMap { "settings.jet.html": func(vars jet.VarMap) jet.VarMap {
vars.Set("Form", &LanguagesJSONResponse{"", publicSettings.Languages{{"", ""}}}) vars.Set("Form", &LanguagesJSONResponse{"", publicSettings.Languages{{"", "", ""}}})
return vars return vars
}, },
"login.jet.html": func(vars jet.VarMap) jet.VarMap { "login.jet.html": func(vars jet.VarMap) jet.VarMap {

Voir le fichier

@ -22,8 +22,8 @@
<div name="language" class="form-input language"> <div name="language" class="form-input language">
{{ range _, language := GetTorrentLanguages() }} {{ range _, language := GetTorrentLanguages() }}
<span class="input-group"> <span class="input-group">
<input type="checkbox" name="languages" id="lang-{{ language.Code }}" value="{{language.Code}}"{{if contains(Form.Languages, language) }} checked{{end}}> <input type="checkbox" name="languages" id="lang-{{ language.Code }}" value="{{language.Code}}"{{if contains(Form.Languages, language.Code) }} checked{{end}}>
<label for="lang-{{ language.Code }}" class="flag flag-{{ language.Flag() }}" title="{{LanguageName(language, T)}}"></label> <label for="lang-{{ language.Code }}" class="flag flag-{{ language.Flag(false) }}" title="{{LanguageName(language, T)}}"></label>
</span> </span>
{{ end }} {{ end }}
</div> </div>

Voir le fichier

@ -1,5 +1,6 @@
{* We extend the base template *} {* We extend the base template *}
{{ extends "partials/base" }} {{ extends "partials/base" }}
{{import "partials/helpers/search"}}
{* We apply the menu in the base template *} {* We apply the menu in the base template *}
{{ block menu()}} {{ block menu()}}

Voir le fichier

@ -1,5 +1,6 @@
{* We extend the base template *} {* We extend the base template *}
{{ extends "partials/base" }} {{ extends "partials/base" }}
{{import "partials/helpers/search"}}
{* We apply the menu in the base template *} {* We apply the menu in the base template *}
{{ block menu()}} {{ block menu()}}

Voir le fichier

@ -1,6 +1,5 @@
{{import "helpers/errors"}} {{import "helpers/errors"}}
{{import "helpers/infos"}} {{import "helpers/infos"}}
{{import "helpers/search"}}
<!DOCTYPE html> <!DOCTYPE html>
<html lang="{{ T("language_code") }}"> <html lang="{{ T("language_code") }}">
<head> <head>

Voir le fichier

@ -57,8 +57,8 @@
<div name="language" class="form-refine form-input language"> <div name="language" class="form-refine form-input language">
{{ range _, language := GetTorrentLanguages() }} {{ range _, language := GetTorrentLanguages() }}
<span class="input-group"> <span class="input-group">
<input type="checkbox" name="lang" id="lang-{{ language }}" value="{{language}}"{{ range _, v := Search.Languages}}{{ if v.Code == language }} checked{{end}}{{end}}> <input type="checkbox" name="lang" id="lang-{{ language.Code }}" value="{{language.Code}}"{{ range _, v := Search.Languages}}{{ if v.Code == language.Code }} checked{{end}}{{end}}>
<label for="lang-{{ language.Code }}" class="flag flag-{{ language.Flag() }}" title="{{LanguageName(language, T)}}"></label> <label for="lang-{{ language.Code }}" class="flag flag-{{ language.Flag(false) }}" title="{{LanguageName(language, T)}}"></label>
</span> </span>
{{ end }} {{ end }}
</div> </div>

Voir le fichier

@ -28,7 +28,7 @@
{{ range _, language := GetTorrentLanguages() }} {{ range _, language := GetTorrentLanguages() }}
<span class="input-group"> <span class="input-group">
<input type="checkbox" name="languages" id="lang-{{ language.Code }}" value="{{language.Code}}"{{if contains(Form.Languages, language.Code) }} checked{{end}}> <input type="checkbox" name="languages" id="lang-{{ language.Code }}" value="{{language.Code}}"{{if contains(Form.Languages, language.Code) }} checked{{end}}>
<label for="lang-{{ language.Code }}" class="flag flag-{{ language.Flag() }}" title="{{LanguageName(language, T)}}"></label> <label for="lang-{{ language.Code }}" class="flag flag-{{ language.Flag(false) }}" title="{{LanguageName(language, T)}}"></label>
</span> </span>
{{ end }} {{ end }}
</div> </div>

Voir le fichier

@ -49,7 +49,7 @@
<a href="{{ URL.Parse("/search?c="+.Category+"_"+ .SubCategory) }}" title="{{ T(CategoryName(.Category, .SubCategory)) }}" class="category"> <a href="{{ URL.Parse("/search?c="+.Category+"_"+ .SubCategory) }}" title="{{ T(CategoryName(.Category, .SubCategory)) }}" class="category">
{{if .Languages[0] != "" }} {{if .Languages[0] != "" }}
<a href="{{ URL.Parse("/search?c="+.Category+"_"+ .SubCategory +"&lang=") }}{{ range key, language := .Languages }}{{ language }}{{ if len(.Languages) > 1 && (key+1) < len(.Languages) }},{{ end }}{{ end }}"> <a href="{{ URL.Parse("/search?c="+.Category+"_"+ .SubCategory +"&lang=") }}{{ range key, language := .Languages }}{{ language }}{{ if len(.Languages) > 1 && (key+1) < len(.Languages) }},{{ end }}{{ end }}">
<img src="/img/blank.gif" alt="{{ LanguageName(.Languages[0], T) }}" class="flag flag-{{ (len(.Languages) == 1) ? .Languages[0].Flag() : "multiple" }}" title=" {{ range key, language := .Languages }}{{ LanguageName(language, T) }}{{ if len(.Languages) > 1 && (key+1) < len(.Languages) }},{{ end }}{{ end }}"> <img src="/img/blank.gif" alt="{{ LanguageName(.Languages[0], T) }}" class="flag flag-{{ (len(.Languages) == 1) ? .Languages[0].Flag(false) : "multiple" }}" title=" {{ range key, language := .Languages }}{{ LanguageName(language, T) }}{{ if len(.Languages) > 1 && (key+1) < len(.Languages) }},{{ end }}{{ end }}">
</a> </a>
{{end}} {{end}}
</a> </a>

Voir le fichier

@ -34,7 +34,7 @@
{{ range _, language := GetTorrentLanguages() }} {{ range _, language := GetTorrentLanguages() }}
<span class="input-group"> <span class="input-group">
<input type="checkbox" name="languages" id="lang-{{ language.Code }}" value="{{language.Code}}"> <input type="checkbox" name="languages" id="lang-{{ language.Code }}" value="{{language.Code}}">
<label for="lang-{{ language.Code }}" class="flag flag-{{ language.Flag() }}" title="{{LanguageName(language, T)}}"></label> <label for="lang-{{ language.Code }}" class="flag flag-{{ language.Flag(false) }}" title="{{LanguageName(language, T)}}"></label>
</span> </span>
{{ end }} {{ end }}
</div> </div>

Voir le fichier

@ -36,7 +36,7 @@
<td class="tr-flag torrent-view-td torrent-info-data"> <td class="tr-flag torrent-view-td torrent-info-data">
{{ range _, language := Torrent.Languages}} {{ range _, language := Torrent.Languages}}
{{ if language != "" }} {{ if language != "" }}
<span><img src="/img/blank.gif" alt="{{ LanguageName(language, T) }}" class="flag flag-{{ language.Flag() }}" title="{{ LanguageName(language, T) }}"></img> {{ LanguageName(language, T) }}</span> <span><img src="/img/blank.gif" alt="{{ LanguageName(language, T) }}" class="flag flag-{{ language.Flag(false) }}" title="{{ LanguageName(language, T) }}"></img> {{ LanguageName(language, T) }}</span>
{{end}} {{end}}
{{end}} {{end}}
</td> </td>

Voir le fichier

@ -26,7 +26,7 @@
<a href="{{URL.Parse ("/search?c="+ torrent.Category + "_" +torrent.SubCategory) }}" title="{{T(CategoryName(torrent.Category, torrent.SubCategory))}}" class="category"> <a href="{{URL.Parse ("/search?c="+ torrent.Category + "_" +torrent.SubCategory) }}" title="{{T(CategoryName(torrent.Category, torrent.SubCategory))}}" class="category">
{{ if torrent.Languages[0] != "" }} {{ if torrent.Languages[0] != "" }}
<a href="{{ URL.Parse("/search?c="+torrent.Category+"_"+ torrent.SubCategory +"&lang=") }}{{ range key, language := torrent.Languages }}{{ language }}{{ if len(torrent.Languages) > 1 && (key+1) < len(torrent.Languages) }},{{ end }}{{ end }}"> <a href="{{ URL.Parse("/search?c="+torrent.Category+"_"+ torrent.SubCategory +"&lang=") }}{{ range key, language := torrent.Languages }}{{ language }}{{ if len(torrent.Languages) > 1 && (key+1) < len(torrent.Languages) }},{{ end }}{{ end }}">
<img src="/img/blank.gif" alt="{{ LanguageName(torrent.Languages[0], T) }}" class="flag flag-{{ (len(torrent.Languages) == 1) ? torrent.Languages[0].Flag() : "multiple" }}" title=" {{ range key, language := torrent.Languages }}{{ LanguageName(language, T) }}{{ if len(torrent.Languages) > 1 && (key+1) < len(torrent.Languages) }},{{ end }}{{ end }}"> <img src="/img/blank.gif" alt="{{ LanguageName(torrent.Languages[0], T) }}" class="flag flag-{{ (len(torrent.Languages) == 1) ? torrent.Languages[0].Flag(false) : "multiple" }}" title=" {{ range key, language := torrent.Languages }}{{ LanguageName(language, T) }}{{ if len(torrent.Languages) > 1 && (key+1) < len(torrent.Languages) }},{{ end }}{{ end }}">
</a> </a>
{{end}} {{end}}
</a> </a>