Skip to content

Commit eabb686

Browse files
committed
feat: add to templates - issue 2551353 - add roundup-classhelper
Incorporate roundup-classhelper into templates. page.html: add script tag to load classhelper.js Wrap classhelp links in the macros: search_popup and search_multiselect with roundup-classhelper. Implement mechanism to set data-search-with using data_search_with variable defined in tal in the scope enclosing the macro call. E.G. in issue.search.html you could use: <tr tal:define="name string:keyword; data_search_with string:name; db_klass string:keyword; db_content string:name;"> <th i18n:translate="">Keyword:</th> <td metal:use-macro="search_multiselect"></td> <td metal:use-macro="column_input"></td> <td metal:use-macro="sort_input"></td> <td metal:use-macro="group_input"></td> </tr> rather than the expression editor if you wanted. Note that the search_* macros are not documented AFAICT. I can't find search_multiselect and search_popup used in any of the stock templates. issue.item.html: Wrap classhelp links with roundup-classhelper. Configure data-search-with to emulate (or enhance) original classhelper popups. For user classhelpers show roles search only if he user has an Admin role. _generic.translation, classhelper.css: import from https://github.com/UMB-CS-682-Team-03/tracker rev: 1b897b1 classhelper.js: import from https://github.com/UMB-CS-682-Team-03/tracker rev: 1b897b1 with one change. Change roles endpoint from "/rest/roles" to "/rest/data/user/roles" to match new endpoint added to Roundup.
1 parent 1be4e22 commit eabb686

File tree

5 files changed

+1575
-4
lines changed

5 files changed

+1575
-4
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<tal xmlns:tal="http://xml.zope.org/namespaces/tal" tal:omit-tag="true"
2+
><tal:x tal:replace="python:request.client.additional_headers.update(
3+
{'Content-Type':'application/vnd.roundup.translation+json'}
4+
)"></tal:x>{
5+
"RoundupTranslations": "RoundupTranslations"<tal:block
6+
tal:condition="request/form/properties/value | false"
7+
><tal:loop tal:repeat="field
8+
python:request.form['properties'].value.split(',')"
9+
><tal:x tal:condition="field"
10+
tal:replace="python:',\n \x22%s\x22: \x22%s\x22' % (
11+
field, i18n.gettext(field))"
12+
/></tal:loop></tal:block>
13+
}
14+
</tal>
Lines changed: 141 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,141 @@
1+
.popup-tablediv {
2+
overflow: auto;
3+
}
4+
5+
.popup-table {
6+
table-layout: auto;
7+
width: 100%;
8+
font-size: .9em;
9+
}
10+
11+
table th {
12+
font-weight: normal;
13+
text-align: left;
14+
padding-left: .3em;
15+
color: #444;
16+
background-color: #efefef;
17+
border-bottom: 1px solid #afafaf;
18+
border-top: 1px solid #afafaf;
19+
text-transform: uppercase;
20+
vertical-align: middle;
21+
line-height: 1.5em;
22+
}
23+
24+
table td {
25+
vertical-align: middle;
26+
padding-left: .3em;
27+
padding-right: .2em;
28+
border-bottom: 1px solid #efefef;
29+
text-align: left;
30+
empty-cells: show;
31+
white-space: nowrap;
32+
vertical-align: middle;
33+
}
34+
35+
table.popup-table tr:hover {
36+
background-color: #eee;
37+
cursor: pointer;
38+
}
39+
40+
.row-style {
41+
cursor: pointer;
42+
}
43+
44+
.table-header {
45+
width: 15px;
46+
}
47+
48+
/* Accumulator */
49+
50+
.popup-control {
51+
display: flex;
52+
flex-wrap: wrap;
53+
justify-content: space-evenly;
54+
gap: 8px;
55+
padding: 8px;
56+
border-top: 2px solid #444;
57+
background-color: #eee;
58+
}
59+
60+
button {
61+
min-width: 3em;
62+
}
63+
64+
@media (pointer: coarse) {
65+
/* make min width 48px (3em*16px/em) on touch screens */
66+
button {
67+
min-height: 3em;
68+
}
69+
table td { padding-block: 2em; }
70+
}
71+
72+
.popup-apply {
73+
background-color: #c1cee6;
74+
font-weight: bold;
75+
min-width: 7em;
76+
}
77+
78+
/* Pagination */
79+
80+
.popup-pagination {
81+
display: flex;
82+
justify-content: space-evenly;
83+
padding: 8px;
84+
}
85+
86+
.popup-pagination button {
87+
min-width: 40px;
88+
width: 30%;
89+
cursor: pointer;
90+
color: blue;
91+
}
92+
93+
.popup-pagination button:disabled {
94+
color: gray;
95+
opacity: 0.4;
96+
cursor: default;
97+
}
98+
99+
/* Search */
100+
.popup-search {
101+
border-bottom: 2px solid #444;
102+
}
103+
104+
.search-label {
105+
text-transform: capitalize;
106+
font-weight: bold;
107+
}
108+
109+
.search-button {
110+
background-color: #c1cee6;
111+
font-weight: bold;
112+
min-width: 7em;
113+
}
114+
115+
.reset-button {
116+
margin-left: 60px;
117+
}
118+
119+
.flex-container {
120+
margin: 0;
121+
display: flex;
122+
flex-direction: column;
123+
height: 100%;
124+
}
125+
126+
.separator {
127+
flex-grow: 1;
128+
}
129+
130+
.search-error input {
131+
border: 2px solid red;
132+
}
133+
134+
.search-error > .error-message {
135+
color: red;
136+
font-size: 14px;
137+
margin-left: 4px;
138+
padding-block-start: 0.25em;
139+
}
140+
141+
*:focus-visible { outline-offset: 3px; }

0 commit comments

Comments
 (0)