-
Notifications
You must be signed in to change notification settings - Fork 31
/
blog_add.html
101 lines (86 loc) · 3.58 KB
/
blog_add.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
---
texts: compatibility
nav: blog
---
<!DOCTYPE html>
<html ng-app="Vita3K">
<head>
{% include head.html %}
</head>
<body id="page-top" ng-controller="angularController">
<script>
function get(name) {
if (name = (new RegExp('[?&]' + encodeURIComponent(name) + '=([^&]*)')).exec(location.search))
return decodeURIComponent(name[1]);
}
angular.module('Vita3K', []).controller("angularController", function($scope, $http, $filter, $window) {
{% include languagescript.js %}
$scope.showPreview = 0;
$scope.title = "";
$scope.report = "";
$scope.author = "";
$scope.password = "";
$scope.preview = {}
$scope.data = {}
$scope.show = function() {
$scope.showPreview = 1;
$scope.preview.title = $scope.title
$scope.preview.report = $scope.report
$scope.preview.author = $scope.author
}
$scope.send = function() {
$scope.data.password = $scope.password
$scope.data.title = $scope.title
$scope.data.report = $scope.report
$scope.data.author = $scope.author
$http.post('https://vita3k.rinnegatamante.it/submit.php', $scope.data).then(res => {
$window.location.href = "/blog_admin.html";
})
}
}).filter('unsafe', function($sce) {
return function(val) {
return $sce.trustAsHtml(val);
};
});
</script>
{% include nav.html %}
{% include languageselection.html %}
<section class="text-white">
<div class="container">
<div class="row">
<div class="col-lg-12 mx-auto text-center">
<h2 class="section-heading">Add a Blog Entry</h2>
</div>
</div>
</div>
</section>
<section class="bg-dark text-white">
<div class="container">
<div class="row">
<div class="col-lg-12 mx-auto text-center">
<a class="btn btn-primary btn-xl js-scroll-trigger" href="" ng-click="show()">Show Preview</a>
<a class="btn btn-primary btn-xl js-scroll-trigger" href="" ng-click="send()">Submit Entry</a>
<hr class="my-4">
<input type="text" ng-model="password" class="form-control" placeholder="Password" required="true" /><br>
<input type="text" ng-model="title" class="form-control" placeholder="Title" required="true" /><br>
<input type="text" ng-model="author" class="form-control" placeholder="Author" required="true" /><br>
<textarea style="resize: vertical;" ng-model="report" class="form-control" placeholder="Blog Entry" required="true"></textarea>
</div>
</div>
</div>
</section>
<section class="blog-body text-white" ng-if="showPreview == 1">
<div class="container" id="blog-container">
<div class="row blog-post">
<div class="col-lg-12 mx-auto text-center">
<h3 class="blog-post-title section-heading"><font color="#bbbbbb">{{preview.title}}</font></h3>
<hr class="my-4">
<p class="blog-post-body mb-5" align="left" ng-bind-html="preview.report | unsafe">
</p>
<div class="blog-post-author" align="right"><small><i>by {{preview.author}}</i></small></div>
</div>
</div>
</section>
{% include footer.html %}
</body>
</html>