mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-06-23 15:30:45 -04:00
Add support for half stars to the new content server
This commit is contained in:
parent
982d406121
commit
494ccb9a82
5
imgsrc/srv/star-half.svg
Normal file
5
imgsrc/srv/star-half.svg
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -200 1000 1000" version="1.1">
|
||||||
|
<g transform="matrix(1,0,0,-1,72.033898,564.7623)">
|
||||||
|
<path d="M 466.134,74.71 320.554,-51.818 c -45.752,-39.7363 -70.796,-61.0836 -75.128,-64.0476 -4.334,-2.962 -8.58,-4.444 -12.738,-4.444 -4.853,0 -9.273,2.004 -13.259,6.013 -3.987,4.008 -5.98,8.453 -5.98,13.332 0,3.1369 9.88,29.6271 29.638,79.4718 l 79.028,201.816 -169.497,109.275 c -47.835,30.673 -73.3963,47.578 -76.6883,50.715 -3.294,3.137 -4.9404,7.668 -4.9404,13.594 0,15.336 8.8398,23.005 26.5166,23.005 1.3867,0 25.6491,-2.092 72.7901,-6.274 l 209.529,-17.776 47.315,202.339 c 12.131,52.633 19.671,81.563 22.617,86.791 2.945,5.229 8.405,7.842 16.377,7.842 8.32,0 0,-575.124 0,-575.124 z" />
|
||||||
|
</g>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 752 B |
@ -1 +1,5 @@
|
|||||||
<svg width="1792" height="1792" viewBox="0 0 1792 1792" xmlns="http://www.w3.org/2000/svg"><path d="M1728 647q0 22-26 48l-363 354 86 500q1 7 1 20 0 21-10.5 35.5t-30.5 14.5q-19 0-40-12l-449-236-449 236q-22 12-40 12-21 0-31.5-14.5t-10.5-35.5q0-6 2-20l86-500-364-354q-25-27-25-48 0-37 56-46l502-73 225-455q19-41 49-41t49 41l225 455 502 73q56 9 56 46z"/></svg>
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -200 1000 1000" version="1.1">
|
||||||
|
<g transform="matrix(1,0,0,-1,34.12485,564.762)">
|
||||||
|
<path d="m 551.923,352.862 197.574,16.73 c 55.457,4.531 83.882,6.797 85.268,6.797 17.33,0 25.996,-7.493 25.996,-22.482 0,-5.926 -1.733,-10.544 -5.199,-13.855 -3.467,-3.312 -29.984,-20.827 -79.55,-52.546 L 609.635,180.323 716.22,-88.417 c 1.386,-2.7881 2.081,-6.9707 2.081,-12.548 0,-5.228 -1.907,-9.76 -5.721,-13.593 -3.811,-3.835 -7.972,-5.752 -12.476,-5.752 -4.161,0 -8.494,1.482 -13.001,4.444 -4.505,2.964 -28.941,23.615 -73.308,61.9578 L 466.134,74.7098 320.554,-51.8182 c -45.752,-39.7363 -70.796,-61.0836 -75.128,-64.0476 -4.334,-2.962 -8.58,-4.444 -12.738,-4.444 -4.853,0 -9.273,2.004 -13.259,6.013 -3.987,4.008 -5.98,8.453 -5.98,13.332 0,3.1369 9.88,29.6271 29.638,79.4718 l 79.028,201.816 -169.497,109.275 c -47.835,30.673 -73.3963,47.578 -76.6883,50.715 -3.294,3.137 -4.9404,7.668 -4.9404,13.594 0,15.336 8.8398,23.005 26.5166,23.005 1.3867,0 25.6491,-2.092 72.7901,-6.274 l 209.529,-17.776 47.315,202.339 c 12.131,52.633 19.671,81.563 22.617,86.791 2.945,5.229 8.405,7.842 16.377,7.842 8.32,0 13.866,-2.874 16.638,-8.626 2.773,-5.751 10.746,-37.035 23.917,-93.851 z" />
|
||||||
|
</g>
|
||||||
|
</svg>
|
||||||
|
Before Width: | Height: | Size: 356 B After Width: | Height: | Size: 1.2 KiB |
@ -144,8 +144,11 @@ def render_metadata(mi, interface_data, table, field_list=None):
|
|||||||
|
|
||||||
def process_rating(field, fm, name, val):
|
def process_rating(field, fm, name, val):
|
||||||
stars = E.span()
|
stars = E.span()
|
||||||
for i in range(int(val) // 2):
|
val = int(val)
|
||||||
|
for i in range(val // 2):
|
||||||
stars.appendChild(svgicon('star'))
|
stars.appendChild(svgicon('star'))
|
||||||
|
if fm.display.allow_half_stars and (val % 2):
|
||||||
|
stars.appendChild(svgicon('star-half'))
|
||||||
add_row(name, stars)
|
add_row(name, stars)
|
||||||
|
|
||||||
def process_identifiers(field, fm, name, val):
|
def process_identifiers(field, fm, name, val):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user