fix for: if more than one mediatype attached to a comment, the medias are shown multi...
[mir.git] / templates / admin / commentlist.template
index b8df175..f271925 100755 (executable)
 <html>
 <head>
-       <title>${config["Mir.Name"]} | ${lang("commentlist.htmltitle")}</title>
-       <link rel="stylesheet" type="text/css" href="${config.docRoot}/style/admin.css">
+  <title>${config["Mir.Name"]} | ${lang("commentlist.htmltitle")}</title>
+  <link rel="stylesheet" type="text/css" href="${config.docRoot}/style/admin.css">
 
 </head>
 
 <body marginwidth="0" marginheight="0" topmargin="0" leftmargin="0">
 
+<include "FUNCTIONS.template">
 <include "head.template">
+
 <assign grey="0">
 
 <form method="post" action="${config.actionRoot}">
   <input type="hidden" name="module" value="Comment">
   <input type="hidden" name="do" value="search">
    
-  <table border="0" cellpadding="2" cellspacing="1">
-    <tr class="pink">
-      <td>
-        search in field
-      </td>
-      <td>
-        for value
+  <table border="0" cellpadding="2" cellspacing="3">
+  <tr>
+    <td class="table-head">${lang("commentsearch.field")}</td>
+    <td class="table-head">${lang("commentsearch.value")}</td>
+    <td class="table-head">${lang("commentsearch.publishedstate")}</td>
+    <td class="table-head">${lang("commentsearch.status")}</td>
+    <td class="table-head">${lang("commentsearch.order")}</td>
+    <td class="table-head">&nbsp;</td>
+  </tr>
+
+  <tr>
+    <td class="listrow2">
+      <input type="text"   size="10" maxlength="20" name="searchtext" value="${searchtext}">
+    </td>
+    <td class="listrow2">
+      <select name="searchfield">
+        <option value="title"<if searchfield=="title"> selected</if>>${lang("commentsearch.field.title")}</option>
+        <option value="creator"<if searchfield=="creator"> selected</if>>${lang("commentsearch.field.creator")}</option>
+        <option value="description"<if searchfield=="description"> selected</if>>${lang("commentsearch.field.description")}</option>
+        <option value="main_url"<if searchfield=="main_url"> selected</if>>${lang("commentsearch.field.main_url")}</option>
+        <option value="email"<if searchfield=="email"> selected</if>>${lang("commentsearch.field.email")}</option>
+        <option value="comment"<if searchfield=="comment"> selected</if>>${lang("commentsearch.field.comment")}</option>
+      </select>
+    </td>
+    <td class="listrow2">
+      <select name="searchispublished">
+        <option value="">--</option>
+        <option value="0" <if searchispublished=="0"> selected</if>>${lang("commentsearch.publishedstate.hidden")}</option>
+        <option value="1" <if searchispublished=="1"> selected</if>>${lang("commentsearch.publishedstate.published")}</option>
+      </select>
+    </td>
+    <td class="listrow2">
+      <select name="searchstatus">
+        <option value="">--</option>
+        <list commentstatuses as cs>
+          <option value="${cs.id}" <if searchstatus==cs.id> selected</if>>${lang("commentstatus." + cs.name)}</option>
+        </list>
+      </select>
+    </td>
+    <td class="listrow2">
+      <select name="searchorder">
+        <option value="datedesc" <if searchorder=="datedesc"> selected</if>>${lang("commentsearch.order.datedesc")}</option>
+        <option value="dateasc" <if searchorder=="dateasc"> selected</if>>${lang("commentsearch.order.dateasc")}</option>
+        <option value="articletitle" <if searchorder=="articletitle"> selected</if>>${lang("commentsearch.order.articletitle")}</option>
+      </select>
+    </td>
+    <td class="listrow2">
+      <input class="majorbutton" type="submit" name="search" value="${lang("commentsearch.searchbutton")}">
+    </td>
+  </tr>
+</table>
+</form>
+
+<if comments>
+  <if config["Mir.Localizer.Admin.ListOperationsFlavor"]!="0">
+    <form method="post" action="${config.actionRoot}">
+      <input type="hidden" name="module" value="Localizer">
+      <input type="hidden" name="do" value="commentoperationbatch">
+      <input type="hidden" name="returnurl" value="${utility.encodeHTML(thisurl)}">
+      <p class="box">
+        <input class="majorbutton" type="submit" name="save" value="${lang("save")}">&nbsp; (${lang("commentlist.activate")})
+      </p>
+  </if>    
+
+  <call showPrevNextLinks (prevurl, nexturl, "right")>
+  
+  <table border="0" cellpadding="2" cellspacing="3">  
+  
+    <tr class="table-head">
+      <td valign="top">
+        ${lang("comment.date")}
       </td>
       <td>
