... |
... |
@@ -1,35 +1,41 @@ |
1 |
1 |
{{velocity}} |
2 |
|
-#set($headline = "$!wikimacro.parameters.headline") |
3 |
|
-#set($url = "$!wikimacro.parameters.url") |
4 |
|
-#set($description = "$!wikimacro.parameters.description") |
5 |
|
-#set($image = "$!wikimacro.parameters.image") |
|
2 |
+#set($request = $request) |
|
3 |
+#if($request.getParameter("submitIncident")) |
|
4 |
+ #set($headline = $request.getParameter("headline")) |
|
5 |
+ #set($url = $request.getParameter("url")) |
|
6 |
+ #set($desc = $request.getParameter("description")) |
6 |
6 |
|
7 |
|
-## Use wiki syntax and proper macros for rendering |
8 |
|
-{{box title="Incident Preview" cssClass="floatinginfobox"}} |
|
8 |
+#set($block = ''' |
|
9 |
+(% style="margin-bottom:20px; width:100%" %) |
|
10 |
+|[[image:PLACEHOLDER.jpg||alt="image" data-xwiki-image-style="thumbnail-clickable" style="border:1px solid #cccccc" width="200"]]| |
9 |
9 |
|
10 |
|
-(% class="incident-preview" %) |
11 |
|
-#if($image && $image != "") |
12 |
|
-[[image:$image||width="200" style="border:1px solid #ccc;"]] |
13 |
|
-#else |
14 |
|
-(% style="width:200px; height:150px; background:#eee; text-align:center; border:1px solid #ccc;" %) |
15 |
|
-No image |
16 |
|
-(%) |
17 |
|
-#end |
|
12 |
+=== [[${headline}>>${url}]] === |
18 |
18 |
|
19 |
|
-=== [[$headline>>$url]] === |
|
14 |
+${desc} |
|
15 |
+[[Read More>>${url}]] |
|
16 |
+''') |
20 |
20 |
|
21 |
|
-$description |
22 |
22 |
|
23 |
|
-[[Read More>>$url]] |
|
19 |
+ #set($doc = $xwiki.getDocument($doc.fullName)) |
|
20 |
+ #set($content = $doc.getContent()) |
|
21 |
+ $doc.setContent("${content}\n\n${block}") |
|
22 |
+ $doc.save() |
24 |
24 |
|
25 |
|
-(%) |
26 |
|
-{{/box}} |
|
24 |
+ <div class=\"xwiki-messages xwiki-successmessage\">Incident added to page.</div> |
|
25 |
+#end |
27 |
27 |
|
28 |
|
-{{box title="Wiki Syntax (Copy and paste this)" cssClass="infobox"}} |
29 |
|
-(% style="margin-bottom:20px; width:100%" %) |
30 |
|
-|#if($image && $image != "")[[image:$image||data-xwiki-image-style="thumbnail-clickable" style="border:1px solid #ccc" width="200"]]#{else}No image provided.#{end}| |
31 |
|
-=== [[$headline>>$url]] === |
32 |
|
-$description |
33 |
|
-[[Read More>>$url]] |
34 |
|
-text{{/box}} |
|
27 |
+<form method="post"> |
|
28 |
+ <h3>Add Incident</h3> |
|
29 |
+ <label>Headline:</label><br/> |
|
30 |
+ <input type="text" name="headline" style="width:100%" /><br/><br/> |
|
31 |
+ |
|
32 |
+ <label>URL:</label><br/> |
|
33 |
+ <input type="text" name="url" style="width:100%" /><br/><br/> |
|
34 |
+ |
|
35 |
+ <label>Description:</label><br/> |
|
36 |
+ <textarea name="description" rows="4" style="width:100%"></textarea><br/><br/> |
|
37 |
+ |
|
38 |
+ <input type="submit" name="submitIncident" value="Submit Incident" /> |
|
39 |
+</form> |
35 |
35 |
{{/velocity}} |
|
41 |
+ |