Decorator for handling the current page in the breadcrumbs.
186991
def handle_page_crumb(func):
    
    @wraps(func)
    def wrapper(path, model, page, root_name):
        path = PAGE_REGEXP.sub('', path)
        breadcrumbs = func(path, model, root_name)
        if page:
            if page.number > 1:
                breadcrumbs[-1].url = path
                page_crumb = Crumb(_('Page %s') % page.number)
                breadcrumbs.append(page_crumb)
        return breadcrumbs
    return wrapper
607238
def get_crumb_list_by_selector(self, crumb_selector):
        """"""
        return [
            self.parsedpage.get_text_from_node(crumb)
            for crumb in self.parsedpage.get_nodes_by_selector(crumb_selector)
        ]
549769
def gotoNext( self ):
        
        next_page = self.currentPage() + 1
        if ( next_page > self.pageCount() ):
            return
        
        self.setCurrentPage(next_page)
979706
public void setCurrentPage(int currentPage) throws CmsIllegalArgumentException {

        if (getSize() != 0) {
            if ((currentPage < 1) || (currentPage > getNumberOfPages())) {
                throw new CmsIllegalArgumentException(
                    Messages.get().container(Messages.ERR_LIST_INVALID_PAGE_1, new Integer(currentPage)));
            }
        }
        m_currentPage = currentPage;
    }
290874
def pageassert(func):
    '''
    
    '''
    @wraps(func)
    def wrapper(*args, **kwargs):
        if args[0] < 1 or args[0] > 40:
            raise ValueError('Page Number not found')
        return func(*args, **kwargs)
    return wrapper
1023069
function getCurrentUrl(page, ph, callback) {
    page.get('url', function (url) {
        callback(null, page, ph, url);
    });
}
427530
def breadcrumb_trail(options = {})
      return enum_for(:breadcrumb_trail) unless block_given?

      valid?(options)
      options = Loaf.configuration.to_hash.merge(options)
      _breadcrumbs.each do |crumb|
        name = title_for(crumb.name)
        path = url_for(_expand_url(crumb.url))
        current = current_crumb?(path, crumb.match)

        yield(Loaf::Breadcrumb[name, path, current])
      end
    end
802453
def breadcrumb_raw(context, label, viewname, *args, **kwargs):
    
    append_breadcrumb(context, escape(label), viewname, args, kwargs)
    return ''
1106616
def reload_current_page(self, *args, **kwds):
        '''
        '''
        index = self.notebook.get_current_page()
        self.notebook.get_nth_page(index).reload()
1363820
public function onIndex()
    {
        $this->breadcrumbs->register(self::$name, function(Generator $breadcrumbs) {
            $breadcrumbs->push(trans('antares/ban_management::messages.breadcrumbs.ban_management'), handles('antares::ban_management/rules/datatable'));
        });

        $this->breadcrumbs->register(self::$name . '-rules', function(Generator $breadcrumbs) {
            $breadcrumbs->parent(self::$name);
        });

        $this->shareOnView(self::$name);
    }
1254589
def pagination_for(context, current_page, page_var="page", exclude_vars=""):
    
    querystring = context["request"].GET.copy()
    exclude_vars = [v for v in exclude_vars.split(",") if v] + [page_var]
    for exclude_var in exclude_vars:
        if exclude_var in querystring:
            del querystring[exclude_var]
    querystring = querystring.urlencode()
    return {
        "current_page": current_page,
        "querystring": querystring,
        "page_var": page_var,
    }
853829
def index
      add_breadcrumb I18n.t('integral.breadcrumbs.blog'), nil
      @posts = Integral::Post.published.order('published_at DESC').paginate(page: params[:page])
    end
988019
def parent_breadcrumb(options = {}, &block)
      if block_given?
        gretel_renderer.yield_parent_breadcrumb(options, &block)
      else
        gretel_renderer.parent_breadcrumb(options)
      end
    end
238287
function (e) {
        if (e && e.prevValue === e.newValue) {
            return;
        }

        var par   = this.current ? this.current.parentNode : null,
            after = this.link;

        if (par) {
            switch (this.paginator.getTotalPages()) {
                case Paginator.VALUE_UNLIMITED :
                        after = this.na; break;
                case this.paginator.getCurrentPage() :
                        after = this.span; break;
            }

            if (this.current !== after) {
                par.replaceChild(after,this.current);
                this.current = after;
            }
        }
    }
399557
def breadcrumb(name, url, options = {})
      _breadcrumbs << Loaf::Crumb.new(name, url, options)
    end
491418
def page_view(url):
    

    def decorator(func):
        @wraps(func)
        async def wrapper(self: BaseState, *args, **kwargs):
            user_id = self.request.user.id

            try:
                user_lang = await self.request.user.get_locale()
            except NotImplementedError:
                user_lang = ''

            title = self.__class__.__name__

            # noinspection PyTypeChecker
            async for p in providers():
                await p.page_view(url, title, user_id, user_lang)

            return await func(self, *args, **kwargs)
        return wrapper
    return decorator
967068
function syncPagesbar() {
            if ($pages[0] && last.page !== rel.activePage) {
                last.page = rel.activePage;
                $pages.removeClass(o.activeClass).eq(rel.activePage).addClass(o.activeClass);
            }
        }