diff --git a/public/css/style-night.css b/public/css/style-night.css index 01e46b5a..0c071edb 100644 --- a/public/css/style-night.css +++ b/public/css/style-night.css @@ -103,7 +103,7 @@ a:hover { } :target { - background-color: #585b4f; + background-color: #b294bb; } /* style the dropdown member menu */ @@ -149,3 +149,14 @@ a:hover { background: #29363d; color: #cf9fff; } + +/*Comments*/ + +.commentList .commentData { + color: #fff; +} + +.commentList .commentBody { + background: #29363d; + color: #fff; +} diff --git a/public/css/style.css b/public/css/style.css index 4c71284d..d4959092 100644 --- a/public/css/style.css +++ b/public/css/style.css @@ -15,18 +15,18 @@ color: white; } #mainmenu { - position: fixed; + position: fixed; width: 100%; z-index: 4; border: 0px solid white; } #mainmenu a { - background: none; - color: white; + background: none; + color: white; } #mainmenu .divider { - background: black; + background: black; } #container { @@ -54,7 +54,7 @@ body { } .torrentNav { - text-align: center; + text-align: center; } .pagination > .active > a { @@ -65,8 +65,8 @@ body { /* Links, Text */ a { - color: #106655; - text-decoration : none; + color: #106655; + text-decoration : none; } .download-btn { @@ -87,25 +87,25 @@ td { } .torrent-info .name { - font-weight: bold; - overflow: hidden; - padding-bottom: 3px; - padding-top: 3px; - word-wrap: break-word; + font-weight: bold; + overflow: hidden; + padding-bottom: 3px; + padding-top: 3px; + word-wrap: break-word; } .torrent-hash { - font-family: monospace; + font-family: monospace; } .torrent-info .filesize { - white-space: nowrap; + white-space: nowrap; } .comment-row td:first-of-type { - vertical-align: top; - text-align: left; - color:#bbb; + vertical-align: top; + text-align: left; + color:#bbb; } /* Table style & fixes */ @@ -115,25 +115,25 @@ td { } .table > tbody > tr > th, .table > tbody > tr > td { - padding: 4px; + padding: 4px; } .captcha-container { - display: grid; - grid-template-rows: auto; - grid-template-columns: 240px; + display: grid; + grid-template-rows: auto; + grid-template-columns: 240px; } tr.torrent-info td.date { - white-space: nowrap; + white-space: nowrap; } .custom-table-hover > tbody > tr:hover { - opacity: 0.82; + opacity: 0.82; } .comment-row { - border-top: 1px solid #ddd; + border-top: 1px solid #ddd; } div.container div.blockBody:nth-of-type(2) table{table-layout:fixed;} @@ -144,25 +144,25 @@ div.container div.blockBody:nth-of-type(2) table tr:first-of-type th:last-of-typ /* Mobile-friendly main table */ @media only screen and (max-width: 700px) { - table, thead, tbody, tr { - display: block; - } + table, thead, tbody, tr { + display: block; + } - th { - display: none; - } + th { + display: none; + } - td { - display: inline-block; - } + td { + display: inline-block; + } - td:nth-of-type(1), td:nth-of-type(2) { - display: block; - } + td:nth-of-type(1), td:nth-of-type(2) { + display: block; + } - .table > tbody > tr > td { - border: none; - } + .table > tbody > tr > td { + border: none; + } } /* Credit to bootsnipp.com for the css for the color graph */ @@ -178,8 +178,8 @@ div.container div.blockBody:nth-of-type(2) table tr:first-of-type th:last-of-typ } .center-image { - max-width: 100%; - max-height: 80vh; + max-width: 100%; + max-height: 80vh; } /* the curved edges triggered my autism */ @@ -196,11 +196,11 @@ div.container div.blockBody:nth-of-type(2) table tr:first-of-type th:last-of-typ } #mainmenu button .search_text { - display: none; + display: none; } #mainmenu .navbar-form select.form-control { - width: 12rem; + width: 12rem; } #mainmenu .navbar-form select.form-control#max { @@ -365,10 +365,10 @@ select#bottom_language_selector { /* Psuedo green-text fuckery. */ #comments blockquote { - color: #789922; + color: #789922; } #comments blockquote:before { - content: ">"; + content: ">"; } .completed { @@ -395,11 +395,108 @@ select#bottom_language_selector { } .comment-date { - font-size: smaller; - width: auto; /* Undo bootstrap's fixed width */ + font-size: smaller; + width: auto; /* Undo bootstrap's fixed width */ } .text-error { background: white; color: #cf9fff; } + +/* Wordbreak fix*/ + +.break { + word-break:break-all; + -webkit-hyphens: auto; + -moz-hyphens: auto; + -ms-hyphens: auto; + hyphens: auto; +} + + +/*Comments*/ + +.commentList::before, +.commentList::after { + content: ""; + display: table; + clear: both; +} + +.commentList ul { + list-style-type: none; + padding: 0; +} + +.commentList img { + opacity: 1; + filter: Alpha(opacity=100); + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + -o-border-radius: 4px; + border-radius: 4px; +} + +.commentList img.avatar { + position: relative; + float: left; + margin-left: 0; + margin-top: 0; + width: 65px; + height: 65px; +} + +.commentList .commentBody { + border: 1px solid #eee; + margin-bottom: 20px; + margin-left: 85px; + margin-right: 0px; + padding: 10px 20px; + position: relative; + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + -o-border-radius: 4px; + border-radius: 4px; + background: #fff; + color: #6b6e80; + position: relative; +} + +.commentList .commentData { + font-size: 13px; + color: #aaaaaa; + padding-bottom: 8px; + margin-bottom: 10px !important; + border-bottom: 1px solid #eee; + height: 2.5em; +} + +.commentList ul.comments ul{ + list-style-type: none; + padding: 0; + margin-left: 85px; +} + + +.commentList h3 { + margin-bottom: 40px; + font-size: 26px; + line-height: 30px; + font-weight: 800; +} + +.comment { + margin: 1em; + padding: 1em; + width: 75%; + margin-left: 12%; +} + +@media only screen and (min-device-width : 320px) and (max-device-width : 480px) { + + .comment { + width: 100%; + margin-left: 0; + } +} diff --git a/public/js/main.js b/public/js/main.js index d0e90e8a..63d67b6f 100644 --- a/public/js/main.js +++ b/public/js/main.js @@ -48,6 +48,12 @@ for(var i in list) { e.innerText = date.toDateString() + " " + date.toLocaleTimeString(); } +/*Fixed-Navbar offset fix*/ +window.onload = function() { + var shiftWindow = function() { scrollBy(0, -70) }; +if (location.hash) shiftWindow(); +window.addEventListener("hashchange", shiftWindow); +}; function loadLanguages() { var xhr = new XMLHttpRequest(); xhr.onreadystatechange = function() { @@ -78,4 +84,4 @@ function loadLanguages() { xhr.send() } -loadLanguages(); \ No newline at end of file +loadLanguages(); diff --git a/router/templateFunctions.go b/router/templateFunctions.go index 40f55f26..f2227ff2 100644 --- a/router/templateFunctions.go +++ b/router/templateFunctions.go @@ -41,56 +41,56 @@ var FuncMap = template.FuncMap{ order := false if _, ok := values["order"]; ok { order, _ = strconv.ParseBool(values["order"][0]) - if values["sort"][0]==sortBy { - order=!order //Flip order by repeat-clicking + if values["sort"][0] == sortBy { + order = !order //Flip order by repeat-clicking } else { - order=false //Default to descending when sorting by something new + order = false //Default to descending when sorting by something new } } values.Set("sort", sortBy) values.Set("order", strconv.FormatBool(order)) url, _ := Router.Get("search").URL() - url.RawQuery=values.Encode() - + url.RawQuery = values.Encode() + return template.URL(url.String()) }, "genNav": func(nav Navigation, currentUrl *url.URL, pagesSelectable int) template.HTML { var ret = "" - if (nav.TotalItem > 0) { - maxPages := math.Ceil(float64(nav.TotalItem) / float64(nav.MaxItemPerPage)) + if nav.TotalItem > 0 { + maxPages := math.Ceil(float64(nav.TotalItem) / float64(nav.MaxItemPerPage)) - if nav.CurrentPage-1 > 0 { - url, _ := Router.Get(nav.Route).URL("page", "1") - ret = ret + "
  • «
  • " - } - startValue := 1 - if nav.CurrentPage > pagesSelectable/2 { - startValue = (int(math.Min((float64(nav.CurrentPage)+math.Floor(float64(pagesSelectable)/2)), maxPages)) - pagesSelectable + 1) - } - endValue := (startValue + pagesSelectable - 1) - if endValue > int(maxPages) { - endValue = int(maxPages) - } - log.Println(nav.TotalItem) - for i := startValue; i <= endValue; i++ { - pageNum := strconv.Itoa(i) - url, _ := Router.Get(nav.Route).URL("page", pageNum) - ret = ret + " 0 { + url, _ := Router.Get(nav.Route).URL("page", "1") + ret = ret + "
  • «
  • " } + startValue := 1 + if nav.CurrentPage > pagesSelectable/2 { + startValue = (int(math.Min((float64(nav.CurrentPage)+math.Floor(float64(pagesSelectable)/2)), maxPages)) - pagesSelectable + 1) + } + endValue := (startValue + pagesSelectable - 1) + if endValue > int(maxPages) { + endValue = int(maxPages) + } + log.Println(nav.TotalItem) + for i := startValue; i <= endValue; i++ { + pageNum := strconv.Itoa(i) + url, _ := Router.Get(nav.Route).URL("page", pageNum) + ret = ret + "" + strconv.Itoa(i) + "" - } - if nav.CurrentPage < int(maxPages) { - url, _ := Router.Get(nav.Route).URL("page", strconv.Itoa(nav.CurrentPage+1)) - ret = ret + "
  • »
  • " - } + ret = ret + ">" + strconv.Itoa(i) + "" + } + if nav.CurrentPage < int(maxPages) { + url, _ := Router.Get(nav.Route).URL("page", strconv.Itoa(nav.CurrentPage+1)) + ret = ret + "
  • »
  • " + } } return template.HTML(ret) }, - "T": i18n.IdentityTfunc, + "T": i18n.IdentityTfunc, "Ts": i18n.IdentityTfunc, "getAvatar": func(hash string, size int) string { return "https://www.gravatar.com/avatar/" + hash + "?s=" + strconv.Itoa(size) @@ -105,9 +105,9 @@ var FuncMap = template.FuncMap{ return template.HTML(str) }, "calcWidthSeed": func(seed uint32, leech uint32) float64 { - return float64(float64(seed)/(float64(seed)+float64(leech)))*100 + return float64(float64(seed)/(float64(seed)+float64(leech))) * 100 }, "calcWidthLeech": func(seed uint32, leech uint32) float64 { - return float64(float64(leech)/(float64(seed)+float64(leech)))*100 + return float64(float64(leech)/(float64(seed)+float64(leech))) * 100 }, } diff --git a/templates/home.html b/templates/home.html index 037f3af0..4720bb62 100644 --- a/templates/home.html +++ b/templates/home.html @@ -17,9 +17,9 @@ {{T "name"}} - {{T "S"}} / - {{T "L"}} / - {{T "D"}} + {{T "S"}} / + {{T "L"}} / + {{T "D"}} {{T "date"}} {{T "size"}} diff --git a/templates/view.html b/templates/view.html index 85175b8e..5be2b908 100644 --- a/templates/view.html +++ b/templates/view.html @@ -5,11 +5,11 @@ {{with .Torrent}}
    -

    {{T "comments"}}

    - {{ range $index, $element := .Comments }} -
    -
    - {{if eq .UserID -1}} - {{$index}} - {{.Username}} - {{else}} - {{$index}} - {{.Username}} +
    +

    {{T "comments"}}

    +
    +
      + {{ range $index, $element := .Comments }} +
    • + {{/* The following line is wrong. Should be using the MD5 User hash but i don't knwo how to access it. */}} + {{/* Changing Gravatar for something else, so it can stay like this. */}} + +
      +
      +
      +
      +
      +
      + {{if eq .UserID -1}} + #{{$index}} by {{.Username}} + {{else}} + #{{$index}} + by {{.Username}} + {{end}} +
      +
      + + + {{ .Date.Format ( Ts "date_format" ) }} + {{/* output: "2017-05-01 15:30" + Went with "Year-Month-Day" because it's the most unambiguous. + If you want it to be determined by where you're from, be my guest. */}} + + +
      +
      +
      +
      +
      +
      +
      + {{.Content}} +
      +
      +
      +
    • {{end}} -
    -
    - {{ .Date.Format ( Ts "date_format" ) }} - {{/* output: "2017-05-01 15:30" - Went with "Year-Month-Day" because it's the most unambiguous. - If you want it to be determined by where you're from, be my guest. */}} -
    -
    - {{.Content}} -
    +
    - {{end}}
    diff --git a/translations/fr-fr.all.json b/translations/fr-fr.all.json index 59e631f0..e0558a80 100644 --- a/translations/fr-fr.all.json +++ b/translations/fr-fr.all.json @@ -351,6 +351,10 @@ "id": "all_categories", "translation": "Toutes les catégories" }, + { + "id": "select_a_torrent_category", + "translation": "Choisir une catégorie de torrents" + }, { "id": "anime", "translation": "Anime" @@ -511,10 +515,6 @@ "id": "personal_info", "translation": "Informations personnelles" }, - { - "id": "email", - "translation": "Adresse email" - }, { "id": "language", "translation": "Langue" @@ -617,7 +617,11 @@ }, { "id": "completed", - "translation": "Terminé" + "translation": "Complété" + }, + { + "id": "change_language", + "translation": "Changer la langue" }, { "id": "language_name", diff --git a/translations/it-it.all.json b/translations/it-it.all.json index c4e08c21..0ebc6926 100644 --- a/translations/it-it.all.json +++ b/translations/it-it.all.json @@ -225,7 +225,7 @@ }, { "id": "notice_keep_seeding", - "translation": "ATTENZIONE: CONTINUA A SEEDARE I TORRENT E ABILITA IL DHT RITARDATO" + "translation": "ATTENZIONE: CONTINUA A SEEDARE I TORRENT E ABILITA IL DHT IDIOTA" }, { "id": "official_nyaapocalipse_faq", @@ -317,7 +317,7 @@ }, { "id": "answer_how_can_i_help", - "translation": "Se hai esperienza nel web design, vieni sul canale IRC #nyaapantsu su irc.rizon.net. Se hai dei database aggiornati, specialmente per sukebei, CARICALI!." + "translation": "Se hai esperienza nel web design, vieni sul canale IRC #nyaapantsu su irc.rizon.net. Se hai dei database aggiornati, specialmente per sukebei,per favore caricali." }, { "id": "your_design_sucks_found_a_bug", @@ -351,6 +351,10 @@ "id": "all_categories", "translation": "Tutte le categorie" }, + { + "id": "select_a_torrent_category", + "translation": "Seleziona una Categoria Torrent" + }, { "id": "anime", "translation": "Anime" @@ -614,6 +618,10 @@ { "id": "completed", "translation": "Completato" + }, + { + "id": "change_language", + "translation": "Cambia Lingua" }, { "id": "language_name",