list_current_groups

NAML documentation   Watch a video
   Usages of this macro
... in profile_backbutton.naml
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
<override_macro name="list_current_groups" requires="user">
    <!-- List the groups of the user-->
    <n.set_local_user
Macro
Parameters: user
.this_user
Binary
Namespace: UserNamespace
Parameters: do
 />
    <div style="margin-top:.4em">
        <strong><t>Groups</t>:</strong>
        <n.local_user
Macro
Parameters: do
.groups
Binary
Namespace: UserNamespace
Parameters: do
.>
            <n.sort
Binary
Namespace: StringList
/>
            <n.loop
Macro
Requires: sequence
Parameters: by, do
.>
                <n.if
Binary
Namespace: BasicNamespace
Parameters: condition, else, then
.has_more_elements
Binary
Namespace: ListSequence
Parameters: n
>
                    <then><n.current_group
Binary
Namespace: GroupList
/>,&nbsp;</then>
                    <else><n.current_group
Binary
Namespace: GroupList
/></else>
                </n.if.has_more_elements>
            </n.loop.>
        </n.local_user.groups.>
        <n.if
Binary
Namespace: BasicNamespace
Parameters: condition, else, then
.visitor
Binary
Namespace: ServletNamespace
Parameters: do
.is_site_admin
Macro
Requires: user
>
            <then>
                <div style="margin-top:.3em">
                    <img src="/images/user_group.png" align="absmiddle" width="18" height="16"/>
                    
                    <n.if
Binary
Namespace: BasicNamespace
Parameters: condition, else, then
.is_empty
Binary
Namespace: BasicNamespace
Parameters: value
.get_parameter
Binary
Namespace: RequestNamespace
Parameters: name
 name='nextUrl' >
                        <then>                    
                            <a id="addGroup" href="[n.local_user
Macro
Parameters: do
.change_user_groups_path
Macro
Requires: user
/]"><t>Add / Remove Groups</t></a>
                        </then>
                        <else>                    
                            <a id="addGroup" href="[n.local_user
Macro
Parameters: do
.change_user_groups_path
Macro
Requires: user
/]&nextUrl=[n.get_parameter
Binary
Namespace: RequestNamespace
Parameters: name
 name='nextUrl'/]"><t>Add / Remove Groups</t></a>
                        </else>
                    </n.if.is_empty.get_parameter>
                    | <a href="[n.local_user
Macro
Parameters: do
.edit_profile_path
Macro
Requires: user
/]"><t>Edit Profile</t></a>                                        
                </div>
            </then>
        </n.if.visitor.is_site_admin>
    </div>    
</override_macro>
Overrides default macro
... in user_profile.naml
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
<macro name="list_current_groups" requires="user">
    <!-- List the groups of the user-->
    <n.set_local_user.this_user />
    <div style="margin-top:.4em">
        <strong><t>Groups</t>:</strong>
        <n.local_user.groups.>
            <n.sort/>
            <n.loop.>
                <n.if.has_more_elements>
                    <then><n.current_group/>,&nbsp;</then>
                    <else><n.current_group/></else>
                </n.if.has_more_elements>
            </n.loop.>
        </n.local_user.groups.>
        <n.if.visitor.is_site_admin>
            <then>
                <div style="margin-top:.3em">
                    <img src="/images/user_group.png" align="absmiddle" width="18" height="16"/>
                    <a href="[n.local_user.change_user_groups_path/]"><t>Add / Remove Groups</t></a>
                    | <a href="[n.local_user.edit_profile_path/]"><t>Edit Profile</t></a>
                </div>
            </then>
        </n.if.visitor.is_site_admin>
    </div>
</macro>