Login  Register

Re: Really need some more Admin capabilities

Posted by Pedro on Feb 17, 2014; 6:18pm
URL: https://support.nabble.com/Really-need-some-more-Admin-capabilities-tp7589349p7589448.html

We can do it like we've done before:
<override_macro name="user_nodes" requires="servlet">
    <n.user_page.>
        <n.html>
            <head>
                <n.user_nodes_meta/>
                <n.title.>
                    <t>Profile of <t.author.page_user.name/></t>
                    <n.hide_if_equals. value1="[n.user_nodes_page_number/]" value2="1">
                        | <t>Page <t.number.user_nodes_page_number/></t>
                    </n.hide_if_equals.>
                </n.title.>
                <style type="text/css">
                    table.nodes {
                        width:100%;
                        border-collapse:collapse;
                    }
                    table.nodes td {
                        padding:.3em;
                    }
                    table.nodes td.header {
                        padding: .2em;
                        font-weight:bold;
                    }
                    div.table-title {
                        font-weight:bold;
                        font-size:120%;
                        margin: 1em .1em 1em;
                    }
                </style>
            </head>
            <body>
                <n.page_user.profile_header/>

                <n.user_nodes_search_box/>
                
                <n.if.visitor.is_site_admin>
                    <then>
                        <n.root_node.descendant_apps_list.>
                            <n.loop.>       
                                <br/>Edit Subscription inside: <a href="/template/NamlServlet.jtp?macro=subscribe_user&node=[n.current_node.id/]&user=[n.page_user.id/]"><t><n.current_node.subject/></t></a>
                                <n.set_local_subscription.current_node.subscription_for email="[n.page_user.user_email/]" />                                
                                <n.if.local_subscription.is_subscribed>
                                    <then>
                                        <n.local_subscription.to/>
                                        <n.local_subscription.type/>
                                    </then>
                                    <else>Not subscribed.</else>                                    
                                </n.if.local_subscription.is_subscribed>
                            </n.loop.>
                        </n.root_node.descendant_apps_list.>
                    </then>
                </n.if.visitor.is_site_admin>
                
                
                <!-- If this is the profile of the visitor -->
                <n.if.visitor.equals.page_user>
                    <then>
                        <n.horizontal_tab_control.>
                            <n.add_horizontal_tab url="[n.starred_nodes_path/]" text="[n.small_star_icon/] [t]Stars in [t.location.root_node.subject/][/t]" selected="false" details=""/>
                            <n.add_horizontal_tab url="" text="[t]Posts in [t.location.root_node.subject/][/t]" selected="true" details=""/>
                        </n.horizontal_tab_control.>
                    </then>
                    <else>
                        <div class="second-font table-title">
                            <t>Posts in <t.location.root_node.subject/></t>
                        </div>
                    </else>
                </n.if.visitor.equals.page_user>

                <n.user_nodes_table.>
                    <n.date_column width="7em"/>
                    <n.subject_column/>
                    <n.count_column/>
                    <n.location_column/>
                </n.user_nodes_table.>
            </body>
        </n.html>
    </n.user_page.>
</override_macro>
Here, you will see the "raw" subscription type. We can format that if you need.
My test forum.