Skip to content

Commit 5ee6e26

Browse files
committed
started ui revamp
1 parent 6f39ea8 commit 5ee6e26

File tree

4 files changed

+235
-12
lines changed

4 files changed

+235
-12
lines changed

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

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -857,6 +857,32 @@ body {
857857
#workspace-view .diff-line-offset {
858858
cursor: pointer;
859859
}
860+
#changedFilesContainer {
861+
width: 100%;
862+
}
863+
#changedFilesContainer .file-area {
864+
padding-left: 20px;
865+
padding-top: 15px;
866+
overflow-y: scroll;
867+
}
868+
#changedFilesContainer .file-area .form-check {
869+
margin-left: 10px;
870+
padding: 3px 5px 3px 5px;
871+
}
872+
#changedFilesContainer .file-area .file-item-label {
873+
padding-top: 1px;
874+
padding-left: 8px;
875+
font-size: 1rem;
876+
}
877+
#changedFilesContainer .file-area .file-item-label::after {
878+
content: "A";
879+
position: absolute;
880+
right: 5px;
881+
}
882+
#changedFilesContainer .commit-area {
883+
padding-top: 15px;
884+
overflow-y: scroll;
885+
}
860886
#commit-explorer-view #commit-explorer-navigator-view .panel .panel-body {
861887
flex: 1 1 0px;
862888
-webkit-flex: 1 1 0px;

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

