Skip to content

Commit

Permalink
add docs for overriding partials (#898)
Browse files Browse the repository at this point in the history
  • Loading branch information
johrstrom authored Dec 4, 2023
1 parent 2a1c56b commit af9a9df
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 0 deletions.
2 changes: 2 additions & 0 deletions source/customizations.rst
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,8 @@ This will result in a CSS tag added to all dashboard pages with the path: ``/pub
.. _help_menu_guide:

.. include:: customizations/overriding-partials.inc

Add URLs to Help Menu
---------------------

Expand Down
41 changes: 41 additions & 0 deletions source/customizations/overriding-partials.inc
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
.. _overriding-partials:


Overriding Pages
----------------

Open OnDemand is built with Ruby on Rails which uses ``partials``
to build the web pages that are ultimately served to the clients.

All partials are held within `dashboard's views folder`_. These
are the default ``partials`` that get distributed when you install
the package.

Open OnDemand provides a facility to override any of these partial
pages by supplying new files in ``/etc/ood/config/apps/dashboard/views``.

Let's look at an example where a center can provide a different,
specialized, footer for the bottom of the page. Overriding the
``partial`` that has been distributed.

First, you would need to find the original ``partial`` that is being
distributed.

We can find this file's location at ``layouts/_footer.html.erb``
(relative to the `dashboard's views folder`_).

To override it, we simply provide a new file of the same name
and path in the ``/etc/ood/config/apps/dashboard/views`` folder.

So, the full file path would be ``/etc/ood/config/apps/dashboard/views/layouts/_footer.html.erb``.
By providing a simple html file like the one below, placed in the location in the
previous sentence, your center has now provided a different footer than the one
distributed by the Open OnDemand package.

.. code-block:: html

<div class="text-center h-5 my-3" >
My center's custom footer.
<div>

.. _dashboard's views folder: https://github.com/OSC/ondemand/tree/master/apps/dashboard/app/views

0 comments on commit af9a9df

Please sign in to comment.