Comments (4)
Hi @petasis,
Could you share the code you are using to set the heading text? My initial though would be that you aren't using mark_safe
and therefore django is escaping the html but there may be something else going on in dashboards.
from django-dashboards.
Here it is:
class Layout(Dashboard.Layout):
components = ComponentLayout(
Card(
Div("details",
css_classes={"wrapper":"table-responsive"}, grid_css_classes="span-12"),
heading="\uf19c <i>Activity",
actions = [("http://google.com", "Google")],
css_classes="card activity-card", grid_css_classes="span-12"
),
"animals",
grid_css_classes="span-12"
)
Div does not have the mark_safe
parameter (only Text has it).
You can see the rendering here:
https://digitisation.vast-project.eu/dashboards/vast_dashboards/activitydashboard/11/
from django-dashboards.
I think you should be able to do
from django.utils.safestring import mark_safe
class Layout(Dashboard.Layout):
components = ComponentLayout(
Card(
Div("details",
css_classes={"wrapper":"table-responsive"}, grid_css_classes="span-12"),
heading=mark_safe("\uf19c <i>Activity"),
actions = [("http://google.com", "Google")],
css_classes="card activity-card", grid_css_classes="span-12"
),
"animals",
grid_css_classes="span-12"
)
The important part to note here is the heading parameter is now wrapped in mark_safe
.
from django-dashboards.
Thank you, it works. It was a django question it seems...
from django-dashboards.
Related Issues (8)
- I am working on a Awesome-Python-HTMX, seeking your feedback HOT 2
- How do I register my dashboard class ? HOT 5
- Plotly is not loaded with version 0.1.5... HOT 3
- How can I override the default css file? HOT 7
- Can I add an image with a link in a Card? HOT 1
- Form template is missing {{form.media}} HOT 1
- Strange issue on Tables: they appear empty on first load... HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from django-dashboards.