mirror of
				https://github.com/janeczku/calibre-web
				synced 2025-10-30 23:03:02 +00:00 
			
		
		
		
	series_index filter to show x.0 as x
This commit is contained in:
		| @@ -111,3 +111,10 @@ def timestamptodate(date, fmt=None): | ||||
| @jinjia.app_template_filter('yesno') | ||||
| def yesno(value, yes, no): | ||||
|     return yes if value else no | ||||
|  | ||||
| @jinjia.app_template_filter('formatseriesindex') | ||||
| def formatseriesindex_filter(series_index): | ||||
|     if int(series_index) - series_index == 0: | ||||
|         return int(series_index) | ||||
|     else: | ||||
|         return series_index | ||||
| @@ -75,7 +75,7 @@ | ||||
|           <a href="{{url_for('web.books_list', data='series', sort='new', book_id=entry.series[0].id )}}"> | ||||
|             {{entry.series[0].name}} | ||||
|           </a>  | ||||
|           ({{entry.series_index}}) | ||||
|           ({{entry.series_index|formatseriesindex}}) | ||||
|         </p> | ||||
|         {% endif %} | ||||
|         {% if entry.ratings.__len__() > 0 %} | ||||
| @@ -127,7 +127,7 @@ | ||||
|           <a href="{{url_for('web.books_list', data='series', sort='new', book_id=entry.series[0].id )}}"> | ||||
|             {{entry.series[0].name}} | ||||
|           </a>  | ||||
|           ({{entry.series_index}}) | ||||
|           ({{entry.series_index|formatseriesindex}}) | ||||
|         </p> | ||||
|         {% endif %} | ||||
|         <div class="rating"> | ||||
|   | ||||
| @@ -114,7 +114,7 @@ | ||||
|       {% endif %} | ||||
|  | ||||
|       {% if entry.series|length > 0 %} | ||||
|         <p>{{_('Book')}} {{entry.series_index}} {{_('of')}} <a href="{{url_for('web.books_list', data='series',sort='abc', book_id=entry.series[0].id)}}">{{entry.series[0].name}}</a></p> | ||||
|         <p>{{_('Book')}} {{entry.series_index|formatseriesindex}} {{_('of')}} <a href="{{url_for('web.books_list', data='series',sort='abc', book_id=entry.series[0].id)}}">{{entry.series[0].name}}</a></p> | ||||
|       {% endif %} | ||||
|  | ||||
|       {% if entry.languages.__len__() > 0 %} | ||||
|   | ||||
| @@ -39,7 +39,7 @@ | ||||
|           <a href="{{url_for('web.books_list', data='series', sort='new', book_id=entry.series[0].id )}}"> | ||||
|             {{entry.series[0].name}} | ||||
|           </a>  | ||||
|           ({{entry.series_index}}) | ||||
|           ({{entry.series_index|formatseriesindex}}) | ||||
|         </p> | ||||
|         {% endif %} | ||||
|         {% if entry.ratings.__len__() > 0 %} | ||||
|   | ||||
| @@ -38,7 +38,7 @@ | ||||
|           <a href="{{url_for('web.books_list', data='series', sort='new', book_id=entry.series[0].id )}}"> | ||||
|             {{entry.series[0].name}} | ||||
|           </a>  | ||||
|           ({{entry.series_index}}) | ||||
|           ({{entry.series_index|formatseriesindex}}) | ||||
|         </p> | ||||
|         {% endif %} | ||||
|         {% if entry.ratings.__len__() > 0 %} | ||||
| @@ -114,7 +114,7 @@ | ||||
|           <a href="{{url_for('web.books_list', data='series', sort='new', book_id=entry.series[0].id )}}"> | ||||
|             {{entry.series[0].name}} | ||||
|           </a>  | ||||
|           ({{entry.series_index}}) | ||||
|           ({{entry.series_index|formatseriesindex}}) | ||||
|         </p> | ||||
|         {% endif %} | ||||
|         {% if entry.ratings.__len__() > 0 %} | ||||
|   | ||||
| @@ -81,7 +81,7 @@ | ||||
|           <a href="{{url_for('web.books_list', data='series', sort='new', book_id=entry.series[0].id )}}"> | ||||
|             {{entry.series[0].name}} | ||||
|           </a>  | ||||
|           ({{entry.series_index}}) | ||||
|           ({{entry.series_index|formatseriesindex}}) | ||||
|         </p> | ||||
|         {% endif %} | ||||
|  | ||||
|   | ||||
| @@ -48,7 +48,7 @@ | ||||
|           <a href="{{url_for('web.books_list', data='series', sort='new', book_id=entry.series[0].id )}}"> | ||||
|             {{entry.series[0].name}} | ||||
|           </a>  | ||||
|           ({{entry.series_index|int}}) | ||||
|           ({{entry.series_index|formatseriesindex}}) | ||||
|         </p> | ||||
|         {% endif %} | ||||
|         {% if entry.ratings.__len__() > 0 %} | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Michael Knepher
					Michael Knepher