%TMPL:INCLUDE{"view"}%

%TMPL:DEF{"content"}%<div class="foswikiTopicText">
---+!! %NOP%%TOPIC%
%TEXT%
---++ %MAKETEXT{"Members"}%
%INCLUDE{"%USERSWEB%.GroupViewTemplate"
         section="rendergroup"
         groupname="%TOPIC%"
         twisty="on"
         twistyalign="left"
       }%

*%MAKETEXT{"Related topics:"}%* [[%SYSTEMWEB%.AccessControl][AccessControl]], [[%USERSWEB%.WikiGroups][WikiGroups]]

#TopicEnd
</div>%TMPL:END%

%TMPL:DEF{"topicactionbuttons__"}%%TMPL:END%

%TMPL:DEF{Named_sections_for_INCLUDE}%
---++ Named INCLUDE sections for use in both Group topics and the WikiGroups list
<verbatim>
<!--
  parameters: groupname, twisty
-->
%STARTSECTION{"rendergroup"}%<!-- rendergroup -->
%GROUPINFO{"%groupname%" expand="0"
  format="$percntIF{\"not istopic '%USERSWEB%.$wikiname'\" then=\"<nop>\"}$percnt$wikiname" 
  separator=", "
  zeroresults="%MAKETEXT{"no members"}%"
}%<!-- list of members// -->
%INCLUDE{"%WEB%.%TOPIC%"
  section="%IF{
    "istopic '%USERSWEB%.%groupname%' AND 
     '%groupname%' != 'NobodyGroup' AND
     '%maint%' != 'off' AND
     '%USERSWEB%.%groupname%' allows 'change'
    " 
    then="changegroup%IF{"'%twisty%' = 'off'" then="notwisty"}%" 
    else="nochange"
  }%"
  groupname="%groupname%"
}% 
<p class='foswikiClear' />
<!-- //rendergroup -->%ENDSECTION{"rendergroup"}%
</verbatim>

<verbatim>
<!--
  parameters: username, groupname
-->
%STARTSECTION{"nochange"}%<!-- nochange // -->%ENDSECTION{"nochange"}%
</verbatim>

<verbatim>
<!--
  parameters: groupname
-->
%STARTSECTION{"changegroupnotwisty"}%<!-- changegroupnotwisty -->
%IF{"'%BASEWEB%.%BASETOPIC%'='%USERSWEB%.%groupname%'"
then='
---++ %MAKETEXT{"Administration"}%
'}%
%INCLUDE{"%WEB%.%TOPIC%"
  section="group_add"
  groupname="%groupname%"
}%
%INCLUDE{"%WEB%.%TOPIC%"
  section="group_remove"
  groupname="%groupname%"
}%
<!-- //changegroupnotwisty -->%ENDSECTION{"changegroupnotwisty"}%
</verbatim>


<verbatim>
<!--
  parameters: groupname
-->
%STARTSECTION{"changegroup"}%<!-- changegroup -->
<div class="%IF{"'%twistyalign%' != 'left'" then="foswikiRight"}%">
%IF{"'%BASEWEB%.%BASETOPIC%'='%USERSWEB%.%groupname%'"
then='
---++ %MAKETEXT{"Administration"}%
'}%<!-- -->
%TWISTYBUTTON{
  id="%groupname%_add"
  link="<img src='%ICONURLPATH{"useradd"}%' alt='%MAKETEXT{"Add member..."}%' title='%MAKETEXT{"Add member..."}%' /> %MAKETEXT{"Add member..."}%"
}% %TWISTYBUTTON{
  id="%groupname%_remove"
  link="<img src='%ICONURLPATH{"userdelete"}%' alt='%MAKETEXT{"Remove member..."}%' title='%MAKETEXT{"Remove member..."}%' /> %MAKETEXT{"Remove member..."}%"
}%
</div>
<p class="foswikiClear" />
%INCLUDE{"%WEB%.%TOPIC%"
  section="%IF{"
    istopic '%USERSWEB%.%groupname%' AND 
    not ( '%USERSWEB%.%groupname%'/preferences[name='VIEW_TEMPLATE'].value = 'GroupView' )
  " 
  then="group_upgrade"
  else="nochange" 
}%"
  groupname="%groupname%"
}%
%TWISTYTOGGLE{id="%groupname%_add" mode="div"}%
%INCLUDE{"%WEB%.%TOPIC%"
  section="group_add"
  groupname="%groupname%"
}%
%ENDTWISTYTOGGLE%
%TWISTYTOGGLE{id="%groupname%_remove" mode="div"}%
%INCLUDE{"%WEB%.%TOPIC%"
  section="group_remove"
  groupname="%groupname%"
  mode="div"
}%
%ENDTWISTYTOGGLE%
<!-- //changegroup -->%ENDSECTION{"changegroup"}%
</verbatim>

<verbatim>
<!--
  parameters: groupname
-->
%STARTSECTION{"group_upgrade"}%<!-- group_upgrade -->
<sticky>
<form action="%SCRIPTURLPATH{"manage"}%/%WEB%/%TOPIC%" method="post">
  <input type="hidden" name="groupname" value="%groupname%"/>
  <input type="hidden" name="action" value="addUserToGroup"/>
  <input type="hidden" name="create" value="1"/>
  <input class="foswikiButton" type="submit" value="%MAKETEXT{"Upgrade group topic"}%" />
</form>

<div class="foswikiGrayText">
%ICON{"info"}% %MAKETEXT{"Upgrade will adjust the format of this group topic to the new format with user management options"}%
</div></sticky>
<!-- //group_upgrade -->%ENDSECTION{"group_upgrade"}%
</verbatim><verbatim>
<!--
  parameters: groupname
-->
%STARTSECTION{"group_add"}%<!-- group_add --><sticky>
<form action="%SCRIPTURLPATH{"manage"}%/%WEB%/%TOPIC%" method="POST"> 
<input type="hidden" name="groupname" value="%groupname%"/> 
<input type="hidden" name="action" value="addUserToGroup"/>
<div class='foswikiFormSteps'>
  <div class='foswikiFormStep foswikiLast'>
     <h3>%MAKETEXT{"Add a user or group to this group"}%</h3>
%JQREQUIRE{"autocomplete"}%
     <input type="text" name="username" value="" size="40" class="foswikiInputField foswikiDefaultText" title="%MAKETEXT{Name of user}%" autocomplete="%SCRIPTURL{"view"}%/%SYSTEMWEB%/JQueryAjaxHelper?section=user;skin=text;baseweb=%BASEWEB%;%IF{"defined EXCLUDE" then="exclude=%EXCLUDE%"}%"/> <input class="foswikiSubmit" type="submit" value="%MAKETEXT{"Add member"}%" />
  </div>
</div>
</form></sticky>
<!-- //group_add -->%ENDSECTION{"group_add"}%
</verbatim>

<verbatim>
<!--
  parameters: groupname
-->
%STARTSECTION{"group_remove"}%<!-- group_remove -->
%GROUPINFO{
   "%groupname%" expand="0"
   header="<form action='%SCRIPTURLPATH{"manage"}%/%WEB%/%TOPIC%' method='POST' >
     <input type='hidden' name='groupname' value='%groupname%' />
     <input type='hidden' name='action' value='removeUserFromGroup' />
     <div class='foswikiFormSteps'>
     <div class='foswikiFormStep foswikiLast'>
     <h3>%MAKETEXT{"Remove members from this group"}%</h3>$n"
   format="<label style='display:block'>
      <input type='checkbox' name='username' value='$wikiname' /> <nop>$wikiname
      </label>"
   footer="<input type='submit' class='foswikiSubmit' value='%MAKETEXT{"Remove selected members"}%' />
      </div>
      </form>
      </div>"
   separator="$n"
}%
<!-- //group_remove -->%ENDSECTION{"group_remove"}%
</verbatim>

%TMPL:END%

%META:PREFERENCE{name="VIEW_TEMPLATE" title="VIEW_TEMPLATE" type="Set" value="SkinTemplateView"}%
