'generates content in <div class="rightbox">'

def rightbox(self):

    ps = PaneStack(css_class='spacer')
    if self.searchbox:
        ps.append(SearchForm())
    sidebar_message = g.live_config.get('sidebar_message')
    if (sidebar_message and isinstance(c.site, DefaultSR)):
        ps.append(SidebarMessage(sidebar_message[0]))
    gold_sidebar_message = g.live_config.get('gold_sidebar_message')
    if (c.user_is_loggedin and c.user.gold and gold_sidebar_message and isinstance(c.site, DefaultSR)):
        ps.append(SidebarMessage(gold_sidebar_message[0], extra_class='gold'))
    if ((not c.user_is_loggedin) and self.loginbox and (not g.read_only_mode)):
        ps.append(LoginFormWide())
    if (isinstance(c.site, DomainSR) and c.user_is_admin):
        from r2.lib.pages.admin_pages import AdminNotesSidebar
        notebar = AdminNotesSidebar('domain', c.site.domain)
        ps.append(notebar)
    if (isinstance(c.site, Subreddit) and c.user_is_admin):
        from r2.lib.pages.admin_pages import AdminNotesSidebar
        notebar = AdminNotesSidebar('subreddit', c.site.name)
        ps.append(notebar)
    if ((not c.user.pref_hide_ads) or (not c.user.gold)):
        ps.append(SponsorshipBox())
    if (isinstance(c.site, Filtered) and (not (isinstance(c.site, AllSR) and (not c.user.gold)))):
        ps.append(FilteredInfoBar())
    elif isinstance(c.site, AllSR):
        ps.append(AllInfoBar(c.site, c.user))
    elif isinstance(c.site, ModSR):
        ps.append(ModSRInfoBar())
    if isinstance(c.site, (MultiReddit, ModSR)):
        srs = Subreddit._byID(c.site.sr_ids, data=True, return_dict=False, stale=True)
        if (srs and c.user_is_loggedin and (c.user_is_admin or c.site.is_moderator(c.user))):
            ps.append(self.sr_admin_menu())
        if isinstance(c.site, LabeledMulti):
            ps.append(MultiInfoBar(c.site, srs, c.user))
            c.js_preload.set_wrapped(('/api/multi/%s' % c.site.path.lstrip('/')), c.site)
        elif srs:
            if isinstance(c.site, ModSR):
                box = SubscriptionBox(srs, multi_text=strings.mod_multi)
            else:
                box = SubscriptionBox(srs)
            ps.append(SideContentBox(_('these    subreddits'), [box]))
    user_banned = (c.user_is_loggedin and c.site.is_banned(c.user))
    if (self.submit_box and (c.user_is_loggedin or (not g.read_only_mode)) and (not user_banned)):
        if ((not isinstance(c.site, FakeSubreddit)) and (c.site.type in ('archived', 'restricted', 'gold_restricted')) and (not (c.user_is_loggedin and c.site.can_submit(c.user)))):
            if (c.site.type == 'archived'):
                subtitle = _('this    subreddit    is    archived    and    no    longer    accepting    submissions.')
                ps.append(SideBox(title=_('Submissions    disabled'), css_class='submit', disabled=True, subtitles=[subtitle], show_icon=False))
            else:
                if (c.site.type == 'restricted'):
                    subtitle = _('Only    approved    users    may    post    in    this    community.')
                elif (c.site.type == 'gold_restricted'):
                    subtitle = _('Anyone    can    view    or    comment,    but    only    Reddit    Gold    members    can    post    in    this    community.')
                ps.append(SideBox(title=_('Submissions    restricted'), css_class='submit', disabled=True, subtitles=[subtitle], show_icon=False))
        else:
            fake_sub = isinstance(c.site, FakeSubreddit)
            is_multi = isinstance(c.site, MultiReddit)
            mod_link_override = mod_self_override = False
            if isinstance(c.site, FakeSubreddit):
                submit_buttons = set(('link', 'self'))
            else:
                submit_buttons = c.site.allowed_types
                if c.user_is_loggedin:
                    if (('link' not in submit_buttons) and c.site.can_submit_link(c.user)):
                        submit_buttons.add('link')
                        mod_link_override = True
                    if (('self' not in submit_buttons) and c.site.can_submit_text(c.user)):
                        submit_buttons.add('self')
                        mod_self_override = True
            if ('link' in submit_buttons):
                css_class = 'submit    submit-link'
                if mod_link_override:
                    css_class += '    mod-override'
                data_attrs = {'type': 'subreddit', 'event-action': 'submit', 'event-detail': 'link'}
                ps.append(SideBox(title=(c.site.submit_link_label or strings.submit_link_label), css_class=css_class, link='/submit', sr_path=((not fake_sub) or is_multi), data_attrs=data_attrs, show_cover=True))
            if ('self' in submit_buttons):
                css_class = 'submit    submit-text'
                if mod_self_override:
                    css_class += '    mod-override'
                data_attrs = {'type': 'subreddit', 'event-action': 'submit', 'event-detail': 'self'}
                ps.append(SideBox(title=(c.site.submit_text_label or strings.submit_text_label), css_class=css_class, link='/submit?selftext=true', sr_path=((not fake_sub) or is_multi), data_attrs=data_attrs, show_cover=True))
    no_ads_yet = True
    user_disabled_ads = (c.user.gold and c.user.pref_hide_ads)
    show_adbox = (c.site.allow_ads and (not (user_disabled_ads or g.disable_ads)))
    if (not isinstance(c.site, FakeSubreddit)):
        ps.append(SubredditInfoBar())
        moderator = (c.user_is_loggedin and (c.user_is_admin or c.site.is_moderator(c.user)))
        wiki_moderator = (c.user_is_loggedin and (c.user_is_admin or c.site.is_moderator_with_perms(c.user, 'wiki')))
        if self.show_wiki_actions:
            menu = self.wiki_actions_menu(moderator=wiki_moderator)
            ps.append(menu)
        if moderator:
            ps.append(self.sr_admin_menu())
        if show_adbox:
            ps.append(Ads())
        no_ads_yet = False
    elif self.show_wiki_actions:
        ps.append(self.wiki_actions_menu())
    if (self.create_reddit_box and c.user_is_loggedin):
        if ((c.user._age.days >= g.min_membership_create_community) and c.user.can_create_subreddit):
            subtitles = get_funny_translated_string('create_subreddit', 2)
            data_attrs = {'event-action': 'createsubreddit'}
            ps.append(SideBox(_('Create    your    own    subreddit'), '/subreddits/create', 'create', subtitles=subtitles, data_attrs=data_attrs, show_cover=True))
    if c.default_sr:
        hook = hooks.get_hook('home.add_sidebox')
        extra_sidebox = hook.call_until_return()
        if extra_sidebox:
            ps.append(extra_sidebox)
    if (not isinstance(c.site, FakeSubreddit)):
        moderator_ids = c.site.moderator_ids()
        if moderator_ids:
            sidebar_list_length = 10
            allow_stale = ((not c.user_is_loggedin) or (c.user._id not in moderator_ids))
            moderators = Account._byID(moderator_ids[:sidebar_list_length], data=True, return_dict=False, stale=allow_stale)
            num_not_shown = (len(moderator_ids) - sidebar_list_length)
            if (num_not_shown > 0):
                more_text = (_('...and    %d    more') % num_not_shown)
            else:
                more_text = _('about    moderation    team')
            is_admin_sr = (('/r/%s' % c.site.name) == g.admin_message_acct)
            if is_admin_sr:
                label = _('message    the    admins')
            else:
                label = _('message    the    moderators')
            wrapped_moderators = [WrappedUser(mod) for mod in moderators if (not mod._deleted)]
            helplink = HelpLink(('/message/compose?to=%%2Fr%%2F%s' % c.site.name), label, access_required=(not is_admin_sr), data_attrs={'type': 'subreddit', 'fullname': c.site._fullname, 'event-action': 'compose'})
            mod_href = (c.site.path + 'about/moderators')
            ps.append(SideContentBox(_('moderators'), wrapped_moderators, helplink=helplink, more_href=mod_href, more_text=more_text))
    if (no_ads_yet and show_adbox):
        ps.append(Ads())
        if g.live_config['gold_revenue_goal']:
            ps.append(Goldvertisement())
    if (c.user.pref_clickgadget and c.recent_clicks):
        ps.append(SideContentBox(_('Recently    viewed    links'), [ClickGadget(c.recent_clicks)]))
    if c.user_is_loggedin:
        activity_link = AccountActivityBox()
        ps.append(activity_link)
    return ps
