Skip to content

Commit aa202ba

Browse files
committed
yet simpler grid
1 parent a5e0867 commit aa202ba

4 files changed

Lines changed: 80 additions & 194 deletions

File tree

apps/_dashboard/__init__.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
)
2929
from py4web.core import DAL, Fixture, Reloader, Session, dumps, error_logger, safely
3030
from py4web.utils.factories import ActionFactory
31-
from py4web.utils.grid import ActionButton, Grid
31+
from py4web.utils.grid import Grid
3232
from yatl.helpers import A
3333

3434
from .diff2kryten import diff2kryten
@@ -173,9 +173,11 @@ def make_grid():
173173
details=False,
174174
editable=False,
175175
pre_action_buttons=[
176-
lambda row: ActionButton(
177-
"Show", URL("ticket", row.uuid), icon="fa-eye"
178-
)
176+
lambda row: {
177+
"text": "Show",
178+
"url": URL("ticket", row.uuid),
179+
"icon": "fa-eye",
180+
}
179181
],
180182
)
181183

apps/_dashboard/templates/layout.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
.grid-search-form {width:100%; max-width: 100%}
2424
tbody tr:hover { background-color:#002233 }
2525
.grid-search-form-tr {border-bottom: none}
26+
.grid-td:last-child {text-align: right}
2627
</style>
2728
[[block page_head]]<!-- individual pages can customize header here -->[[end]]
2829
</head>

py4web/core.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -897,7 +897,11 @@ def URL( # pylint: disable=invalid-name
897897
broken_parts.insert(1, "_" + static_version)
898898

899899
url_prefix = os.environ.get("PY4WEB_URL_PREFIX", "")
900-
url = url_prefix + prefix + "/".join(urllib.parse.quote(part, safe=r":/{}") for part in broken_parts)
900+
url = (
901+
url_prefix
902+
+ prefix
903+
+ "/".join(urllib.parse.quote(part, safe=r":/{}") for part in broken_parts)
904+
)
901905
# Signs the URL if required. Copy vars into urlvars not to modify it.
902906
urlvars = dict(vars) if vars else {}
903907
if signer:

0 commit comments

Comments
 (0)