Skip to content

Show Longer Branch Name in Web UI's "More ..." View #309

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jan 4, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Fixed
- Support for git submodules in package manager-aware setting (#305)
- Web UI's 'More ...' view shows longer branch names (#294)
- Deletion of files in locked environment is now suppressed (#302)

## [2.3.0] - 2023-12-06
6 changes: 5 additions & 1 deletion git-webui/release/share/git-webui/webui/css/git-webui.css
Original file line number Diff line number Diff line change
@@ -265,7 +265,7 @@ body {
border: none;
}
.modal .card-header {
padding: 1% 2% 0% 14%;
padding: 0;
background-color: #fff;
color: inherit !important;
border: none !important;
@@ -277,6 +277,10 @@ body {
padding-bottom: 1%;
margin: 0%;
border: none !important;
overflow: visible;
}
.modal .modal-content {
min-width: fit-content;
}
#main-view {
display: flex;
12 changes: 11 additions & 1 deletion git-webui/release/share/git-webui/webui/js/git-webui.js
Original file line number Diff line number Diff line change
@@ -362,7 +362,7 @@ webui.SideBarView = function(mainView, noEventHandlers) {
var itemId = refname + idPostfix;
var cardHeader = $('<div class="card-header" id="heading-' + itemId +'">').appendTo(cardDiv);
var button = $('<button class="btn btn-sm btn-default btn-branch text-left" type="button" data-toggle="collapse" data-target="#collapse-' + itemId + '" aria-expanded="true" aria-controls="collapse-' + itemId + '">'
+ ref //IMPORTANT: This has to be the original ref for selectRef to work
+ ref //IMPORTANT: This has to be the original ref for selectRef to work
+ '</button>').appendTo(cardHeader)

var collapseDiv = $('<div id="collapse-' + itemId + '" class="collapse" aria-labelledby="heading-' + itemId + '" data-parent="#accordion-'+id+'-'+idPostfix+'">').appendTo(cardDiv);
@@ -377,6 +377,16 @@ webui.SideBarView = function(mainView, noEventHandlers) {
self.selectRef(event.target.innerHTML);
});
}

if (id === "remote-branches" && idPostfix === "popup") {
const remoteBranchBtns = $("#accordion-remote-branches-popup button").filter((i, span) => jQuery.inArray($(span).text(),refs) != -1);
const widest = Math.max(...remoteBranchBtns.map((i, span) => $(span).width()));
if (remoteBranchBtns.length > 0) {
remoteBranchBtns.css("padding", ".25rem .5rem");
remoteBranchBtns.css("border", 0);
remoteBranchBtns.width(widest);
}
}
return accordionDiv;
}

6 changes: 5 additions & 1 deletion git-webui/src/share/git-webui/webui/css/git-webui.less
Original file line number Diff line number Diff line change
@@ -361,7 +361,7 @@ body {

.modal {
.card-header {
padding: 1% 2% 0% 14%;
padding: 0;
background-color: #fff;
color: inherit !important;
border:none !important;
@@ -372,6 +372,10 @@ body {
padding-bottom:1%;
margin: 0%;
border: none !important;
overflow: visible;
}
.modal-content {
min-width: fit-content;
}
}

12 changes: 11 additions & 1 deletion git-webui/src/share/git-webui/webui/js/git-webui.js
Original file line number Diff line number Diff line change
@@ -362,7 +362,7 @@ webui.SideBarView = function(mainView, noEventHandlers) {
var itemId = refname + idPostfix;
var cardHeader = $('<div class="card-header" id="heading-' + itemId +'">').appendTo(cardDiv);
var button = $('<button class="btn btn-sm btn-default btn-branch text-left" type="button" data-toggle="collapse" data-target="#collapse-' + itemId + '" aria-expanded="true" aria-controls="collapse-' + itemId + '">'
+ ref //IMPORTANT: This has to be the original ref for selectRef to work
+ ref //IMPORTANT: This has to be the original ref for selectRef to work
+ '</button>').appendTo(cardHeader)

var collapseDiv = $('<div id="collapse-' + itemId + '" class="collapse" aria-labelledby="heading-' + itemId + '" data-parent="#accordion-'+id+'-'+idPostfix+'">').appendTo(cardDiv);
@@ -377,6 +377,16 @@ webui.SideBarView = function(mainView, noEventHandlers) {
self.selectRef(event.target.innerHTML);
});
}

if (id === "remote-branches" && idPostfix === "popup") {
const remoteBranchBtns = $("#accordion-remote-branches-popup button").filter((i, span) => jQuery.inArray($(span).text(),refs) != -1);
const widest = Math.max(...remoteBranchBtns.map((i, span) => $(span).width()));
if (remoteBranchBtns.length > 0) {
remoteBranchBtns.css("padding", ".25rem .5rem");
remoteBranchBtns.css("border", 0);
remoteBranchBtns.width(widest);
}
}
return accordionDiv;
}