Skip to content

Commit 9d912b3

Browse files
committed
git ui revamp ready for release
1 parent 4b99792 commit 9d912b3

File tree

4 files changed

+37
-16
lines changed

4 files changed

+37
-16
lines changed

git-webui/release/share/git-webui/webui/css/git-webui.css

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -866,7 +866,7 @@ body {
866866
padding-top: 15px;
867867
}
868868
#changedFilesContainer .file-area .select-all {
869-
border-bottom: 2px solid black;
869+
border-bottom: 1px solid lightgray;
870870
}
871871
#changedFilesContainer .file-area .select-all .form-check-label {
872872
font-size: 1rem;
@@ -877,7 +877,7 @@ body {
877877
margin-bottom: 2px;
878878
}
879879
#changedFilesContainer .file-area .diffed-file {
880-
background-color: #4daefd;
880+
background-color: #7fceff;
881881
}
882882
#changedFilesContainer .file-area .form-check {
883883
padding: 3px 5px 3px 15px;
@@ -894,17 +894,22 @@ body {
894894
margin-left: -12px !important;
895895
}
896896
#changedFilesContainer .file-area .A::after {
897-
content: "A";
897+
content: "Added";
898898
position: absolute;
899899
right: 5px;
900900
}
901901
#changedFilesContainer .file-area .D::after {
902-
content: "D";
902+
content: "Deleted";
903903
position: absolute;
904904
right: 5px;
905905
}
906906
#changedFilesContainer .file-area .M::after {
907-
content: "M";
907+
content: "Modified";
908+
position: absolute;
909+
right: 5px;
910+
}
911+
#changedFilesContainer .file-area .R::after {
912+
content: "Renamed";
908913
position: absolute;
909914
right: 5px;
910915
}

