Archived
1
0

Fix #5 - Project Edit Page isn't working and more

This commit is contained in:
Marcel
2018-10-18 14:49:07 +02:00
parent 23a79c98df
commit d7f7a49a24
14 changed files with 374 additions and 298 deletions

View File

@@ -20,6 +20,30 @@ body > section {
padding: 50px 0;
}
.dark {
background: #222222;
color: #FAFAFA;
}
.dark h1, .dark h2, .dark h3 {
color: #fafafa;
}
.dark .btn.btn-default {
background: #222222;
color: #FAFAFA;
border: 2px solid #FAFAFA;
}
.dark .btn.btn-default:hover,
.dark .btn.btn-default:focus,
.dark .btn.btn-default:active,
.dark .btn.btn-default.active {
background: #FAFAFA;
color: #222222;
}
.primary p, .secondary p, .turquoise p, .green-sea p, .sun-flower p, .section-orange p, .section-green p, .nephrits p, .carrot p, .pumkin p, .peter-river p, .belize-hole p, .section-red p, .pomegranate p, .amethyst p, .wisteria p, .clouds .silver p, .wet-asphalt p, .midnight-blue p, .concrete p, .asbestos p, .primary h2, .secondary h2, .turquoise h2, .green-sea h2, .sun-flower h2, .section-orange h2, .section-green h2, .nephrits h2, .carrot h2, .pumkin h2, .peter-river h2, .belize-hole h2, .section-red h2, .pomegranate h2, .amethyst h2, .wisteria h2, .clouds .silver h2, .wet-asphalt h2, .midnight-blue h2, .concrete h2, .asbestos h2, .primary h3, .secondary h3, .turquoise h3, .green-sea h3, .sun-flower h3, .section-orange h3, .section-green h3, .nephrits h3, .carrot h3, .pumkin h3, .peter-river h3, .belize-hole h3, .section-red h3, .pomegranate h3, .amethyst h3, .wisteria h3, .clouds .silver h3, .wet-asphalt h3, .midnight-blue h3, .concrete h3, .asbestos h3, .primary h4, .secondary h4, .turquoise h4, .green-sea h4, .sun-flower h4, .section-orange h4, .section-green h4, .nephrits h4, .carrot h4, .pumkin h4, .peter-river h4, .belize-hole h4, .section-red h4, .pomegranate h4, .amethyst h4, .wisteria h4, .clouds .silver h4, .wet-asphalt h4, .midnight-blue h4, .concrete h4, .asbestos h4, .primary h5, .secondary h5, .turquoise h5, .green-sea h5, .sun-flower h5, .section-orange h5, .section-green h5, .nephrits h5, .carrot h5, .pumkin h5, .peter-river h5, .belize-hole h5, .section-red h5, .pomegranate h5, .amethyst h5, .wisteria h5, .clouds .silver h5, .wet-asphalt h5, .midnight-blue h5, .concrete h5, .asbestos h5, .primary h6, .secondary h6, .turquoise h6, .green-sea h6, .sun-flower h6, .section-orange h6, .section-green h6, .nephrits h6, .carrot h6, .pumkin h6, .peter-river h6, .belize-hole h6, .section-red h6, .pomegranate h6, .amethyst h6, .wisteria h6, .clouds .silver h6, .wet-asphalt h6, .midnight-blue h6, .concrete h6, .asbestos h6 {
color: #fff;
}
@@ -143,30 +167,6 @@ body > section {
margin: 0;
}
section.dark {
background: #222222;
color: #FAFAFA;
}
section.dark h1, section.dark h2, section.dark h3 {
color: #fafafa;
}
section.dark .btn.btn-default {
background: #222222;
color: #FAFAFA;
border: 2px solid #FAFAFA;
}
section.dark .btn.btn-default:hover,
section.dark .btn.btn-default:focus,
section.dark .btn.btn-default:active,
section.dark .btn.btn-default.active {
background: #FAFAFA;
color: #222222;
}
#title h1 {
margin: 0;
font-size: 36px;
@@ -1116,7 +1116,8 @@ ul#downloadSlider a.active .overlay {
border-radius: 50%;
}
.comment-list .comment-well .post-non-content {
.comment-list .comment-well .post-non-content,
.postFullviewModal .post-non-content {
display: inline-block;
width: 100px;
padding: 10px;
@@ -1560,6 +1561,7 @@ ul#downloadSlider a.active .overlay {
transition: 0.4s ease;
visibility: hidden;
opacity: 0;
white-space: nowrap;
}
.btn-floating .btn-floating-shadow {

View File

@@ -204,7 +204,6 @@ $(function () {
} else {
defaultDate = new Date();
}
console.log('lteasdf');
$('#datetimepicker').datetimepicker({
format: 'DD.MM.YYYY HH:mm',
stepping: '10',
@@ -419,41 +418,41 @@ var deletePost = function (id) {
});
};
$('#deleteModal').on('show.bs.modal', function (event) {
var button = $(event.relatedTarget);
var type = button.data('type');
var title = button.data('title');
var id = button.data('id');
var modal = $(this);
modal.find('.modal-body').html("<div class='alert alert-danger'><b>Durch das Klicken auf den Bestätigungs-Button wird der/die/das " + type + " <b>unwiederruflich</b> gelöscht und kann nicht wiederhergestellt werden!</b></div><p>Diese Aktion kann <b>NICHT</b> rückgängig gemacht werden. Dies wird alle Kommentare, Statistiken, Likes und Inhalte von <b>" + title + "</b> unwiederruflich löschen.</p><p>Bitte gib zur Bestätigung den Titel des Eintrags unter Berücksichtigung der Groß- und Kleinschreibung ein:</p><input class='form-control' id='confirm-delete-input' data-title='" + title + "'>");
modal.find('.modal-footer .btn-red').attr('disabled', '');
$('#confirm-delete-input').keyup(function () {
var removeButton = $('.modal-footer .btn-red', '#deleteModal');
if ($(this).val() == title) {
removeButton.removeAttr('disabled');
switch (type) {
case "Blog-Post":
removeButton.attr('onclick', 'deletePostFinally(' + id + ', "/admin/blog/deleteFinally", "post")');
break;
case "Projekt":
removeButton.attr('onclick', 'deletePostFinally(' + id + ', "/admin/projects/delete", "entry")');
break;
case "Projekt-Kategorie":
removeButton.attr('onclick', 'deletePostFinally(' + id + ', "/admin/projects/delete_category", "category")');
break;
case "Datei":
removeButton.attr('onclick', 'deletePostFinally(' + id + ', "/admin/files/delete", "file")');
break;
}
removeButton.css('cursor', 'pointer');
} else {
removeButton.attr('disabled', '');
removeButton.removeAttr('onclick');
removeButton.css('cursor', 'auto');
}
});
});
// $('#deleteModal').on('show.bs.modal', function (event) {
// var button = $(event.relatedTarget);
// var type = button.data('type');
// var title = button.data('title');
// var id = button.data('id');
//
// var modal = $(this);
// modal.find('.modal-body').html("<div class='alert alert-danger'><b>Durch das Klicken auf den Bestätigungs-Button wird der/die/das " + type + " <b>unwiederruflich</b> gelöscht und kann nicht wiederhergestellt werden!</b></div><p>Diese Aktion kann <b>NICHT</b> rückgängig gemacht werden. Dies wird alle Kommentare, Statistiken, Likes und Inhalte von <b>" + title + "</b> unwiederruflich löschen.</p><p>Bitte gib zur Bestätigung den Titel des Eintrags unter Berücksichtigung der Groß- und Kleinschreibung ein:</p><input class='form-control' id='confirm-delete-input' data-title='" + title + "'>");
// modal.find('.modal-footer .btn-red').attr('disabled', '');
// $('#confirm-delete-input').keyup(function () {
// var removeButton = $('.modal-footer .btn-red', '#deleteModal');
// if ($(this).val() == title) {
// removeButton.removeAttr('disabled');
// switch (type) {
// case "Blog-Post":
// removeButton.attr('onclick', 'deletePostFinally(' + id + ', "/admin/blog/deleteFinally", "post")');
// break;
// case "Projekt":
// removeButton.attr('onclick', 'deletePostFinally(' + id + ', "/admin/projects/delete", "entry")');
// break;
// case "Projekt-Kategorie":
// removeButton.attr('onclick', 'deletePostFinally(' + id + ', "/admin/projects/delete_category", "category")');
// break;
// case "Datei":
// removeButton.attr('onclick', 'deletePostFinally(' + id + ', "/admin/files/delete", "file")');
// break;
// }
// removeButton.css('cursor', 'pointer');
// } else {
// removeButton.attr('disabled', '');
// removeButton.removeAttr('onclick');
// removeButton.css('cursor', 'auto');
// }
// });
// });
function deletePostFinally(id, url, selector) {
var row = $("#" + selector + "-" + id);

View File

@@ -343,3 +343,15 @@ function loadNotificationsAsync() {
}
loadNotificationsAsync();
$('#switchDarkmode').click(function (event) {
event.preventDefault();
$('body').toggleClass('dark');
if($('body').hasClass('dark')) {
$(this).find('.fa-moon').removeClass('fa').addClass('far');
$(this).attr('data-title', 'Light Theme')
} else {
$(this).find('.fa-moon').removeClass('far').addClass('fa');
$(this).attr('data-title', 'Dark Theme')
}
});