[jboss-svn-commits] JBL Code SVN: r10293 - in labs/jbossforums/branches/forums101P22/forums/src: bin/portal-forums-war/default_graphics/images and 7 other directories.
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Fri Mar 16 19:06:11 EDT 2007
Author: unibrew
Date: 2007-03-16 19:06:11 -0400 (Fri, 16 Mar 2007)
New Revision: 10293
Added:
labs/jbossforums/branches/forums101P22/forums/src/bin/portal-forums-war/default_graphics/images/forum_ico_admindelete_disa.gif
Removed:
labs/jbossforums/branches/forums101P22/forums/src/bin/portal-forums-war/default_graphics/images/forum_ico_admindelete.gif
labs/jbossforums/branches/forums101P22/forums/src/resources/portal-forums-war/views/admin/editCategory.xhtml
labs/jbossforums/branches/forums101P22/forums/src/resources/portal-forums-war/views/admin/editForum.xhtml
Modified:
labs/jbossforums/branches/forums101P22/forums/src/bin/portal-forums-war/default_graphics/forums_styles.css
labs/jbossforums/branches/forums101P22/forums/src/main/org/jboss/portlet/forums/theme/ForumsTheme.java
labs/jbossforums/branches/forums101P22/forums/src/main/org/jboss/portlet/forums/ui/ForumUtil.java
labs/jbossforums/branches/forums101P22/forums/src/main/org/jboss/portlet/forums/ui/ForumsJSFPortlet.java
labs/jbossforums/branches/forums101P22/forums/src/main/org/jboss/portlet/forums/ui/action/AdminController.java
labs/jbossforums/branches/forums101P22/forums/src/resources/portal-forums-war/WEB-INF/classes/ResourceJSF.properties
labs/jbossforums/branches/forums101P22/forums/src/resources/portal-forums-war/WEB-INF/classes/default_graphics/theme.properties
labs/jbossforums/branches/forums101P22/forums/src/resources/portal-forums-war/WEB-INF/forums-config.xml
labs/jbossforums/branches/forums101P22/forums/src/resources/portal-forums-war/WEB-INF/forums.taglib.xml
labs/jbossforums/branches/forums101P22/forums/src/resources/portal-forums-war/views/admin/index.xhtml
Log:
[JBFORUMS-172] [JBFORUMS-173] [JBFORUMS-174] I rewrote admin main view and I integrated EditCategory and EditForum into it. Still a fine tuning of HTML/CSS needed.
Modified: labs/jbossforums/branches/forums101P22/forums/src/bin/portal-forums-war/default_graphics/forums_styles.css
===================================================================
--- labs/jbossforums/branches/forums101P22/forums/src/bin/portal-forums-war/default_graphics/forums_styles.css 2007-03-16 22:52:59 UTC (rev 10292)
+++ labs/jbossforums/branches/forums101P22/forums/src/bin/portal-forums-war/default_graphics/forums_styles.css 2007-03-16 23:06:11 UTC (rev 10293)
@@ -63,6 +63,18 @@
font-size:14px;
font-weight:bold;
}
+.forumtitletext .successtext {
+ margin: 5px auto;
+ color:#226809;
+ font-size:12px;
+ font-weight:bold;
+}
+.forumtitletext .failuretext {
+ margin: 5px auto;
+ color:#CC0000;
+ font-size:12px;
+ font-weight:bold;
+}
.forumtitletext p {
margin: 2px auto 12px auto;
}
@@ -82,18 +94,20 @@
}
.actionbuttons {
- padding: 4px 0px 4px 0px;
+ padding: 5px 0px;
}
.actionbuttons ul {
- padding-left: 0px;
- margin-left: 0px;
+ padding: 0px;
+ margin: 0px;
display: inline;
}
.actionbuttons ul li {
list-style: none;
display: inline;
+ padding: 0px;
+ margin: 0px;
}
.actionbuttons ul li img {
Deleted: labs/jbossforums/branches/forums101P22/forums/src/bin/portal-forums-war/default_graphics/images/forum_ico_admindelete.gif
===================================================================
(Binary files differ)
Copied: labs/jbossforums/branches/forums101P22/forums/src/bin/portal-forums-war/default_graphics/images/forum_ico_admindelete_disa.gif (from rev 10292, labs/jbossforums/branches/forums101P24/forums/src/bin/portal-forums-war/default_graphics/images/forum_ico_admindelete_disa.gif)
===================================================================
(Binary files differ)
Modified: labs/jbossforums/branches/forums101P22/forums/src/main/org/jboss/portlet/forums/theme/ForumsTheme.java
===================================================================
--- labs/jbossforums/branches/forums101P22/forums/src/main/org/jboss/portlet/forums/theme/ForumsTheme.java 2007-03-16 22:52:59 UTC (rev 10292)
+++ labs/jbossforums/branches/forums101P22/forums/src/main/org/jboss/portlet/forums/theme/ForumsTheme.java 2007-03-16 23:06:11 UTC (rev 10293)
@@ -201,6 +201,11 @@
/**
* DOCUMENT_ME
*/
+ public String resourceTopicModeDeleteDisaURL;
+
+ /**
+ * DOCUMENT_ME
+ */
public String resourceTopicModMoveURL;
/**
@@ -217,6 +222,36 @@
* DOCUMENT_ME
*/
public String resourceTopicModSplitURL;
+
+ /**
+ * DOCUMENT_ME
+ */
+ public String resourceAdminNewCategoryURL;
+
+ /**
+ * DOCUMENT_ME
+ */
+ public String resourceAdminNewForumURL;
+
+ /**
+ * DOCUMENT_ME
+ */
+ public String resourceAdminArrowUpURL;
+
+ /**
+ * DOCUMENT_ME
+ */
+ public String resourceAdminArrowUpDisaURL;
+
+ /**
+ * DOCUMENT_ME
+ */
+ public String resourceAdminArrowDownURL;
+
+ /**
+ * DOCUMENT_ME
+ */
+ public String resourceAdminArrowDownDisaURL;
/**
* DOCUMENT_ME
@@ -427,10 +462,17 @@
resourcePostLockedURL = xprops.getResourceURL("post_locked");
resourcePostNewURL = xprops.getResourceURL("post_new");
resourceTopicModeDeleteURL = xprops.getResourceURL("topic_mod_delete");
+ resourceTopicModeDeleteDisaURL = xprops.getResourceURL("topic_mod_delete_disa");
resourceTopicModMoveURL = xprops.getResourceURL("topic_mod_move");
resourceTopicModLockURL = xprops.getResourceURL("topic_mod_lock");
resourceTopicModUnlockURL = xprops.getResourceURL("topic_mod_unlock");
resourceTopicModSplitURL = xprops.getResourceURL("topic_mod_split");
+ resourceAdminNewCategoryURL = xprops.getResourceURL("admin_newcategory");
+ resourceAdminNewForumURL = xprops.getResourceURL("admin_newforum");
+ resourceAdminArrowUpURL = xprops.getResourceURL("admin_arrowup");
+ resourceAdminArrowUpDisaURL = xprops.getResourceURL("admin_arrowup_disa");
+ resourceAdminArrowDownURL = xprops.getResourceURL("admin_arrowdown");
+ resourceAdminArrowDownDisaURL = xprops.getResourceURL("admin_arrowdown_disa");
resourceTopicUnWatchURL = xprops.getResourceURL("topic_un_watch");
resourceTopicWatchURL = xprops.getResourceURL("topic_watch");
resourceReplyNewURL = xprops.getResourceURL("reply_new");
Modified: labs/jbossforums/branches/forums101P22/forums/src/main/org/jboss/portlet/forums/ui/ForumUtil.java
===================================================================
--- labs/jbossforums/branches/forums101P22/forums/src/main/org/jboss/portlet/forums/ui/ForumUtil.java 2007-03-16 22:52:59 UTC (rev 10292)
+++ labs/jbossforums/branches/forums101P22/forums/src/main/org/jboss/portlet/forums/ui/ForumUtil.java 2007-03-16 23:06:11 UTC (rev 10293)
@@ -23,6 +23,7 @@
import java.text.DecimalFormat;
import java.util.Date;
+import java.util.Collection;
import javax.faces.context.FacesContext;
@@ -137,6 +138,15 @@
return string.trim();
}
+ public static int collectionSize( Collection collection )
+ {
+ if (collection==null)
+ {
+ return -1;
+ }
+ return collection.size();
+ }
+
public static Post getLastPost(ForumsModule fm, Forum forum)
{
try
Modified: labs/jbossforums/branches/forums101P22/forums/src/main/org/jboss/portlet/forums/ui/ForumsJSFPortlet.java
===================================================================
--- labs/jbossforums/branches/forums101P22/forums/src/main/org/jboss/portlet/forums/ui/ForumsJSFPortlet.java 2007-03-16 22:52:59 UTC (rev 10292)
+++ labs/jbossforums/branches/forums101P22/forums/src/main/org/jboss/portlet/forums/ui/ForumsJSFPortlet.java 2007-03-16 23:06:11 UTC (rev 10293)
@@ -441,6 +441,8 @@
String page = ForumUtil.getParameter(request,Constants.p_page);
String watchId = ForumUtil.getParameter(request,Constants.p_watchId);
String viewId = ForumUtil.getParameter(request,Constants.p_viewId);
+ String adminEditCatMode = ForumUtil.getParameter(request,Constants.EDIT_CATEGORY);
+ String adminEditForMode = ForumUtil.getParameter(request,Constants.EDIT_FORUM);
if(categoryId!=null && categoryId.trim().length()>0)
{
response.setRenderParameter(Constants.p_categoryId,categoryId);
@@ -497,6 +499,14 @@
{
response.setRenderParameter(Constants.p_viewId,viewId);
}
+ if(adminEditCatMode!=null && adminEditCatMode.trim().length()>0)
+ {
+ response.setRenderParameter(Constants.EDIT_CATEGORY,adminEditCatMode);
+ }
+ if(adminEditForMode!=null && adminEditForMode.trim().length()>0)
+ {
+ response.setRenderParameter(Constants.EDIT_FORUM,adminEditForMode);
+ }
}
/**
Modified: labs/jbossforums/branches/forums101P22/forums/src/main/org/jboss/portlet/forums/ui/action/AdminController.java
===================================================================
--- labs/jbossforums/branches/forums101P22/forums/src/main/org/jboss/portlet/forums/ui/action/AdminController.java 2007-03-16 22:52:59 UTC (rev 10292)
+++ labs/jbossforums/branches/forums101P22/forums/src/main/org/jboss/portlet/forums/ui/action/AdminController.java 2007-03-16 23:06:11 UTC (rev 10293)
@@ -61,6 +61,13 @@
*/
private int selectedCategory = 0;
private int selectedForum = 0;
+
+ /**
+ * flags telling in what mode should the view be displayed
+ */
+ private boolean editCategoryMode;
+ private boolean editForumMode;
+
//-----ui data-------------------------------------------------------------------------------------------------------------------------
/**
* @return Returns the categoryName.
@@ -136,6 +143,22 @@
{
this.selectedForum = selectedForum;
}
+
+ /**
+ *
+ */
+ public boolean isEditCategoryMode()
+ {
+ return editCategoryMode;
+ }
+
+ /**
+ *
+ */
+ public boolean isEditForumMode()
+ {
+ return editForumMode;
+ }
//cleanup related----------------------------------------------------------------------------------------------------------------------
/**
*
@@ -147,6 +170,8 @@
this.forumDescription = null;
this.selectedCategory = 0;
this.selectedForum = 0;
+ this.editCategoryMode = false;
+ this.editForumMode = false;
}
//-------------------------------------------------------------------------------------------------------------------------------------
/**
@@ -175,6 +200,7 @@
}
if (category!=null) {
this.categoryName = category.getTitle();
+ this.selectedCategory = category.getId().intValue();
}
}
@@ -198,8 +224,22 @@
this.forumName = forum.getName();
this.forumDescription = forum.getDescription();
this.selectedCategory = forum.getCategory().getId().intValue();
+ this.selectedForum = forum.getId().intValue();
}
}
+
+ // Checking for editModes flags
+ String editCatStr = ForumUtil.getParameter(Constants.EDIT_CATEGORY);
+ if (editCatStr != null && editCatStr.trim().length()>0)
+ {
+ this.editCategoryMode = Boolean.parseBoolean(editCatStr);
+ }
+
+ String editForStr = ForumUtil.getParameter(Constants.EDIT_FORUM);
+ if (editForStr != null && editForStr.trim().length()>0)
+ {
+ this.editForumMode = Boolean.parseBoolean(editForStr);
+ }
}
catch(Exception e)
{
@@ -262,7 +302,7 @@
String start = JSFUtil.getBundleMessage("ResourceJSF","Category_updated_0");
String end = JSFUtil.getBundleMessage("ResourceJSF","Category_updated_1");
- JSFUtil.setMessage(Constants.FEEDBACK,start+"\""+this.categoryName+"\""+end);
+ JSFUtil.setMessage(Constants.FEEDBACK,start+" \""+this.categoryName+"\" "+end);
navState = Constants.EDIT_CATEGORY;
success = true;
@@ -625,7 +665,8 @@
/**
*
*/
- public String lockForum() {
+ public String lockForum()
+ {
try
{
//get the forumId where this forum should be added
@@ -656,7 +697,8 @@
/**
*
*/
- public String unlockForum() {
+ public String unlockForum()
+ {
try
{
//get the forumId where this forum should be added
@@ -683,4 +725,12 @@
}
return null;
}
+
+ /**
+ *
+ */
+ public String dummyAction()
+ {
+ return null;
+ }
}
Modified: labs/jbossforums/branches/forums101P22/forums/src/resources/portal-forums-war/WEB-INF/classes/ResourceJSF.properties
===================================================================
--- labs/jbossforums/branches/forums101P22/forums/src/resources/portal-forums-war/WEB-INF/classes/ResourceJSF.properties 2007-03-16 22:52:59 UTC (rev 10292)
+++ labs/jbossforums/branches/forums101P22/forums/src/resources/portal-forums-war/WEB-INF/classes/ResourceJSF.properties 2007-03-16 23:06:11 UTC (rev 10293)
@@ -1594,17 +1594,18 @@
#
# Forum Management
#
-Forum_admin=Forum Administration
+Forum_admin=Categories And Forums
Forum_admin_explain=From this panel you can add, delete, edit, re-order and re-synchronise categories and forums
-Edit_forum=Edit forum
-Create_forum=Create new forum
+Admin_actions=Actions
+Edit_forum=Edit Forum
+Create_forum=Add New Forum
Forum_created_0=The Forum
Forum_created_1=was successfully created.
Forum_updated_0=The Forum
Forum_updated_1=was successfully updated.
Forum_deleted_0=The Forum
Forum_deleted_1=was successfully deleted.
-Create_category=Create new category
+Create_category=Add New Category
Category_created_0=The Category
Category_created_1=was successfully created.
Category_updated_0=The Category
@@ -1635,8 +1636,10 @@
Forum_settings=General Forum Settings
Forum_name=Forum name
Forum_desc=Description
+Forum_category=Forum category
Forum_status=Forum status
Forum_pruning=Auto-pruning
+Category_name=Category name
prune_freq=Check for topic age every
prune_days=Remove topics that have not been posted to in
Modified: labs/jbossforums/branches/forums101P22/forums/src/resources/portal-forums-war/WEB-INF/classes/default_graphics/theme.properties
===================================================================
--- labs/jbossforums/branches/forums101P22/forums/src/resources/portal-forums-war/WEB-INF/classes/default_graphics/theme.properties 2007-03-16 22:52:59 UTC (rev 10292)
+++ labs/jbossforums/branches/forums101P22/forums/src/resources/portal-forums-war/WEB-INF/classes/default_graphics/theme.properties 2007-03-16 23:06:11 UTC (rev 10293)
@@ -38,7 +38,14 @@
topic_mod_unlock=images/forum_ico_adminunlock.gif
topic_mod_split=images/forum_ico_adminsplit.gif
topic_mod_move=images/forum_ico_adminmove.gif
-topic_mod_delete=images/forum_ico_admindelete.gif
+topic_mod_delete=images/forum_ico_admindelete_norm.gif
+topic_mod_delete_disa=images/forum_ico_admindelete_disa.gif
+admin_arrowup=images/forum_ico_adminarrowup_norm.gif
+admin_arrowdown=images/forum_ico_adminarrowdown_norm.gif
+admin_arrowup_disa=images/forum_ico_adminarrowup_disa.gif
+admin_arrowdown_disa=images/forum_ico_adminarrowdown_disa.gif
+admin_newcategory=images/forum_but_addnewcategory.gif
+admin_newforum=images/forum_but_addnewforum.gif
Modified: labs/jbossforums/branches/forums101P22/forums/src/resources/portal-forums-war/WEB-INF/forums-config.xml
===================================================================
--- labs/jbossforums/branches/forums101P22/forums/src/resources/portal-forums-war/WEB-INF/forums-config.xml 2007-03-16 22:52:59 UTC (rev 10292)
+++ labs/jbossforums/branches/forums101P22/forums/src/resources/portal-forums-war/WEB-INF/forums-config.xml 2007-03-16 23:06:11 UTC (rev 10293)
@@ -379,13 +379,6 @@
<managed-bean-class>org.jboss.portlet.forums.ui.action.AdminController</managed-bean-class>
<managed-bean-scope>request</managed-bean-scope>
</managed-bean>
- <navigation-rule>
- <from-view-id>/views/admin/editCategory.xhtml</from-view-id>
- <navigation-case>
- <from-outcome>editCategory</from-outcome>
- <to-view-id>/views/admin/index.xhtml</to-view-id>
- </navigation-case>
- </navigation-rule>
<navigation-rule>
<from-view-id>/views/admin/deleteCategory.xhtml</from-view-id>
<navigation-case>
@@ -394,13 +387,6 @@
</navigation-case>
</navigation-rule>
<navigation-rule>
- <from-view-id>/views/admin/editForum.xhtml</from-view-id>
- <navigation-case>
- <from-outcome>editForum</from-outcome>
- <to-view-id>/views/admin/index.xhtml</to-view-id>
- </navigation-case>
- </navigation-rule>
- <navigation-rule>
<from-view-id>/views/admin/deleteForum.xhtml</from-view-id>
<navigation-case>
<from-outcome>deleteForum</from-outcome>
Modified: labs/jbossforums/branches/forums101P22/forums/src/resources/portal-forums-war/WEB-INF/forums.taglib.xml
===================================================================
--- labs/jbossforums/branches/forums101P22/forums/src/resources/portal-forums-war/WEB-INF/forums.taglib.xml 2007-03-16 22:52:59 UTC (rev 10292)
+++ labs/jbossforums/branches/forums101P22/forums/src/resources/portal-forums-war/WEB-INF/forums.taglib.xml 2007-03-16 23:06:11 UTC (rev 10293)
@@ -134,6 +134,15 @@
<function-class>org.jboss.portlet.forums.ui.ForumUtil</function-class>
<function-signature>java.lang.String nullIfEmptyString( java.lang.String )</function-signature>
</function>
+
+ <!--
+ Simple method which returns collection's size.
+ -->
+ <function>
+ <function-name>collectionSize</function-name>
+ <function-class>org.jboss.portlet.forums.ui.ForumUtil</function-class>
+ <function-signature>int collectionSize( java.util.Collection )</function-signature>
+ </function>
<!--
function to get theme URL location
Deleted: labs/jbossforums/branches/forums101P22/forums/src/resources/portal-forums-war/views/admin/editCategory.xhtml
===================================================================
--- labs/jbossforums/branches/forums101P22/forums/src/resources/portal-forums-war/views/admin/editCategory.xhtml 2007-03-16 22:52:59 UTC (rev 10292)
+++ labs/jbossforums/branches/forums101P22/forums/src/resources/portal-forums-war/views/admin/editCategory.xhtml 2007-03-16 23:06:11 UTC (rev 10293)
@@ -1,73 +0,0 @@
-<!--
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
--->
-
-<div xmlns="http://www.w3.org/1999/xhtml"
- xmlns:ui="http://java.sun.com/jsf/facelets"
- xmlns:c="http://java.sun.com/jstl/core"
- xmlns:h="http://java.sun.com/jsf/html"
- xmlns:f="http://java.sun.com/jsf/core"
- xmlns:forums="http://www.jboss.com/products/jbossportal/forums" class="bb">
-
- <ui:composition template="/views/common/common.xhtml">
- <ui:define name="mainContent">
-
- <h1>${resource.Edit_Category}</h1>
-
- <p>${resource.Edit_Category_explain}</p>
-
- <!-- display the edit category widget -->
- <h:form>
- <input type="hidden" name="c" value="#{param['c']}"/>
- <table cellpadding="4" cellspacing="1" border="0" class="forumline" align="center">
- <tr>
- <th class="thHead" colspan="2">${resource.Edit_Category}</th>
- </tr>
- <tr>
- <td class="row1">${resource.Category}</td>
- <td class="row2">
- <h:inputText id="Category" styleClass="post" size="25"
- value="#{adminController.categoryName}" required="true"/>
-  <h:message for="Category" style="color:red" styleClass="liteoption"/> 
- </td>
- </tr>
- <tr>
- <td class="catBottom" colspan="2" align="center">
- <h:commandButton value="${resource.Submit}" styleClass="mainoption" action="#{adminController.editCategory}"/>
- </td>
- </tr>
- </table>
- </h:form>
-
- <!-- integrate the jump box -->
- <table cellspacing="0" cellpadding="0" border="0" align="right">
- <tr>
- <td align="right" valign="top" nowrap="nowrap">
- <ui:include src="/views/jumpbox.xhtml"/>
- </td>
- </tr>
- </table>
-
- </ui:define>
- </ui:composition>
-</div>
\ No newline at end of file
Deleted: labs/jbossforums/branches/forums101P22/forums/src/resources/portal-forums-war/views/admin/editForum.xhtml
===================================================================
--- labs/jbossforums/branches/forums101P22/forums/src/resources/portal-forums-war/views/admin/editForum.xhtml 2007-03-16 22:52:59 UTC (rev 10292)
+++ labs/jbossforums/branches/forums101P22/forums/src/resources/portal-forums-war/views/admin/editForum.xhtml 2007-03-16 23:06:11 UTC (rev 10293)
@@ -1,92 +0,0 @@
-<!--
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
--->
-
-<div xmlns="http://www.w3.org/1999/xhtml"
- xmlns:ui="http://java.sun.com/jsf/facelets"
- xmlns:c="http://java.sun.com/jstl/core"
- xmlns:h="http://java.sun.com/jsf/html"
- xmlns:f="http://java.sun.com/jsf/core"
- xmlns:forums="http://www.jboss.com/products/jbossportal/forums" class="bb">
-
- <ui:composition template="/views/common/common.xhtml">
- <ui:define name="mainContent">
-
- <h1>${resource.Edit_forum}</h1>
-
- <p>${resource.Forum_edit_delete_explain}</p>
-
-
- <!-- edit forum widget -->
- <h:form>
- <input type="hidden" name="f" value="#{param['f']}"/>
- <table width="100%" cellpadding="4" cellspacing="1" border="0" class="forumline" align="center">
- <tr>
- <th class="thHead" colspan="2">${resource.Forum_settings}</th>
- </tr>
- <tr>
- <td class="row1">${resource.Forum_name}</td>
- <td class="row2">
- <h:inputText id="Forum" size="25" styleClass="post" value="#{adminController.forumName}" required="true"/>
-  <h:message for="Forum" style="color:red" styleClass="liteoption"/> 
- </td>
- </tr>
- <tr>
- <td class="row1">${resource.Forum_desc}</td>
- <td class="row2">
- <h:inputTextarea rows="5" cols="45" styleClass="post" value="#{adminController.forumDescription}"/>
- </td>
- </tr>
- <tr>
- <td class="row1">${resource.Category}</td>
- <td class="row2">
- <h:selectOneMenu value="#{adminController.selectedCategory}">
- <c:forEach items="#{adminPanel.categories}" var="category">
- <f:selectItem itemValue="#{category.id}" itemLabel="#{category.title}" />
- </c:forEach>
- </h:selectOneMenu>
- </td>
- </tr>
- <tr>
- <td class="catBottom" colspan="2" align="center">
- <h:commandButton value="${resource.Confirm}" styleClass="mainoption" action="#{adminController.editForum}"/>
- </td>
- </tr>
- </table>
- </h:form>
-
- <br clear="all"/>
-
-
- <!-- integrate the jump box -->
- <table cellspacing="0" cellpadding="0" border="0" align="right">
- <tr>
- <td align="right" valign="top" nowrap="nowrap">
- <ui:include src="/views/jumpbox.xhtml"/>
- </td>
- </tr>
- </table>
-
- </ui:define>
- </ui:composition>
-</div>
\ No newline at end of file
Modified: labs/jbossforums/branches/forums101P22/forums/src/resources/portal-forums-war/views/admin/index.xhtml
===================================================================
--- labs/jbossforums/branches/forums101P22/forums/src/resources/portal-forums-war/views/admin/index.xhtml 2007-03-16 22:52:59 UTC (rev 10292)
+++ labs/jbossforums/branches/forums101P22/forums/src/resources/portal-forums-war/views/admin/index.xhtml 2007-03-16 23:06:11 UTC (rev 10293)
@@ -27,170 +27,347 @@
xmlns:c="http://java.sun.com/jstl/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
- xmlns:forums="http://www.jboss.com/products/jbossportal/forums" class="bb">
+ xmlns:forums="http://www.jboss.com/products/jbossportal/forums"
+ class="forumscontainer">
- <ui:composition template="/views/common/common.xhtml">
- <ui:define name="mainContent">
- <!-- Forum admin tool title/messages -->
- <h1>${resource.Forum_admin}</h1>
-
- <!-- display any feedback messages here -->
- <span style="color:green"><b>#{forums:message('feedback')}</b></span><br/>
-
- <p>${resource.Forum_admin_explain}</p>
-
- <!-- Forum admin widget with the list of category and forums in each category -->
- <table width="100%" cellpadding="4" cellspacing="1" border="0" class="forumline" align="center">
- <tr>
- <th class="thHead" colspan="7">${resource.Forum_admin}</th>
- </tr>
-
- <!-- display a list of categories -->
- <c:forEach items="#{adminPanel.categories}" var="category">
- <forums:isAllowed fragment="acl://viewCategory" contextData="#{category}">
- <tr>
- <td class="catLeft" colspan="3">
- <span class="cattitle">
- <b>
- <h:outputLink value="#{forums:outputLink(shared.links['category'],true)}">
- <f:param name="c" value="#{category.id}"/>
- ${category.title}
- </h:outputLink>
- </b>
- </span>
- </td>
- <td class="cat" align="center" valign="middle">
- <forums:isAllowed fragment="acl://editCategory" contextData="#{category}">
- <span class="gen">
- <h:outputLink value="#{forums:outputLink('/views/admin/editCategory.jsf',true)}">
- <f:param name="c" value="#{category.id}"/>
- <h:outputText value="${resource.Edit}"/>
- </h:outputLink>
- </span>
- </forums:isAllowed>
- </td>
- <td class="cat" align="center" valign="middle">
- <forums:isAllowed fragment="acl://deleteCategory" contextData="#{category}">
- <span class="gen">
- <h:outputLink value="#{forums:outputLink('/views/admin/deleteCategory.jsf',true)}">
- <f:param name="c" value="#{category.id}"/>
- <h:outputText value="${resource.Delete}"/>
- </h:outputLink>
- </span>
- </forums:isAllowed>
- </td>
- <td class="cat" align="center" valign="middle" nowrap="nowrap">
- <span class="gen">
- <h:form>
- <input type="hidden" name="c" value="#{category.id}"/>
- <h:commandLink action="#{adminController.moveCategoryUp}">
- <h:outputText value="${resource.Move_up}"/>
- </h:commandLink>
-    
- <h:commandLink action="#{adminController.moveCategoryDown}">
- <h:outputText value="${resource.Move_down}"/>
- </h:commandLink>
- </h:form>
- </span>
- </td>
- <td class="catRight" align="center" valign="middle">
- <span class="gen"> </span>
- </td>
- </tr>
- <!-- display the forums in this category -->
- <c:forEach items="#{category.forums}" var="forum">
- <forums:isAllowed fragment="acl://viewForum" contextData="#{forum}">
- <tr>
- <td class="row2">
- <span class="gen">
- <h:outputLink value="#{forums:outputLink(shared.links['forum'],true)}" target="_new">
- <f:param name="f" value="#{forum.id}"/>
- ${forum.name}
- </h:outputLink>
- </span>
- <br/><span class="gensmall">${forum.description}</span>
- </td>
- <td class="row1" align="center" valign="middle">
- <span class="gen">${forum.topicCount}</span>
- </td>
- <td class="row2" align="center" valign="middle">
- <span class="gen">${forum.postCount}</span>
- </td>
- <td class="row1" align="center" valign="middle">
- <forums:isAllowed fragment="acl://editForum" contextData="#{forum}">
- <span class="gen">
- <h:outputLink value="#{forums:outputLink('/views/admin/editForum.jsf',true)}">
- <f:param name="f" value="#{forum.id}"/>
- <h:outputText value="${resource.Edit}"/>
- </h:outputLink>
- </span>
- </forums:isAllowed>
- </td>
- <td class="row2" align="center" valign="middle">
- <forums:isAllowed fragment="acl://deleteForum" contextData="#{forum}">
- <span class="gen">
- <h:outputLink value="#{forums:outputLink('/views/admin/deleteForum.jsf',true)}">
- <f:param name="f" value="#{forum.id}"/>
- <h:outputText value="${resource.Delete}"/>
- </h:outputLink>
- </span>
- </forums:isAllowed>
- </td>
- <td class="row1" align="center" valign="middle">
- <span class="gen">
- <h:form>
- <input type="hidden" name="f" value="#{forum.id}"/>
- <h:commandLink action="#{adminController.moveForumUp}">
- <h:outputText value="${resource.Move_up}"/>
- </h:commandLink>
-    
- <h:commandLink action="#{adminController.moveForumDown}">
- <h:outputText value="${resource.Move_down}"/>
- </h:commandLink>
- </h:form>
- </span>
- </td>
- <td class="row2" align="center" valign="middle">
- <!--span class="gen"><a href="">Resync</a></span-->
- </td>
- </tr>
- </forums:isAllowed>
- </c:forEach>
- <forums:isAllowed fragment="acl://addForum">
- <!-- create new forum widget for each category -->
- <h:form>
- <tr>
- <td colspan="7" class="row2">
- <input type="hidden" name="c" value="#{category.id}"/>
- <h:inputText styleClass="post" value="#{adminController.forumName}" required="true"/>
- <h:commandButton styleClass="liteoption" value="${resource.Create_forum}" action="#{adminController.addForum}"/>
- </td>
- </tr>
- </h:form>
- </forums:isAllowed>
- <tr>
- <td colspan="7" height="1" class="spaceRow">
- <img src="/subSilver/images/spacer.gif" alt="" width="1" height="1"/>
- </td>
- </tr>
- </forums:isAllowed>
- </c:forEach>
-
- <forums:isAllowed fragment="acl://addCategory">
- <!-- Add new category widget -->
- <h:form>
- <tr>
- <td colspan="7" class="catBottom">
- <h:inputText id="Category" styleClass="post" value="#{adminController.categoryName}" required="true"/>
- <h:commandButton styleClass="liteoption" value="${resource.Create_category}" action="#{adminController.addCategory}"/>
-  <h:message for="Category" style="color:red" styleClass="liteoption"/> 
- </td>
- </tr>
- </h:form>
- </forums:isAllowed>
-
- </table>
-
+<ui:composition template="/views/common/common.xhtml">
+<ui:define name="mainContent">
+
+ <!-- Forum admin tool title and usability explanation and feedback messages -->
+ <div class="forumtitletext">
+ <h4>${resource.Forum_admin}</h4>
+ <p>${resource.Forum_admin_explain}</p>
+ <p class="successtext">#{forums:message('feedback')}</p>
+ </div>
+
+ <!-- Add new category button -->
+ <forums:isAllowed fragment="acl://addCategory">
+ <h:form>
+ <div class="actionbuttons">
+ <ul>
+ <li>
+ <h:commandLink action="#{adminController.addCategory}">
+ <img src="${forums:themeURL('resourceAdminNewCategoryURL')}"
+ alt="${resource.Create_category}" name="newCategory"
+ width="127" height="17" border="0" />
+ </h:commandLink>
+ </li>
+ </ul>
+ </div>
+ </h:form>
+ </forums:isAllowed>
+
+ <table width="100%" border="0" cellpadding="0" cellspacing="0" class="forumtablestyle">
+
+ <!-- Table header -->
+ <tr class="header">
+ <td class="forumheaderfirst">${resource.Forum_admin}</td>
+ <td class="forumheaderlast">${Admin_actions}</td>
+ </tr>
+
+ <!-- display a list of categories -->
+ <c:forEach items="#{adminPanel.categories}" var="category" varStatus="categoryIdx" >
+ <forums:isAllowed fragment="acl://viewCategory" contextData="#{category}">
+ <c:choose>
+
+ <c:when test="${(adminController.editCategoryMode or forums:message('form:Category') ne null)
+ and adminController.selectedCategory eq category.id}" >
+ <tr class="editRow">
+ <td>
+ <h:form id="form">
+ <input type="hidden" name="c" value="#{param['c']}"/>
+ <label for="categoryname" class="categorylabel">${resource.Category_name}:</label>
+ <h:inputText id="Category" required="true"
+ value="#{adminController.categoryName}" />
+ <h:commandButton id="editinline" value="${resource.Update}" styleClass="buttonMed"
+ action="#{adminController.editCategory}"/>
+ <br />
+ <h:message for="Category" styleClass="forumtitletext failuretext"/>
+ </h:form>
+ </td>
+ <td class="forumlistlast">
+  
+ </td>
+ </tr>
+ </c:when>
+
+ <c:otherwise>
+ <tr class="oddRow">
+ <td>
+
+ <!-- create new forum button -->
+ <forums:isAllowed fragment="acl://addForum">
+ <h:form>
+ <input type="hidden" name="c" value="#{category.id}"/>
+ <div class="forumfloatright">
+ <h:commandLink action="#{adminController.addForum}">
+ <img src="${forums:themeURL('resourceAdminNewForumURL')}"
+ alt="${resource.Create_forum}" border="0" />
+ </h:commandLink>
+ </div>
+ </h:form>
+ </forums:isAllowed>
+
+ <strong>${category.title}</strong>
+
+ <forums:isAllowed fragment="acl://editCategory" contextData="#{category}">
+ <h:form>
+ <input type="hidden" name="c" value="#{category.id}"/>
+  ( 
+ <h:commandLink action="${adminController.dummyAction}">
+ <f:param name="editCategory" value="true"/>
+ <h:outputText value="${resource.Edit_Category}"/>
+ </h:commandLink>
+ )
+ </h:form>
+ </forums:isAllowed>
+
+ </td>
+ <td class="forumlistlast actionbuttons">
+ <h:form>
+ <input type="hidden" name="c" value="#{category.id}"/>
+ <ul>
+ <li>
+ <c:choose>
+
+ <c:when test="${categoryIdx.index eq 1}">
+ <img src="${forums:themeURL('resourceAdminArrowUpDisaURL')}"
+ alt="${resource.Move_up}" name="arrowup" border="0" />
+ </c:when>
+
+ <c:otherwise>
+ <h:commandLink action="#{adminController.moveCategoryUp}">
+ <img src="${forums:themeURL('resourceAdminArrowUpURL')}"
+ alt="${resource.Move_up}" name="arrowup" border="0" />
+ </h:commandLink>
+ </c:otherwise>
+
+ </c:choose>
+ </li>
+
+ <li>
+ <c:choose>
+
+ <c:when test="${categoryIdx.index eq forums:collectionSize(adminPanel.categories)}">
+ <img src="${forums:themeURL('resourceAdminArrowDownDisaURL')}"
+ alt="${resource.Move_down}" name="arrowdown" border="0" />
+ </c:when>
+
+ <c:otherwise>
+ <h:commandLink action="#{adminController.moveCategoryDown}">
+ <img src="${forums:themeURL('resourceAdminArrowDownURL')}"
+ alt="${resource.Move_down}" name="arrowdown" border="0" />
+ </h:commandLink>
+ </c:otherwise>
+
+ </c:choose>
+ </li>
+
+ <li>
+ <forums:isAllowedChoose>
+
+ <forums:isAllowedWhen fragment="acl://deleteCategory" contextData="#{category}">
+ <h:outputLink value="#{forums:outputLink('/views/admin/deleteCategory.jsf',true)}">
+ <f:param name="c" value="#{category.id}"/>
+ <img src="${forums:themeURL('resourceTopicModeDeleteURL')}"
+ alt="${resource.Delete}" name="delete" border="0" />
+ </h:outputLink>
+ </forums:isAllowedWhen>
+
+ <forums:isAllowedOtherwise>
+ <img src="${forums:themeURL('resourceTopicModeDeleteDisaURL')}"
+ alt="${resource.Delete}" name="delete" border="0" />
+ </forums:isAllowedOtherwise>
+
+ </forums:isAllowedChoose>
+ </li>
+
+ <!-- TODO: Locking/Unlocking of a category needs support from database.
+ <li>
+ <a href="#">
+ <img src="images/forum_ico_adminunlock.gif"
+ alt="Unlock" name="unlock" border="0" />
+ </a>
+ </li>
+ -->
+
+ </ul>
+ </h:form>
+ </td>
+ </tr>
+ </c:otherwise>
+
+ </c:choose>
+
+
+ <!-- display the forums in this category -->
+ <c:forEach items="#{category.forums}" var="forum" varStatus="forumIdx" >
+ <forums:isAllowed fragment="acl://viewForum" contextData="#{forum}">
+ <c:choose>
+
+ <c:when test="${(adminController.editForumMode or forums:message('forumForm:Forum') ne null)
+ and adminController.selectedForum eq forum.id}" >
+ <tr class="editRow">
+ <td class="Indent">
+ <h:form id="forumForm">
+ <input type="hidden" name="f" value="#{param['f']}"/>
+ <label for="forumname">${resource.Forum_name}:</label>
+ <h:inputText id="Forum" required="true"
+ value="#{adminController.forumName}" />
+ <h:message for="Forum" styleClass="forumtitletext failuretext"/>
+ <br />
+ <label for="forumdescription">${resource.Forum_desc}:</label>
+ <h:inputTextarea rows="5" styleClass="forumdescription"
+ value="#{adminController.forumDescription}"/>
+ <br />
+ <label for="forumcategory">${resource.Forum_category}:</label>
+ <h:selectOneMenu value="#{adminController.selectedCategory}">
+ <c:forEach items="#{adminPanel.categories}" var="cat">
+ <f:selectItem itemValue="#{cat.id}" itemLabel="#{cat.title}" />
+ </c:forEach>
+ </h:selectOneMenu>
+ <br />
+ <h:commandButton id="adminbutton" value="${resource.Update}" styleClass="buttonMed"
+ action="#{adminController.editForum}"/>
+ </h:form>
+ </td>
+ <td class="forumlistlast">
+  
+ </td>
+ </tr>
+ </c:when>
+
+ <c:otherwise>
+ <tr class="evenRow">
+ <td class="Indent">
+ <strong>${forum.name}</strong>
+ <forums:isAllowed fragment="acl://editForum" contextData="#{forum}">
+ <h:form>
+ <input type="hidden" name="f" value="#{forum.id}"/>
+  ( 
+ <h:commandLink action="#{adminController.dummyAction}">
+ <f:param name="editForum" value="true"/>
+ <h:outputText value="${resource.Edit_forum}"/>
+ </h:commandLink>
+ )
+ </h:form>
+ </forums:isAllowed>
+ ${forum.description}
+ </td>
+ <td class="forumlistlast actionbuttons">
+ <h:form>
+ <input type="hidden" name="f" value="#{forum.id}"/>
+ <ul>
+ <li>
+ <c:choose>
+
+ <c:when test="${forumIdx.index eq 1}">
+ <img src="${forums:themeURL('resourceAdminArrowUpDisaURL')}"
+ alt="${resource.Move_up}" name="arrowup" border="0" />
+ </c:when>
+
+ <c:otherwise>
+ <h:commandLink action="#{adminController.moveForumUp}">
+ <img src="${forums:themeURL('resourceAdminArrowUpURL')}"
+ alt="${resource.Move_up}" name="arrowup" border="0" />
+ </h:commandLink>
+ </c:otherwise>
+
+ </c:choose>
+ </li>
+
+ <li>
+ <c:choose>
+
+ <c:when test="${forumIdx.index eq forums:collectionSize(category.forums)}">
+ <img src="${forums:themeURL('resourceAdminArrowDownDisaURL')}"
+ alt="${resource.Move_down}" name="arrowdown" border="0" />
+ </c:when>
+
+ <c:otherwise>
+ <h:commandLink action="#{adminController.moveForumDown}">
+ <img src="${forums:themeURL('resourceAdminArrowDownURL')}"
+ alt="${resource.Move_down}" name="arrowdown" border="0" />
+ </h:commandLink>
+ </c:otherwise>
+
+ </c:choose>
+ </li>
+
+ <li>
+ <forums:isAllowedChoose>
+
+ <forums:isAllowedWhen fragment="acl://deleteForum" contextData="#{forum}">
+ <h:outputLink value="#{forums:outputLink('/views/admin/deleteForum.jsf',true)}">
+ <f:param name="f" value="#{forum.id}"/>
+ <img src="${forums:themeURL('resourceTopicModeDeleteURL')}"
+ alt="${resource.Delete}" name="delete" border="0" />
+ </h:outputLink>
+ </forums:isAllowedWhen>
+
+ <forums:isAllowedOtherwise>
+ <img src="${forums:themeURL('resourceTopicModeDeleteDisaURL')}"
+ alt="${resource.Delete}" name="delete" border="0" />
+ </forums:isAllowedOtherwise>
+
+ </forums:isAllowedChoose>
+ </li>
+
+ <forums:isAllowed fragment="acl://lockForums" contextData="#{forum}" >
+ <li>
+ <c:choose>
+
+ <c:when test="#{forum.status eq forums:constantInt('FORUM_LOCKED')}">
+ <h:commandLink action="#{adminController.unlockForum}">
+ <f:param name="f" value="#{forum.id}"/>
+ <f:param name="c" value="#{category.id}"/>
+ <img src="${forums:themeURL('resourceIconUnlockURL')}" alt="${resource.Forum_unlock}" border="0"/>
+ </h:commandLink>
+ </c:when>
+
+ <c:otherwise>
+ <h:commandLink action="#{adminController.lockForum}">
+ <f:param name="f" value="#{forum.id}"/>
+ <f:param name="c" value="#{category.id}"/>
+ <img src="${forums:themeURL('resourceIconLockURL')}" alt="${resource.Forum_lock}" border="0"/>
+ </h:commandLink>
+ </c:otherwise>
+
+ </c:choose>
+ </li>
+ </forums:isAllowed>
+
+ </ul>
+ </h:form>
+ </td>
+ </tr>
+ </c:otherwise>
+
+ </c:choose>
+ </forums:isAllowed>
+ </c:forEach>
+
+ </forums:isAllowed>
+ </c:forEach>
+ </table>
+
+ <!-- Add new category button -->
+ <forums:isAllowed fragment="acl://addCategory">
+ <h:form>
+ <div class="actionbuttons">
+ <ul>
+ <li>
+ <h:commandLink action="#{adminController.addCategory}">
+ <img src="${forums:themeURL('resourceAdminNewCategoryURL')}"
+ alt="${resource.Create_category}" name="newCategory"
+ width="127" height="17" border="0" />
+ </h:commandLink>
+ </li>
+ </ul>
+ </div>
+ </h:form>
+ </forums:isAllowed>
+
<!-- integrate the jump box -->
<!--
<table cellspacing="0" cellpadding="0" border="0" align="right">
More information about the jboss-svn-commits
mailing list