Compare commits
4 commits
dcdc0e7dab
...
805ce5966f
Author | SHA1 | Date | |
---|---|---|---|
|
805ce5966f | ||
|
5c06353fa3 | ||
|
352afc1e22 | ||
|
48a473e540 |
13
CHANGELOG.md
13
CHANGELOG.md
|
@ -5,6 +5,19 @@ All notable changes to wuttaweb will be documented in this file.
|
|||
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
|
||||
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
|
||||
|
||||
## v0.16.0 (2024-12-05)
|
||||
|
||||
### Feat
|
||||
|
||||
- add `get_template_context()` method for master view
|
||||
|
||||
### Fix
|
||||
|
||||
- add option for People entry in the Admin menu
|
||||
- fix handling of `Upgrade.uuid`
|
||||
- improve support for random objects with grid, master view
|
||||
- hide CRUD header buttons if master view does not allow
|
||||
|
||||
## v0.15.0 (2024-11-24)
|
||||
|
||||
### Feat
|
||||
|
|
|
@ -6,10 +6,10 @@ build-backend = "hatchling.build"
|
|||
|
||||
[project]
|
||||
name = "WuttaWeb"
|
||||
version = "0.15.0"
|
||||
version = "0.16.0"
|
||||
description = "Web App for Wutta Framework"
|
||||
readme = "README.md"
|
||||
authors = [{name = "Lance Edgar", email = "lance@edbob.org"}]
|
||||
authors = [{name = "Lance Edgar", email = "lance@wuttaproject.org"}]
|
||||
license = {text = "GNU GPL v3+"}
|
||||
classifiers = [
|
||||
"Development Status :: 4 - Beta",
|
||||
|
@ -42,7 +42,7 @@ dependencies = [
|
|||
"pyramid_tm",
|
||||
"waitress",
|
||||
"WebHelpers2",
|
||||
"WuttJamaican[db]>=0.15.0",
|
||||
"WuttJamaican[db]>=0.16.1",
|
||||
"zope.sqlalchemy>=1.5",
|
||||
]
|
||||
|
||||
|
@ -68,6 +68,7 @@ wuttaweb = "wuttaweb.conf:WuttaWebConfigExtension"
|
|||
[project.urls]
|
||||
Homepage = "https://wuttaproject.org/"
|
||||
Repository = "https://forgejo.wuttaproject.org/wutta/wuttaweb"
|
||||
Issues = "https://forgejo.wuttaproject.org/wutta/wuttaweb/issues"
|
||||
Changelog = "https://forgejo.wuttaproject.org/wutta/wuttaweb/src/branch/master/CHANGELOG.md"
|
||||
|
||||
|
||||
|
|
|
@ -142,38 +142,54 @@ class MenuHandler(GenericHandler):
|
|||
The return value for this method should be a *single* dict,
|
||||
which will ultimately be one element of the final list of
|
||||
dicts as described in :class:`MenuHandler`.
|
||||
|
||||
:param include_people: You can pass this flag to indicate the
|
||||
admin menu should contain an entry for the "People" view.
|
||||
"""
|
||||
items = []
|
||||
|
||||
if kwargs.get('include_people'):
|
||||
items.extend([
|
||||
{
|
||||
'title': "All People",
|
||||
'route': 'people',
|
||||
'perm': 'people.list',
|
||||
},
|
||||
])
|
||||
|
||||
items.extend([
|
||||
{
|
||||
'title': "Users",
|
||||
'route': 'users',
|
||||
'perm': 'users.list',
|
||||
},
|
||||
{
|
||||
'title': "Roles",
|
||||
'route': 'roles',
|
||||
'perm': 'roles.list',
|
||||
},
|
||||
{'type': 'sep'},
|
||||
{
|
||||
'title': "App Info",
|
||||
'route': 'appinfo',
|
||||
'perm': 'appinfo.list',
|
||||
},
|
||||
{
|
||||
'title': "Raw Settings",
|
||||
'route': 'settings',
|
||||
'perm': 'settings.list',
|
||||
},
|
||||
{
|
||||
'title': "Upgrades",
|
||||
'route': 'upgrades',
|
||||
'perm': 'upgrades.list',
|
||||
},
|
||||
])
|
||||
|
||||
return {
|
||||
'title': "Admin",
|
||||
'type': 'menu',
|
||||
'items': [
|
||||
{
|
||||
'title': "Users",
|
||||
'route': 'users',
|
||||
'perm': 'users.list',
|
||||
},
|
||||
{
|
||||
'title': "Roles",
|
||||
'route': 'roles',
|
||||
'perm': 'roles.list',
|
||||
},
|
||||
{'type': 'sep'},
|
||||
{
|
||||
'title': "App Info",
|
||||
'route': 'appinfo',
|
||||
'perm': 'appinfo.list',
|
||||
},
|
||||
{
|
||||
'title': "Raw Settings",
|
||||
'route': 'settings',
|
||||
'perm': 'settings.list',
|
||||
},
|
||||
{
|
||||
'title': "Upgrades",
|
||||
'route': 'upgrades',
|
||||
'perm': 'upgrades.list',
|
||||
},
|
||||
],
|
||||
'items': items,
|
||||
}
|
||||
|
||||
##############################
|
||||
|
|
|
@ -217,7 +217,7 @@ class UpgradeView(MasterView):
|
|||
|
||||
def get_upgrade_filepath(self, upgrade, filename=None, create=True):
|
||||
""" """
|
||||
uuid = upgrade.uuid
|
||||
uuid = str(upgrade.uuid)
|
||||
path = self.app.get_appdir('data', 'upgrades', uuid[:2], uuid[2:],
|
||||
create=create)
|
||||
if filename:
|
||||
|
|
|
@ -14,8 +14,17 @@ class TestMenuHandler(WebTestCase):
|
|||
self.handler = mod.MenuHandler(self.config)
|
||||
|
||||
def test_make_admin_menu(self):
|
||||
menus = self.handler.make_admin_menu(self.request)
|
||||
self.assertIsInstance(menus, dict)
|
||||
|
||||
# no people entry by default
|
||||
menu = self.handler.make_admin_menu(self.request)
|
||||
self.assertIsInstance(menu, dict)
|
||||
routes = [item.get('route') for item in menu['items']]
|
||||
self.assertNotIn('people', routes)
|
||||
|
||||
# but we can request it
|
||||
menu = self.handler.make_admin_menu(self.request, include_people=True)
|
||||
routes = [item.get('route') for item in menu['items']]
|
||||
self.assertIn('people', routes)
|
||||
|
||||
def test_make_menus(self):
|
||||
menus = self.handler.make_menus(self.request)
|
||||
|
|
|
@ -127,7 +127,7 @@ class TestUpgradeView(WebTestCase):
|
|||
self.session.commit()
|
||||
|
||||
view = self.make_view()
|
||||
uuid = upgrade.uuid
|
||||
uuid = str(upgrade.uuid)
|
||||
|
||||
# no filename
|
||||
path = view.download_path(upgrade, None)
|
||||
|
@ -153,7 +153,7 @@ class TestUpgradeView(WebTestCase):
|
|||
self.session.commit()
|
||||
|
||||
view = self.make_view()
|
||||
uuid = upgrade.uuid
|
||||
uuid = str(upgrade.uuid)
|
||||
|
||||
# no filename
|
||||
path = view.get_upgrade_filepath(upgrade)
|
||||
|
|
Loading…
Reference in a new issue