-
Notifications
You must be signed in to change notification settings - Fork 0
/
EditPost.html
224 lines (198 loc) · 8.46 KB
/
EditPost.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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<title>IRF - Donate</title>
<!-- Font Awesome -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
<!-- Bootstrap core CSS -->
<link href="css/bootstrap.min.css" rel="stylesheet">
<!-- Material Design Bootstrap -->
<link href="css/mdb.min.css" rel="stylesheet">
<!-- Your custom styles (optional) -->
<link href="css/style.css" rel="stylesheet">
</head>
<body id="content-page">
<!-- Navbar -->
<nav class="navbar fixed-top navbar-expand-lg navbar-dark scrolling-navbar">
<div class="container">
<!-- Brand -->
<a class="navbar-brand" href="index.html">
<strong>Food Rescue</strong>
</a>
<!-- Collapse -->
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent"
aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<!-- Links -->
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<!-- Left -->
<ul class="navbar-nav mr-auto">
<li class="nav-item">
<a class="nav-link" href="index.html">Home</a>
</li>
<li class="nav-item active">
<a class="nav-link" href="TheMarket.html">The Market</a>
</li>
<li class="nav-item" id="myposts-menu">
<a class="nav-link" href="MyPosts.html">My Posts</a>
</li>
<li class="nav-item">
<a class="nav-link" href="Contact.html">Contact</a>
</li>
<li class="nav-item">
<a class="nav-link" href="AboutUs.html">About Us</a>
</li>
<li class="nav-item">
<a class="nav-link" href="Help.html">Help</a>
</li>
</ul>
<!-- Right -->
<ul class="navbar-nav nav-flex-icons">
<li class="nav-item" id="logout-menu">
<a class="nav-link border border-light rounded" id="logout-user" href="index.html">
Logout
</a>
</li>
</ul>
</div>
</div>
</nav>
<!-- Navbar -->
<!--Main layout-->
<main>
<div class="container">
<div class="row">
<div class="col-lg-8 col-lg-offset-2">
<div class="card" id="createPost">
<div class="card-header d-flex align-items-center">
<h4>Edit Post</h4>
</div>
<div class="card-body">
<form class="form-horizontal">
<div class="form-group row">
<label class="col-sm-3">Title</label>
<div class="col-sm-9">
<input id="title" type="text" placeholder="" class="form-control form-control-success"><small class="form-text"></small>
</div>
</div>
<div class="form-group row">
<label class="col-sm-3">Description</label>
<div class="col-sm-9">
<textarea id="description" rows="3" class="form-control form-control-success" /></textarea>
</div>
</div>
<div class="form-group row">
<label class="col-sm-3">Amount</label>
<div class="col-sm-9">
<input id="amount" type="text" class="form-control form-control-warning"><small class="form-text"></small>
</div>
</div>
<div class="form-group row">
<label class="col-sm-3">Readiness</label>
<div class="col-sm-9">
<select id="readiness" class="form-control">
<option value="harvestable">Harvestable</option>
<option value="packable">Packable</option>
<option value="packed">Packed</option>
</select>
</div>
</div>
<div class="form-group row">
<label class="col-sm-3">Eligibility</label>
<div class="col-sm-9">
<fieldset id="eligibility-group">
<input type="checkbox" id="eligibility-business" value="business"> Business<br/>
<input type="checkbox" id="eligibility-non-profit" value="non-profit"> Non-Profit<br/>
<input type="checkbox" id="eligibility-individual" value="individual"> Individual<br/>
</fieldset>
</div>
</div>
<div class="form-group row">
<label class="col-sm-3">Availability</label>
<div class="col-sm-9">
<select name="availability" class="form-control">
<option value="available">Available</option>
<option value="claimed">Claimed</option>
<option value="picked up">Picked Up</option>
</select>
</div>
</div>
<div class="form-group row">
<label class="col-sm-3">Pickup Window</label>
<div class="col-sm-9">
<input id="pickupWindow" type="text" placeholder="" class="form-control form-control-success"><small class="form-text"></small>
</div>
</div>
<div class="form-group row">
<label class="col-sm-3">Pickup Address</label>
<div class="col-sm-9">
<input id="pickupAddress" type="text" class="form-control form-control-warning"><small class="form-text"></small>
</div>
</div>
<div class="form-group row">
<div class="col-sm-9 offset-sm-3">
<a id="submit" class="btn btn-primary">Update</a>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
</main>
<!--Main layout-->
<!--Footer-->
<footer class="page-footer text-center font-small mt-4 wow ">
<!--Copyright-->
<div class="footer-copyright py-3">
© 2018 Copyright:
<a href="https://mdbootstrap.com/bootstrap-tutorial/" target="_blank"> MDBootstrap.com </a>
</div>
<!--/.Copyright-->
</footer>
<!--/.Footer-->
<!-- SCRIPTS -->
<!-- JQuery -->
<script type="text/javascript" src="js/jquery-3.2.1.min.js"></script>
<!-- Bootstrap tooltips -->
<script type="text/javascript" src="js/popper.min.js"></script>
<!-- Bootstrap core JavaScript -->
<script type="text/javascript" src="js/bootstrap.min.js"></script>
<!-- MDB core JavaScript -->
<script type="text/javascript" src="js/mdb.min.js"></script>
<script type="text/javascript" src="js/asmcrypto.js"></script>
<!-- Initializations -->
<script type="text/javascript">
// Animations initialization
new WOW().init();
</script>
<!-- Main File-->
<script src="js/Post.js"></script>
<script src="js/User.js"></script>
<script type="text/JavaScript">
$(document).ready( function () {
var id = getUrlParameter("id");
ViewPost(id);
$("#submit").click(() => {
var title = $("#title").val();
var amount = $("#amount").val();
var desc = $("#description").val();
var window = $("#pickupWindow").val();
var location = $("#pickupAddress").val();
var eligibility = [];
$("input:checkbox[id^='eligibility-']:checked").each(function(){
eligibility.push($(this).val());
});
var availability = $("#readiness option:selected").val();
var readiness = $("#readiness option:selected").val();
UpdatePost(title, amount, desc, window, location, availability, readiness, eligibility);
});
LoadUser();
});
</script>
</body>
</html>