FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Pagination and more macros by stefano-maggiolo · Pull Request #1101 · cms-dev/cms · GitHub

/ cms Public

Pagination and more macros - #1101

Merged
stefano-maggiolo merged 5 commits into
cms-dev:masterfrom
stefano-maggiolo:pagination
Jan 27, 2019
Merged

Pagination and more macros#1101
stefano-maggiolo merged 5 commits into
cms-dev:masterfrom
stefano-maggiolo:pagination

Conversation

stefano-maggiolo commented Jan 19, 2019
edited
Loading

Copy link
Copy Markdown
Member

If you think you'll have more than a few comments let me know and I'll split into more PRs.

Partially fixes #1097.


This change is 

stefano-maggiolo requested a review from lw January 19, 2019 17:36

codecov Bot commented Jan 19, 2019
edited
Loading

Copy link
Copy Markdown

Codecov Report

Merging #1101 into master will decrease coverage by 0.01%.
The diff coverage is n/a.

@@            Coverage Diff            @@
##           master   #1101      +/-   ##
=========================================
- Coverage   62.02%     62%   -0.02%     
=========================================
  Files         230     230              
  Lines       16587   16587              
=========================================
- Hits        10288   10285       -3     
- Misses       6299    6302       +3
Flag Coverage Δ
#functionaltests 45.77% <ø> (-0.07%) ⬇️
#unittests 43.25% <ø> (-0.01%) ⬇️
Impacted Files Coverage Δ
cms/server/admin/handlers/task.py 39.84% <0%> (-1.18%) ⬇️
cms/service/EvaluationService.py 67.28% <0%> (-1.07%) ⬇️
cms/db/base.py 84.04% <0%> (-1.07%) ⬇️
cms/server/admin/handlers/dataset.py 24.76% <0%> (-0.93%) ⬇️
cms/db/util.py 50.37% <0%> (-0.75%) ⬇️
cms/db/filecacher.py 77.37% <0%> (-0.66%) ⬇️
cms/grading/Sandbox.py 68.23% <0%> (-0.37%) ⬇️
cms/server/admin/handlers/base.py 68.13% <0%> (+0.33%) ⬆️
cms/db/usertest.py 95.71% <0%> (+0.71%) ⬆️
cms/service/ResourceService.py 58.9% <0%> (+0.91%) ⬆️
... and 4 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 584cc42...58856f5. Read the comment docs.

lw left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Didn't test it, but the code looks alright.

Reviewed 3 of 3 files at r1, 1 of 1 files at r2, 8 of 8 files at r3, 2 of 2 files at r4, 5 of 5 files at r5.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @stefano-maggiolo)


cms/server/admin/templates/macro/pages.html, line 21 at r1 (raw file):

    {% endfor %}
  {% endif %}
</div>

The outer if and the div are nested incorrectly.


cms/server/admin/templates/macro/pages.html, line 25 at r2 (raw file):

    {% endif %}
  {% endif %}
</div>

Same nesting issue.


cms/server/admin/templates/macro/pages.html, line 33 at r2 (raw file):

Show a page range selector from start (included) to end (excluded).
#}
  {% for i in range([0, start]|max, [pages, end]|min) %}

Dunno if it's the same in Jinja, but this syntax works in plain Python: range(pages)[start:end] (and it returns a properly capped range object)

stefano-maggiolo left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @lerks)


cms/server/admin/templates/macro/pages.html, line 21 at r1 (raw file):

Previously, lerks (Luca Wehrstedt) wrote…

The outer if and the div are nested incorrectly.

Good catch


cms/server/admin/templates/macro/pages.html, line 25 at r2 (raw file):

Previously, lerks (Luca Wehrstedt) wrote…

Same nesting issue.

Good catch


cms/server/admin/templates/macro/pages.html, line 33 at r2 (raw file):

Good catch
not if start is negative, no?

stefano-maggiolo left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Thanks! Fixing in place and submitting.

Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @lerks)

stefano-maggiolo merged commit 58856f5 into cms-dev:master Jan 27, 2019

andreyv commented Jan 27, 2019
edited
Loading

Copy link
Copy Markdown
Member

I'm getting an error on the Submissions and User tests pages with CMS installed in the system:

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/tornado/web.py", line 1510, in _execute
    result = method(*self.path_args, **self.path_kwargs)
  File "/usr/lib/python3/dist-packages/tornado/web.py", line 2898, in wrapper
    return method(self, *args, **kwargs)
  File "/usr/local/lib/python3.6/dist-packages/cms-1.5.dev0-py3.6.egg/cms/server/admin/handlers/base.py", line 173, in newfunc
    return func(self, *args, **kwargs)
  File "/usr/local/lib/python3.6/dist-packages/cms-1.5.dev0-py3.6.egg/cms/server/admin/handlers/contestsubmission.py", line 47, in get
    self.render("contest_submissions.html", **self.r_params)
  File "/usr/local/lib/python3.6/dist-packages/cms-1.5.dev0-py3.6.egg/cms/server/admin/handlers/base.py", line 281, in render
    for chunk in t.generate(**params):
  File "/usr/lib/python3/dist-packages/jinja2/environment.py", line 1045, in generate
    yield self.environment.handle_exception(exc_info, True)
  File "/usr/lib/python3/dist-packages/jinja2/environment.py", line 780, in handle_exception
    reraise(exc_type, exc_value, tb)
  File "/usr/lib/python3/dist-packages/jinja2/_compat.py", line 37, in reraise
    raise value.with_traceback(tb)
  File "/usr/local/lib/python3.6/dist-packages/cms-1.5.dev0-py3.6.egg/cms/server/admin/templates/contest_submissions.html", line 1, in top-level template code
    {% import "macro/reevaluation_buttons.html" as macro_reevaluation_buttons %}
  File "/usr/lib/python3/dist-packages/jinja2/loaders.py", line 235, in get_source
    raise TemplateNotFound(template)
jinja2.exceptions.TemplateNotFound: macro/reevaluation_buttons.html

fragments/reevaluation_buttons.html exists on the file system instead.

stefano-maggiolo deleted the pagination branch January 27, 2019 21:21
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

[AWS] Support large number of users and their artifacts

3 participants


Back | FazBrowse Home | New Git URL