mirror of
				https://github.com/iv-org/invidious.git
				synced 2025-10-31 04:32:02 +00:00 
			
		
		
		
	Added a first page button
This commit is contained in:
		| @@ -11,6 +11,7 @@ | ||||
|     "last": "neueste", | ||||
|     "Next page": "Nächste Seite", | ||||
|     "Previous page": "Vorherige Seite", | ||||
| 	 "First page": "Erste Seite", | ||||
|     "Clear watch history?": "Verlauf löschen?", | ||||
|     "New password": "Neues Passwort", | ||||
|     "New passwords must match": "Neue Passwörter müssen übereinstimmen", | ||||
|   | ||||
| @@ -28,6 +28,7 @@ | ||||
|     "last": "last", | ||||
|     "Next page": "Next page", | ||||
|     "Previous page": "Previous page", | ||||
| 	 "First page": "First page", | ||||
|     "Clear watch history?": "Clear watch history?", | ||||
|     "New password": "New password", | ||||
|     "New passwords must match": "New passwords must match", | ||||
|   | ||||
| @@ -11,6 +11,7 @@ | ||||
|     "last": "недавние", | ||||
|     "Next page": "Следующая страница", | ||||
|     "Previous page": "Предыдущая страница", | ||||
| 	 "First page": "Первая страница", | ||||
|     "Clear watch history?": "Очистить историю просмотров?", | ||||
|     "New password": "Новый пароль", | ||||
|     "New passwords must match": "Новые пароли не совпадают", | ||||
|   | ||||
| @@ -3,6 +3,15 @@ require "uri" | ||||
| module Invidious::Frontend::Pagination | ||||
|   extend self | ||||
|  | ||||
|   private def first_page(str : String::Builder, locale : String?, url : String) | ||||
|     str << %(<a href=") << url << %(" class="pure-button pure-button-secondary">) | ||||
|  | ||||
|     str << translate(locale, "First page") | ||||
|     str << "  " | ||||
|     str << %(<i class="icon ion-ios-arrow-back"></i>) | ||||
|     str << "</a>" | ||||
|   end | ||||
|  | ||||
|   private def previous_page(str : String::Builder, locale : String?, url : String) | ||||
|     # Link | ||||
|     str << %(<a href=") << url << %(" class="pure-button pure-button-secondary">) | ||||
| @@ -72,12 +81,18 @@ module Invidious::Frontend::Pagination | ||||
|     end | ||||
|   end | ||||
|  | ||||
|   def nav_ctoken(locale : String?, *, base_url : String | URI, ctoken : String?) | ||||
|   def nav_ctoken(locale : String?, *, base_url : String | URI, ctoken : String?, first_page : String?) | ||||
|     return String.build do |str| | ||||
|       str << %(<div class="h-box">\n) | ||||
|       str << %(<div class="page-nav-container flexible">\n) | ||||
|  | ||||
|       str << %(<div class="page-prev-container flex-left"></div>\n) | ||||
|       str << %(<div class="page-prev-container flex-left">) | ||||
|  | ||||
| 		if !first_page.nil? | ||||
| 		  self.first_page(str, locale, base_url.to_s) | ||||
| 		end | ||||
|  | ||||
| 		str << %(</div>\n) | ||||
|  | ||||
|       str << %(<div class="page-next-container flex-right">) | ||||
|  | ||||
|   | ||||
| @@ -20,7 +20,8 @@ | ||||
|  | ||||
|   page_nav_html = IV::Frontend::Pagination.nav_ctoken(locale, | ||||
|     base_url: relative_url, | ||||
|     ctoken: next_continuation | ||||
|     ctoken: next_continuation, | ||||
| 	 first_page: continuation | ||||
|   ) | ||||
| %> | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 RadoslavL
					RadoslavL