File tree Expand file tree Collapse file tree 2 files changed +25
-3
lines changed Expand file tree Collapse file tree 2 files changed +25
-3
lines changed Original file line number Diff line number Diff line change 1818 <th >completion*</th >
1919</tr >
2020</thead >
21- <tbody >
2221{% for directory in stats .stats_by_directory () %}
23- <tr >
22+ <tr class = " directory " data-toggle = " directory-{{ loop.index }} " >
2423 <td >▶ {{ directory.path.name }} ({{ directory.files_stats | length }})</td >
2524 <td data-label =" completion" >
2625 <div class =" progress-bar" style =" width : {{ directory.completion }}%;background-color : #4caf50 ;" >
3130 </div >
3231 </td >
3332</tr >
33+ <tbody class =" files" id =" directory-{{ loop.index }}" style =" display : none ;" >
3434{% for file in directory .files_stats | sort (attribute ='filename' ) %}
3535<tr >
3636 <td >{{ file.filename }}</td >
4444 </td >
4545</tr >
4646{% endfor %}
47- {% endfor %}
4847</tbody >
48+ {% endfor %}
4949</table >
5050<p >* in brackets: number of strings (entries) translated / total</p >
5151</body >
6666 updateProgressBarVisibility ();
6767
6868 window .addEventListener (' resize' , updateProgressBarVisibility);
69+
70+ document .querySelectorAll (' .directory' ).forEach (directoryRow => {
71+ directoryRow .addEventListener (' click' , () => {
72+ const toggleId = directoryRow .getAttribute (' data-toggle' );
73+ const filesTable = document .getElementById (toggleId);
74+ const arrow = directoryRow .querySelector (' td:first-child' );
75+
76+ if (filesTable .style .display === ' none' ) {
77+ filesTable .style .display = ' table-row-group' ;
78+ arrow .textContent = arrow .textContent .replace (' ▶' , ' ▼' );
79+ } else {
80+ filesTable .style .display = ' none' ;
81+ arrow .textContent = arrow .textContent .replace (' ▼' , ' ▶' );
82+ }
83+
84+ updateProgressBarVisibility ();
85+ });
86+ });
6987 </script >
7088</html >
Original file line number Diff line number Diff line change @@ -53,6 +53,10 @@ td[data-label="completion"] {
5353 right : 10px ;
5454 }
5555
56+ .directory {
57+ cursor : pointer;
58+ }
59+
5660@media screen and (max-width : 675px ) {
5761 .switchpages {
5862 all : unset;
You can’t perform that action at this time.
0 commit comments