Skip to content

Commit 9316e1a

Browse files
committed
Add some styles
1 parent 39b175c commit 9316e1a

3 files changed

Lines changed: 91 additions & 43 deletions

File tree

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
.doodle-date {
2+
font-weight: 700;
3+
white-space: nowrap;
4+
}
5+
6+
.doodle-view {
7+
border-radius: 0.5rem;
8+
}
9+
10+
.doodle-view td .badge {
11+
margin-right: 0.25rem;
12+
}
13+
14+
.doodle-view button.btn {
15+
white-space: nowrap;
16+
}

src/experimental/doodle/browser/templates/doodle.pt

Lines changed: 59 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -6,48 +6,65 @@
66
>
77
<body>
88
<metal:content-core fill-slot="content-core">
9-
<h1>Doodle</h1>
10-
<table class="listing"
11-
tal:condition="view/rows"
12-
>
13-
<thead>
14-
<tr>
15-
<th>Date</th>
16-
<th>Option</th>
17-
<th>Participants</th>
18-
<th>Action</th>
19-
</tr>
20-
</thead>
21-
<tbody>
22-
<tr tal:repeat="row view/rows">
23-
<td tal:content="python:view.date_label(row['date'])">2026-01-01</td>
24-
<td tal:content="row/title">Date option</td>
25-
<td>
26-
<span tal:condition="python:not row['participants']">No participants yet</span>
27-
<span tal:repeat="member row/participants"
28-
tal:content="member"
29-
tal:attributes="
30-
class string:label;
31-
"
32-
>member</span>
33-
</td>
34-
<td>
35-
<form method="post"
36-
tal:condition="row/can_toggle"
37-
tal:attributes="
38-
action row/toggle_url;
39-
"
40-
>
41-
<!-- Removed _authenticator input -->
42-
<button type="submit"
43-
tal:content="python:'Unselect' if row['selected'] else 'Select'"
44-
>Select</button>
45-
</form>
46-
</td>
47-
</tr>
48-
</tbody>
49-
</table>
50-
<p tal:condition="python:not view.rows()">No date options yet.</p>
9+
<section class="doodle-view card shadow-sm border-0">
10+
<div class="card-body p-3 p-md-4">
11+
<h2 class="h4 mb-2">Doodle</h2>
12+
<p class="text-muted mb-4">Pick the dates that work for you and compare availability at a glance.</p>
13+
<div class="table-responsive"
14+
tal:condition="view/rows"
15+
>
16+
<table class="listing table table-striped table-hover align-middle mb-0">
17+
<thead>
18+
<tr>
19+
<th scope="col">Date</th>
20+
<th scope="col">Option</th>
21+
<th scope="col">Participants</th>
22+
<th scope="col">Action</th>
23+
</tr>
24+
</thead>
25+
<tbody>
26+
<tr tal:repeat="row view/rows">
27+
<td class="doodle-date"
28+
tal:content="python:view.date_label(row['date'])"
29+
>2026-01-01</td>
30+
<td class="fw-semibold"
31+
tal:content="row/title"
32+
>Date option</td>
33+
<td>
34+
<span class="text-muted"
35+
tal:condition="python:not row['participants']"
36+
>No participants yet</span>
37+
<span tal:repeat="member row/participants"
38+
tal:content="member"
39+
tal:attributes="
40+
class python:'badge rounded-pill text-bg-success' if row['selected'] and member == user.getId() else 'badge rounded-pill text-bg-light';
41+
"
42+
>member</span>
43+
</td>
44+
<td>
45+
<form method="post"
46+
tal:condition="row/can_toggle"
47+
tal:attributes="
48+
action row/toggle_url;
49+
"
50+
>
51+
<button type="submit"
52+
tal:content="python:'Unselect' if row['selected'] else 'Select'"
53+
tal:attributes="
54+
class python:'btn btn-sm btn-outline-secondary' if row['selected'] else 'btn btn-sm btn-primary';
55+
"
56+
>Select</button>
57+
</form>
58+
</td>
59+
</tr>
60+
</tbody>
61+
</table>
62+
</div>
63+
<p class="text-muted mt-3 mb-0"
64+
tal:condition="python:not view.rows()"
65+
>No date options yet.</p>
66+
</div>
67+
</section>
5168
</metal:content-core>
5269
</body>
5370
</html>

src/experimental/doodle/profiles/default/registry/main.xml

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,21 @@
33
i18n:domain="experimental.doodle"
44
>
55

6-
<!-- -*- extra stuff goes here -*- -->
6+
<records interface="plone.base.interfaces.IResourceRegistry"
7+
prefix="plone.resources/experimental-doodle-style"
8+
>
9+
<value key="css">++plone++experimental.doodle/doodle.css</value>
10+
</records>
11+
12+
<records interface="plone.base.interfaces.IBundleRegistry"
13+
prefix="plone.bundles/experimental-doodle-style"
14+
>
15+
<value key="enabled">True</value>
16+
<value key="csscompilation">++plone++experimental.doodle/doodle.css</value>
17+
<value key="load_async">False</value>
18+
<value key="load_defer">False</value>
19+
<value key="compile">False</value>
20+
<value key="depends">plone</value>
21+
</records>
722

823
</registry>

0 commit comments

Comments
 (0)