Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor widget templates to share more code #78

Closed
simonw opened this issue May 8, 2021 · 1 comment
Closed

Refactor widget templates to share more code #78

simonw opened this issue May 8, 2021 · 1 comment
Labels
dashboard-widgets documentation Improvements or additions to documentation

Comments

@simonw
Copy link
Owner

simonw commented May 8, 2021

And document the new pattern.

@simonw simonw added documentation Improvements or additions to documentation dashboard-widgets labels May 8, 2021
@simonw simonw added this to the First non-alpha release milestone May 8, 2021
@simonw
Copy link
Owner Author

simonw commented May 8, 2021

New big_number-label.html:

{% extends "django_sql_dashboard/widgets/_base_widget.html" %}

{% block widget_results %}
  {% for row in result.rows %}
  <div class="big-number">
    <p><strong>{{ row.label }}</strong></p>
    <h1>{{ row.big_number }}</h1>
  </div>
  {% endfor %}
{% endblock %}

@simonw simonw closed this as completed in fd7da19 May 8, 2021
simonw added a commit that referenced this issue May 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dashboard-widgets documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

1 participant