##// 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 c.f_path = f_path
647 c.f_path = f_path
648 at_rev = self.request.GET.get('at')
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 # prev link
657 # prev link
651 try:
658 try:
652 prev_commit = c.commit.prev(c.branch)
659 prev_commit = c.commit.prev(c.branch)
@@ -673,15 +680,9 b' class RepoFilesView(RepoAppView):'
673 c.url_next = '#'
680 c.url_next = '#'
674 c.next_commit = EmptyCommit()
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 # load file content
683 # load file content
684 if c.file.is_file():
684 if c.file.is_file():
685
685 c.lf_node = {}
686 c.lf_node = {}
686
687
687 has_lf_enabled = self._is_lf_enabled(self.db_repo)
688 has_lf_enabled = self._is_lf_enabled(self.db_repo)
@@ -39,6 +39,7 b' from rhodecode.lib.utils2 import ('
39 safe_str, remove_prefix, obfuscate_url_pw,
39 safe_str, remove_prefix, obfuscate_url_pw,
40 get_current_rhodecode_user, safe_int, action_logger_generic)
40 get_current_rhodecode_user, safe_int, action_logger_generic)
41 from rhodecode.lib.vcs.backends import get_backend
41 from rhodecode.lib.vcs.backends import get_backend
42 from rhodecode.lib.vcs.nodes import NodeKind
42 from rhodecode.model import BaseModel
43 from rhodecode.model import BaseModel
43 from rhodecode.model.db import (
44 from rhodecode.model.db import (
44 _hash_key, func, case, joinedload, or_, in_filter_generator,
45 _hash_key, func, case, joinedload, or_, in_filter_generator,
@@ -1128,6 +1129,10 b' class ReadmeFinder:'
1128 """
1129 """
1129 Find a readme in the given `commit`.
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 nodes = commit.get_nodes(path)
1136 nodes = commit.get_nodes(path)
1132 matches = self._match_readmes(nodes)
1137 matches = self._match_readmes(nodes)
1133 matches = self._sort_according_to_priority(matches)
1138 matches = self._sort_according_to_priority(matches)
@@ -264,7 +264,10 b' They are permanent until deleted, or con'
264
264
265 </script>
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 ##// END OF EJS Templates
272 ##// END OF EJS Templates
270 </div>
273 </div>
@@ -1,5 +1,13 b''
1 <%namespace name="base" file="/base/base.mako"/>
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 at_ref = request.GET.get('at')
12 at_ref = request.GET.get('at')
5 if at_ref:
13 if at_ref:
@@ -29,6 +37,7 b''
29 </tr>
37 </tr>
30
38
31 <% has_files = False %>
39 <% has_files = False %>
40 % if not c.file.is_submodule():
32 % for cnt,node in enumerate(c.file):
41 % for cnt, node in enumerate(c.file):
33 <% has_files = True %>
42 <% has_files = True %>
34 <tr class="parity${(cnt % 2)}">
43 <tr class="parity${(cnt % 2)}">
@@ -37,10 +46,10 b''
37 <span class="submodule-dir">
46 <span class="submodule-dir">
38 % if node.url.startswith('http://') or node.url.startswith('https://'):
47 % if node.url.startswith('http://') or node.url.startswith('https://'):
39 <a href="${node.url}">
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 </a>
50 </a>
42 % else:
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 % endif
53 % endif
45 </span>
54 </span>
46 % else:
55 % else:
@@ -82,12 +91,17 b''
82 %endif
91 %endif
83 </tr>
92 </tr>
84 % endfor
93 % endfor
94 % endif
85
95
86 % if not has_files:
96 % if not has_files:
87 <tr>
97 <tr>
88 <td colspan="5">
98 <td colspan="5">
89 ##empty-dir mostly SVN
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 </td>
105 </td>
92 </tr>
106 </tr>
93 % endif
107 % endif
@@ -15,17 +15,15 b''
15 <div class="summary-detail-header">
15 <div class="summary-detail-header">
16
16
17 </div><!--end summary-detail-header-->
17 </div><!--end summary-detail-header-->
18
18 % if c.file.is_dir() or c.file.is_submodule():
19 % if c.file.is_submodule():
20 <span class="submodule-dir">Submodule ${h.escape(c.file.name)}</span>
21 % elif c.file.is_dir():
22 <%include file='files_tree_header.mako'/>
19 <%include file='files_tree_header.mako'/>
23 % else:
20 % else:
24 <%include file='files_source_header.mako'/>
21 <%include file='files_source_header.mako'/>
25 % endif
22 % endif
26
23
27 </div> <!--end summary-detail-->
24 </div> <!--end summary-detail-->
28 % if c.file.is_dir():
25
26 % if c.file.is_dir() or c.file.is_submodule():
29 <%include file='files_browser.mako'/>
27 <%include file='files_browser.mako'/>
30 % else:
28 % else:
31 <%include file='files_source.mako'/>
29 <%include file='files_source.mako'/>
General Comments 0
You need to be logged in to leave comments. Login now