Index page title

I was wondering how you can change the index page title ‘Openboxes’.

openboxestitle

All other page’s have custom titles, even the login and location select page. But then when it goes to the index page it says ‘OpenBoxes’.

I’ve searched several .gsp file’s for language references and added them to the database but no effect,

I think the default template (custom.gsp) defines the default title as OpenBoxes but every page can override. In the case of the index page I actually think this is a React page so I think the title is from react.gsp. However these are not things you should be changing.

If you wanted to provide justification for changing the title we could consider a code change. And we could even consider making this customizable / localizable.

What would you prefer to change it to?

Something like: Logistics Management System. Anyway if you can bind it to a language label then it’s customizable.

Anyhow been researching for a workaround (for now) seems you can use ‘grails.gsp.enable.reload = true’ to the .groovy file (Grails Goodness: Enable Hot Reloading For Non-Development Environments - JDriven Blog). However this seems not to work.
`

Something like: Logistics Management System. Anyway if you can bind it to a language label then it’s customizable.

We probably won’t get to that any time soon, but we could add it as a community ticket for someone to do.

Anyhow been researching for a workaround (for now) seems you can use ‘grails.gsp.enable.reload = true’ to the .groovy file (Grails Goodness: Enable Hot Reloading For Non-Development Environments - JDriven Blog). However this seems not to work.

This should work, but I think it goes along with the grails.gsp.view.dir config property. So I would enable the reload property along with this one.

grails.gsp.enable.reload = true
grails.gsp.view.dir = "/home/username/openboxes/grails-app/views"

Then to test this out, copy a non-layout GSP like product/edit.gsp, make a change and see if that works.

If it does, then copy layouts/custom.gsp, edit the title to something.

Then copy all of the layouts and make the title change across the board.

Note:

  • I don’t know if this is actually going to work, but that’s how I would test it if i had time.
  • Keep in mind that this solution may lead to performance issues as the pages might need to be recompiled on every request (unless Grails does some magic around caching the latest version).

Justin

Works like charm! Thanks for the tip :slight_smile:

1 Like

So I was playing around and I noticed the footer in the index page (dashboard) is not loaded from the _footer.gsp. Same with the megamenu, etc. Every other page loads the footer from the _footer.gsp file. Any idea how this can happen?

I edited the footer to delete some information that are not relevant to show. Not a big deal but I just noticed it :).

I don’t understand what you mean.

Sorry, I try to explain it better.
I was playing around with those GSP files. I edited the _footer.gsp to delete some information that is not relevant. I saved the file and if I visited any page the _footer loads correctly like I edited it. However the index-page (dashboard) shows an other footer the default one.

The same is with the menu. If I disable for example the ‘links’ menu button. On every page it’s gone, but on the index-page (dashboard) it still shows up.

So somehow the menu and footer on the index-page is a different file then on the other pages. Or not loaded again from the new gsp file like it does on the other pages. (grails.gsp.enable.reload = true)

Got it. Thanks for the explanation.

This is why I would not recommend changing code in a deployed system. There are a lot of moving parts and it’s very difficult to debug these types of changes without a more fundamental understanding of the code.

In this case we have two view technologies in place (Grails views and React). The change you made works with the Grails views but not with React. I don’t think there’s a way to change the footer in React without rebuilding the application. The megamenu can be changed through configuration.

Thanks! Stupid question: which role is higher Admin or Super User?

I tried to change the megamenu in the groovy file, but if I (for example) disable the configuration menu (and then reload tomcat / openboxes) the menu still is showing.

openboxes {
//config menu start
configuration {
            enabled = false
            requiredRole = [RoleType.ROLE_ADMIN, RoleType.ROLE_SUPERUSER]
            label = "configuration.label"
            defaultLabel = "Configuration"
            subsections = [
                [
                    label: "admin.label",
                    defaultLabel: "Administration",
                    menuItems: [
                        [label: "default.settings.label", defaultLabel: "Settings", href: "/${appName}/admin/showSettings"],
                        [label: "cache.label", defaultLabel: "Cache", href: "/${appName}/admin/cache"],
                        [label: "console.label", defaultLabel: "Console", href: "/${appName}/console/index"],
                        [label: "dataImport.label", defaultLabel: "Data Import", href: "/${appName}/batch/importData"],
                        [label: "dataMigration.label", defaultLabel: "Data Migration", href: "/${appName}/migration/index"],
                        [label: "email.label", defaultLabel: "Email", href: "/${appName}/admin/sendMail"],
                        [label: "localization.label", defaultLabel: "Localization", href: "/${appName}/localization/list"]
                    ]
                ],
                [
                    label: "parties.label",
                    defaultLabel: "Locations",
                    menuItems: [
                        [label: "locations.label", defaultLabel: "Locations", href: "/${appName}/location/list"],
                        [label: "locationGroups.label", defaultLabel: "Location groups", href: "/${appName}/locationGroup/list"],
                        [label: "locationTypes.label", defaultLabel: "Location types", href: "/${appName}/locationType/list"],
                        [label: "organizations.label", defaultLabel: "Organizations", href: "/${appName}/organization/list"],
                        [label: "partyRoles.label", defaultLabel: "Party roles", href: "/${appName}/partyRole/list"],
                        [label: "partyTypes.label", defaultLabel: "Party types", href: "/${appName}/partyType/list"],
                        [label: "person.list.label", defaultLabel: "People", href: "/${appName}/person/list"],
                        [label: "roles.label", defaultLabel: "Roles", href: "/${appName}/role/list"],
                        [label: "users.label", defaultLabel: "Users", href: "/${appName}/user/list"],
                    ]
                ],
                [
                    label: "transactions.label",
                    defaultLabel: "Transactions",
                    menuItems: [
                        [label: "transactionsTypes.label", defaultLabel: "Transactions Types", href: "/${appName}/transactionType"],
                        [label: "transactions.label", defaultLabel: "Transactions", href: "/${appName}/inventory/listAllTransactions"],
                        [label: "transaction.add.label", defaultLabel: "Add transaction", href: "/${appName}/inventory/editTransaction"],
                        [label: "import.inventory.label", defaultLabel: "Import Inventory", href: "/${appName}/batch/importData?type=inventory"],
                        [label: "import.inventoryLevel.label", defaultLabel: "Import Inventory Level", href: "/${appName}/batch/importData?type=inventoryLevel"]
                    ]
                ],
                [
                    label: "default.other.label",
                    defaultLabel: "Other",
                    menuItems: [
                        [label: "budgetCode.label", defaultLabel: "Budget Code", href: "/${appName}/budgetCode/list", requiredRole: [RoleType.ROLE_ADMIN, RoleType.ROLE_SUPERUSER]],
                        [label: "containerTypes.label", defaultLabel: "Container Types", href: "/${appName}/containerType/list"],
                        [label: "documents.label", defaultLabel: "Documents", href: "/${appName}/document/list"],
                        [label: "documentTypes.label", defaultLabel: "Document Types", href: "/${appName}/documentType/list"],
                        [label: "eventTypes.label", defaultLabel: "Event Types", href: "/${appName}/eventType/list"],
                        [label: "glAccountType.label", defaultLabel: "GL Account Type", href: "/${appName}/glAccountType/list", requiredRole: [RoleType.ROLE_ADMIN, RoleType.ROLE_SUPERUSER]],
                        [label: "glAccount.label", defaultLabel: "GL Account", href: "/${appName}/glAccount/list", requiredRole: [RoleType.ROLE_ADMIN, RoleType.ROLE_SUPERUSER]],
                        [label: "orderAdjustmentType.label", defaultLabel: "Order Adjustment Type", href: "/${appName}/orderAdjustmentType/list", requiredRole: [RoleType.ROLE_ADMIN, RoleType.ROLE_SUPERUSER]],
                        [label: "paymentMethodTypes.label", defaultLabel: "Payment Method Types", href: "/${appName}/paymentMethodType/list"],
                        [label: "paymentTerms.label", defaultLabel: "Payment Terms", href: "/${appName}/paymentTerm/list"],
                        [label: "preferenceType.label", defaultLabel: "Preference Type", href: "/${appName}/preferenceType/list"],
                        [label: "shippers.label", defaultLabel: "Shippers", href: "/${appName}/shipper/list"],
                        [label: "shipmentWorkflows.label", defaultLabel: "Shipment Workflows", href: "/${appName}/shipmentWorkflow/list"]
                    ]
                ]
            ]
        }
   }

Superuser.

Superuser is basically Admin with delete / rollback permission.

Here’s some docs describing the roles / permissions.
https://openboxes.atlassian.net/wiki/spaces/OBW/pages/1266352262/Manage+Users

1 Like