Wiki source code of TopicClassSheet
Show last authors
| author | version | line-number | content |
|---|---|---|---|
| 1 | ## | ||
| 2 | ## Disable footer | ||
| 3 | ## | ||
| 4 | #set ($docextras = []) | ||
| 5 | ## | ||
| 6 | ## Include style | ||
| 7 | ## | ||
| 8 | $xwiki.ssx.use("BBCode.Skin") | ||
| 9 | $xwiki.jsx.use("BBCode.Skin") | ||
| 10 | #if($request.parent && $request.parent!="") #set($parent=$request.parent) #else #set($parent=$doc.parent) #end | ||
| 11 | <input type="hidden" name="parent" value="$parent" /> | ||
| 12 | #set($class = $doc.getObject("BBCode.TopicClass").xWikiClass) | ||
| 13 | <input type="hidden" name="title" value="" /> | ||
| 14 | <input type="hidden" name="BBCode.PostClass_0_postauthor" value="$context.user" /> | ||
| 15 | <div class="bbbigbox"> | ||
| 16 | #if ($context.action == 'inline') | ||
| 17 | ## | ||
| 18 | ## Edit topic | ||
| 19 | ## | ||
| 20 | $msg.bb_entertopictitle<br /> $doc.display('topictitle')<br/> | ||
| 21 | $msg.get("bb_entertopiccontent")<br/> | ||
| 22 | $doc.display("postcontent") | ||
| 23 | #set($newtopictitle = $request.nicetopictitle) | ||
| 24 | #if($newtopictitle) | ||
| 25 | #set($newtopictitle = $newtopictitle.replaceAll('"',"'")) | ||
| 26 | <script type="text/javascript"> | ||
| 27 | var nicetopictitle = "${newtopictitle}"; | ||
| 28 | {pre} | ||
| 29 | document.forms.inline["BBCode.TopicClass_0_topictitle"].value = nicetopictitle; | ||
| 30 | document.forms.inline["title"].value = nicetopictitle; | ||
| 31 | {/pre} | ||
| 32 | </script> | ||
| 33 | #end | ||
| 34 | #if($doc.isNew() == 'false') | ||
| 35 | #set($title = $doc.getValue('topictitle', $doc.getObject('BBCode.TopicClass'))) | ||
| 36 | <script type="text/javascript"> | ||
| 37 | var nicetopictitle = "${title}"; | ||
| 38 | {pre} | ||
| 39 | document.forms.inline["title"].value = nicetopictitle; | ||
| 40 | {/pre} | ||
| 41 | </script> | ||
| 42 | #end | ||
| 43 | #else | ||
| 44 | ## | ||
| 45 | ## Topic title | ||
| 46 | ## | ||
| 47 | #if("$parent" != "") | ||
| 48 | #set($parentDoc = $xwiki.getDocument("$parent")) | ||
| 49 | <span class="topic-category"> | ||
| 50 | #if("$parentDoc.getDisplayTitle()" != "") | ||
| 51 | $msg.get("bb_topiccategory") <a href="$parentDoc.getURL('view')">$parentDoc.getDisplayTitle()</a> | ||
| 52 | #else | ||
| 53 | $msg.get("bb_topiccategory") <a href="$parentDoc.getURL('view')">$parentDoc.name</a> | ||
| 54 | #end | ||
| 55 | </span> | ||
| 56 | #end | ||
| 57 | <h1><span>#if ($doc.getValue('topictitle', $doc.getObject('BBCode.TopicClass')) != "") $doc.display('topictitle') #else $doc.name #end</span></h1> | ||
| 58 | #set($postclass = $doc.getObjects('BBCode.PostClass')) | ||
| 59 | <span class="bbdatatext">$postclass.size() $msg.bb_messagesintopic </span> | ||
| 60 | <table class="topictable"> | ||
| 61 | ## | ||
| 62 | ## Loop over posts | ||
| 63 | ## | ||
| 64 | #foreach($item in $postclass) | ||
| 65 | #set ($postauthor = $xwiki.getUserName($doc.display('postauthor', $item), true)) | ||
| 66 | #if ($doc.getValue('postcontent', $item) != '') | ||
| 67 | <tr class="#if($postindex % 2 == 0) evenpost #end"> | ||
| 68 | <td id="posttd"> | ||
| 69 | #set ($localpostauthor = $doc.display('postauthor', $item)) | ||
| 70 | #set ($index = $localpostauthor.indexOf(":")) | ||
| 71 | #set ($index = $index + 1) | ||
| 72 | #set ($localpostauthor = $localpostauthor.substring($index)) | ||
| 73 | <div class="postauthor">$postauthor</div> | ||
| 74 | <div class="avatar"> | ||
| 75 | <a href="$xwiki.getURL($localpostauthor)">#useravatar($localpostauthor)</a><br /> | ||
| 76 | #end | ||
| 77 | </div></td> | ||
| 78 | <td id="posttd"> <div id="message$item.number"> | ||
| 79 | {pre} | ||
| 80 | <textarea id="quotecontent$item.number" style="display:none">$item.getProperty("postcontent").getValue()</textarea> | ||
| 81 | <script type="text/javascript"> | ||
| 82 | var quote$item.number = XWiki.bulletinboard.addQuote($("quotecontent$item.number").value, "$xwiki.getLocalUserName($doc.display('postauthor', $item), false)", "$doc.display('postdate', $item)"); | ||
| 83 | </script> | ||
| 84 | {/pre} | ||
| 85 | <span class="bbdatatext">$msg.bb_postedon $doc.display('postdate', $item) - <a name=$velocityCount href="#$velocityCount"><img src="$xwiki.getSkinFile("icons/silk/link_go.gif")" title="Direct link to post #$velocityCount" /></a> - <a href="#" onclick="XWiki.bulletinboard.insertInReply(XWiki.bulletinboard.getQuote(quote$item.number)); XWiki.bulletinboard.jumpToReply(); return false;"><img src="$xwiki.getSkinFile("icons/silk/comment_add.gif")" title="Quote this message" /></a> #if(($context.user == $doc.display('postauthor', $item) || $xwiki.hasAdminRights() == 'true') && $velocityCount > 1) - <a href="$doc.getURL("objectremove", "classname=BBCode.PostClass&classid=${item.number}&xredirect=${request.getRequestURL()}")"><img src="$xwiki.getSkinFile("icons/silk/bin.gif")" title="$msg.bb_deletethismessage" /></a> #end </span> | ||
| 86 | ##<hr size="1" /> | ||
| 87 | <div class="postcontent"> | ||
| 88 | $doc.display('postcontent', $item) | ||
| 89 | </div></div> | ||
| 90 | </td> | ||
| 91 | </tr> | ||
| 92 | #end | ||
| 93 | <tr> | ||
| 94 | <td> </td> | ||
| 95 | <td> | ||
| 96 | #if ($context.user == 'XWiki.XWikiGuest') | ||
| 97 | <span class="bbdatatext"> $msg.bb_needloginmessage </span> | ||
| 98 | #else | ||
| 99 | #set ($lastpostid = $postclass.size() + 1) | ||
| 100 | <a id="reply"></a> | ||
| 101 | <span class="bbsmalltitle"> <a name=postmessage href="#postmessage"> $msg.bb_postmessage </a> </span> | ||
| 102 | <form method="post" action="$doc.getURL("objectadd")" class="postreply"> | ||
| 103 | <input type="hidden" name="xredirect" value="$doc.getURL()#$lastpostid" /> | ||
| 104 | <input type="hidden" name="classname" value="BBCode.PostClass" /> | ||
| 105 | <input type="hidden" name="BBCode.PostClass_postauthor" value="$context.user" /> | ||
| 106 | <textarea rows="10" cols="65" id="BBCode.PostClass_postcontent" name="BBCode.PostClass_postcontent" /></textarea><br /> | ||
| 107 | <input id="BBCode.PostClass_postbutton" type="submit" value="Post!" /> | ||
| 108 | </form> | ||
| 109 | #end | ||
| 110 | </td> | ||
| 111 | </tr> | ||
| 112 | </table> | ||
| 113 | #end | ||
| 114 | </div> |