... |
... |
@@ -1,8 +1,8 @@ |
1 |
1 |
{{velocity}} |
2 |
2 |
#if($request.headline) |
3 |
3 |
## Processing form submission |
4 |
|
- #set($appPage = $xwiki.getDocument("Help.Applications.Anti White Incidents.WebHome")) |
5 |
|
- #set($className = "Help.Applications.Anti White Incidents.Code.AntiWhiteIncidentsClass") |
|
4 |
+ #set($appPage = $xwiki.getDocument("Help.Applications.AntiWhiteIncidents.WebHome")) |
|
5 |
+ #set($className = "Help.Applications.AntiWhiteIncidents.Code.AntiWhiteIncidentsClass") |
6 |
6 |
#set($obj = $appPage.newObject($className)) |
7 |
7 |
$obj.set("headline", $request.headline) |
8 |
8 |
$obj.set("description", $request.description) |
... |
... |
@@ -10,13 +10,11 @@ |
10 |
10 |
$obj.set("image", $request.image) |
11 |
11 |
$obj.set("date", $request.date) |
12 |
12 |
$appPage.save("Added new incident from public form") |
13 |
|
- |
|
13 |
+ |
14 |
14 |
<div class="alert alert-success"> |
15 |
15 |
Thank you for your submission. It has been added to our database. |
16 |
16 |
</div> |
17 |
|
- |
18 |
18 |
#else |
19 |
|
- ## Display form |
20 |
20 |
<h3>Submit an Incident</h3> |
21 |
21 |
<form method="post" action="$doc.getURL()"> |
22 |
22 |
<div class="form-group"> |
... |
... |
@@ -23,28 +23,29 @@ |
23 |
23 |
<label>Headline</label> |
24 |
24 |
<input type="text" name="headline" class="form-control" required> |
25 |
25 |
</div> |
26 |
|
- |
|
24 |
+ |
27 |
27 |
<div class="form-group"> |
28 |
28 |
<label>Description</label> |
29 |
29 |
<textarea name="description" class="form-control" rows="4" required></textarea> |
30 |
30 |
</div> |
31 |
|
- |
|
29 |
+ |
32 |
32 |
<div class="form-group"> |
33 |
33 |
<label>Source URL</label> |
34 |
34 |
<input type="url" name="url" class="form-control"> |
35 |
35 |
</div> |
36 |
|
- |
|
34 |
+ |
37 |
37 |
<div class="form-group"> |
38 |
38 |
<label>Image URL</label> |
39 |
39 |
<input type="url" name="image" class="form-control"> |
40 |
40 |
</div> |
41 |
|
- |
|
39 |
+ |
42 |
42 |
<div class="form-group"> |
43 |
43 |
<label>Date</label> |
44 |
44 |
<input type="date" name="date" class="form-control"> |
45 |
45 |
</div> |
46 |
|
- |
|
44 |
+ |
47 |
47 |
<button type="submit" class="btn btn-primary">Submit Incident</button> |
48 |
48 |
</form> |
49 |
49 |
#end |
50 |
50 |
{{/velocity}} |
|
49 |
+ |