-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwrite.html
More file actions
62 lines (59 loc) · 2.63 KB
/
write.html
File metadata and controls
62 lines (59 loc) · 2.63 KB
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
<!DOCTYPE html>
<html lang="en" ng-app="prosjektWeb">
<head>
<meta charset="UTF-8">
<title>Write new - Prosjektweb</title>
<link rel="stylesheet" href="public/stylesheets/general.css">
<link rel="stylesheet" href="public/stylesheets/design.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.5.7/angular.min.js"></script>
<script src="public/angular/write.controller.js"></script>
<script src="public/angular/write.functionallity.js"></script>
<script src="public/angular/posts.service.js"></script>
<script src="public/angular/users.service.js"></script>
<script src="public/angular/dateFormatter.filter.js"></script>
</head>
<body>
<main id="write" ng-controller="writeController" >
<h2>Skriv nytt innlegg:</h2>
<form action="/api/diary/post.php" method="GET">
<input type="text" name="title" id="title" placeholder="Skriv inn tittel" ng-model="titleField" onchange="displayDate()">
<br>
<textarea name="content" id="content" rows="10" placeholder="Skriv inn innhold" ng-model="contentField" onchange="displayDate()"></textarea>
<div>
<label>Hvem er du?</label>
<select name="owner" ng-model="ownerField">
<option ng-repeat="user in users" value="{{ user.id }}">{{ user.firstname }} {{ user.lastname}} </option>
</select>
<button type="submit">LAGRE INNLEGG</button>
</div>
</form>
<br>
<section id="diary"> <!-- HER KOMMER BLOGGEN -->
<h2>Forhåndsvisning av innlegg</h2>
<div>
<div class="previewDate date" ng-bind-html="today | formatDate" onload="displayDate()">
</div>
<article >
<h2> {{ titleField }} </h2>
<h3> Av {{ ownerField }} </h3>
<p> {{ contentField }} </p>
</article>
</div>
<br>
<h2>Tidligere innlegg</h2>
<div ng-repeat="post in posts">
<div class="date" ng-bind-html="post.date | formatDate"></div>
<article >
<h2> {{ post.title }} </h2>
<h3> Av {{ post.owner }}</h3>
<p> {{ post.content }} </p>
<p ng-repeat="links in post.links">
<a href="{{ links.link }}">{{ links.text }}</a>
</p>
</article>
</div>
</section>
</main>
</body>
</html>