Skip to content

Commit

Permalink
Add docs for the slick reporting settings
Browse files Browse the repository at this point in the history
  • Loading branch information
RamezIssac committed Sep 22, 2023
1 parent 5059b7c commit a2432d7
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 2 deletions.
1 change: 1 addition & 0 deletions docs/source/ref/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ Below are links to the reference documentation for the various components of the
:maxdepth: 2
:caption: Components:

settings
computation_field
report_generator
view_options
Expand Down
50 changes: 50 additions & 0 deletions docs/source/ref/settings.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,56 @@
Settings
========

.. note::

Settings are changed in version 1.1.1 to being a dictionary instead of individual variables.
Variables will continue to work till next major release.


Below are the default settings for django-slick-reporting. You can override them in your settings file.

.. code-block:: python
SLICK_REPORTING_SETTINGS_DEFAULT = {
"JQUERY_URL": "https://code.jquery.com/jquery-3.7.0.min.js",
"DEFAULT_START_DATE_TIME": datetime(
datetime.now().year, 1, 1, 0, 0, 0, tzinfo=timezone.utc
), # 1st Jan of current year
"DEFAULT_END_DATE_TIME": datetime.datetime.today(), # today
"FONT_AWESOME": {
"CSS_URL": "https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css",
"ICONS": {
"pie": "fas fa-chart-pie",
"bar": "fas fa-chart-bar",
"line": "fas fa-chart-line",
"area": "fas fa-chart-area",
"column": "fas fa-chart-column",
},
},
"CHARTS": {
"highcharts": "$.slick_reporting.highcharts.displayChart",
"chartjs": "$.slick_reporting.chartjs.displayChart",
},
"MESSAGES": {
"total": _("Total"),
},
}
*. FONT_AWESOME
Font awesome is used to display the icon next to the chart title. You can override the following settings:
1. ``CSS_URL``: URL to the font-awesome css file
2. ``ICONS``: Icons used for different chart types.
*. CHARTS:
The entry points for displaying charts on the front end.
YOu can add your own chart engine by adding an entry to this dictionary.
* MESSAGES:
The strings used in the front end. You can override them here, it also gives a chance to set and translate them per your requirements.


Old versions settings:

1. ``SLICK_REPORTING_DEFAULT_START_DATE``: Default: the beginning of the current year
2. ``SLICK_REPORTING_DEFAULT_END_DATE``: Default: the end of the current year.
Expand Down
4 changes: 2 additions & 2 deletions slick_reporting/app_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ def get_end_date():

SLICK_REPORTING_SETTINGS_DEFAULT = {
"JQUERY_URL": SLICK_REPORTING_JQUERY_URL,
"DEFAULT_START_DATE": SLICK_REPORTING_DEFAULT_START_DATE,
"DEFAULT_END_DATE": SLICK_REPORTING_DEFAULT_END_DATE,
"DEFAULT_START_DATE_TIME": SLICK_REPORTING_DEFAULT_START_DATE,
"DEFAULT_END_DATE_TIME": SLICK_REPORTING_DEFAULT_END_DATE,
"FONT_AWESOME": {
"CSS_URL": "https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css",
"ICONS": {
Expand Down

0 comments on commit a2432d7

Please sign in to comment.