Skip to content

Ogc management and settings#2441

Open
BreathingFlesh wants to merge 22 commits intomasterfrom
ogc-management-and-settings
Open

Ogc management and settings#2441
BreathingFlesh wants to merge 22 commits intomasterfrom
ogc-management-and-settings

Conversation

@BreathingFlesh
Copy link
Copy Markdown
Contributor

@BreathingFlesh BreathingFlesh commented Apr 13, 2026

Please fill in the commit message below and work through the checklist. You can delete parts that are not needed, e.g. the optional description, the link to a ticket or irrelevant options of the checklist.

Commit message

Org: Rearrange settings and management bar

  • Added a link for User manual
  • Added a new category "modules" to the global tools
  • Rearranged the global tools and settings
  • Added categories to settings

TYPE: Feature

Checklist

  • I have performed a self-review of my code
  • I considered adding a reviewer
  • I have updated the PO files
  • I made changes/features for both org and town6
  • I have tested my code thoroughly by hand

Copy link
Copy Markdown
Member

@Daverball Daverball left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nicely done. I like this a lot better.

There are a couple of minor issues, like a missing translation.

I also have some other small nitpicks and some suggested potential refactors, but we don't necessarily need to tackle those now, since it is no worse than it was before.

Comment thread src/onegov/feriennet/templates/layout.pt
Comment thread src/onegov/feriennet/templates/layout.pt
Comment thread src/onegov/org/forms/__init__.py
Comment thread src/onegov/org/templates/layout.pt
Comment on lines +92 to +103

if (
setting['name'] == 'newsletter-settings'
and not request.app.org.show_newsletter
):
continue

if (
setting['name'] == 'ris-settings'
and not request.app.org.ris_enabled | False
):
continue
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might not be quite worth it yet, but if we see more conditions sneaking in like this, we may want to extract this into an optional setting_visible predicate that takes a callback (lambda request: True by default) that needs to return True in order for the setting to be visible.

But if you feel like cleaning this up a bit, please go ahead.

Furthermore in terms of refactors, that might be worth it: Defining a new directive for settings views, with its own registry (or rather making the one we didn't end up using work correctly). So we don't have to use quite as much work to retrieve all of the setting views. This could be a CompositeAction that yields a HtmlHandleFormAction and a new action that registers the setting or a subclass of HtmlHandleFormAction that adds the extra logic for registering the setting.

We could then also be a little bit more robust and emit an exception if we encounter a setting with a setting category we don't know about.

Comment thread src/onegov/org/views/ticket.py
@OrgApp.form(
model=Organisation, name='module-activation-settings', template='form.pt',
permission=Secret, form=ModuleActivationSettingsForm,
setting=_('Activate/deactivate modules'), order=0,
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I found this to be a little wordy and it also ends up not fitting into one line in the settings view and gets broken up weirdly, on the other hand it's very clear what it means and I can't think of something shorter that still explains what the setting is for. Maybe "Optional Modules" could work?

Copy link
Copy Markdown
Contributor Author

@BreathingFlesh BreathingFlesh Apr 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like "optional Modules". I will leave the "activate/deactivate Modules" in the modules dropdown and rename it in the settings.

Comment thread src/onegov/org/custom.py
Comment thread src/onegov/town6/forms/settings.py
Comment thread src/onegov/town6/views/ris_settings.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants