<commit_before><?xml version="1.0" encoding="UTF-8"?>
<!--
  Copyright 1999-2004 The Apache Software Foundation

  Licensed under the Apache License, Version 2.0 (the "License");
  you may not use this file except in compliance with the License.
  You may obtain a copy of the License at

      http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
-->

<!-- $Id$ -->

<xsl:stylesheet
    version="1.0"
    xmlns="http://www.w3.org/1999/xhtml"
    xmlns:i18n="http://apache.org/cocoon/i18n/2.1"
    xmlns:page="http://apache.org/cocoon/lenya/cms-page/1.0"
    xmlns:session="http://www.apache.org/xsp/session/2.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    >
    
  <xsl:output encoding="UTF-8" indent="yes" version="1.0"/>
  
  
  <xsl:template match="/">
    <xsl:apply-templates/>
  </xsl:template>
  
  
  <xsl:template match="page">
    <page:page>
      <page:title><i18n:text>User Administration</i18n:text></page:title>
      <page:body>
        <xsl:apply-templates/>
      </page:body>
    </page:page>
  </xsl:template>
  
  
  <xsl:template match="users">
    <div style="margin: 10px 0px">
      <xsl:call-template name="add-user"/>
    </div>
    <table cellspacing="0" class="lenya-table">
      <tr>
        <th><i18n:text>User ID</i18n:text></th>
        <th><i18n:text>Full Name</i18n:text></th>
        <th><i18n:text>Groups</i18n:text></th>
        <th></th>
      </tr>
      <xsl:apply-templates select="user">
        <xsl:sort select="id"/>
      </xsl:apply-templates>
    </table>
  </xsl:template>
  
  
  <xsl:template match="user">
    <tr>
      <td style="vertical-align: middle">
        <a href="users/{id}.html"><xsl:value-of select="id"/></a>
      </td>
      <td style="vertical-align: middle">
        <xsl:value-of select="name"/>
      </td>
      <xsl:apply-templates select="groups"/>
      <td style="vertical-align: middle">
        <form method="GET">
          <input type="hidden" name="lenya.usecase" value="userDeleteUser"/>
          <input name="user-id" type="hidden" value="{id}"/>
          <input i18n:attr="value" type="submit" value="Delete">
            <xsl:if test="@deletable = 'false'">
              <xsl:attribute name="disabled">disabled</xsl:attribute>
            </xsl:if>
          </input>
        </form>
      </td>
    </tr>
  </xsl:template>
  
  
  <xsl:template match="groups">
   <td style="vertical-align: middle">
      <xsl:apply-templates select="group"/>
    </td>
  </xsl:template>
  
  
  <xsl:template match="group">
    <a href="groups/{@id}.html"><xsl:value-of select="@id"/></a>
    <xsl:if test="position() != last()">, <xsl:text/>
    </xsl:if>
  </xsl:template>
  
  
  <xsl:template name="add-user">
    <table class="lenya-table-noborder">
  	  <tr>
	    <td>
  		  <i18n:text>Add User</i18n:text>:&#160;
	    </td>
	    <xsl:for-each select="types/type">
	      <td>
	        <form method="GET">
            <input type="hidden" name="lenya.usecase" value="addUser"/>
            <input type="hidden" name="className" value="{@class-name}"/>
            <input type="hidden" name="userType" value="{normalize-space(.)}"/>
            <input i18n:attr="value" type="submit" value="{normalize-space(.)}"/>
          </form>
	      </td>
	    </xsl:for-each>
      </tr>
    </table>
  </xsl:template>
  
  
</xsl:stylesheet><commit_msg>re-organized admin usecases<commit_after><?xml version="1.0" encoding="UTF-8"?>
<!--
  Copyright 1999-2004 The Apache Software Foundation

  Licensed under the Apache License, Version 2.0 (the "License");
  you may not use this file except in compliance with the License.
  You may obtain a copy of the License at

      http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
-->

<!-- $Id$ -->

<xsl:stylesheet
    version="1.0"
    xmlns="http://www.w3.org/1999/xhtml"
    xmlns:i18n="http://apache.org/cocoon/i18n/2.1"
    xmlns:page="http://apache.org/cocoon/lenya/cms-page/1.0"
    xmlns:session="http://www.apache.org/xsp/session/2.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    >
    
  <xsl:output encoding="UTF-8" indent="yes" version="1.0"/>
  
  
  <xsl:template match="/">
    <xsl:apply-templates/>
  </xsl:template>
  
  
  <xsl:template match="page">
    <page:page>
      <page:title><i18n:text>User Administration</i18n:text></page:title>
      <page:body>
        <xsl:apply-templates/>
      </page:body>
    </page:page>
  </xsl:template>
  
  
  <xsl:template match="users">
    <div style="margin: 10px 0px">
      <xsl:call-template name="add-user"/>
    </div>
    <table cellspacing="0" class="lenya-table">
      <tr>
        <th><i18n:text>User ID</i18n:text></th>
        <th><i18n:text>Full Name</i18n:text></th>
        <th><i18n:text>Groups</i18n:text></th>
        <th></th>
      </tr>
      <xsl:apply-templates select="user">
        <xsl:sort select="id"/>
      </xsl:apply-templates>
    </table>
  </xsl:template>
  
  
  <xsl:template match="user">
    <tr>
      <td style="vertical-align: middle">
        <a href="users/{id}.html"><xsl:value-of select="id"/></a>
      </td>
      <td style="vertical-align: middle">
        <xsl:value-of select="name"/>
      </td>
      <xsl:apply-templates select="groups"/>
      <td style="vertical-align: middle">
        <form method="GET">
          <input type="hidden" name="lenya.usecase" value="userDeleteUser"/>
          <input name="user-id" type="hidden" value="{id}"/>
          <input i18n:attr="value" type="submit" value="Delete">
            <xsl:if test="@deletable = 'false'">
              <xsl:attribute name="disabled">disabled</xsl:attribute>
            </xsl:if>
          </input>
        </form>
      </td>
    </tr>
  </xsl:template>
  
  
  <xsl:template match="groups">
   <td style="vertical-align: middle">
      <xsl:apply-templates select="group"/>
    </td>
  </xsl:template>
  
  
  <xsl:template match="group">
    <a href="groups/{@id}.html"><xsl:value-of select="@id"/></a>
    <xsl:if test="position() != last()">, <xsl:text/>
    </xsl:if>
  </xsl:template>
  
  
  <xsl:template name="add-user">
    <table class="lenya-table-noborder">
  	  <tr>
	    <td>
  		  <i18n:text>Add User</i18n:text>:&#160;
	    </td>
	    <xsl:for-each select="types/type">
	      <td>
	        <form method="GET">
            <input type="hidden" name="lenya.usecase" value="admin.addUser"/>
            <input type="hidden" name="className" value="{@class-name}"/>
            <input type="hidden" name="userType" value="{normalize-space(.)}"/>
            <input i18n:attr="value" type="submit" value="{normalize-space(.)}"/>
          </form>
	      </td>
	    </xsl:for-each>
      </tr>
    </table>
  </xsl:template>
  
  
</xsl:stylesheet>
{'fraction_non_alphanumeric': 0.18562055768179334, 'fraction_numerical': 0.019409513395297978, 'mean_word_length': 2.7198779867819014, 'pattern_counts': {'":': 0, '<': 211, '<?xml version=': 2, '>': 211, 'https://': 0, 'lorem ipsum': 0, 'www.': 8, 'xml': 12}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6261102', 'n_tokens_mistral': 2654, 'n_tokens_neox': 2473, 'n_words': 487}