Lines changed: 89 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -797,7 +797,7 @@ webui.SideBarView = function(mainView, noEventHandlers) {
797797
workspaceElement.click(function (event) {
798798
$("*", self.element).removeClass("active");
799799
workspaceElement.addClass("active");
800-
self.mainView.workspaceView.update("stage");
800+
self.mainView.workspaceView.show();
801801
});
802802

803803
var stashElement = $("#sidebar-stash h4", self.element);
@@ -2106,7 +2106,7 @@ webui.HistoryView = function(mainView) {
21062106
self.element.appendChild(self.commitView.element);
21072107
self.mainView = mainView;
21082108
};
2109-
2109+
21102110
/*
21112111
* == WorkspaceView ===========================================================
21122112
*/
@@ -2116,10 +2116,10 @@ webui.WorkspaceView = function(mainView) {
21162116

21172117
self.show = function() {
21182118
mainView.switchTo(self.element);
2119+
self.update("stage");
21192120
};
21202121

21212122
self.update = function(mode) {
2122-
self.show();
21232123
self.workingCopyView.update();
21242124
self.stagingAreaView.update();
21252125
self.commitMessageView.update();
@@ -2137,13 +2137,17 @@ webui.WorkspaceView = function(mainView) {
21372137
workspaceDiffView.appendChild(self.diffView.element);
21382138
var workspaceEditor = $("#workspace-editor", self.element)[0];
21392139
self.workingCopyView = new webui.ChangedFilesView(self, "working-copy", "Working Copy");
2140-
workspaceEditor.appendChild(self.workingCopyView.element);
2140+
// workspaceEditor.appendChild(self.workingCopyView.element);
21412141
self.commitMessageView = new webui.CommitMessageView(self);
2142-
workspaceEditor.appendChild(self.commitMessageView.element);
2142+
// workspaceEditor.appendChild(self.commitMessageView.element);
21432143
self.stagingAreaView = new webui.ChangedFilesView(self, "staging-area", "Staging Area");
2144-
workspaceEditor.appendChild(self.stagingAreaView.element);
2144+
// workspaceEditor.appendChild(self.stagingAreaView.element);
2145+
2146+
self.newChangedFilesView = new webui.NewChangedFilesView(self);
2147+
workspaceEditor.appendChild(self.newChangedFilesView.element);
21452148
};
21462149

2150+
21472151
/*
21482152
* == ChangedFilesView ========================================================
21492153
*/
@@ -2201,6 +2205,7 @@ webui.ChangedFilesView = function(workspaceView, type, label) {
22012205
}
22022206

22032207
if (isForCurrentUser) {
2208+
console.log(fileList);
22042209
addItemToFileList(fileList, "", model);
22052210
}
22062211
}
@@ -2496,6 +2501,84 @@ webui.ChangedFilesView = function(workspaceView, type, label) {
24962501
self.filesCount = 0;
24972502
};
24982503

2504+
/*
2505+
* ==new ChangedFilesView ====================================================
2506+
*/
2507+
2508+
webui.NewChangedFilesView = function(workspaceView) {
2509+
2510+
var self = this;
2511+
2512+
self.update = function() {
2513+
$(fileList).empty();
2514+
webui.git("status -u --porcelain", function(data) {
2515+
$.get("api/uncommitted", function (uncommitted) {
2516+
var uncommittedItems = JSON.parse(uncommitted)["current user's changes"];
2517+
2518+
})
2519+
});
2520+
}
2521+
2522+
self.getSelectedItemsCount = function() {
2523+
return $(".active", fileList).length;
2524+
}
2525+
2526+
self.element = $(
2527+
'<div id="changedFilesContainer" class="container">' +
2528+
'<div class="row">' +
2529+
'<div class="col-sm-5 file-area">' +
2530+
'<h4 id="fileAreaHeader">Test Header</h4>' +
2531+
'<div class="changed-files-list">' +
2532+
'<div class="form-check">' +
2533+
'<input class="form-check-input" type="checkbox" value="" id="defaultCheck1">' +
2534+
'<label class="form-check-label file-item-label" for="defaultCheck1">' +
2535+
'test check'+
2536+
'</label>' +
2537+
'</div>' +
2538+
'<div class="form-check">' +
2539+
'<input class="form-check-input" type="checkbox" value="" id="defaultCheck2" checked>' +
2540+
'<label class="form-check-label file-item-label" for="defaultCheck2">' +
2541+
'test check'+
2542+
'</label>' +
2543+
'</div>' +
2544+
'<div class="form-check">' +
2545+
'<input class="form-check-input" type="checkbox" value="" id="defaultCheck3">' +
2546+
'<label class="form-check-label file-item-label" for="defaultCheck3">' +
2547+
'test check'+
2548+
'</label>' +
2549+
'</div>' +
2550+
'<div class="form-check">' +
2551+
'<input class="form-check-input" type="checkbox" value="" id="defaultCheck4">' +
2552+
'<label class="form-check-label file-item-label" for="defaultCheck4">' +
2553+
'test check'+
2554+
'</label>' +
2555+
'</div>' +
2556+
'<div class="form-check">' +
2557+
'<input class="form-check-input" type="checkbox" value="" id="defaultCheck5" checked>' +
2558+
'<label class="form-check-label file-item-label" for="defaultCheck5">' +
2559+
'test check'+
2560+
'</label>' +
2561+
'</div>' +
2562+
'</div>' +
2563+
'</div>' +
2564+
'<div class="commit-area offset-sm-2 col-sm-5">' +
2565+
'<h4>Commit Area</h4>' +
2566+
'<div class="form-group">' +
2567+
'<label for="commitMsg">Enter commit message:</label>' +
2568+
'<input type="area" class="form-control" id="commitMsg" placeholder="commit message">' +
2569+
'</div>' +
2570+
'<div class="form-group">' +
2571+
'<label for="commitMsgDetail">Enter commit message detail (optional)</label>' +
2572+
'<textarea class="form-control" id="commitMsgDetail"></textarea>' +
2573+
'</div>' +
2574+
'</div>' +
2575+
'</div>' +
2576+
'</div>'
2577+
)[0];
2578+
var fileListContainer = $(".file-area", self.element)[0];
2579+
var fileList = $(".changed-files-list", fileListContainer)[0];
2580+
}
2581+
24992582
/*
25002583
* == CommitMessageView =======================================================
25012584
*/

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

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -828,6 +828,37 @@ body {
828828
}
829829
}
830830

831+
#changedFilesContainer {
832+
width: 100%;
833+
.file-area {
834+
padding-left: 20px;
835+
padding-top: 15px;
836+
837+
overflow-y: scroll;
838+
839+
.form-check {
840+
margin-left: 10px;
841+
padding: 3px 5px 3px 5px;
842+
}
843+
.file-item-label {
844+
padding-top: 1px;
845+
padding-left: 8px;
846+
font-size: 1rem;
847+
848+
}
849+
.file-item-label::after {
850+
content: "A";
851+
position: absolute;
852+
right: 5px;
853+
}
854+
}
855+
856+
.commit-area {
857+
padding-top: 15px;
858+
overflow-y: scroll;
859+
}
860+
}
861+
831862
#commit-explorer-view {
832863
#commit-explorer-navigator-view {
833864
.panel {

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

Lines changed: 89 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -797,7 +797,7 @@ webui.SideBarView = function(mainView, noEventHandlers) {
797797
workspaceElement.click(function (event) {
798798
$("*", self.element).removeClass("active");
799799
workspaceElement.addClass("active");
800-
self.mainView.workspaceView.update("stage");
800+
self.mainView.workspaceView.show();
801801
});
802802

803803
var stashElement = $("#sidebar-stash h4", self.element);
@@ -2106,7 +2106,7 @@ webui.HistoryView = function(mainView) {
21062106
self.element.appendChild(self.commitView.element);
21072107
self.mainView = mainView;
21082108
};
2109-
2109+
21102110
/*
21112111
* == WorkspaceView ===========================================================
21122112
*/
@@ -2116,10 +2116,10 @@ webui.WorkspaceView = function(mainView) {
21162116

21172117
self.show = function() {
21182118
mainView.switchTo(self.element);
2119+
self.update("stage");
21192120
};
21202121

21212122
self.update = function(mode) {
2122-
self.show();
21232123
self.workingCopyView.update();
21242124
self.stagingAreaView.update();
21252125
self.commitMessageView.update();
@@ -2137,13 +2137,17 @@ webui.WorkspaceView = function(mainView) {
21372137
workspaceDiffView.appendChild(self.diffView.element);
21382138
var workspaceEditor = $("#workspace-editor", self.element)[0];
21392139
self.workingCopyView = new webui.ChangedFilesView(self, "working-copy", "Working Copy");
2140-
workspaceEditor.appendChild(self.workingCopyView.element);
2140+
// workspaceEditor.appendChild(self.workingCopyView.element);
21412141
self.commitMessageView = new webui.CommitMessageView(self);
2142-
workspaceEditor.appendChild(self.commitMessageView.element);
2142+
// workspaceEditor.appendChild(self.commitMessageView.element);
21432143
self.stagingAreaView = new webui.ChangedFilesView(self, "staging-area", "Staging Area");
2144-
workspaceEditor.appendChild(self.stagingAreaView.element);
2144+
// workspaceEditor.appendChild(self.stagingAreaView.element);
2145+
2146+
self.newChangedFilesView = new webui.NewChangedFilesView(self);
2147+
workspaceEditor.appendChild(self.newChangedFilesView.element);
21452148
};
21462149

2150+
21472151
/*
21482152
* == ChangedFilesView ========================================================
21492153
*/
@@ -2201,6 +2205,7 @@ webui.ChangedFilesView = function(workspaceView, type, label) {
22012205
}
22022206

22032207
if (isForCurrentUser) {
2208+
console.log(fileList);
22042209
addItemToFileList(fileList, "", model);
22052210
}
22062211
}
@@ -2496,6 +2501,84 @@ webui.ChangedFilesView = function(workspaceView, type, label) {
24962501
self.filesCount = 0;
24972502
};
24982503

2504+
/*
2505+
* ==new ChangedFilesView ====================================================
2506+
*/
2507+
2508+
webui.NewChangedFilesView = function(workspaceView) {
2509+
2510+
var self = this;
2511+
2512+
self.update = function() {
2513+
$(fileList).empty();
2514+
webui.git("status -u --porcelain", function(data) {
2515+
$.get("api/uncommitted", function (uncommitted) {
2516+
var uncommittedItems = JSON.parse(uncommitted)["current user's changes"];
2517+
2518+
})
2519+
});
2520+
}
2521+
2522+
self.getSelectedItemsCount = function() {
2523+
return $(".active", fileList).length;
2524+
}
2525+
2526+
self.element = $(
2527+
'<div id="changedFilesContainer" class="container">' +
2528+
'<div class="row">' +
2529+
'<div class="col-sm-5 file-area">' +
2530+
'<h4 id="fileAreaHeader">Test Header</h4>' +
2531+
'<div class="changed-files-list">' +
2532+
'<div class="form-check">' +
2533+
'<input class="form-check-input" type="checkbox" value="" id="defaultCheck1">' +
2534+
'<label class="form-check-label file-item-label" for="defaultCheck1">' +
2535+
'test check'+
2536+
'</label>' +
2537+
'</div>' +
2538+
'<div class="form-check">' +
2539+
'<input class="form-check-input" type="checkbox" value="" id="defaultCheck2" checked>' +
2540+
'<label class="form-check-label file-item-label" for="defaultCheck2">' +
2541+
'test check'+
2542+
'</label>' +
2543+
'</div>' +
2544+
'<div class="form-check">' +
2545+
'<input class="form-check-input" type="checkbox" value="" id="defaultCheck3">' +
2546+
'<label class="form-check-label file-item-label" for="defaultCheck3">' +
2547+
'test check'+
2548+
'</label>' +
2549+
'</div>' +
2550+
'<div class="form-check">' +
2551+
'<input class="form-check-input" type="checkbox" value="" id="defaultCheck4">' +
2552+
'<label class="form-check-label file-item-label" for="defaultCheck4">' +
2553+
'test check'+
2554+
'</label>' +
2555+
'</div>' +
2556+
'<div class="form-check">' +
2557+
'<input class="form-check-input" type="checkbox" value="" id="defaultCheck5" checked>' +
2558+
'<label class="form-check-label file-item-label" for="defaultCheck5">' +
2559+
'test check'+
2560+
'</label>' +
2561+
'</div>' +
2562+
'</div>' +
2563+
'</div>' +
2564+
'<div class="commit-area offset-sm-2 col-sm-5">' +
2565+
'<h4>Commit Area</h4>' +
2566+
'<div class="form-group">' +
2567+
'<label for="commitMsg">Enter commit message:</label>' +
2568+
'<input type="area" class="form-control" id="commitMsg" placeholder="commit message">' +
2569+
'</div>' +
2570+
'<div class="form-group">' +
2571+
'<label for="commitMsgDetail">Enter commit message detail (optional)</label>' +
2572+
'<textarea class="form-control" id="commitMsgDetail"></textarea>' +
2573+
'</div>' +
2574+
'</div>' +
2575+
'</div>' +
2576+
'</div>'
2577+
)[0];
2578+
var fileListContainer = $(".file-area", self.element)[0];
2579+
var fileList = $(".changed-files-list", fileListContainer)[0];
2580+
}
2581+
24992582
/*
25002583
* == CommitMessageView =======================================================
25012584
*/

0 commit comments

Comments
 (0)