changeset 7203:43c9da9eed11

git: open submodule links in a new tab Since you are leaving the project context (maybe even kallithea), sub module links should open in a new tab.
author domruf <dominikruf@gmail.com>
date Wed, 21 Feb 2018 18:25:19 +0100
parents 48f7c2aed3b7
children 702439a16ff1
files kallithea/templates/files/files_browser.html kallithea/tests/other/test_vcs_operations.py
diffstat 2 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/kallithea/templates/files/files_browser.html	Sun Mar 11 17:36:38 2018 +0100
+++ b/kallithea/templates/files/files_browser.html	Wed Feb 21 18:25:19 2018 +0100
@@ -72,7 +72,7 @@
             %for cnt,node in enumerate(c.file):
                 <tr class="parity${cnt%2}">
                      <td>
-                         ${h.link_to(file_name(node),file_url(node,c),class_=file_class(node)+(" ypjax-link" if not node.is_submodule() else ""))}
+                         ${h.link_to(file_name(node),file_url(node,c),class_=file_class(node)+(" ypjax-link" if not node.is_submodule() else ""), target_="_blank" if node.is_submodule() else None)}
                      </td>
                      <td>
                      %if node.is_file():
--- a/kallithea/tests/other/test_vcs_operations.py	Sun Mar 11 17:36:38 2018 +0100
+++ b/kallithea/tests/other/test_vcs_operations.py	Wed Feb 21 18:25:19 2018 +0100
@@ -688,7 +688,7 @@
                                     repo_name=fork_name,
                                     revision='tip',
                                     f_path='/'))
-        response.mustcontain('<a class="submodule-dir" href="%s"><i class="icon-file-submodule"></i><span>testsubmodule @ ' % clone_url)
+        response.mustcontain('<a class="submodule-dir" href="%s" target="_blank"><i class="icon-file-submodule"></i><span>testsubmodule @ ' % clone_url)
 
         # check that following a submodule link actually works - and redirects
         response = self.app.get(url(controller='files', action='index',