#3393 Refactor the pull_request.html template
Merged by ryanlerch. Opened by ryanlerch.
ryanlerch/pagure new-pr-page  into  master

Download 3393.patch

Previously, the pull_request.html template was used for 3 different
pages: the PR page, the create PR page(displayed as a diff of two
branches when not logged in), and diffing two commits.

This PR pulls the actual rendering of the diff out into a new macro
file, that is shared between three new templates:

  • repo_pull_request.html
  • repo_compare_commits.html
  • repo_new_pull_request.html

This does not change any of the style of the pages, it is simply
an abstraction of the templates to make the upcoming restyling
a lot easier.

Signed-off-by: Ryan Lerch rlerch@redhat.com

Left over debugging :)

This surprises me a little, we now have one more diff than before?

Replace %} by -%} and that should fix the issue with the tests checking for <title>Diff from...

rebased onto 3645bfa248012bd2359b5ba1f800d89e85f36b34

rebased onto 76bfdb5bc5089f2ea344d5cb2207b568959e83cf

rebased onto a623afb382c6a996550283741f30ddb7f60233c3

Fixed the print statement, and the titles tests.

With the other issue, there was actually always 2 diffs there, they both had the id of "_1".

the reason the test started failing was that we were using a variable defined in the template {%set count = 0 %} outside the loop that printed the diffs, and tried toincrement it inside the loop. This was fixed in jinja: https://github.com/pallets/jinja/issues/641 so this no longer worked.

When changing the template over, i changed the count to just use loop.index.

Pretty please pagure-ci rebuild

Let's wait for jenkins and merge :)

Jenkies says go go go!!

Pull-Request has been merged by ryanlerch

Metadata