git-webui/release/share/git-webui/webui/js/git-webui.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2518,6 +2518,7 @@ webui.NewChangedFilesView = function(workspaceView) {
25182518
$("#commitMsg").val("");
25192519
$("#commitMsgDetail").val("");
25202520
$('#selectAllFiles').prop('checked', false);
2521+
25212522
webui.git("status -u --porcelain", function(data) {
25222523
$.get("api/uncommitted", function (uncommitted) {
25232524
var uncommittedItems = JSON.parse(uncommitted)["current user's changes"];
@@ -2590,16 +2591,18 @@ webui.NewChangedFilesView = function(workspaceView) {
25902591
self.deselectAll();
25912592
}
25922593
});
2593-
2594+
$("#commitBtn").off("click");
25942595
$("#commitBtn").on("click", function() {
25952596
var commitMessage = $('#commitMsg').val() + "\n" + $("#commitMsgDetail").val()
25962597
self.commit(commitMessage);
25972598
});
25982599

2600+
$("#discardBtn").off("click");
25992601
$("#discardBtn").on("click", function() {
26002602
self.discard();
26012603
});
26022604

2605+
$("#stashBtn").off("click");
26032606
$("#stashBtn").on("click", function() {
26042607
self.stash();
26052608
});
@@ -2614,6 +2617,9 @@ webui.NewChangedFilesView = function(workspaceView) {
26142617
if (fileIndex == -1) {
26152618
selectedItems.push(fileName);
26162619
}
2620+
if (selectedItems.length == Array.from(fileList.children).length) {
2621+
$('#selectAllFiles').prop('checked', true);
2622+
}
26172623
} else {
26182624
$('#selectAllFiles').prop('checked', false);
26192625
if (fileIndex > -1) {
@@ -2692,7 +2698,6 @@ webui.NewChangedFilesView = function(workspaceView) {
26922698
self.discard = function() {
26932699
var selectedFilesAsString = selectedItems.join(" ");
26942700
webui.git("restore -- " + selectedFilesAsString, function(output) {
2695-
// webui.showSuccess(output);
26962701
workspaceView.update();
26972702
});
26982703
}
@@ -2721,7 +2726,7 @@ webui.NewChangedFilesView = function(workspaceView) {
27212726
'<input type="area" class="form-control" id="commitMsg" placeholder="Enter commit message (required, 72 character limit)">' +
27222727
'</div>' +
27232728
'<div class="form-group">' +
2724-
'<textarea class="form-control" id="commitMsgDetail" rows="4" placeholder="Enter commit details (optional, no character limit)"></textarea>' +
2729+
'<textarea class="form-control" id="commitMsgDetail" rows="4" placeholder="Enter commit details (optional)"></textarea>' +
27252730
'</div>' +
27262731
'<div class="button-group">' +
27272732
'<button type="button" class="btn btn-primary file-action-button" id="commitBtn" disabled> Commit </button>' +

git-webui/src/share/git-webui/webui/css/git-webui.less

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -848,11 +848,11 @@ body {
848848
margin-bottom: 2px;
849849
}
850850

851-
border-bottom: 2px solid black;
851+
border-bottom: 1px solid lightgray;
852852
}
853853

854854
.diffed-file {
855-
background-color: #4daefd;
855+
background-color: #7fceff;
856856
}
857857

858858

@@ -876,19 +876,25 @@ body {
876876
margin-left: -12px !important;
877877
}
878878
.A::after {
879-
content: "A";
879+
content: "Added";
880880
position: absolute;
881881
right: 5px;
882882
}
883883

884884
.D::after {
885-
content: "D";
885+
content: "Deleted";
886886
position: absolute;
887887
right: 5px;
888888
}
889889

890890
.M::after {
891-
content: "M";
891+
content: "Modified";
892+
position: absolute;
893+
right: 5px;
894+
}
895+
896+
.R::after {
897+
content: "Renamed";
892898
position: absolute;
893899
right: 5px;
894900
}

git-webui/src/share/git-webui/webui/js/git-webui.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2518,6 +2518,7 @@ webui.NewChangedFilesView = function(workspaceView) {
25182518
$("#commitMsg").val("");
25192519
$("#commitMsgDetail").val("");
25202520
$('#selectAllFiles').prop('checked', false);
2521+
25212522
webui.git("status -u --porcelain", function(data) {
25222523
$.get("api/uncommitted", function (uncommitted) {
25232524
var uncommittedItems = JSON.parse(uncommitted)["current user's changes"];
@@ -2590,16 +2591,18 @@ webui.NewChangedFilesView = function(workspaceView) {
25902591
self.deselectAll();
25912592
}
25922593
});
2593-
2594+
$("#commitBtn").off("click");
25942595
$("#commitBtn").on("click", function() {
25952596
var commitMessage = $('#commitMsg').val() + "\n" + $("#commitMsgDetail").val()
25962597
self.commit(commitMessage);
25972598
});
25982599

2600+
$("#discardBtn").off("click");
25992601
$("#discardBtn").on("click", function() {
26002602
self.discard();
26012603
});
26022604

2605+
$("#stashBtn").off("click");
26032606
$("#stashBtn").on("click", function() {
26042607
self.stash();
26052608
});
@@ -2614,6 +2617,9 @@ webui.NewChangedFilesView = function(workspaceView) {
26142617
if (fileIndex == -1) {
26152618
selectedItems.push(fileName);
26162619
}
2620+
if (selectedItems.length == Array.from(fileList.children).length) {
2621+
$('#selectAllFiles').prop('checked', true);
2622+
}
26172623
} else {
26182624
$('#selectAllFiles').prop('checked', false);
26192625
if (fileIndex > -1) {
@@ -2692,7 +2698,6 @@ webui.NewChangedFilesView = function(workspaceView) {
26922698
self.discard = function() {
26932699
var selectedFilesAsString = selectedItems.join(" ");
26942700
webui.git("restore -- " + selectedFilesAsString, function(output) {
2695-
// webui.showSuccess(output);
26962701
workspaceView.update();
26972702
});
26982703
}
@@ -2721,7 +2726,7 @@ webui.NewChangedFilesView = function(workspaceView) {
27212726
'<input type="area" class="form-control" id="commitMsg" placeholder="Enter commit message (required, 72 character limit)">' +
27222727
'</div>' +
27232728
'<div class="form-group">' +
2724-
'<textarea class="form-control" id="commitMsgDetail" rows="4" placeholder="Enter commit details (optional, no character limit)"></textarea>' +
2729+
'<textarea class="form-control" id="commitMsgDetail" rows="4" placeholder="Enter commit details (optional)"></textarea>' +
27252730
'</div>' +
27262731
'<div class="button-group">' +
27272732
'<button type="button" class="btn btn-primary file-action-button" id="commitBtn" disabled> Commit </button>' +

0 commit comments

Comments
 (0)