diff --git a/config/trackers.go b/config/trackers.go index ed0eed33..a3c74e62 100644 --- a/config/trackers.go +++ b/config/trackers.go @@ -1,5 +1,5 @@ package config const ( - Trackers = "&tr=udp://zer0day.to:1337/announce&tr=udp://tracker.leechers-paradise.org:6969&tr=udp://explodie.org:6969&tr=udp://tracker.opentrackr.org:1337&tr=udp://tracker.coppersurfer.tk:6969&tr=http://tracker.baka-sub.cf/announce" -) \ No newline at end of file + Trackers = "&tr=udp://tracker.coppersurfer.tk:6969&tr=udp://zer0day.to:1337/announce&tr=udp://tracker.leechers-paradise.org:6969&tr=udp://explodie.org:6969&tr=udp://tracker.opentrackr.org:1337&tr=http://tracker.baka-sub.cf/announce" +) diff --git a/css/style.css b/css/style.css index 5dd91a5c..e19ea3c3 100644 --- a/css/style.css +++ b/css/style.css @@ -9,7 +9,6 @@ background-color: #81d3fa; } - /* modified copy of NyaaTorrent theme */ nav#mainmenu { background: #263238; @@ -56,6 +55,19 @@ a { text-decoration : none; } +.download-btn { + font-size: 20px; +} + +.table-borderless > tbody > tr > td, +.table-borderless > tbody > tr > th, +.table-borderless > tfoot > tr > td, +.table-borderless > tfoot > tr > th, +.table-borderless > thead > tr > td, +.table-borderless > thead > tr > th { + border: none; +} + .torrent-info .name { font-weight: bold; overflow: hidden; @@ -72,11 +84,16 @@ a { white-space: nowrap; } +/* Styling/fixes for the table: */ .table > tbody > tr > td { /* fix bootstrap uglyness */ vertical-align: middle; } +.custom-table-hover > tbody > tr:hover { + opacity: 0.82; +} + div.container div.blockBody:nth-of-type(2) table{table-layout:fixed;} div.container div.blockBody:nth-of-type(2) table tr:first-of-type th:first-of-type, div.container div.blockBody:nth-of-type(2) table tr:first-of-type th:nth-of-type(5){width:10%;} div.container div.blockBody:nth-of-type(2) table tr:first-of-type th:nth-of-type(3){width:15%;} diff --git a/main.go b/main.go index 9d237fc0..68ff664c 100644 --- a/main.go +++ b/main.go @@ -15,7 +15,6 @@ import ( "time" ) - func RunServer(conf *config.Config) { http.Handle("/", router.Router) diff --git a/router/faqHandler.go b/router/faqHandler.go index d69e62e2..bd1ff0a4 100644 --- a/router/faqHandler.go +++ b/router/faqHandler.go @@ -10,8 +10,10 @@ import( func FaqHandler(w http.ResponseWriter, r *http.Request) { var templates = template.Must(template.New("FAQ").Funcs(FuncMap).ParseFiles("templates/index.html", "templates/FAQ.html")) templates.ParseGlob("templates/_*.html") // common - err := templates.ExecuteTemplate(w, "index.html", FaqTemplateVariables{Navigation{}, NewSearchForm(), r.URL, mux.CurrentRoute(r)}) - if err != nil { + searchForm := NewSearchForm() + searchForm.HideAdvancedSearch = true + err := templates.ExecuteTemplate(w, "index.html", FaqTemplateVariables{Navigation{}, searchForm, r.URL, mux.CurrentRoute(r)}) + if err != nil { http.Error(w, err.Error(), http.StatusInternalServerError) } } \ No newline at end of file diff --git a/router/rssHandler.go b/router/rssHandler.go index c09b8110..93136c13 100644 --- a/router/rssHandler.go +++ b/router/rssHandler.go @@ -5,7 +5,7 @@ import( "net/http" "github.com/gorilla/feeds" "github.com/ewhal/nyaa/util/search" - + "strconv" ) func RssHandler(w http.ResponseWriter, r *http.Request) { @@ -29,7 +29,7 @@ func RssHandler(w http.ResponseWriter, r *http.Request) { torrent_json := torrents[i].ToJson() feed.Items[i] = &feeds.Item{ // need a torrent view first - //Id: URL + torrents[i].Hash, + Id: "https://nyaa.pantsu.cat/view/" + strconv.Itoa(torrents[i].Id), Title: torrents[i].Name, Link: &feeds.Link{Href: string(torrent_json.Magnet)}, Description: "", diff --git a/router/searchHandler.go b/router/searchHandler.go index 78186076..53a539e9 100644 --- a/router/searchHandler.go +++ b/router/searchHandler.go @@ -39,6 +39,7 @@ func SearchHandler(w http.ResponseWriter, r *http.Request) { search_param.Category, search_param.Sort, search_param.Order, + false, } htv := HomeTemplateVariables{b, torrentService.GetAllCategories(false), searchForm, navigationTorrents, r.URL, mux.CurrentRoute(r)} diff --git a/router/templateVariables.go b/router/templateVariables.go index 327bfa20..a361d260 100644 --- a/router/templateVariables.go +++ b/router/templateVariables.go @@ -53,6 +53,7 @@ type SearchForm struct { Category string Sort string Order string + HideAdvancedSearch bool } // Some Default Values to ease things out @@ -74,4 +75,4 @@ func NewSearchForm(params ...string) SearchForm { searchForm.Order = "DESC" } return searchForm -} \ No newline at end of file +} diff --git a/templates/_search.html b/templates/_search.html index 2f787dc9..69ca25af 100644 --- a/templates/_search.html +++ b/templates/_search.html @@ -27,7 +27,7 @@ @@ -43,7 +43,7 @@ - diff --git a/templates/home.html b/templates/home.html index a64d064c..eec8478a 100644 --- a/templates/home.html +++ b/templates/home.html @@ -8,7 +8,7 @@
- +
@@ -34,7 +34,7 @@ diff --git a/util/search/search.go b/util/search/search.go index 069fe00c..6f21804e 100644 --- a/util/search/search.go +++ b/util/search/search.go @@ -60,7 +60,11 @@ func SearchByQuery(r *http.Request, pagenum int) (SearchParam, []model.Torrents, parameters.Params = append(parameters.Params, searchSubCatId) } if search_param.Status != "" { - conditions = append(conditions, "status_id = ?") + if search_param.Status == "2" { + conditions = append(conditions, "status_id != ?") + } else { + conditions = append(conditions, "status_id = ?") + } parameters.Params = append(parameters.Params, search_param.Status) } searchQuerySplit := strings.Split(search_param.Query, " ")
Category Name{{.Date}} {{.Filesize}} - +