-        published
+        ${lang("comment.article")} / ${lang("comment.title")} / ${lang("comment.creator")} / ${lang("comment.text")}
       </td>
       <td>
-        status
+        ${lang("comment.comment")}
       </td>
       <td>
-        order
+        &nbsp;
       </td>
     </tr>
-    <tr>
-      <td>
-          <input type="text"   size="10" maxlength="20" name="searchtext" value="${searchtext}">
-      </td>
-
-      <td>
-             <select name="searchfield">
-            <option value="title"<if searchfield=="title"> selected</if>>${lang("comment.title")}</option>
-            <option value="creator"<if searchfield=="creator"> selected</if>>${lang("comment.creator")}</option>
-            <option value="description"<if searchfield=="description"> selected</if>>${lang("comment.text")}</option>
-          </select>
-      </td>
-      <td>
-          <select name="searchispublished">
-            <option value="">--</option>
-            <option value="0" <if searchispublished=="0"> selected</if>>${lang("commentlist.hidden")}</option>
-            <option value="1" <if searchispublished=="1"> selected</if>>${lang("commentlist.published")}</option>
-          </select>
-      </td>
-<!--      
-      <td>
-          <select name="searchstatus">
-            <option value="">--</option>
-            <option value="0" <if searchstatus=="0"> selected</if>>${lang("commentlist.hidden")}</option>
-            <option value="1" <if searchstatus=="1"> selected</if>>${lang("commentlist.published")}</option>
-          </select>
-      </td>
- -->      
-      <td>
-          <select name="searchorder">
-            <option value="datedesc" <if searchorder=="datedesc"> selected</if>>${lang("commentlist.order.datedesc")}</option>
-            <option value="dateasc" <if searchorder=="dateasc"> selected</if>>${lang("commentlist.order.dateasc")}</option>
-            <option value="articletitle" <if searchorder=="articletitle"> selected</if>>${lang("commentlist.order.articletitle")}</option>
-          </select>
+      
+  <list comments as entry>
+    <tr <if grey=="1"><assign grey="0">class="listrow1"<else><assign grey="1">class="listrow2"</if>>
+      <td valign="top" class="small">
+        ${entry.creationdate.format(config["Mir.DefaultDateTimeFormat"])}<br>
+        <if entry.is_published=="0"><b>${lang("commentlist.hidden")}</b><else>-</if><br>
+        <br>
+        ${lang("comment.status")}: <br>
+        <if entry.status>
+          <b>
+            ${lang("commentstatus." + entry.status.name)}
+          </b>
+        <else> 
+          - 
+        </if>
       </td>
+          
       <td>
-          <input type="submit" name="search" value="${lang("commentlist.search")}">
-      </td>
-    </tr>
-  </table>
-</form>
-
-<if comments>
- <if config["Mir.Localizer.Admin.ListOperationsFlavor"]!="0">
-  <form method="post" action="${config.actionRoot}">
-    <input type="hidden" name="module" value="Localizer">
-    <input type="hidden" name="do" value="commentoperationbatch">
-    <input type="hidden" name="returnurl" value="${utility.encodeHTML(thisurl)}">
-
-    <p>
-      <input class="majorbutton" type="submit" name="save" value="${lang("save")}">
-    </p>
- </if>    
+        <a name="${entry.id}"></a>
+        <if entry.to_content>
+            <div class="small">
+            ${lang("comment.article")}:
+            <a href="${config.actionRoot}?module=Content&do=edit&id=${entry.to_content.id}">
+              ${utility.encodeHTML(entry.to_content.title)} (${entry.to_content.id})
+            </a>
+              (${lang("articletypes."+entry.to_content.article_type.name)}) 
+  
+              [
+              <a href="${config.actionRoot}?module=Content&do=edit&id=${entry.to_content.id}">
+              ${lang("edit")}
+              </a> |
+              <a href="${config.actionRoot}?module=Comment&do=articlecomments&articleid=${entry.to_content.id}">
+                ${lang("commentlist.allcomments")}
+              </a>
+              ]
+              </div>
+            </if>
+  
+        
+        <b>${utility.encodeHTML(entry.title)}</b> (${entry.id})&nbsp;
+        <if entry.creator>
+          ${lang("by")}: ${utility.encodeHTML(entry.creator)}
+        </if>
+        <br>
+        ${utility.prettyEncodeHTML(utility.subString(entry.description, 0, config["Mir.Admin.ListTextLengthLimit"]))}
 
-    <table border="0" cellpadding="2" cellspacing="1">  
-      <if comments>
-        <tr><td>
-          <if prevurl>
-            <a href="${config.actionRoot}?${prevurl}">${lang("list.previous")}</a>&nbsp;
-          </if>
-          <if nexturl>
-            <a href="${config.actionRoot}?${nexturl}">${lang("list.next")}</a>&nbsp;
+        <br>
+          <if entry.to_all_media_images || entry.to_all_media_audio || entry.to_all_media_video || entry.to_all_media_other>
+               <call showCommentAttachment(entry, thisurl)></if>
           </if>
-        </td></tr>
-      </if>
-      <tr class="darkgrey">
-        <td><p class="witesmall">${lang("comment.date")}</p></td>
-        <td><p class="witesmall">${lang("comment.title")}/ ${lang("comment.creator")}<br>
-            ${lang("comment.text")}</p></td>
-        <td>&nbsp;</td>
-      </tr>
-    
-        <list comments as entry>
-          <tr <if grey=="1"><assign grey="0">class="list1"<else><assign grey="1">class="list2"</if>>
+        <br>
         
-                       <td>${entry.creationdate.formatted["dd.MM.yyyy HH:mm"]}<br>
-                 <if entry.is_published=="0"><span class="spezialtext">hidden</span><else>-</if>
-                       </td>
+        <if entry.main_url><br>URL: ${utility.encodeHTML(entry.main_url)}</if>
+        <br>
+        <if config["Mir.Localizer.Admin.ListOperationsFlavor"]=="0">
+          <list entry.operations as op>
+            [ <a href="${config.actionRoot}?module=Localizer&do=commentoperation&operation=${op}&id=${entry.id}&returnurl=${utility.encodeURI(thisurl + "#" + entry.id)}">${lang("comment.operation."+op)}</a> ]
+          </list>
+        </if>
+        <if config["Mir.Localizer.Admin.ListOperationsFlavor"]=="1">
+          <list entry.operations as op>
+             <input type="checkbox" name="operation" value="${entry.id};${op}">${lang("comment.operation."+op)} 
+          </list>
+        </if>
+        <if config["Mir.Localizer.Admin.ListOperationsFlavor"]=="2">
+          <select name="operation">
+            <option value="" selected>&nbsp;</option>
+            <list entry.operations as op>
+              <option value="${entry.id};${op}">${lang("comment.operation."+op)}</option>
+            </list>
+          </select>
+        </if>
+        <if entry.operations>&nbsp;|&nbsp;</if>
+        <a href="${config.actionRoot}?module=Comment&do=edit&id=${entry.id}">${lang("edit")}</a>
+      </td>
         
-            <td>
-                ${lang("comment.article")}
-                <a href="${config.actionRoot}?module=Content&do=edit&id=${entry.to_content.id}">
-                  ${utility.encodeHTML(entry.to_content.title)}
-                </a>
-                <br>
-                  <a name="${entry.id}"></a>
-                    <if entry.status>${lang("commentstatus." + entry.status.name)} - </if> 
-                    <b>${entry.title}</b><br>
-      
-                <if entry.creator>${lang("comment.creator")}: ${entry.creator}<br></if>
-                <span class="small">${entry.description}</span>
-                <if entry.main_url><br>URL: ${entry.main_url}</if>
-                <br>
-                <if config["Mir.Localizer.Admin.ListOperationsFlavor"]=="0">
-                                     <list entry.operations as op>
-                               [<a href="${config.actionRoot}?module=Localizer&do=commentoperation&operation=${op}&id=${entry.id}&returnurl=${utility.encodeURI(thisurl + "#" + entry.id)}">${op}</a>]
-                             </list>
-                           </if>
-                <if config["Mir.Localizer.Admin.ListOperationsFlavor"]=="1">
-                                     <list entry.operations as op>
-                                   [<input type="checkbox" name="operation" value="${entry.id};${op}">${op}]
-                             </list>
-                           </if>
-                <if config["Mir.Localizer.Admin.ListOperationsFlavor"]=="2">
-                     <select name="operation">
-                    <option value="" selected>&nbsp;</option>
-                                       <list entry.operations as op>
-                      <option value="${entry.id};${op}">${op}</option>
-                               </list>
-                  </select>
-                           </if>
-                <if entry.operations>|</if>
-                <a href="${config.actionRoot}?module=Comment&do=edit&id=${entry.id}">${lang("edit")}</a>                
-            </td>
-      
-            <td>
-              <span class="text">&nbsp;
-                <a href="${config.actionRoot}?module=Comment&do=delete&id=${entry.id}">${lang("delete")}</a>
-              </span>
-            </td>
+      <td valign="top">
+        ${utility.prettyEncodeHTML(entry.comment)}
+      </td>    
+      <td valign="top">
+        &nbsp;
+        <if config["Mir.Localizer.Admin.AllowDeleteComment"]=="1">
+          <a class="small" href="${config.actionRoot}?module=Comment&do=delete&id=${entry.id}&okurl=${utility.encodeURI(thisurl)}&cancelurl=${utility.encodeURI(thisurl)}">[${lang("delete")}]</a>
+        </if>
+      </td>    
+    </tr>
+  </list>
         
-               </tr>
-        </list>
-      
-        <tr class="darkgrey">
-          <td colspan="3"><span class="witesmall">${count} ${lang("records")} / ${lang("show_from_to", from, to)}</span></td>
-        </tr>
-        <tr><td>
-          <if prevurl>
-            <a href="${config.actionRoot}?${prevurl}">${lang("list.previous")}</a>&nbsp;
-          </if>
-          <if nexturl>
-            <a href="${config.actionRoot}?${nexturl}">${lang("list.next")}</a>&nbsp;
-          </if>
-        </td></tr>
-    </table>
-
+    <tr>
+      <td colspan="4" class="table-foot">
+        ${count} ${lang("records")} / ${lang("show_from_to", from, to)}
+      </td>
+    </tr>
+  </table>
+  
   <if config["Mir.Localizer.Admin.ListOperationsFlavor"]!="0">
-      <p>
-        <input class="majorbutton" type="submit" name="save" value="${lang("save")}">
-      </p>
-    </form>    
+    <p class="box">
+      <input class="majorbutton" type="submit" name="save" value="${lang("save")}"> &nbsp; (${lang("commentlist.activate")})
+    </p>
+    </form> 
   </if>  
   
+  <call showPrevNextLinks (prevurl, nexturl, "right")>
+  
 <else>
-  <P align="center">${lang("no_matches_found")}</p>
+  <P align="center" class="box">${lang("no_matches_found")}</p>
 </if>
 
 <include "foot.template">