From 4c82539f1ad40ab47b40cf0f96b25546f5077b39 Mon Sep 17 00:00:00 2001 From: Julen Landa Alustiza Date: Nov 28 2019 17:56:33 +0000 Subject: templates/pull request: rewrite source conditionals Fixes #4670 --- diff --git a/pagure/templates/repo_pull_request.html b/pagure/templates/repo_pull_request.html index b0a4a21..a9984ac 100644 --- a/pagure/templates/repo_pull_request.html +++ b/pagure/templates/repo_pull_request.html @@ -84,22 +84,26 @@
- {% if pull_request.remote_git or (pull_request.project_from and pull_request.project_from.is_fork) %} + {% if pull_request.remote_git %} - {% if pull_request.remote_git %} - - {{pull_request.remote_git}} - {% elif pull_request.project_from.is_fork %} - - {% if pull_request.project_from.namespace %} - {{pull_request.project_from.namespace}}/ - {% endif %} - {% if pull_request.project_from.is_fork -%} - {{ pull_request.project_from.user.user }}/ - {%- endif -%} - {{pull_request.project_from.name}} + {{ pull_request.remote_git }} + + {% elif pull_request.project_from and pull_request.project_from.id != repo.id %} + + + {% if pull_request.project_from.namespace %} + {{pull_request.project_from.namespace}}/ {% endif %} + {% if pull_request.project_from.is_fork -%} + {{ pull_request.project_from.user.user }}/ + {%- endif -%} + {{ pull_request.project_from.name }} + + {% elif pull_request.project_from is none and pull_request.remote_git is none %} + + Unknown source + {% endif %} - + {{ pull_request.branch_from }} - {% else %} - - - Unknown source - - {% endif %} -  into  +  into  - {{ pull_request.branch }} + {{ pull_request.branch }}