abhiabhi94 / django-flag-app

A pluggable django application that adds the ability for users to flag(or report) your models.
MIT License
14 stars 5 forks source link

Make flag icon more customizable #38

Open tetron432 opened 3 years ago

tetron432 commented 3 years ago

It's really difficult to get the flag icon in template to show up where I would want it to go- is it possible to get {% render_flag_form post user %} variable as an HTML element or template variable so we can put it where we want? The icon is always at the far right regardless where I put it.

abhiabhi94 commented 3 years ago

Thanks for the feedback.

I agree this is something that should be a lot easier to customize. As of now, this behavior of the icon floating towards the right comes from CSS.

https://github.com/abhiabhi94/django-flag-app/blob/509b3d56ca53a994aa9d6dcd1f0782d588e0d194/flag/static/flag/css/flag.css#L32-L36

The class flag-icon is need by the JavaScript file flag.js for some processing. So the name needs to be there. Although you can override the default static files pretty similar to how you override the default templates. For more information on this, please see https://docs.djangoproject.com/en/dev/ref/contrib/staticfiles/#collectstatic

If you have any ideas, how we can make this customization easier, I would love to know them.

abhiabhi94 commented 3 years ago

There is more some information in the documentation about customizing the flag icon. Please see https://django-flag-app.readthedocs.io/en/latest/style-customisation.html#flag-icon in case, this fits your case.