Improvement in the look and feel of the whole application

Changed the SCSS/CSS for the below third party libraries to adopt the
new look 'n' feel:
- wcDocker
- Alertify dialogs, and notifications
- AciTree
- Bootstrap Navbar
- Bootstrap Tabs
- Bootstrap Drop-Down menu
- Backgrid
- Select2

Adopated the new the look 'n' feel for the dialogs, wizard, properties,
tab panels, tabs, fieldset, subnode control, spinner control, HTML
table, and other form controls.

- Font is changed to Roboto
- Using SCSS variables to define the look 'n' feel
- Designer background images for the Login, and Forget password pages in
  'web' mode
- Improved the look 'n' feel for the key selection in the preferences
  dialog
- Table classes consistency changes across the application
- File Open and Save dialog list view changes

Author(s): Aditya Toshniwal & Khushboo Vashi
This commit is contained in:
Ashesh Vashi
2018-12-21 17:14:55 +05:30
parent a000dc6f60
commit 5799ac14ba
135 changed files with 5030 additions and 3878 deletions
@@ -1,30 +1,6 @@
/*
* CSS for Storage Manager Dialog
*/
.file_manager #uploader {
padding: 2px 4px;
border-width: 1px;
height: auto;
min-height:30px;
max-height: 80px;
overflow: hidden;
border-bottom: 1px;
}
#uploader .input-path {
font-size: 14px;
margin: 0;
padding: 0;
display: block;
float: left;
text-align: left;
line-height:1.6em;
width: calc(100% - 72px);
text-overflow: ellipsis;
overflow: hidden;
}
.uploadresponse {
display: none;
}
@@ -47,12 +23,10 @@
.fileinfo #contents li p > span.less_text,
.fileinfo table#contents tr td:first-child p span.less_text {
width: 100%;
display: inline-block;
text-overflow: ellipsis;
overflow: hidden;
text-align: center;
white-space: nowrap;
padding: 0 10px;
}
.fileinfo table#contents tr td p {
@@ -108,7 +82,6 @@ x:-o-prefocus, .file-input-container {top:16px;width:198px;}
/** Input file Replacement - end */
.file_listing #contents.grid {
padding: 25px;
text-align: left;
}
@@ -168,6 +141,11 @@ button.list span {
position: relative;
}
#dropzone-container {
min-height: 100%;
}
#dropzone-container h2 {
font-size: 20px;
margin-top: 0;
@@ -186,97 +164,6 @@ button.list span {
width: 100% !important;
}
.storage_dialog {
height: 100%;
width: 100%;
}
.storage_content {
height: 100%;
width: 100%;
}
.file_manager {
bottom: 0;
left: 0;
position: absolute;
right: 0;
top: 0;
}
.file_manager .fileinfo {
height: calc(100% - 90px);
overflow: hidden;
position: relative;
}
.file_manager .fileinfo #contents{
padding: 5px;
text-align: left;
display: inline-block;
height: 100%;
width: 100%;
overflow: hidden;
}
.file_manager .fileinfo #contents thead tr{
position: relative;
display: block;
width: 100%;
}
.file_manager .fileinfo #contents thead tr th:nth-child(1),
.file_manager .fileinfo #contents tbody tr td:nth-child(1) {
position: relative;
width: 100%;
min-width: 100%;
max-width: 100%;
}
.file_manager .fileinfo #contents thead tr th:nth-child(2) {
width: 152px;
min-width: 152px;
max-width: 152px;
padding-left: 10px;
}
.file_manager .fileinfo #contents tbody tr td:nth-child(2) {
width: 150px;
min-width: 150px;
max-width: 150px;
}
.file_manager .fileinfo #contents thead tr th:nth-child(3) {
width: 197px;
min-width: 197px;
max-width: 197px;
padding-left: 10px;
}
.file_manager .fileinfo #contents tbody tr td:nth-child(3) {
width: 177px;
min-width: 177px;
max-width: 177px;
}
.file_manager .fileinfo #contents tbody {
display: block;
overflow: auto;
width: 100%;
height: calc(100% - 30px);
}
.file_manager .fileinfo #contents tbody tr{
/*display: table;*/
max-width: 100%;
width: 100%;
cursor: pointer;
}
.file_manager .upload_file #dropzone-container {
height: 100%;
}
.file_manager .upload_file #multiple-uploads .dz-message {
text-align: center;
}
@@ -313,12 +200,6 @@ button.list span {
width: 150px;
}
.allowed_file_types .change_file_types {
position: absolute;
top: 4px;
right: 0;
}
.allowed_file_types .change_file_types select {
width: 75px;
margin-left: 10px;
@@ -326,10 +207,6 @@ button.list span {
height: 22px;
}
.allowed_file_types .change_file_types label {
float: right;
}
.upload_file .file_upload_main .show_error p.size {
text-align: center;
}
@@ -442,10 +319,18 @@ div.change_file_types span {
}
/* Overriding the css for the dropzone */
.dropzone {
text-align: center;
}
.dropzone .dz-preview .dz-progress {
height: initial;
}
.dropzone.dz-clickable {
cursor: move;
}
.dropzone .dz-preview .dz-progress .dz-upload {
bottom: initial;
}
@@ -12,15 +12,14 @@ module.exports = Alertify.dialog('createModeDlg', function() {
setup: function() {
return {
buttons: [{
text: gettext('Cancel'),
key: 27,
className: 'btn btn-secondary fa fa-times file_manager_create_cancel pg-alertify-button',
},{
text: gettext('Create'),
key: 13,
className: 'btn btn-primary fa fa-file file_manager_create file_manager_ok pg-alertify-button disabled',
},
{
text: gettext('Cancel'),
key: 27,
className: 'btn btn-danger fa fa-times file_manager_create_cancel pg-alertify-button',
},
],
focus: {
element: 0,
@@ -18,11 +18,6 @@ module.exports = Alertify.dialog('fileSelectionDlg', function() {
self.dialog_type = params['dialog_type'];
this.set('title', params['dialog_title']);
if (_.isUndefined(params['btn_primary'])) {
params['btn_primary'] = 'Select';
}
this.set('label', params['btn_primary']);
this.params = JSON.stringify(params);
this.elements.dialog.style.minWidth = '630px';
@@ -74,21 +69,19 @@ module.exports = Alertify.dialog('fileSelectionDlg', function() {
$($(self.elements.footer).find('.file_manager_ok')).trigger('click');
});
}, 200);
self.__internal.buttons[0].element.disabled = true;
self.__internal.buttons[1].element.disabled = true;
},
setup: function() {
return {
buttons: [{
text: gettext('Cancel'),
key: 27,
className: 'btn btn-secondary fa fa-times pg-alertify-button',
},{
text: gettext('Select'),
key: 13,
className: 'btn btn-primary fa fa-file file_manager_ok pg-alertify-button disabled',
},
{
text: gettext('Cancel'),
key: 27,
className: 'btn btn-danger fa fa-times pg-alertify-button',
},
],
}],
focus: {
element: 0,
},
@@ -576,7 +576,7 @@ define([
result += '</ul>';
} else {
result += '<table id="contents" class="list tablesorter">';
result += '<table id="contents" class="table table-bordered table-noouter-border table-hover tablesorter">';
result += '<thead><tr><th>';
result += '<span>' + lg.name + '</span></th>';
result += '<th><span>' + lg.size + '</span></th><th>';
@@ -589,7 +589,7 @@ define([
var path = _.escape((data[key]).Path),
props = (data[key]).Properties,
cap_classes = '',
cap, class_type;
cap, class_type, icon_type;
for (cap in capabilities) {
if (has_capability(data[key], capabilities[cap])) {
@@ -601,11 +601,14 @@ define([
bindToolbar(data[key]);
if ((data[key]).file_type == 'dir') {
class_type = 'fa fa-folder-open tbl_folder';
class_type = 'tbl_folder';
icon_type = 'fa fa-folder-open';
} else if ((data[key]).file_type == 'drive') {
class_type = 'fa fa-hdd-o tbl_drive';
class_type = 'tbl_drive';
icon_type = 'fa fa-hdd-o';
} else {
class_type = 'fa fa-file-text tbl_file';
class_type = 'tbl_file';
icon_type = 'fa fa-file-text';
}
result += '<tr class="' + cap_classes + '">';
@@ -617,16 +620,21 @@ define([
fm_filename = _.escape(fm_filename);
result += '<td title="' + path + '" class="' + class_type + '">';
let data_protected = '';
if ((data[key]).Protected == 1) {
result +=
'<i class="fa fa-lock tbl_lock_icon" data-protected="protected"></i>';
data_protected = '<i class="fa fa-lock tbl_lock_icon" data-protected="protected"></i>';
}
if (!has_capability(data[key], 'rename')) {
result += data_protected;
result += '<span title="' + (data[key]).Filename + '">' +
fm_filename + '</span></td>';
} else {
result += '<p><input type="text" class="fm_file_rename"/><span class="less_text" title="' +
fm_filename + '">' + fm_filename + '</span></p></td>';
result += '<p><input type="text" class="fm_file_rename"/>'+
'<span class="'+icon_type+'"></span>' +
data_protected +
'<span class="less_text ml-2" title="' + fm_filename + '">' + fm_filename + '</span>' +
'</p></td>';
}
if (props.Size && props.Size != '') {
result += '<td><span title="' + props.Size + '">' +
@@ -1104,20 +1112,15 @@ define([
selected = false,
have_all_types = false;
select_box = '<div class=\'change_file_types\'>' +
gettext('Show hidden files and folders') +
'? <input type=\'checkbox\' id=\'show_hidden\' onclick=\'pgAdmin.FileUtils.handleClick(this)\' tabindex=\'11\'>' +
'<span></span>' +
'<select name=\'type\' tabindex=\'12\'>';
let fileFormats = '';
while (i < types_len) {
t = allowed_types[i];
if (!selected && (types_len == 1 || t != '*')) {
select_box += '<option value=' + t + ' selected>' + t + '</option>';
fileFormats += '<option value=' + t + ' selected>' + t + '</option>';
selected = true;
have_all_types = (have_all_types || (t == '*'));
} else {
select_box += '<option value="' + t + '">' +
fileFormats += '<option value="' + t + '">' +
(t == '*' ? gettext('All Files') : t) + '</option>';
have_all_types = (have_all_types || (t == '*'));
}
@@ -1125,9 +1128,18 @@ define([
}
if (!have_all_types) {
select_box += '<option value="*">' + gettext('All Files') + '</option>';
fileFormats += '<option value="*">' + gettext('All Files') + '</option>';
}
select_box += '</select><label>' + gettext('Format') + ': </label></div>';
select_box = `<div class='change_file_types d-flex align-items-center p-1'>
<div>
${gettext('Show hidden files and folders')} ?
<input type='checkbox' id='show_hidden' onclick='pgAdmin.FileUtils.handleClick(this)' tabindex='11'>
</div>
<div class="ml-auto">
<label>${gettext('Format')}</label>
<select name='type' tabindex='12'>${fileFormats}</select>
<div>`;
}
$('.allowed_file_types').html(select_box);
@@ -1399,10 +1411,12 @@ define([
$('#uploader .upload').off().on('click', function() {
// we create prompt
var msg = '<div id="dropzone-container">' +
'<button class="fa fa-times dz_cross_btn" tabindex="7"></button>' +
'<div id="multiple-uploads" class="dropzone"></div>' +
'<div class="prompt-info">' + lg.file_size_limit +
var msg = '<div id="dropzone-container" class="d-flex flex-column flex-grow-1">' +
'<button class="fa fa-times fa-lg dz_cross_btn ml-auto" tabindex="7"></button>' +
'<div id="multiple-uploads" class="dropzone flex-grow-1 d-flex p-1">'+
'<div class="dz-default dz-message d-none"></div>'+
'</div>' +
'<div class="prompt-info">Drop files here to upload. ' + lg.file_size_limit +
config.upload.fileSizeLimit + ' ' + lg.mb + '.</div>',
path = $('.currentpath').val(),
filesizelimit = config.upload.fileSizeLimit,
@@ -1419,10 +1433,10 @@ define([
acceptFiles = null;
}
$('.file_manager .upload_file').toggle();
$('.file_manager .upload_file').toggleClass('d-none');
$('.file_manager .file_listing').toggleClass('d-none');
$('.file_manager .upload_file').html(msg);
//var previewTemplate = '<div id="dropzone-container">';
var previewTemplate = '<div class="file_upload_main dz-preview dz-file-preview">' +
'<div class="show_error">' +
'<p class="size dz-size" data-dz-size></p>' +
@@ -1454,7 +1468,8 @@ define([
autoProcessQueue: true,
init: function() {
$('.dz_cross_btn').off().on('click', function() {
$('.file_manager .upload_file').toggle();
$('.file_manager .upload_file').toggleClass('d-none');
$('.file_manager .file_listing').toggleClass('d-none');
});
},
sending: function(file, xhr, formData) {
@@ -1594,10 +1609,12 @@ define([
// template to create new folder in table view
folder_div = $(
'<tr class=\'cap_download cap_delete cap_select_file cap_select_folder cap_rename cap_create cap_upload\'>' +
'<td title=\'\' class=\'fa fa-folder-open tbl_folder\'>' +
'<p><input type=\'text\' class=\'fm_file_rename\'><span>' +
lg.new_folder + '</span></p>' +
'</td><td><span title=\'\'></span></td>' +
'<td title=\'\' class=\' tbl_folder\'>' +
'<input type=\'text\' class=\'fm_file_rename\'>'+
'<span class="fa fa-folder-open"></span>' +
'<span>' + lg.new_folder + '</span>' +
'</td>'+
'<td><span title=\'\'></span></td>' +
'<td></td>' +
'</tr>'
);
@@ -3,12 +3,15 @@
color: $color-gray;
}
.file_listing #contents.grid li.selected {
border: 1px solid $color-primary-lighter;
.file_listing {
min-width: 100%;
}
.file_listing #contents.grid li.selected, .fileinfo #contents tbody tr.selected {
background: $color-primary-lighter !important;
.file_listing #contents.grid li:hover,
.file_listing #contents.grid li.selected {
cursor: pointer;
border: $table-hover-border;
background: $table-hover-bg-color;
}
.fileinfo table#contents tr td p {
@@ -25,10 +28,6 @@
color: $color-gray;
}
.file_manager button {
background-color: $color-gray-light;
}
.newfile {
position: absolute;
top:0;
@@ -87,40 +86,23 @@
width: 100%;
}
.file_listing #contents.list th {
font-weight: bold;
cursor: pointer;
color: $color-fg-inverse;
}
.file_listing #contents.list td.tbl_folder:first-child:before {
margin-right: 5px;
color: $color-warning;
}
.file_listing #contents.list td.tbl_drive:first-child:before {
color: $color-gray-light;
margin-right: 5px;
}
.file_listing #contents.list tbody tr:nth-child(even):hover {
background-color: $color-gray-lighter !important;
}
.file_listing #contents.grid li:hover {
border: 1px solid $color-gray-lighter;
background-color: $color-gray-lighter;
cursor: pointer;
height: 80px;
}
.btn-group.filemanager-btn-group .btn:not(:first-child):not(:last-child),
.btn-group.filemanager-path-group .btn:not(:first-child):not(:last-child) {
border-left: 1px solid $color-gray-light;
}
.file_manager {
position: absolute;
top: 0px;
bottom: 0px;
left: 0px;
right: 0px;
}
.file_manager #uploader {
border-bottom: $panel-border;
}
.file_manager #uploader .filemanager-path-group {
padding: 0;
display: block;
@@ -149,65 +131,21 @@
overflow: hidden;
}
.file_manager .fileinfo #contents tbody tr:nth-child(even) {
background: $color-gray-lighter;
}
.file_manager .fileinfo #contents thead tr th:not(:first-child) {
border-left: 1px solid $color-bg;
}
.file_manager .upload_file {
display: none;
z-index: 1;
margin-bottom: auto;
top: 0;
margin-top: 0;
height: calc(100% - 5px);
width: 100%;
border: none;
position: absolute;
bottom: 0;
background-color: $color-bg-inverse;
padding: 0px;
padding-top: 22px;
padding-left: 10px;
}
.file_manager .upload_file #multiple-uploads {
height: calc(100% - 20px);
background: $color-bg-inverse;
color: $color-fg-inverse;
padding: 0px !important;
overflow: auto;
width: 100%;
.file_manager .upload_file #dropzone-container {
background: $color-gray-light;
}
.fileinfo .prompt-info {
text-align: center;
color: $color-fg-inverse;
color: $color-fg-theme;
}
.fileinfo .file_listing {
display: block;
height: calc(100% - 35px);
border: 1px solid $color-gray-lighter;
border-bottom: none;
font-size: 12px;
.allowed_file_types {
border-top: $panel-border;
}
.fileinfo .allowed_file_types {
display: block;
height: 25px;
position: absolute;
right: 0;
border-top: 1px solid $color-gray-lighter;
padding-top: 4px;
bottom: 4px;
width: 100%;
background: $color-bg;
white-space: nowrap;
.upload_file{
min-width: 100%;
}
.upload_file .file_upload_main {
@@ -242,7 +180,7 @@
}
.file_upload_main .dz-progress .dz-upload {
background: $color-primary-lighter !important;
background: $color-primary-light !important;
text-align: center;
}
@@ -268,6 +206,10 @@
border: 1px solid $color-fg;
}
.dropzone .dz-message {
color: $color-gray;
}
.fileinfo .fm_dimmer {
height: calc(100% - 32px);
display: none;
@@ -282,14 +224,10 @@
.fileinfo .delete_item, .fileinfo .replace_file {
display: none;
padding: 15px 15px;
opacity: 0.8;
color: $color-fg-inverse;
border: 1px solid $color-gray-light;
border-left: 0;
border-right: 0;
background: $color-bg-inverse;
box-shadow: 1px 0px 3px 1px $color-bg;
font-weight: bold;
background: $color-bg-theme;
position: absolute;
top: 0;
left: 0;
@@ -307,17 +245,15 @@
}
.upload_file .dz_cross_btn {
color: $color-fg-inverse;
font-size: x-large;
right: -4px;
color: $color-fg-theme;
right: 0px;
position: absolute;
top: -1px;
background: transparent;
border: none;
}
.file_manager .fileinfo #contents .fm_lock_icon {
color: $color-danger-lighter;
color: $color-danger;
position: absolute;
top: 6px;
right: 0;
@@ -326,16 +262,16 @@
}
.file_manager .fileinfo #contents .fa-lock.tbl_lock_icon {
color: $color-danger-lighter;
position: absolute;
left: 19px;
top: 5px;
color: $color-danger;
position: relative;
left: -5px;
top: -5px;
font-size: 10px;
}
.file_manager button.ON {
background: $color-gray-lighter;
border: 1px inset $color-gray-lighter;
background: $color-primary;
color: $color-primary-fg;
}
.fileinfo .is_file_replace {
@@ -346,17 +282,16 @@
.file_selection_ctrl button.select_item {
display: inline;
background: $color-gray;
background: -webkit-linear-gradient( $color-gray, $color-gray);
background: -o-linear-gradient( $color-gray, $color-gray-light);
background: -moz-linear-gradient( $color-gray, $color-gray-light);
background: linear-gradient( $color-gray, $color-gray-light);
color: $color-fg-inverse;
background: $color-bg-theme;
padding: 9px 0px 9px 0px;
margin-left: 0px;
margin-right: -7px;
margin-top: -4px;
min-width: 30px;
border-top-left-radius: 0;
border-bottom-left-radius: 0;
}
.cap_select_file {
cursor: pointer;
}