{% extends 'creme_core/bricks/base/paginated-table.html' %} {% load i18n creme_bricks reports_tags %} {% load blockjsondata has_perm_to jsonify url from creme_core_tags %} {% block brick_extra_class %}{{block.super}} reports-graphs-brick{% endblock %} {% block brick_script %} {% endblock %} {% block brick_header_title %} {% translate 'Graphs' context 'reports-graphs' as empty_label %} {% brick_header_title title=_('{count} Graph') plural=_('{count} Graphs') empty=empty_label icon='graph' %} {% endblock %} {% block brick_header_actions %} {% has_perm_to change object.report as has_perm %} {% brick_header_action id='add' url='reports__create_graph'|url:object.id label=_('Create a new graph') enabled=has_perm %} {% endblock %} {% block brick_table_columns %} {% brick_table_column title=_('Name') status='primary nowrap' colspan=2 %} {% brick_table_column title=_('X axis (field)') %} {% brick_table_column title=_('X axis (grouping)') %} {% brick_table_column title=_('Y axis (type)') %} {% brick_table_column title=_('Y axis (field)') %} {% brick_table_column title=_('Actions') status='action' colspan=2 %} {% endblock %} {% block brick_table_rows %} {% has_perm_to admin 'reports' as admin_perm %} {% for graph in page.object_list %} {% with hand=graph.hand %}
{{graph.name}} {{hand.verbose_abscissa}} {{hand.verbose_name}}{% if graph.abscissa_parameter %} ({{graph.abscissa_parameter}}){% endif %}{# TODO: hand.verbose parameter ? #} {% with ordinate=hand.ordinate %} {{ordinate.verbose_name}} {{ordinate.cell|default:'—'}} {% endwith %} {% has_perm_to change graph as graph_edit_perm %} {% brick_table_action id='edit' url='reports__edit_graph'|url:graph.id enabled=graph_edit_perm %} {% has_perm_to delete graph as graph_delete_perm %} {% brick_table_action id='delete' url='creme_core__delete_entity'|url:graph.id label=_('Delete this graph') enabled=graph_delete_perm %}
{% translate 'Graph' context 'reports-graphs' %} :  {% translate 'Histogram' %}
{% translate 'Sorting' %} :  {% translate 'Ascending' %}
{% if volatile_column %}
{% translate 'Volatile column' %} :  {{volatile_column}}
{% endif %} {% with bricks_count=graph.instance_bricks_count %}{% blocktranslate count count=bricks_count asvar popup_label %}{{count}} configured block{% plural %}{{count}} configured blocks{% endblocktranslate %} {% if bricks_count %}
{% brick_table_action id='view' url='reports__instance_bricks_info'|url:graph.id label=popup_label display='text' %}
{% endif %} {% endwith %}
{% brick_table_action id='add' url='reports__create_instance_brick'|url:graph.id label=_('Create a block for this graph') display='text' enabled=admin_perm %}
{% for name, chart in report_charts %} {% blockjsondata name=name %}{% reports_chart_jqplot_json graph chart is_small=True %}{% endblockjsondata %} {% endfor %}
{% endwith %} {% endfor %} {% endblock %} {% block brick_table_empty %} {% translate 'No graphs registered for the moment' %} {% endblock %}