Changeset - 1174b9f0afc4
[Not reviewed]
default
0 2 0
domruf - 8 years ago 2017-08-08 23:43:11
dominikruf@gmail.com
Grafted from: a6ef4ceaf240
changelog: cleanup url hack

Instead of using a hack, that removes the 'set' parameter from the request,
don't give the submit button a name and therefore don't submit the parameter
in the first place.

Related to 97c12433267a
2 files changed with 1 insertions and 9 deletions:
0 comments (0 inline, 0 general)
kallithea/controllers/changelog.py
Show inline comments
 
@@ -71,20 +71,12 @@ class ChangelogController(BaseRepoContro
 
            h.flash(safe_str(e), category='error')
 
        raise HTTPBadRequest()
 

	
 
    @LoginRequired()
 
    @HasRepoPermissionLevelDecorator('read')
 
    def index(self, repo_name, revision=None, f_path=None):
 
        # Fix URL after page size form submission via GET
 
        # TODO: Somehow just don't send this extra junk in the GET URL
 
        if request.GET.get('set'):
 
            request.GET.pop('set', None)
 
            if revision is None:
 
                raise HTTPFound(location=url('changelog_home', repo_name=repo_name, **request.GET))
 
            raise HTTPFound(location=url('changelog_file_home', repo_name=repo_name, revision=revision, f_path=f_path, **request.GET))
 

	
 
        limit = 2000
 
        default = 100
 
        if request.GET.get('size'):
 
            c.size = max(min(safe_int(request.GET.get('size')), limit), 1)
 
            session['changelog_size'] = c.size
 
            session.save()
kallithea/templates/changelog/changelog.html
Show inline comments
 
@@ -35,13 +35,13 @@ ${self.repo_context_bar('changelog', c.f
 
    </div>
 
    <div class="panel-body changelog-panel">
 
        %if c.cs_pagination:
 
                <div class="changelog-heading clearfix" style="${'display:none' if c.changelog_for_path else ''}">
 
                    <div class="pull-left">
 
                        ${h.form(h.url.current(),method='get',class_="form-inline")}
 
                            ${h.submit('set',_('Show'),class_="btn btn-default btn-sm")}
 
                            ${h.submit(None,_('Show'),id='set_size_submit',class_="btn btn-default btn-sm")}
 
                            ${h.text('size',size=3,value=c.size,class_='form-control')}
 
                            ${_('revisions')}
 
                            %if c.branch_name:
 
                                ${h.hidden('branch', c.branch_name)}
 
                            %endif
 
                            <a href="#" class="btn btn-default btn-sm" id="rev_range_clear" style="display:none">${_('Clear selection')}</a>
0 comments (0 inline, 0 general)