Commit 3c44dbea authored by Gradl, Tobias's avatar Gradl, Tobias
Browse files

1257: Migrate administrative views

Task-Url: https://pm.winseda.de/issues/1257
parent 066af3cc
......@@ -116,25 +116,10 @@
margin-bottom: 6px;
margin-left: 0.5rem; }
.sidebar .sidebar-block ul {
padding-left: 1rem;
padding-left: 12px;
margin-left: 0; }
.sidebar .sidebar-block ul li {
display: inline-block; }
.sidebar .sidebar-block ul li::before {
display: inline-block;
width: 0;
height: 0;
margin-right: 3px;
margin-left: 8px;
border-top: 5px solid transparent;
border-bottom: 5px solid transparent;
content: " ";
border-left: 5px solid #333333; }
.sidebar .sidebar-block ul li.has-error a {
color: #652122;
font-weight: 700; }
.sidebar .sidebar-block ul li.has-error a:hover, .sidebar .sidebar-block ul li.has-error a:focus {
color: #2b0e0f; }
padding-bottom: 6px; }
.modal .modal-dialog .modal-content .modal-header .modal-title {
margin: 0; }
......@@ -308,3 +293,77 @@
background: -moz-linear-gradient(top, #9b9fc4, #494e7d);
background: linear-gradient(top, #9b9fc4, #494e7d);
border-color: #213365; }
table.dataTable.state-table {
border-collapse: separate;
border-spacing: 0 1px;
width: 100%; }
table.dataTable.state-table.state-table-navigatable tbody tr.state-row-default.active, table.dataTable.state-table.state-table-navigatable tbody tr.state-row-default:hover, table.dataTable.state-table.state-table-navigatable tbody tr.state-row-default.group, table.dataTable.state-table.state-table-selectable tbody tr.state-row-default.active, table.dataTable.state-table.state-table-selectable tbody tr.state-row-default:hover, table.dataTable.state-table.state-table-selectable tbody tr.state-row-default.group {
background-color: #d6d6d6; }
table.dataTable.state-table.state-table-navigatable tbody tr.state-row-ok.active, table.dataTable.state-table.state-table-navigatable tbody tr.state-row-ok:hover, table.dataTable.state-table.state-table-navigatable tbody tr.state-row-ok.group, table.dataTable.state-table.state-table-selectable tbody tr.state-row-ok.active, table.dataTable.state-table.state-table-selectable tbody tr.state-row-ok:hover, table.dataTable.state-table.state-table-selectable tbody tr.state-row-ok.group {
background-color: #aad57d; }
table.dataTable.state-table.state-table-navigatable tbody tr.state-row-info.active, table.dataTable.state-table.state-table-navigatable tbody tr.state-row-info:hover, table.dataTable.state-table.state-table-navigatable tbody tr.state-row-info.group, table.dataTable.state-table.state-table-selectable tbody tr.state-row-info.active, table.dataTable.state-table.state-table-selectable tbody tr.state-row-info:hover, table.dataTable.state-table.state-table-selectable tbody tr.state-row-info.group {
background-color: #a7e9f4; }
table.dataTable.state-table.state-table-navigatable tbody tr.state-row-warning.active, table.dataTable.state-table.state-table-navigatable tbody tr.state-row-warning:hover, table.dataTable.state-table.state-table-navigatable tbody tr.state-row-warning.group, table.dataTable.state-table.state-table-selectable tbody tr.state-row-warning.active, table.dataTable.state-table.state-table-selectable tbody tr.state-row-warning:hover, table.dataTable.state-table.state-table-selectable tbody tr.state-row-warning.group {
background-color: #fff4d3; }
table.dataTable.state-table.state-table-navigatable tbody tr.state-row-danger.active, table.dataTable.state-table.state-table-navigatable tbody tr.state-row-danger:hover, table.dataTable.state-table.state-table-navigatable tbody tr.state-row-danger.group, table.dataTable.state-table.state-table-navigatable tbody tr.state-row-error.active, table.dataTable.state-table.state-table-navigatable tbody tr.state-row-error:hover, table.dataTable.state-table.state-table-navigatable tbody tr.state-row-error.group, table.dataTable.state-table.state-table-selectable tbody tr.state-row-danger.active, table.dataTable.state-table.state-table-selectable tbody tr.state-row-danger:hover, table.dataTable.state-table.state-table-selectable tbody tr.state-row-danger.group, table.dataTable.state-table.state-table-selectable tbody tr.state-row-error.active, table.dataTable.state-table.state-table-selectable tbody tr.state-row-error:hover, table.dataTable.state-table.state-table-selectable tbody tr.state-row-error.group {
background-color: #d57d7f; }
table.dataTable.state-table.state-table-navigatable tbody tr:hover, table.dataTable.state-table.state-table-selectable tbody tr:hover {
cursor: pointer; }
table.dataTable.state-table.state-table-navigatable tbody tr.active td:last-child:before, table.dataTable.state-table.state-table-navigatable tbody tr:hover td:last-child:before {
content: "\f0c1";
font-family: 'Font Awesome 5 Free';
font-weight: 900;
position: absolute;
right: 1rem;
color: #707070; }
table.dataTable.state-table tbody tr.state-row-default th, table.dataTable.state-table tbody tr.state-row-default td {
border-color: #707070; }
table.dataTable.state-table tbody tr.state-row-ok th, table.dataTable.state-table tbody tr.state-row-ok td {
border-color: #446521; }
table.dataTable.state-table tbody tr.state-row-info th, table.dataTable.state-table tbody tr.state-row-info td {
border-color: #17a2b8; }
table.dataTable.state-table tbody tr.state-row-warning th, table.dataTable.state-table tbody tr.state-row-warning td {
border-color: #ffc107; }
table.dataTable.state-table tbody tr.state-row-danger th, table.dataTable.state-table tbody tr.state-row-danger td, table.dataTable.state-table tbody tr.state-row-error th, table.dataTable.state-table tbody tr.state-row-error td {
border-color: #652122; }
table.dataTable.state-table tbody tr th, table.dataTable.state-table tbody tr td {
position: relative;
border-top: 1px solid;
border-bottom: 1px solid;
font-weight: normal;
vertical-align: middle; }
table.dataTable.state-table tbody tr th a, table.dataTable.state-table tbody tr td a {
border-bottom: none; }
table.dataTable.state-table tbody tr th {
border-left: 6px solid;
text-align: center;
width: 8em;
padding: 5px; }
table.dataTable.state-table tbody tr th.state-default i {
color: #707070;
font-weight: normal; }
table.dataTable.state-table tbody tr th.state-ok i {
color: #446521;
font-weight: normal; }
table.dataTable.state-table tbody tr th.state-info i {
color: #17a2b8;
font-weight: bold; }
table.dataTable.state-table tbody tr th.state-warning i {
color: #ffc107;
font-weight: bold; }
table.dataTable.state-table tbody tr th.state-danger i, table.dataTable.state-table tbody tr th .state-error i {
color: #652122;
font-weight: bold; }
table.dataTable.state-table tbody tr td:last-child {
border-right-style: solid;
border-right-width: 1px; }
table.dataTable.state-table tbody tr td.dataTables_empty {
border: 1px solid #707070;
padding: 10px;
text-align: center; }
table.dataTable.state-table tbody tr.group th h2.group-heading, table.dataTable.state-table tbody tr.group td h2.group-heading {
margin: 0 12px 0 12px; }
.status-container li {
display: block !important; }
......@@ -22,42 +22,52 @@ body, wrapper {
color: #707070;
pointer-events: none; }
.color-primary,
.glyphicon-color-primary,
.fa-color-primary {
color: #213365; }
.color-primary-var-1,
.glyphicon-color-primary-var-1,
.fa-color-primary-var-1 {
color: #494e7d; }
.color-primary-var-2,
.glyphicon-color-primary-var-2,
.fa-color-primary-var-2 {
color: #727299; }
.color-secondary,
.glyphicon-color-secondary,
.fa-color-secondary {
color: #707070; }
.color-success,
.glyphicon-color-success,
.fa-color-success {
color: #446521; }
.color-info,
.glyphicon-color-info,
.fa-color-info {
color: #17a2b8; }
.color-warning,
.glyphicon-color-warning,
.fa-color-warning {
color: #ffc107; }
.color-danger,
.glyphicon-color-danger,
.fa-color-danger {
color: #652122; }
.color-light,
.glyphicon-color-light,
.fa-color-light {
color: #f8f9fa; }
.color-dark,
.glyphicon-color-dark,
.fa-color-dark {
color: #333333; }
......@@ -104,6 +114,14 @@ dt {
visibility: hidden !important;
height: 0 !important; }
.no-break-out {
overflow-wrap: break-word;
word-wrap: break-word;
word-break: break-word; }
.no-break {
white-space: nowrap; }
.navbar a {
border: none; }
.navbar .nav-item.show {
......
......@@ -26,17 +26,18 @@ CollectionsEditor.prototype.createTable = function() {
"order": [[5, "asc"]],
"columnDefs": [
{
"targets": [0], "class": "center", "cellType": "th",
"targets": [0], "class": "text-center", "cellType": "th",
"data": function (row, type, val, meta) { return editor.renderStateColumn(row, type, val, meta); },
}, {
"targets": [1], "class": "center",
"targets": [1], "class": "text-center",
"data": function (row, type, val, meta) { return row.entity.dataset.docs.toLocaleString(lang); },
}, {
"targets": [2],
"data": function (row, type, val, meta) { return editor.renderUrlColumn(row, type, val, meta); },
}, {
"targets": [3],
"data": "entity.endpoint.method"
"data": "entity.endpoint.method",
"class": "no-break"
}, {
"targets": [4], "responsivePriority" : 1, // It has the right border
"data": "entity.dataset.datamodelPojo.name"
......@@ -75,7 +76,7 @@ CollectionsEditor.prototype.setGroupRow = function(rows, group) {
return $('<tr class="state-row-' + overallState + '" id="' + rows.data()[0].entity.collection.id + '" />')
.append( '<th class="state-' + overallState + '"></th>' )
.append( '<td colspan="4">' +
'<span class="group-heading">' + rows.data()[0].entity.collection.name + '</span><br />' +
'<h2 class="group-heading"><a href="' + __util.composeRelativeUrl(rows.data()[0].entity.collection.id) + '/">' + rows.data()[0].entity.collection.name + '</a></h2>' +
'</td>' );
}
......@@ -138,12 +139,12 @@ CollectionsEditor.prototype.getColregStatus = function() {
if (data.pojo.accessible===true && data.pojo.statusCode===200) {
$("#colreg-status").html("<i class=\"fa fa-check\"></i> " +
data.pojo.roundtime + "ms");
$("#colreg-status-container").removeClass("alert-default").addClass("alert-success");
$("#colreg-status").addClass("color-success");
} else {
$("#colreg-status").html("<i class=\"fa fa-exclamation\"></i> " +
__translator.translate("~eu.dariah.de.minfba.common.api.status_code") + ": " +
data.pojo.statusCode + ", " + data.pojo.roundtime + "ms");
$("#colreg-status-container").removeClass("alert-default").addClass("alert-warning");
$("#colreg-status").addClass("color-warning");
}
},
error: __util.processServerError
......
......@@ -39,7 +39,7 @@ DatamodelEditor.prototype.createTable = function() {
"data": function (row, type, val, meta) { return editor.renderStateColumn(row, type, val, meta); }
}, {
"targets": [1],
"data": function (row, type, val, meta) { return editor.renderNameColumn(row, type, val, meta); },
"data": "entity.name",
}, {
"targets": [2],
......@@ -82,17 +82,17 @@ DatamodelEditor.prototype.getState = function(entity) {
DatamodelEditor.prototype.getIcon = function(entity) {
if (entity.deleted) {
return "trash";
return "fas fa-trash-alt";
} else if (entity.error || entity.warning) {
return "exclamation";
return "fas fa-exclamation-circle";
} else if (!entity.available) {
return "question";
return "fas fa-question-circle";
} else if (entity.processing || entity.busy || entity.outdated) {
return "refresh";
return "fas fa-sync-alt";
} else if (entity.waiting) {
return "clock-o";
return "fas fa-clock";
} else {
return "check";
return "fas fa-check-circle";
}
};
......@@ -103,14 +103,14 @@ DatamodelEditor.prototype.getDmeStatus = function() {
dataType: "json",
success: function(data) {
if (data.pojo.accessible===true && data.pojo.statusCode===200) {
$("#dme-status").html("<i class=\"fa fa-check\"></i> " +
$("#dme-status").html("<i class=\"fas fa-check-circle\"></i> " +
data.pojo.roundtime + "ms");
$("#dme-status-container").removeClass("alert-default").addClass("alert-success");
$("#dme-status").addClass("color-success");
} else {
$("#dme-status").html("<i class=\"fa fa-exclamation\"></i> " +
$("#dme-status").html("<i class=\"fas fa-exclamation-circle\"></i> " +
__translator.translate("~eu.dariah.de.minfba.search.view.api.status_code") + ": " +
data.pojo.statusCode + ", " + data.pojo.roundtime + "ms");
$("#dme-status-container").removeClass("alert-default").addClass("alert-warning");
$("#dme-status").addClass("color-warning");
}
},
error: __util.processServerError
......@@ -153,20 +153,12 @@ DatamodelEditor.prototype.getDmeStatus = function() {
});
};
DatamodelEditor.prototype.renderNameColumn = function(row, type, val, meta) {
var result = row.entity.name;
if (type==="display") {
result += ' <a title="' + __translator.translate("~eu.dariah.de.minfba.search.view.models.show_in_DME") + '" href="' + row.entity.linkUrl + '" target="_blank"><span class="glyphicon glyphicon-new-window" aria-hidden="true"></span></a>';
}
return result;
};
DatamodelEditor.prototype.renderStateColumn = function(row, type, val, meta) {
if (type==="display") {
var nodes = this._base.table.column(meta.column).nodes();
$(nodes[meta.row]).addClass("state-" + this.getState(row.entity));
return "<i class='fa fa-lg fa-" + this.getIcon(row.entity) + "' aria-hidden='true'></i>";
return "<i class='" + this.getIcon(row.entity) + " fa-lg' aria-hidden='true'></i>";
} else {
// TODO: render some status message instead
return this.getIcon(row.entity);
......@@ -179,9 +171,11 @@ DatamodelEditor.prototype.renderActionColumn = function(row, type, val, meta) {
}
var result = "";
//result += '<a class="btn btn-link" target="_blank" href="' + row.entity.linkUrl + '"><i class="fas fa-external-link-alt" aria-hidden="true"></i> ' + __translator.translate("~eu.dariah.de.minfba.search.view.models.show_in_DME") + '</a>';
if (__util.ulevel >= 100) {
result += "<button type='button' onclick='editor.triggerClearIndex(\"" + row.entity.id + "\"); return false;' class='btn btn-xs btn-link'><span class='glyphicon glyphicon-retweet'></span> " + __translator.translate("~eu.dariah.de.minfba.search.actions.datamodels.clear") + "</button>";
result += "<button type='button' onclick='editor.triggerDropDatamodel(\"" + row.entity.id + "\"); return false;' class='btn btn-xs btn-link'><span class='glyphicon glyphicon-trash'></span> " + __translator.translate("~eu.dariah.de.minfba.common.actions.delete") + "</button>";
result += "<button type='button' onclick='editor.triggerClearIndex(\"" + row.entity.id + "\"); return false;' class='btn btn-link'><i class='fas fa-sync-alt'></i> " + __translator.translate("~eu.dariah.de.minfba.search.actions.datamodels.clear") + "</button>";
result += "<button type='button' onclick='editor.triggerDropDatamodel(\"" + row.entity.id + "\"); return false;' class='btn btn-link'><span class='fas fa-trash-alt'></span> " + __translator.translate("~eu.dariah.de.minfba.common.actions.delete") + "</button>";
}
/*result += "<div class='btn-group'>" +
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment