| 1 | <#-- |
|---|
| 2 | $HeadURL:: $ |
|---|
| 3 | $Id$ |
|---|
| 4 | |
|---|
| 5 | Copyright (c) 2007-2009 by Topaz, Inc. |
|---|
| 6 | http://topazproject.org |
|---|
| 7 | |
|---|
| 8 | Licensed under the Apache License, Version 2.0 (the "License"); |
|---|
| 9 | you may not use this file except in compliance with the License. |
|---|
| 10 | You may obtain a copy of the License at |
|---|
| 11 | |
|---|
| 12 | http://www.apache.org/licenses/LICENSE-2.0 |
|---|
| 13 | |
|---|
| 14 | Unless required by applicable law or agreed to in writing, software |
|---|
| 15 | distributed under the License is distributed on an "AS IS" BASIS, |
|---|
| 16 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
|---|
| 17 | See the License for the specific language governing permissions and |
|---|
| 18 | limitations under the License. |
|---|
| 19 | --> |
|---|
| 20 | <html> |
|---|
| 21 | <head> |
|---|
| 22 | <title>Ambra: Administration</title> |
|---|
| 23 | <script type="text/javascript"> |
|---|
| 24 | /** |
|---|
| 25 | * js in support of admin UI. |
|---|
| 26 | * |
|---|
| 27 | * @author jsuttor |
|---|
| 28 | */ |
|---|
| 29 | function SetAllCheckBoxes(FormName, FieldName, CheckValue) { |
|---|
| 30 | |
|---|
| 31 | // form must exist |
|---|
| 32 | if (!document.forms[FormName]) { return; } |
|---|
| 33 | |
|---|
| 34 | // get all named fields |
|---|
| 35 | var objCheckBoxes = document.forms[FormName].elements[FieldName]; |
|---|
| 36 | if (!objCheckBoxes) { return; } |
|---|
| 37 | |
|---|
| 38 | // set the check value for all check boxes |
|---|
| 39 | var countCheckBoxes = objCheckBoxes.length; |
|---|
| 40 | if (!countCheckBoxes) { |
|---|
| 41 | objCheckBoxes.checked = CheckValue; |
|---|
| 42 | } else { |
|---|
| 43 | for (var i = 0; i < countCheckBoxes; i++) { |
|---|
| 44 | objCheckBoxes[i].checked = CheckValue; |
|---|
| 45 | } |
|---|
| 46 | } |
|---|
| 47 | } |
|---|
| 48 | </script> |
|---|
| 49 | </head> |
|---|
| 50 | <body> |
|---|
| 51 | <h1 style="text-align: center">Ambra: Administration</h1> |
|---|
| 52 | |
|---|
| 53 | <@s.url id="editAnnotation" namespace="/admin" action="editAnnotation"/> |
|---|
| 54 | <@s.url id="manageUsersURL" namespace="/admin" action="findUser" /> |
|---|
| 55 | <@s.url id="manageVirtualJournalsURL" namespace="/admin" action="manageVirtualJournals" /> |
|---|
| 56 | <@s.url id="manageCaches" namespace="/admin" action="manageCaches" /> |
|---|
| 57 | <p style="text-align: right"> |
|---|
| 58 | <@s.a href="${editAnnotation}">Edit Annotation</@s.a> | |
|---|
| 59 | <@s.a href="%{manageUsersURL}">Manage Users</@s.a> | |
|---|
| 60 | <@s.a href="%{manageVirtualJournalsURL}">Manage Virtual Journals</@s.a> | |
|---|
| 61 | <@s.a href="%{manageCaches}">Manage Caches</@s.a> |
|---|
| 62 | </p> |
|---|
| 63 | <hr/> |
|---|
| 64 | |
|---|
| 65 | <#include "templates/messages.ftl"> |
|---|
| 66 | <h2>${journal.key} (${journal.eIssn!""})</h2> |
|---|
| 67 | |
|---|
| 68 | <#if uploadableFiles?has_content> |
|---|
| 69 | <fieldset> |
|---|
| 70 | <legend><b>Ingestable Archives</b></legend> |
|---|
| 71 | <@s.form name="ingestArchives" action="ingestArchives" method="post" namespace="/admin"> |
|---|
| 72 | <#if (uploadableFiles.size() > 1)> |
|---|
| 73 | <input type="button" value="Ingest All" |
|---|
| 74 | onclick="SetAllCheckBoxes('ingestArchives', 'filesToIngest', true);"/> |
|---|
| 75 | <br/> |
|---|
| 76 | </#if> |
|---|
| 77 | <#list uploadableFiles as file> |
|---|
| 78 | <@s.checkbox name="filesToIngest" label="${file}" fieldValue="${file}"/><br/> |
|---|
| 79 | </#list> |
|---|
| 80 | <br/> |
|---|
| 81 | <@s.checkbox name="force" label="Force ingestion even if article(s) already exist" fieldValue="true"/><br/> |
|---|
| 82 | <br/> |
|---|
| 83 | <@s.submit value="Ingest Selected Archives" /> |
|---|
| 84 | </@s.form> |
|---|
| 85 | </fieldset> |
|---|
| 86 | <br/> |
|---|
| 87 | </#if> |
|---|
| 88 | |
|---|
| 89 | <#if publishableFiles?has_content> |
|---|
| 90 | <fieldset> |
|---|
| 91 | <legend><b>Publishable Documents</b></legend> |
|---|
| 92 | <@s.form id="publishArchives" name="publishArchives" action="publishArchives" method="post" namespace="/admin"> |
|---|
| 93 | <table border="1" cellpadding="2" cellspacing="0"> |
|---|
| 94 | <tr> |
|---|
| 95 | <th>Publish</th> |
|---|
| 96 | <#list Request[freemarker_config.journalContextAttributeKey].virtualJournals as virtualJournal> |
|---|
| 97 | <#if journal.key != virtualJournal> |
|---|
| 98 | <th>${virtualJournal}</th> |
|---|
| 99 | </#if> |
|---|
| 100 | </#list> |
|---|
| 101 | <th>Delete</th> |
|---|
| 102 | <th> </th> |
|---|
| 103 | </tr> |
|---|
| 104 | <#if (publishableFiles.size() > 1)> |
|---|
| 105 | <tr> |
|---|
| 106 | <th> |
|---|
| 107 | <input type="button" value="Publish All" |
|---|
| 108 | onclick="SetAllCheckBoxes('publishArchives', 'articlesToPublish', true);"/> |
|---|
| 109 | </th> |
|---|
| 110 | <#list Request[freemarker_config.journalContextAttributeKey].virtualJournals as virtualJournal> |
|---|
| 111 | <#if journal.key != virtualJournal> |
|---|
| 112 | <th> </th> |
|---|
| 113 | </#if> |
|---|
| 114 | </#list> |
|---|
| 115 | <th> |
|---|
| 116 | <input type="button" value="Delete All" |
|---|
| 117 | onclick="SetAllCheckBoxes('publishArchives', 'articlesToDelete', true);"/> |
|---|
| 118 | </th> |
|---|
| 119 | <th> </th> |
|---|
| 120 | </tr> |
|---|
| 121 | </#if> |
|---|
| 122 | <#list publishableFiles as article> |
|---|
| 123 | <tr> |
|---|
| 124 | <@s.url id="articleURL" includeParams="none" namespace="/article" action="fetchArticle" articleURI="${article}"/> |
|---|
| 125 | <td><@s.checkbox name="articlesToPublish" fieldValue="${article}"/></td> |
|---|
| 126 | <#list Request[freemarker_config.journalContextAttributeKey].virtualJournals as virtualJournal> |
|---|
| 127 | <#if journal.key != virtualJournal> |
|---|
| 128 | <td><@s.checkbox name="articlesInVirtualJournals" fieldValue="${article}::${virtualJournal}"/></td> |
|---|
| 129 | </#if> |
|---|
| 130 | </#list> |
|---|
| 131 | <td><@s.checkbox name="articlesToDelete" fieldValue="${article}"/></td> |
|---|
| 132 | <td><a target="_article" href="${articleURL}">${article}</a></td> |
|---|
| 133 | </tr> |
|---|
| 134 | </#list> |
|---|
| 135 | </table> |
|---|
| 136 | <@s.submit value="Publish/Delete Articles"/> |
|---|
| 137 | </@s.form> |
|---|
| 138 | </fieldset> |
|---|
| 139 | <br/> |
|---|
| 140 | </#if> |
|---|
| 141 | |
|---|
| 142 | <#if flaggedComments?has_content> |
|---|
| 143 | <fieldset> |
|---|
| 144 | <legend><b>Flagged Comments</b></legend> |
|---|
| 145 | <@s.form name="processFlags" action="processFlags" method="post" namespace="/admin"> |
|---|
| 146 | <table width="100%"> |
|---|
| 147 | <tr><td><b>Time</b></td><td><b>Comment</b></td><td><b>By</b></td><td><b>Refers To</b></td><td><b>Reason</b></td><td><b>Action</b></td></tr> |
|---|
| 148 | <tr><td colspan="6"><hr/></td></tr> |
|---|
| 149 | <#list flaggedComments as flaggedComment> |
|---|
| 150 | <#if flaggedComment.isAnnotation> |
|---|
| 151 | <@s.url id="flagURL" namespace="/admin" action="viewAnnotation" annotationId="${flaggedComment.target}"/> |
|---|
| 152 | <#if flaggedComment.correction> |
|---|
| 153 | <#assign deleteLabel = "Delete Correction"> |
|---|
| 154 | <#else> |
|---|
| 155 | <#assign deleteLabel = "Delete Comment"> |
|---|
| 156 | </#if> |
|---|
| 157 | <#elseif flaggedComment.isRating> |
|---|
| 158 | <@s.url id="flagURL" namespace="/admin" action="viewRating" ratingId="${flaggedComment.target}"/> |
|---|
| 159 | <#assign deleteLabel = "Delete Rating"> |
|---|
| 160 | <#elseif flaggedComment.isReply> |
|---|
| 161 | <@s.url id="flagURL" namespace="/admin" action="viewReply" replyId="${flaggedComment.target}"/> |
|---|
| 162 | <#assign deleteLabel = "Delete Reply (Sub-thread)"> |
|---|
| 163 | </#if> |
|---|
| 164 | <#if flaggedComment.targetTitle?exists> |
|---|
| 165 | <#assign targetTitle = flaggedComment.targetTitle> |
|---|
| 166 | <#else> |
|---|
| 167 | <#assign targetTitle = '"Flagged Annotation has no Title"'> |
|---|
| 168 | </#if> |
|---|
| 169 | <tr> |
|---|
| 170 | <td>${flaggedComment.created}</td> |
|---|
| 171 | <td width="20%">${flaggedComment.flagComment}</td> |
|---|
| 172 | <td><a href="../user/displayUser.action?userId=${flaggedComment.creatorid}"/>${flaggedComment.creator}</a></td> |
|---|
| 173 | <td width="20%"><a href="${flagURL}">${targetTitle}</a></td> |
|---|
| 174 | <td>${flaggedComment.reasonCode}</td> |
|---|
| 175 | <td> |
|---|
| 176 | <@s.checkbox name="commentsToUnflag" label="Remove Flag" fieldValue="${flaggedComment.target}_${flaggedComment.flagId}_${flaggedComment.targetType}"/> |
|---|
| 177 | <br/> |
|---|
| 178 | <@s.checkbox name="commentsToDelete" label="${deleteLabel}" fieldValue="${flaggedComment.root}_${flaggedComment.target}_${flaggedComment.targetType}"/> |
|---|
| 179 | <#if flaggedComment.isAnnotation && !flaggedComment.isGeneralComment > |
|---|
| 180 | <br/> |
|---|
| 181 | Convert to: |
|---|
| 182 | <br/> |
|---|
| 183 | <#if !flaggedComment.isMinorCorrection() > |
|---|
| 184 | <@s.checkbox name="convertToMinorCorrection" label="Minor Correction" |
|---|
| 185 | fieldValue="${flaggedComment.flagId}_${flaggedComment.target}"/> |
|---|
| 186 | <br/> |
|---|
| 187 | </#if> |
|---|
| 188 | <#if !flaggedComment.isFormalCorrection() > |
|---|
| 189 | <@s.checkbox name="convertToFormalCorrection" label="Formal Correction" |
|---|
| 190 | fieldValue="${flaggedComment.flagId}_${flaggedComment.target}"/> |
|---|
| 191 | <br/> |
|---|
| 192 | </#if> |
|---|
| 193 | <#if !flaggedComment.isRetraction() > |
|---|
| 194 | <@s.checkbox name="convertToRetraction" label="Retraction" |
|---|
| 195 | fieldValue="${flaggedComment.flagId}_${flaggedComment.target}"/> |
|---|
| 196 | <br/> |
|---|
| 197 | </#if> |
|---|
| 198 | <#if flaggedComment.isCorrection() > |
|---|
| 199 | <@s.checkbox name="convertToNote" label="Note" |
|---|
| 200 | fieldValue="${flaggedComment.flagId}_${flaggedComment.target}"/> |
|---|
| 201 | <br/> |
|---|
| 202 | </#if> |
|---|
| 203 | </#if> |
|---|
| 204 | </td> |
|---|
| 205 | </tr> |
|---|
| 206 | <tr><td colspan="6"><hr/></td></tr> |
|---|
| 207 | </#list> |
|---|
| 208 | </table> |
|---|
| 209 | <@s.submit value="Process Selected Flags" /> |
|---|
| 210 | </@s.form> |
|---|
| 211 | <br/> |
|---|
| 212 | </fieldset> |
|---|
| 213 | <br/> |
|---|
| 214 | </#if> |
|---|
| 215 | |
|---|
| 216 | <fieldset> |
|---|
| 217 | <legend><b>Delete Article</b></legend> |
|---|
| 218 | <@s.form name="deleteArticle" action="deleteArticle" method="get" namespace="/admin"> |
|---|
| 219 | <@s.textfield label="Article Uri" name="article" size="80"/> <@s.submit value="Delete"/> |
|---|
| 220 | </@s.form> |
|---|
| 221 | </fieldset> |
|---|
| 222 | </body> |
|---|
| 223 | </html> |
|---|