mirror of
https://github.com/go-gitea/gitea
synced 2025-07-27 20:58:36 +00:00
Refactor time tracker UI (#34983)
Although we decided to "reduce the button amount" on the side bar, not only one user reported that the "time tracker dropdown" is not easy to use. So the best we can do at the moment is: move the buttons to the sidebar again. Fix #34979
This commit is contained in:
@@ -2,13 +2,15 @@
|
||||
<div class="page-content devtest ui container">
|
||||
{{template "base/alert" .}}
|
||||
<div class="modal-buttons flex-text-block tw-flex-wrap"></div>
|
||||
<script type="module">
|
||||
for (const el of $('.ui.modal:not([data-skip-button])')) {
|
||||
const $btn = $('<button class="ui button">').text(`${el.id}`).on('click', () => {
|
||||
$(el).modal({onApprove() {alert('confirmed')}}).modal('show');
|
||||
});
|
||||
$('.modal-buttons').append($btn);
|
||||
}
|
||||
<script>
|
||||
document.addEventListener('gitea:index-ready', () => {
|
||||
for (const el of $('.ui.modal:not([data-skip-button])')) {
|
||||
const $btn = $('<button class="ui button">').text(`${el.id}`).on('click', () => {
|
||||
$(el).modal({onApprove() {alert('confirmed')}}).modal('show');
|
||||
});
|
||||
$('.modal-buttons').append($btn);
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
<div id="test-modal-form-1" class="ui mini modal">
|
||||
|
@@ -45,14 +45,16 @@
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
<script type="module">
|
||||
const $buttons = $('#devtest-button-samples').find('button.ui');
|
||||
<script>
|
||||
document.addEventListener('gitea:index-ready', () => {
|
||||
const $buttons = $('#devtest-button-samples').find('button.ui');
|
||||
|
||||
const $buttonStyles = $('input[name*="button-style"]');
|
||||
$buttonStyles.on('click', () => $buttonStyles.map((_ ,el) => $buttons.toggleClass(el.value, el.checked)));
|
||||
const $buttonStyles = $('input[name*="button-style"]');
|
||||
$buttonStyles.on('click', () => $buttonStyles.map((_, el) => $buttons.toggleClass(el.value, el.checked)));
|
||||
|
||||
const $buttonStates = $('input[name*="button-state"]');
|
||||
$buttonStates.on('click', () => $buttonStates.map((_ ,el) => $buttons.prop(el.value, el.checked)));
|
||||
const $buttonStates = $('input[name*="button-state"]');
|
||||
$buttonStates.on('click', () => $buttonStates.map((_, el) => $buttons.prop(el.value, el.checked)));
|
||||
});
|
||||
</script>
|
||||
</div>
|
||||
</div>
|
||||
|
Reference in New Issue
Block a user