Changeset - 0bec9f92745a
[Not reviewed]
default
0 2 0
domruf - 8 years ago 2017-11-20 23:18:38
dominikruf@gmail.com
Grafted from: 35f75876280c
git: let links to git submodules be real links that can open in new tabs - not just in-page navigation

Submodules should not be loaded with 'ypjax-link' because they point to a place
outside the repository or maybe even outside the kallithea instance.
2 files changed with 2 insertions and 2 deletions:
0 comments (0 inline, 0 general)
kallithea/templates/files/files_browser.html
Show inline comments
 
@@ -63,25 +63,25 @@
 
                        ${h.link_to(h.literal('<i class="icon-folder-open"></i><span>..</span>'),h.url('files_home',repo_name=c.repo_name,revision=c.changeset.raw_id,f_path=c.file.parent.path),class_="browser-dir ypjax-link")}
 
                    </td>
 
                    <td></td>
 
                    <td></td>
 
                    <td></td>
 
                    <td></td>
 
                </tr>
 
                %endif
 

	
 
            %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")}
 
                         ${h.link_to(file_name(node),file_url(node,c),class_=file_class(node)+(" ypjax-link" if not node.is_submodule() else ""))}
 
                     </td>
 
                     <td>
 
                     %if node.is_file():
 
                         ${h.format_byte_size(node.size,binary=True)}
 
                     %endif
 
                     </td>
 
                     <td>
 
                         %if node.is_file():
 
                             <a data-toggle="tooltip" title="${node.last_changeset.message}" href="${h.url('changeset_home',repo_name=c.repo_name,revision=node.last_changeset.raw_id)}" class="changeset_hash">${h.show_id(node.last_changeset)}</a>
 
                         %endif
 
                     </td>
 
                     <td>
kallithea/tests/other/test_vcs_operations.py
Show inline comments
 
@@ -680,20 +680,20 @@ class TestVCSOperations(TestController):
 
        stdout, stderr = Command(TESTS_TMP_PATH).execute('git clone', fork_url, dest_dir)
 
        stdout, stderr = Command(dest_dir).execute('git submodule add', clone_url, 'testsubmodule')
 
        stdout, stderr = Command(dest_dir).execute('git commit -am "added testsubmodule pointing to', clone_url, '"')
 
        stdout, stderr = Command(dest_dir).execute('git push', fork_url, 'master')
 

	
 
        # check for testsubmodule link in files page
 
        self.log_user()
 
        response = self.app.get(url(controller='files', action='index',
 
                                    repo_name=fork_name,
 
                                    revision='tip',
 
                                    f_path='/'))
 
        # BUG: the link to testsubmodule doesn't work - it should probably point at the submodule URL
 
        response.mustcontain('<a class="submodule-dir ypjax-link" href="testsubmodule"><i class="icon-file-submodule"></i><span>testsubmodule @ ')
 
        response.mustcontain('<a class="submodule-dir" href="testsubmodule"><i class="icon-file-submodule"></i><span>testsubmodule @ ')
 

	
 
        # check that following a submodule link actually works - and redirects
 
        response = self.app.get(url(controller='files', action='index',
 
                                    repo_name=fork_name,
 
                                    revision='tip',
 
                                    f_path='/testsubmodule'),
 
                                status=500) # BUG
0 comments (0 inline, 0 general)