##// END OF EJS Templates
fix(submodules): fixed an error if reaching out submodule path....
super-admin -
r5261:550d6219 default
parent child Browse files
Show More
@@ -647,6 +647,13 b' class RepoFilesView(RepoAppView):'
647 647 c.f_path = f_path
648 648 at_rev = self.request.GET.get('at')
649 649
650 # files or dirs
651 try:
652 c.file = c.commit.get_node(f_path, pre_load=['is_binary', 'size', 'data'])
653
654 c.file_author = True
655 c.file_tree = ''
656
650 657 # prev link
651 658 try:
652 659 prev_commit = c.commit.prev(c.branch)
@@ -673,15 +680,9 b' class RepoFilesView(RepoAppView):'
673 680 c.url_next = '#'
674 681 c.next_commit = EmptyCommit()
675 682
676 # files or dirs
677 try:
678 c.file = c.commit.get_node(f_path, pre_load=['is_binary', 'size', 'data'])
679
680 c.file_author = True
681 c.file_tree = ''
682
683 683 # load file content
684 684 if c.file.is_file():
685
685 686 c.lf_node = {}
686 687
687 688 has_lf_enabled = self._is_lf_enabled(self.db_repo)
@@ -39,6 +39,7 b' from rhodecode.lib.utils2 import ('
39 39 safe_str, remove_prefix, obfuscate_url_pw,
40 40 get_current_rhodecode_user, safe_int, action_logger_generic)
41 41 from rhodecode.lib.vcs.backends import get_backend
42 from rhodecode.lib.vcs.nodes import NodeKind
42 43 from rhodecode.model import BaseModel
43 44 from rhodecode.model.db import (
44 45 _hash_key, func, case, joinedload, or_, in_filter_generator,
@@ -1128,6 +1129,10 b' class ReadmeFinder:'
1128 1129 """
1129 1130 Find a readme in the given `commit`.
1130 1131 """
1132 # firstly, check the PATH type if it is actually a DIR
1133 if commit.get_node(path).kind != NodeKind.DIR:
1134 return None
1135
1131 1136 nodes = commit.get_nodes(path)
1132 1137 matches = self._match_readmes(nodes)
1133 1138 matches = self._sort_according_to_priority(matches)
@@ -264,7 +264,10 b' They are permanent until deleted, or con'
264 264
265 265 </script>
266 266
267
267 <script id="ejs_submoduleHovercard" type="text/template" class="ejsTemplate">
268 <strong>Submodule Node</strong><br/>
269 <pre><%= submodule_url %></pre>
270 </script>
268 271
269 272 ##// END OF EJS Templates
270 273 </div>
@@ -1,5 +1,13 b''
1 1 <%namespace name="base" file="/base/base.mako"/>
2 2
3 <%doc>
4 Please note the content of this file is cached, so changes here might not be reflected when editing.
5 add ?no-cache=true into the file url to disable caches.
6
7 e.g
8 http://docker-dev:10020/ipython/files/master/IPython/frontend/html/notebook/static?no-cache=1
9
10 </%doc>
3 11 <%
4 12 at_ref = request.GET.get('at')
5 13 if at_ref:
@@ -29,6 +37,7 b''
29 37 </tr>
30 38
31 39 <% has_files = False %>
40 % if not c.file.is_submodule():
32 41 % for cnt,node in enumerate(c.file):
33 42 <% has_files = True %>
34 43 <tr class="parity${(cnt % 2)}">
@@ -37,10 +46,10 b''
37 46 <span class="submodule-dir">
38 47 % if node.url.startswith('http://') or node.url.startswith('https://'):
39 48 <a href="${node.url}">
40 <i class="icon-directory browser-dir"></i>${node.name}
49 <i class="icon-directory browser-dir"></i><span class="tooltip-hovercard" data-hovercard-alt="${node.url}" data-hovercard-url="javascript:renderTemplate('submoduleHovercard', {'submodule_url':'${node.url}'})">${node.name}</span>
41 50 </a>
42 51 % else:
43 <i class="icon-directory browser-dir"></i>${node.name}
52 <i class="icon-directory browser-dir"></i><span class="tooltip-hovercard" data-hovercard-alt="${node.url}" data-hovercard-url="javascript:renderTemplate('submoduleHovercard', {'submodule_url':'${node.url}'})">${node.name}</span>
44 53 % endif
45 54 </span>
46 55 % else:
@@ -82,12 +91,17 b''
82 91 %endif
83 92 </tr>
84 93 % endfor
94 % endif
85 95
86 96 % if not has_files:
87 97 <tr>
88 98 <td colspan="5">
89 99 ##empty-dir mostly SVN
90 &nbsp;
100
101 ## submodule if we somehow endup
102 % if c.file.is_submodule():
103 <span class="submodule-dir">Submodule ${h.escape(c.file.name)}</span>
104 %endif
91 105 </td>
92 106 </tr>
93 107 % endif
@@ -15,17 +15,15 b''
15 15 <div class="summary-detail-header">
16 16
17 17 </div><!--end summary-detail-header-->
18
19 % if c.file.is_submodule():
20 <span class="submodule-dir">Submodule ${h.escape(c.file.name)}</span>
21 % elif c.file.is_dir():
18 % if c.file.is_dir() or c.file.is_submodule():
22 19 <%include file='files_tree_header.mako'/>
23 20 % else:
24 21 <%include file='files_source_header.mako'/>
25 22 % endif
26 23
27 24 </div> <!--end summary-detail-->
28 % if c.file.is_dir():
25
26 % if c.file.is_dir() or c.file.is_submodule():
29 27 <%include file='files_browser.mako'/>
30 28 % else:
31 29 <%include file='files_source.mako'/>
General Comments 0
You need to be logged in to leave comments. Login now