Themes
Themes, also known as skins, in the Baruwa Enterprise Edition are a combination of Mako Template, CSS and JS files that control the appearance of the Baruwa Web interface as well as reports and emails sent out by the system.
The theme system allows you to easily change the appearance of Baruwa, for example, to use the logo and colors of your company or institution.
There are two kinds of themes:
Default theme
Hostname/Domain linked themes
A Default theme
can be used to override the built-in appearance for
all hosts and domains on a server. A Default theme must be named
default
and only one default theme can be configured on a server.
Hostname/Domain Themes
are linked to the hostname used to access
the Baruwa server and the domain user accounts belong to, which means
that you can virtual host various brands on the same server with
different appearance and product name for each.
Note
Themes need to be kept up to date when changes are made to the built in templates. Ensure that you sync the changes made during each major release. If you do not keep the templates in sync you may get errors or incorrect information displayed.
Using themes ensures that the changes you make survive upgrades as opposed to changes made to the built-in template and asset files shipped with Baruwa which get overwritten during an upgrade.
What can be customized
- Logos
- Web interface
- Emails
- Reports
- Product name
- Product url
Guidelines
Themes MUST
retain the copyright notice at the bottom. The copyright notice
should not be obscured or hidden. Failure to comply with the rebranding guidelines
will lead to termination of your subscription.
If you would like to fully rebrand the interface please purchase a rebranding license.
Note
Themes that remove the copyright notices without a rebranding license will not render.
Configuration
The default configuration assumes that themes are stored under the
following directory /usr/share/baruwa/themes
with the following
directory structure:
/templates/default/
/templates/<hostname>/
/templates/<domainname>/
/assets/default/
/assets/<hostname>/
/assets/<domainname>/
Creating a simple theme
To start off, you simply copy the built-in templates and assets into the a theme directory for the hostname you would like to customize for.
I will be using the hostname spamfighter.example.com
:
BARUWA_PATH=$(python -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")
mkdir -p /usr/share/baruwa/themes/assets/spamfighter.example.com/
mkdir -p /usr/share/baruwa/themes/templates/spamfighter.example.com/
cp -a $BARUWA_PATH/baruwa/templates/* /usr/share/baruwa/themes/templates/spamfighter.example.com/
cp -a $BARUWA_PATH/baruwa/public/* /usr/share/baruwa/themes/assets/spamfighter.example.com/
You can now modify the changes to the templates under /usr/share/baruwa/themes/templates/spamfighter.example.com/
and the CSS, JS and image files under /usr/share/baruwa/themes/assets/spamfighter.example.com/
In order to brand other non web interfaces such as email you need to link the themes to the domain name you want to brand.
For example to theme the domain name example.com
:
ln -s /usr/share/baruwa/themes/assets/spamfighter.example.com \
/usr/share/baruwa/themes/assets/example.com
ln -s /usr/share/baruwa/themes/templates/spamfighter.example.com \
/usr/share/baruwa/themes/templates/example.com
Default theme
A default theme allows you to customize all the domains on your system using
one theme. To create a default theme, simply create templates and assets
directories named default
:
BARUWA_PATH=$(python -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")
mkdir -p /usr/share/baruwa/themes/assets/default
mkdir -p /usr/share/baruwa/themes/templates/default
cp -a $BARUWA_PATH/baruwa/templates/* /usr/share/baruwa/themes/templates/default/
cp -a $BARUWA_PATH/baruwa/public/* /usr/share/baruwa/themes/assets/default/
You can now modify the changes to the templates under /usr/share/baruwa/themes/templates/default/
and the CSS, JS and image files under /usr/share/baruwa/themes/assets/default/
Creating themes from scratch
It is possible to totally redesign the Baruwa interface using a theme, this requires an understanding of the data being sent into the template files by Baruwa as well as the Mako Template language.
We do provide theme customization services, contact us via the contact details on the baruwa.com website.
Emails and Reports
Emails and Reports sent to non admin users will automatically use themes.