Judges user group implemented

main
Inga 🏳‍🌈 14 years ago
parent 79edb756bf
commit c88473d8c6
  1. 2
      Builder/IISMainHandler/build.txt
  2. 4
      Common/dataobjects/AccountSettings.cs
  3. 2
      Common/dataobjects/Moderator.cs
  4. 1
      Common/dataobjects/UserGroup.cs
  5. 4
      static/css/global.css
  6. 4
      static/css/modern/global.css
  7. BIN
      static/images/judge.gif
  8. 3
      templates/Full/elems/Main.xslt
  9. 3
      templates/Lite/elems/Main.xslt
  10. 21
      templates/Modern/elems/Main.xslt

@ -118,9 +118,9 @@ namespace FLocal.Common.dataobjects {
} }
public bool isPostVisible(Post post) { public bool isPostVisible(Post post) {
if(post.poster.showPostsToUsers == User.ENUM_SHOWPOSTSTOUSERS_NONE) return false;
if(post.poster.showPostsToUsers == User.ENUM_SHOWPOSTSTOUSERS_PRIVELEGED) return false;
if(post.layer.name == PostLayer.NAME_HIDDEN) return false; if(post.layer.name == PostLayer.NAME_HIDDEN) return false;
if(post.poster.showPostsToUsers == User.ENUM_SHOWPOSTSTOUSERS_NONE) return false;
if(post.poster.showPostsToUsers == User.ENUM_SHOWPOSTSTOUSERS_PRIVELEGED) return this.account.user.userGroup.name == UserGroup.NAME_JUDGES || this.account.user.userGroup.name == UserGroup.NAME_ADMINISTRATORS;
return true; return true;
} }

@ -78,7 +78,7 @@ namespace FLocal.Common.dataobjects {
//slight optimisation... //slight optimisation...
if(board.administratorId == account.id) return true; if(board.administratorId == account.id) return true;
UserGroup group = account.user.userGroup; UserGroup group = account.user.userGroup;
if(group.name != UserGroup.NAME_ADMINISTRATORS && group.name != UserGroup.NAME_MODERATORS) return false; if(group.name != UserGroup.NAME_ADMINISTRATORS && group.name != UserGroup.NAME_MODERATORS && group.name != UserGroup.NAME_JUDGES) return false;
if(!isModerator_cache.ContainsKey(account.id) || !isModerator_cache[account.id].ContainsKey(board.id)) { if(!isModerator_cache.ContainsKey(account.id) || !isModerator_cache[account.id].ContainsKey(board.id)) {
lock(isModerator_cache) { lock(isModerator_cache) {

@ -11,6 +11,7 @@ namespace FLocal.Common.dataobjects {
public class UserGroup : SqlObject<UserGroup> { public class UserGroup : SqlObject<UserGroup> {
public const string NAME_MODERATORS = "Moderators"; public const string NAME_MODERATORS = "Moderators";
public const string NAME_JUDGES = "Judges";
public const string NAME_ADMINISTRATORS = "Administrators"; public const string NAME_ADMINISTRATORS = "Administrators";
public class TableSpec : ISqlObjectTableSpec { public class TableSpec : ISqlObjectTableSpec {

@ -103,6 +103,10 @@ pre
.UG_Administrators { .UG_Administrators {
color:black !important; color:black !important;
} }
.UG_Judges {
color:black !important;
background-color: white !important;
}
p { p {
margin:0em; margin:0em;
} }

@ -99,6 +99,10 @@ pre
.UG_Administrators { .UG_Administrators {
color:black !important; color:black !important;
} }
.UG_Judges {
color:black !important;
background-color:white !important;
}
p { p {
margin:0em; margin:0em;
} }

Binary file not shown.

After

Width:  |  Height:  |  Size: 861 B

@ -250,6 +250,9 @@
</xsl:attribute> </xsl:attribute>
<xsl:attribute name="href">/Users/User/<xsl:value-of select="id"/>/Info/</xsl:attribute> <xsl:attribute name="href">/Users/User/<xsl:value-of select="id"/>/Info/</xsl:attribute>
<xsl:value-of select="name"/> <xsl:value-of select="name"/>
<xsl:if test="group/name='Judges'">
<img src="/static/images/judge.gif" border="0"/>
</xsl:if>
<xsl:choose> <xsl:choose>
<xsl:when test="isAdministrator='true'"> <xsl:when test="isAdministrator='true'">
<img src="/static/images/adm.gif" border="0"/> <img src="/static/images/adm.gif" border="0"/>

@ -234,6 +234,9 @@
<xsl:attribute name="href">/Users/User/<xsl:value-of select="id"/>/Info/</xsl:attribute> <xsl:attribute name="href">/Users/User/<xsl:value-of select="id"/>/Info/</xsl:attribute>
<xsl:value-of select="name"/> <xsl:value-of select="name"/>
</a> </a>
<xsl:if test="group/name='Judges'">
<xsl:text>^J</xsl:text>
</xsl:if>
<xsl:choose> <xsl:choose>
<xsl:when test="isAdministrator='true'"> <xsl:when test="isAdministrator='true'">
<xsl:text>^A</xsl:text> <xsl:text>^A</xsl:text>

@ -304,24 +304,9 @@
</xsl:attribute> </xsl:attribute>
<xsl:attribute name="href">/Users/User/<xsl:value-of select="id"/>/Info/</xsl:attribute> <xsl:attribute name="href">/Users/User/<xsl:value-of select="id"/>/Info/</xsl:attribute>
<xsl:value-of select="name"/> <xsl:value-of select="name"/>
<xsl:choose> <xsl:if test="group/name='Judges'">
<xsl:when test="isAdministrator='true'"> <img src="/static/images/judge.gif" alt="Judge" border="0"/>
<img src="/static/images/adm.gif" alt="Administrator" border="0"/> </xsl:if>
</xsl:when>
<xsl:when test="isModerator='true'">
<img src="/static/images/mod.gif" alt="Moderator" border="0"/>
</xsl:when>
</xsl:choose>
</a>
</xsl:template>
<xsl:template match="user" mode="userNick">
<a nobr="nobr">
<xsl:attribute name="class">
<xsl:text>separate </xsl:text>
<xsl:text>UG_</xsl:text><xsl:value-of select="group/name"/>
</xsl:attribute>
<xsl:value-of select="name"/>
<xsl:choose> <xsl:choose>
<xsl:when test="isAdministrator='true'"> <xsl:when test="isAdministrator='true'">
<img src="/static/images/adm.gif" alt="Administrator" border="0"/> <img src="/static/images/adm.gif" alt="Administrator" border="0"/>

Loading…
Cancel
Save