feat(settings): New model to allow adding templated links to devices and software
!43 #6
This commit is contained in:
@ -0,0 +1,17 @@
|
||||
---
|
||||
title: External Links
|
||||
description: No Fuss Computings Centurion ERP External Links model documentation.
|
||||
date: 2024-07-15
|
||||
template: project.html
|
||||
about: https://gitlab.com/nofusscomputing/infrastructure/configuration-management/centurion_erp
|
||||
---
|
||||
|
||||
This model enables the end user to define external links to be rendered alongside other models display pages. The values are added to the page context in the [Change View](../common_views.md#display-view).
|
||||
|
||||
|
||||
## External Links
|
||||
|
||||
::: app.settings.models.external_link.ExternalLink
|
||||
options:
|
||||
inherited_members: true
|
||||
heading_level: 3
|
@ -34,6 +34,11 @@ All models must meet the following requirements:
|
||||
- No `queryset` is to return data that the user has not got access to. _see [queryset()](./api/models/tenancy_object.md#tenancy-object-manager)_
|
||||
|
||||
|
||||
## History
|
||||
|
||||
Currently the adding of history to a model is a manual process. edit the file located at `core.views.history` and within `View.get_object` add the model to the `switch` statement.
|
||||
|
||||
|
||||
## Tests
|
||||
|
||||
The following Unit test cases exists for models:
|
||||
|
18
docs/projects/centurion_erp/user/settings/external_links.md
Normal file
18
docs/projects/centurion_erp/user/settings/external_links.md
Normal file
@ -0,0 +1,18 @@
|
||||
---
|
||||
title: External Links
|
||||
description: External Links user documentation for Centurion ERP by No Fuss Computing
|
||||
date: 2024-07-17
|
||||
template: project.html
|
||||
about: https://gitlab.com/nofusscomputing/infrastructure/configuration-management/centurion_erp
|
||||
---
|
||||
|
||||
External Links allow an end user to specify by means of a jinja template a link that when displayed upon an items display page will add a button with a hyperlink to the url provided. External links can be assigned to: devices and software. This includes both at the same time.
|
||||
|
||||
|
||||
## Create a link
|
||||
|
||||
- Software context is under key `software`
|
||||
|
||||
- Device context is under key `device`
|
||||
|
||||
To add a templated link within the `Link Template` field enter your url, with the variable within jinja braces. for example to add a link that will expand with the devices id, specify `{{ device.id }}`. i.e. `https://domainname.tld/{{ device.id }}`. If the link is for software use key `software`. Available fields under context key all of those that are available at the time the page is rendered.
|
Reference in New Issue
Block a user