profile_backbutton.naml
<override_macro name="javascript_library" requires="servlet">
<n.overridden/>
<n.comment.>
Adding "Back" Button.
</n.comment.>
<n.compress.>
$( document ).ready(function() {
var title = document.title;
var nextUrl2 = $(location).attr('href');
var res = nextUrl2.split("nextUrl=");
nextUrl2 = res[1];
if(title.search( 'Edit Personal Information' ) >= 0 )
profileLink();
if(title.search( 'Change Avatar' ) >= 0 )
profileLink();
if(title.search( 'Advanced Settings' ) >= 0 )
profileLink();
if(title.search( 'Remove Your Account' ) >= 0 )
profileLink();
if(title.search( ' Edit Signature' ) >= 0 )
profileLink();
if(title.search( ' Change User Groups' ) >= 0 )
profileLink();
function profileLink () {
console.log("one of those");
$('.breadcrumbs span').html("<a href='/template/NamlServlet.jtp?macro=user_profile&nextUrl="+nextUrl2+"' style='display:inline !important;'>Back</a>");
console.log("Setting Cookie:" + nextUrl2);
Nabble.setCookie("nextUrl12345",nextUrl2);
}
});
</n.compress.>
</override_macro>
<macro name="next_url">
<n.hide_null.get_parameter name='nextUrl' />
</macro>
<override_macro name="change_user_groups" requires="servlet">
<n.user_page.>
<n.if.not.visitor.can_manage_users_and_groups>
<then>
<n.login.><t>Only authorized users can proceed in this area.</t></n.login.>
</then>
</n.if.not.visitor.can_manage_users_and_groups>
<n.if.is_submitted_form>
<then>
<n.catch_exception. id="save-block">
<n.edit_page_user.>
<n.user_group_list.loop.group_field. group="[n.current_group/]">
<n.if.is_checked>
<then><n.add_to_group.current_group/></then>
<else><n.remove_from_group.current_group/></else>
</n.if.is_checked>
</n.user_group_list.loop.group_field.>
<n.get_parameter_values. name="newgroup">
<n.loop.>
<n.if.not.is_empty.current_parameter_value>
<then><n.add_to_group.current_parameter_value/></then>
</n.if.not.is_empty.current_parameter_value>
</n.loop.>
</n.get_parameter_values.>
</n.edit_page_user.>
<n.redirect_to.page_user.url/>
</n.catch_exception.>
</then>
</n.if.is_submitted_form>
<n.html>
<head>
<META NAME="robots" CONTENT="noindex,nofollow"/>
<n.title.><t>Change User Groups</t></n.title.>
<style type="text/css">
.title-row {
padding:.2em;
border-bottom-width:2px;
border-bottom-style:solid;
font-weight:bold;
}
</style>
</head>
<body>
<n.page_user.profile_header/>
<span style="display:none;" id="user_url"><n.page_user.url/></span>
<div class="title-row light-border-color" style="margin-top:.5em">
<t>Groups of this user</t>
</div>
<n.form.>
<table>
<n.fixed_group_row name="[n.anyone_group/]" tip="[t]All users belong to this group[/t]"/>
<n.if.page_user.is_registered>
<then><n.fixed_group_row name="[n.registered_group/]" tip="[t]Users that completed the registration process[/t]"/></then>
</n.if.page_user.is_registered>
<n.if.page_user.is_authenticated>
<then>
<n.user_group_list.loop.>
<n.group_row>
<group><n.current_group/></group>
<checked><n.page_user.is_in_group.current_group/></checked>
</n.group_row>
</n.user_group_list.loop.>
<n.empty_group_controls/>
</then>
</n.if.page_user.is_authenticated>
</table>
<n.if.page_user.is_authenticated>
<then>
<div style="margin-top:1.4em">
<input type="submit" value="[t]Save Changes[/t]" />
<t>or</t> <a href="[n.page_user.url/]"><t>Cancel</t></a>
</div>
</then>
</n.if.page_user.is_authenticated>
</n.form.>
</body>
</n.html>
</n.user_page.>
</override_macro>
<override_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/>, </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"/>
<n.if.is_empty.get_parameter name='nextUrl' >
<then>
<a id="addGroup" href="[n.local_user.change_user_groups_path/]"><t>Add / Remove Groups</t></a>
</then>
<else>
<a id="addGroup" href="[n.local_user.change_user_groups_path/]&nextUrl=[n.get_parameter name='nextUrl'/]"><t>Add / Remove Groups</t></a>
</else>
</n.if.is_empty.get_parameter>
| <a href="[n.local_user.edit_profile_path/]"><t>Edit Profile</t></a>
</div>
</then>
</n.if.visitor.is_site_admin>
</div>
</override_macro>
<override_macro name="authenticated_self_profile_header" requires="user">
<!-- Show basic profile links -->
<n.if.not.equal value1="[n.get_parameter name='macro'/]" value2="user_profile">
<then>
<div style="margin-top:.5em">
<img src="/images/tool.png" align="absmiddle" width="16" height="17" style="margin:0 1px"/>
<a id="accountSettings" href="[n.user_profile_path/]&nextUrl=[n.hide_null.get_parameter name='nextUrl'/]"><t>Account Settings</t></a>
</div>
</then>
</n.if.not.equal>
<n.if.root_node.has_sub_archive>
<then>
<div style="margin-top:.5em">
<img src="/images/icon_pending.png" class="image16" style="margin:0 1px" />
<a href="[n.pending_posts_path/]"><t>My Pending Posts</t></a>
</div>
</then>
</n.if.root_node.has_sub_archive>
<div style="margin-top:.5em">
<img src="/images/forum_sm.png" class="image16" style="margin:0 1px"/>
<a href="[n.nabble_global_apps_url/]" target="_top"><t>My Nabble Applications</t></a>
</div>
</override_macro>