From 8b40695626af031cd7a1c560d52d312647f5f073 Mon Sep 17 00:00:00 2001 From: "Eric J. Bowersox" Date: Wed, 25 Jun 2003 03:44:10 +0000 Subject: [PATCH] fixed up community profile - some of the features from the origina weren't in there yet --- venice-data/scripts/comm/profile.js | 13 +++++++++- venice-data/velocity/comm/profile.vm | 39 ++++++++++++++++++---------- 2 files changed, 38 insertions(+), 14 deletions(-) diff --git a/venice-data/scripts/comm/profile.js b/venice-data/scripts/comm/profile.js index 8918a42..24cdb63 100644 --- a/venice-data/scripts/comm/profile.js +++ b/venice-data/scripts/comm/profile.js @@ -53,16 +53,27 @@ if (logo_url==null) rc.setParameter("logo",logorender.getRenderingObject(logo_url)); +// Get the community type. +tmp = cast.toInteger(comm.getObject(VeniceNamespaces.COMMUNITY_SECURITY_NAMESPACE,"type.hint")); +if (tmp==0) + rc.setParameter("type","Public Community"); +else if (tmp==1) + rc.setParameter("type","Private Community"); +else if (tmp==2) + rc.setParameter("type","Invitation-Only Community"); + // Get the "use category" flag. opts = cast.toOptionSet(globals.getObject(VeniceNamespaces.COMMUNITY_GLOBALS_NAMESPACE,"options")); if (opts.get(0)) - rc.setParameter("use_category",Boolean.TRUE); + rc.setParameter("category",comm.category); // Set the parameters that correspond to single properties. rc.setParameter("synopsis",PropertyUtils.getPropertyNoErr(comm,VeniceNamespaces.COMMUNITY_PROFILE_NAMESPACE, "synopsis")); rc.setParameter("rules",PropertyUtils.getPropertyNoErr(comm,VeniceNamespaces.COMMUNITY_PROFILE_NAMESPACE,"rules")); rc.setParameter("language",comm.getObject(VeniceNamespaces.COMMUNITY_PROFILE_NAMESPACE,"language")); +rc.setParameter("homepage",PropertyUtils.getPropertyNoErr(comm,VeniceNamespaces.COMMUNITY_PROFILE_NAMESPACE, + "url.homepage")); // Fill in the location list. locs = new ArrayList(); diff --git a/venice-data/velocity/comm/profile.vm b/venice-data/velocity/comm/profile.vm index 678dd89..6cf7e13 100644 --- a/venice-data/velocity/comm/profile.vm +++ b/venice-data/velocity/comm/profile.vm @@ -17,13 +17,15 @@ *# #* Parameters: - community = Community we're displaying the profile of. - logo = Community logo renderable object. - use_category = True (set) if we're using categories on this server. - synopsis = Community synopsis. - location = List of strings containing location information - language = Primary language for community (a com.silverwrist.util.Language object) - rules = Community rules/standards of conduct + community = Community we're displaying the profile of. + logo = Community logo renderable object. + type = Community type description. + category = The community's category, if we're using categories on this server. + synopsis = Community synopsis. + location = List of strings containing location information + language = Primary language for community (a com.silverwrist.util.Language object) + rules = Community rules/standards of conduct + homepage = Community home page *# #comment( "Profile for community #${community.getCID()}" ) #header2( "Community Profile:" "${community.Name}" ) @@ -42,15 +44,21 @@ - TODO: Type of Community - #if( $use_category ) - #set( $c = $community.CategoryID ) + $!type + #if( $category ) + #set( $limit = $category.getNumLevels() - 1 )
Category: - #encodeHTML( $community.Category.toString() ) + #foreach( $i in [0..$limit] ) + #if( $i > 0 ): #end + #set( $c = $category.getIDAtLevel($i) ) + #encodeHTML( $category.getTitleAtLevel($i) ) + #end + #end + #if( $synopsis ) +

#encodeHTML( $synopsis )

#end #set( $u = $community.HostUser.Name )

Host: #encodeHTML( $u )

-

#encodeHTML( $synopsis )

Location:
#if( $location ) @@ -60,6 +68,11 @@ #end

Primary Language: #encodeHTML( $language.Name )

-

Standards of Conduct: #encodeHTML( $rules )

+ #if( $rules ) +

Standards of Conduct: #encodeHTML( $rules )

+ #end + #if( $homepage ) +

Home Page: #encodeHTML( $homepage )

+ #end