diff options
Diffstat (limited to 'web_src')
-rw-r--r-- | web_src/js/features/gitgraph.js | 51 | ||||
-rw-r--r-- | web_src/less/_base.less | 4 | ||||
-rw-r--r-- | web_src/less/_repository.less | 1 | ||||
-rw-r--r-- | web_src/less/features/gitgraph.less | 96 | ||||
-rw-r--r-- | web_src/less/themes/theme-arc-green.less | 33 |
5 files changed, 155 insertions, 30 deletions
diff --git a/web_src/js/features/gitgraph.js b/web_src/js/features/gitgraph.js index 655cfb77c2..570d16059f 100644 --- a/web_src/js/features/gitgraph.js +++ b/web_src/js/features/gitgraph.js @@ -46,6 +46,57 @@ export default async function initGitGraph() { window.history.replaceState({}, '', window.location.pathname); } }); + const url = new URL(window.location); + const params = url.searchParams; + const updateGraph = async () => { + const queryString = params.toString(); + const ajaxUrl = new URL(url); + ajaxUrl.searchParams.set('div-only', 'true'); + window.history.replaceState({}, '', queryString ? `?${queryString}` : window.location.pathname); + $('#pagination').empty(); + $('#rel-container').addClass('hide'); + $('#rev-container').addClass('hide'); + $('#loading-indicator').removeClass('hide'); + + const div = $(await $.ajax(String(ajaxUrl))); + $('#pagination').html(div.find('#pagination').html()); + $('#rel-container').html(div.find('#rel-container').html()); + $('#rev-container').html(div.find('#rev-container').html()); + $('#loading-indicator').addClass('hide'); + $('#rel-container').removeClass('hide'); + $('#rev-container').removeClass('hide'); + }; + const dropdownSelected = params.getAll('branch'); + if (params.has('hide-pr-refs') && params.get('hide-pr-refs') === 'true') { + dropdownSelected.splice(0, 0, '...flow-hide-pr-refs'); + } + + $('#flow-select-refs-dropdown').dropdown('set selected', dropdownSelected); + $('#flow-select-refs-dropdown').dropdown({ + clearable: true, + onRemove(toRemove) { + if (toRemove === '...flow-hide-pr-refs') { + params.delete('hide-pr-refs'); + } else { + const branches = params.getAll('branch'); + params.delete('branch'); + for (const branch of branches) { + if (branch !== toRemove) { + params.append('branch', branch); + } + } + } + updateGraph(); + }, + onAdd(toAdd) { + if (toAdd === '...flow-hide-pr-refs') { + params.set('hide-pr-refs', true); + } else { + params.append('branch', toAdd); + } + updateGraph(); + }, + }); $('#git-graph-container').on('mouseenter', '#rev-list li', (e) => { const flow = $(e.currentTarget).data('flow'); if (flow === 0) return; diff --git a/web_src/less/_base.less b/web_src/less/_base.less index 7a757fd922..29eca15d24 100644 --- a/web_src/less/_base.less +++ b/web_src/less/_base.less @@ -1391,6 +1391,10 @@ table th[data-sortt-desc] { } } +.dropdown .ui.label { + margin-left: 0 !important; +} + .ui.dropdown .menu .item { border-radius: 0; } diff --git a/web_src/less/_repository.less b/web_src/less/_repository.less index 0a2772a79e..e77fbc05a7 100644 --- a/web_src/less/_repository.less +++ b/web_src/less/_repository.less @@ -1462,6 +1462,7 @@ #commits-table td.sha .sha.label, #repo-files-table .sha.label, + #rev-list .sha.label, .timeline-item.commits-list .singular-commit .sha.label { border: 1px solid #bbbbbb; diff --git a/web_src/less/features/gitgraph.less b/web_src/less/features/gitgraph.less index da81b13352..ee170fba7f 100644 --- a/web_src/less/features/gitgraph.less +++ b/web_src/less/features/gitgraph.less @@ -1,8 +1,21 @@ #git-graph-container { float: left; display: block; - overflow-x: auto; + overflow-x: scroll; width: 100%; + min-height: 350px; + + > .ui.segment.loading { + border: 0; + z-index: 1; + min-height: 246px; + } + + h2 { + display: flex; + justify-content: space-between; + align-items: center; + } .color-buttons { margin-right: 0; @@ -12,11 +25,49 @@ padding-bottom: 10px; } + #flow-select-refs-dropdown { + border-top-right-radius: 0; + border-bottom-right-radius: 0; + min-width: 250px; + border-right: none; + + .ui.label { + max-width: 180px; + display: inline-flex !important; + align-items: center; + + .truncate { + display: inline-block; + max-width: 140px; + overflow: hidden; + text-overflow: ellipsis; + vertical-align: top; + white-space: nowrap; + } + } + + .dropdown.icon { + display: none; + } + + .default.text { + padding-top: 4px; + padding-bottom: 4px; + } + + input.search { + position: relative; + top: 1px; + } + } + li { list-style-type: none; - height: 20px; - line-height: 20px; + height: 24px; + line-height: 24px; white-space: nowrap; + display: flex; + align-items: center; .node-relation { font-family: "Bitstream Vera Sans Mono", "Courier", monospace; @@ -31,10 +82,6 @@ font-size: 80%; } - a { - color: #000000; - } - a:hover { text-decoration: underline; } @@ -59,16 +106,39 @@ #rev-list { margin: 0; - padding: 0 5px; - min-width: 95%; + padding: 0; + width: 100%; - li.highlight, - li.hover { + li.highlight.hover { background-color: rgba(0, 0, 0, .05); } - li.highlight.hover { - background-color: rgba(0, 0, 0, .1); + .tags a.button { + padding: 2px 4px; + } + + .sha.label { + padding-top: 5px; + padding-bottom: 3px; + } + + .sha.label .shortsha { + padding-top: 0; + } + + .sha.label .shortsha-pad { + padding-right: 10px; + } + + .sha.label .ui.detail.icon.button { + padding-top: 3px; + margin-top: -5px; + padding-bottom: 1px; + } + + .author .ui.avatar.image { + width: auto; + height: 18px; } } diff --git a/web_src/less/themes/theme-arc-green.less b/web_src/less/themes/theme-arc-green.less index c7fd7e4a23..5b0cbb5e96 100644 --- a/web_src/less/themes/theme-arc-green.less +++ b/web_src/less/themes/theme-arc-green.less @@ -1360,10 +1360,6 @@ td.blob-hunk { } } -input { - background: #2e323e; -} - .settings .key.list .item:not(:first-child) { border-top: 1px solid var(--color-secondary); } @@ -1608,6 +1604,12 @@ a.blob-excerpt:hover { color: #dbdbdb; } +.ui.active.label { + background: #393d4a; + border-color: #393d4a; + color: #dbdbdb; +} + a.ui.label:hover, a.ui.labels .label:hover { background-color: #505667 !important; @@ -1617,6 +1619,7 @@ a.ui.labels .label:hover { .sha.label, .repository #repo-files-table .sha.label, .repository #commits-table td.sha .sha.label, +#rev-list .sha.label, .repository .timeline-item.commits-list .singular-commit .sha.label, .repository.view.issue .comment-list .timeline-item.commits-list .singular-commit .shabox .sha.label { border-color: #505667; @@ -1624,6 +1627,7 @@ a.ui.labels .label:hover { .sha.label.isSigned .detail.icon, .repository #commits-table td.sha .sha.label.isSigned .detail.icon, +#rev-list .sha.label.isSigned .detail.icon, .repository #repo-files-table .sha.label.isSigned .detail.icon, .repository .timeline-item.commits-list .singular-commit .sha.label.isSigned .detail.icon, .repository.view.issue .comment-list .timeline-item.commits-list .singular-commit .shabox .sha.label.isSigned .detail.icon { @@ -1743,14 +1747,6 @@ a.ui.labels .label:hover { color: var(--color-secondary-dark-6); } -#git-graph-container li a { - color: #c79575; -} - -#git-graph-container li .author { - color: #c79575; -} - .ui.header .sub.header { color: var(--color-secondary-dark-6); } @@ -1970,6 +1966,10 @@ a.ui.labels .label:hover { } } +.ui.loading.segment:before { + background: #353945; +} + .ui.popup { background-color: #383c4a; color: var(--color-secondary-dark-6); @@ -2053,6 +2053,10 @@ img[src$="/img/matrix.svg"] { filter: invert(80%); } +#git-graph-container li .time { + color: #6a737d; +} + #git-graph-container.monochrome #rel-container .flow-group { stroke: dimgrey; fill: dimgrey; @@ -2077,11 +2081,6 @@ img[src$="/img/matrix.svg"] { } } -#git-graph-container #rev-list li.highlight, -#git-graph-container #rev-list li.hover { - background-color: rgba(255, 255, 255, .05); -} - #git-graph-container #rev-list li.highlight.hover { background-color: rgba(255, 255, 255, .1); } |