-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex-objektorientiert.html
70 lines (57 loc) · 2.18 KB
/
index-objektorientiert.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
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Products-JS</title>
<link rel="stylesheet" href="bootstrap.min.css">
<link rel="stylesheet" href="style.css">
</head>
<body>
<div class="container">
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">Neuen Artikel eintragen</h3>
</div>
<div class="panel-body">
<form class="products-form" role="form" action="index.php" method="POST">
<input class="form-control" type="text" name="name" placeholder="Produktname">
<input class="form-control" type="url" name="url" placeholder="Artikel-URL">
<input class="form-control" type="url" name="image" placeholder="Artikel-Bild">
<div class="row">
<div class="col-xs-6 input-group">
<input type="number" class="form-control" name="price" placeholder="Preis">
<span class="input-group-addon">€</span>
</div>
<div class="col-xs-6">
<button type="submit" class="btn btn-primary btn-block">Anlegen</button>
</div>
</div>
</form>
</div> <!-- /.panel-body -->
</div> <!-- /.panel -->
<div class="products-list" class="row list-group">
<!-- Wird per Script gefüllt -->
</div>
</div> <!-- /.container -->
<textarea id="template" style="display:none">
<div class="item col-xs-4">
<div class="thumbnail">
<a href="{{URL}}">
<img src="{{IMAGE}}" alt="Produktbild">
</a>
<div class="caption">
<h4><a href="{{URL}}">{{NAME}}</a></h4>
<span class="lead">{{PRICE}}€</span>
</div>
</div>
</div>
</textarea>
<script src="script-objektorientiert.js"></script>
<script>
var form = document.querySelector('.products-form');
var products = document.querySelector('.products-list');
var template = document.getElementById('template').value;
new Productlist(form, products, template);
</script>
</body>
</html>