from django import template
from django.contrib.staticfiles.storage import staticfiles_storage

from ..creations import RATING_DESCRIPTIONS

register = template.Library()

@register.inclusion_tag('creations/rating.html')
def creation_rating(rating, skin):
    return {
        'rating_description': RATING_DESCRIPTIONS[round(rating)],
        'rating': range(rating),
        'skin': skin,
        'skin_rating_star_url': staticfiles_storage.url("skins/%s/img/rating-star.gif" % skin),
    }


from django import template
from django.contrib.staticfiles.storage import staticfiles_storage

from ..creations import RATING_DESCRIPTIONS

register = template.Library()

@register.inclusion_tag('creations/rating.html')
def creation_rating(rating, skin):
    return {
        'rating_description': "Hodnocení: %s" % RATING_DESCRIPTIONS[round(rating)],
        'rating': range(rating),
        'skin': skin,
        'skin_rating_star_url': staticfiles_storage.url("skins/%s/img/rating-star.gif" % skin),
    }


Add explicit rating word to rating alt
Add explicit rating word to rating alt

  from django import template
  from django.contrib.staticfiles.storage import staticfiles_storage
  
  from ..creations import RATING_DESCRIPTIONS
  
  register = template.Library()
  
  @register.inclusion_tag('creations/rating.html')
  def creation_rating(rating, skin):
      return {
-         'rating_description': RATING_DESCRIPTIONS[round(rating)],
+         'rating_description': "Hodnocení: %s" % RATING_DESCRIPTIONS[round(rating)],
          'rating': range(rating),
          'skin': skin,
          'skin_rating_star_url': staticfiles_storage.url("skins/%s/img/rating-star.gif" % skin),
      }
  
  
Add explicit rating word to rating alt
## Code Before:
from django import template
from django.contrib.staticfiles.storage import staticfiles_storage

from ..creations import RATING_DESCRIPTIONS

register = template.Library()

@register.inclusion_tag('creations/rating.html')
def creation_rating(rating, skin):
    return {
        'rating_description': RATING_DESCRIPTIONS[round(rating)],
        'rating': range(rating),
        'skin': skin,
        'skin_rating_star_url': staticfiles_storage.url("skins/%s/img/rating-star.gif" % skin),
    }


## Instruction:
Add explicit rating word to rating alt
## Code After:
from django import template
from django.contrib.staticfiles.storage import staticfiles_storage

from ..creations import RATING_DESCRIPTIONS

register = template.Library()

@register.inclusion_tag('creations/rating.html')
def creation_rating(rating, skin):
    return {
        'rating_description': "Hodnocení: %s" % RATING_DESCRIPTIONS[round(rating)],
        'rating': range(rating),
        'skin': skin,
        'skin_rating_star_url': staticfiles_storage.url("skins/%s/img/rating-star.gif" % skin),
    }

