##// END OF EJS Templates
new files views...
marcink -
r1737:61eda8bf beta
parent child Browse files
Show More
@@ -162,9 +162,9 b' class FilesController(BaseRepoController'
162 162
163 163 #files or dirs
164 164 try:
165 c.files_list = c.changeset.get_node(f_path)
165 c.file = c.changeset.get_node(f_path)
166 166
167 if c.files_list.is_file():
167 if c.file.is_file():
168 168 c.file_history = self._get_node_history(c.changeset, f_path)
169 169 else:
170 170 c.file_history = []
@@ -7,15 +7,47 b' div.codeblock {'
7 7 line-height: 100%;
8 8 /* new */
9 9 line-height: 125%;
10 -webkit-border-radius: 4px;
11 -moz-border-radius: 4px;
12 border-radius: 4px;
10 13 }
11 14 div.codeblock .code-header{
12 15 border-bottom: 1px solid #CCCCCC;
13 16 background: #EEEEEE;
14 17 padding:10px 0 10px 0;
15 18 }
16 div.codeblock .code-header .revision{
19
20 div.codeblock .code-header .stats{
21 clear: both;
22 margin-top:-3px;
23 padding-left: 8px;
24 border-bottom: 1px solid rgb(204, 204, 204);
25 margin-bottom: 5px; height: 23px;
26 }
27
28 div.codeblock .code-header .stats .left{
29 float:left;
30 }
31 div.codeblock .code-header .stats .left.item{
32 float:left;
33 padding: 0 9px 0 9px;
34 border-right:1px solid #ccc;
35 }
36 div.codeblock .code-header .stats .left.item.last{
37 border-right:none;
38 }
39 div.codeblock .code-header .stats .buttons{
40 float:right;
41 padding-right:4px;
42 }
43
44 div.codeblock .code-header .author{
17 45 margin-left:25px;
18 46 font-weight: bold;
47 height: 25px;
48 }
49 div.codeblock .code-header .author .user{
50 padding-top:3px;
19 51 }
20 52 div.codeblock .code-header .commit{
21 53 margin-left:25px;
@@ -642,20 +642,22 b' div.options a {'
642 642 }
643 643
644 644 .quick_repo_menu {
645 background: #FFF url("../images/vertical-indicator.png") 8px 50%
646 no-repeat !important;
645 background: #FFF url("../images/vertical-indicator.png") 8px 50% no-repeat !important;
647 646 cursor: pointer;
648 647 width: 8px;
648 border: 1px solid transparent;
649 649 }
650 650
651 651 .quick_repo_menu.active {
652 background: #FFF url("../images/horizontal-indicator.png") 4px 50%
653 no-repeat !important;
654 cursor: pointer;
652 background: url("../images/horizontal-indicator.png") no-repeat scroll 5px 50% #FFFFFF !important;
653 border: 1px solid #003367;
654 box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
655 cursor: pointer;
655 656 }
656 657
657 658 .quick_repo_menu .menu_items {
658 margin-top: 6px;
659 margin-top: 10px;
660 margin-left:-6px;
659 661 width: 150px;
660 662 position: absolute;
661 663 background-color: #FFF;
@@ -664,7 +666,8 b' div.options a {'
664 666 border-right: 1px solid #666666;
665 667 border-style: solid;
666 668 border-width: 1px;
667 box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
669 box-shadow: 2px 8px 4px rgba(0, 0, 0, 0.2);
670 border-top-style: none;
668 671 }
669 672
670 673 .quick_repo_menu .menu_items li {
@@ -807,7 +810,7 b' div.options a {'
807 810 }
808 811
809 812 #content div.box dl {
810 margin: 10px 24px;
813 margin: 10px 0px;
811 814 }
812 815
813 816 #content div.box dt {
@@ -1825,7 +1828,7 b' h3.files_location {'
1825 1828
1826 1829 #files_data dl dt {
1827 1830 float: left;
1828 width: 115px;
1831 width: 60px;
1829 1832 margin: 0 !important;
1830 1833 padding: 5px;
1831 1834 }
@@ -10,7 +10,7 b''
10 10 ${h.link_to(c.repo_name,h.url('files_home',repo_name=c.repo_name))}
11 11 »
12 12 ${_('files')}
13 %if c.files_list:
13 %if c.file:
14 14 @ r${c.changeset.revision}:${h.short_id(c.changeset.raw_id)}
15 15 %endif
16 16 </%def>
@@ -39,8 +39,8 b''
39 39 <script type="text/javascript">
40 40 var YPJAX_TITLE = "${c.repo_name} ${_('Files')} - ${c.rhodecode_name}";
41 41 var current_url = "${h.url.current()}";
42 var node_list_url = '${h.url("files_home",repo_name=c.repo_name,revision=c.changeset.raw_id,f_path=c.files_list.path)}';
43 var url_base = '${h.url("files_nodelist_home",repo_name=c.repo_name,revision=c.changeset.raw_id,f_path=c.files_list.path)}';
42 var node_list_url = '${h.url("files_home",repo_name=c.repo_name,revision=c.changeset.raw_id,f_path=c.file.path)}';
43 var url_base = '${h.url("files_nodelist_home",repo_name=c.repo_name,revision=c.changeset.raw_id,f_path=c.file.path)}';
44 44 var truncated_lbl = "${_('search truncated')}";
45 45 var nomatch_lbl = "${_('no matching files')}";
46 46 fileBrowserListeners(current_url, node_list_url, url_base, truncated_lbl, nomatch_lbl);
@@ -29,29 +29,8 b''
29 29 <div class="table">
30 30 <div id="files_data">
31 31 <h3 class="files_location">${_('Location')}: ${h.files_breadcrumbs(c.repo_name,c.cs.revision,c.file.path)}</h3>
32 <dl class="overview">
33 <dt>${_('Revision')}</dt>
34 <dd>${h.link_to("r%s:%s" % (c.file.last_changeset.revision,h.short_id(c.file.last_changeset.raw_id)),
35 h.url('changeset_home',repo_name=c.repo_name,revision=c.file.last_changeset.raw_id))} </dd>
36 <dt>${_('Size')}</dt>
37 <dd>${h.format_byte_size(c.file.size,binary=True)}</dd>
38 <dt>${_('Mimetype')}</dt>
39 <dd>${c.file.mimetype}</dd>
40 <dt>${_('Options')}</dt>
41 <dd>${h.link_to(_('show source'),
42 h.url('files_home',repo_name=c.repo_name,revision=c.cs.raw_id,f_path=c.f_path))}
43 / ${h.link_to(_('show as raw'),
44 h.url('files_raw_home',repo_name=c.repo_name,revision=c.cs.raw_id,f_path=c.f_path))}
45 / ${h.link_to(_('download as raw'),
46 h.url('files_rawfile_home',repo_name=c.repo_name,revision=c.cs.raw_id,f_path=c.f_path))}
47 % if h.HasRepoPermissionAny('repository.write','repository.admin')(c.repo_name):
48 % if not c.file.is_binary:
49 / ${h.link_to(_('edit'),
50 h.url('files_edit_home',repo_name=c.repo_name,revision=c.cs.raw_id,f_path=c.f_path))}
51 % endif
52 % endif
53 </dd>
54 <dt>${_('History')}</dt>
32 <dl>
33 <dt style="padding-top:10px;font-size:16px">${_('History')}</dt>
55 34 <dd>
56 35 <div>
57 36 ${h.form(h.url('files_diff_home',repo_name=c.repo_name,f_path=c.f_path),method='get')}
@@ -64,10 +43,31 b''
64 43 </dd>
65 44 </dl>
66 45 <div id="body" class="codeblock">
67 <div class="code-header">
68 <div class="revision">${c.file.name}@r${c.file.last_changeset.revision}:${h.short_id(c.file.last_changeset.raw_id)}</div>
69 <div class="commit">"${c.file.message}"</div>
70 </div>
46 <div class="code-header">
47 <div class="stats">
48 <div class="left"><img src="${h.url('/images/icons/file.png')}"/></div>
49 <div class="left item">${h.link_to("r%s:%s" % (c.file.last_changeset.revision,h.short_id(c.file.last_changeset.raw_id)),h.url('changeset_home',repo_name=c.repo_name,revision=c.file.last_changeset.raw_id))}</div>
50 <div class="left item">${h.format_byte_size(c.file.size,binary=True)}</div>
51 <div class="left item last">${c.file.mimetype}</div>
52 <div class="buttons">
53 ${h.link_to(_('show source'),h.url('files_home',repo_name=c.repo_name,revision=c.cs.raw_id,f_path=c.f_path),class_="ui-button-small")}
54 ${h.link_to(_('show as raw'),h.url('files_raw_home',repo_name=c.repo_name,revision=c.cs.raw_id,f_path=c.f_path),class_="ui-button-small")}
55 ${h.link_to(_('download as raw'),h.url('files_rawfile_home',repo_name=c.repo_name,revision=c.cs.raw_id,f_path=c.f_path),class_="ui-button-small")}
56 % if h.HasRepoPermissionAny('repository.write','repository.admin')(c.repo_name):
57 % if not c.file.is_binary:
58 ${h.link_to(_('edit'),h.url('files_edit_home',repo_name=c.repo_name,revision=c.cs.raw_id,f_path=c.f_path),class_="ui-button-small")}
59 % endif
60 % endif
61 </div>
62 </div>
63 <div class="author">
64 <div class="gravatar">
65 <img alt="gravatar" src="${h.gravatar_url(h.email(c.cs.author),16)}"/>
66 </div>
67 <div title="${h.email_or_none(c.cs.author)}" class="user">${h.person(c.cs.author)}</div>
68 </div>
69 <div class="commit">${c.file.last_changeset.message}</div>
70 </div>
71 71 <div class="code-body">
72 72 %if c.file.is_binary:
73 73 ${_('Binary file (%s)') % c.file.mimetype}
@@ -34,7 +34,7 b''
34 34 <div>
35 35 <div id="node_filter_box_loading" style="display:none">${_('Loading file list...')}</div>
36 36 <div id="node_filter_box" style="display:none">
37 ${h.files_breadcrumbs(c.repo_name,c.changeset.raw_id,c.files_list.path)}/<input type="text" value="type to search..." name="filter" size="25" id="node_filter" autocomplete="off">
37 ${h.files_breadcrumbs(c.repo_name,c.changeset.raw_id,c.file.path)}/<input type="text" value="type to search..." name="filter" size="25" id="node_filter" autocomplete="off">
38 38 </div>
39 39 </div>
40 40 </div>
@@ -54,10 +54,10 b''
54 54 </thead>
55 55
56 56 <tbody id="tbody">
57 %if c.files_list.parent:
57 %if c.file.parent:
58 58 <tr class="parity0">
59 59 <td>
60 ${h.link_to('..',h.url('files_home',repo_name=c.repo_name,revision=c.changeset.raw_id,f_path=c.files_list.parent.path),class_="browser-dir ypjax-link")}
60 ${h.link_to('..',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")}
61 61 </td>
62 62 <td></td>
63 63 <td></td>
@@ -67,7 +67,7 b''
67 67 </tr>
68 68 %endif
69 69
70 %for cnt,node in enumerate(c.files_list):
70 %for cnt,node in enumerate(c.file):
71 71 <tr class="parity${cnt%2}">
72 72 <td>
73 73 ${h.link_to(node.name,h.url('files_home',repo_name=c.repo_name,revision=c.changeset.raw_id,f_path=h.safe_unicode(node.path)),class_=file_class(node)+" ypjax-link")}
@@ -39,6 +39,25 b''
39 39 <h3 class="files_location">${_('Location')}: ${h.files_breadcrumbs(c.repo_name,c.cs.revision,c.file.path)}</h3>
40 40 ${h.form(h.url.current(),method='post',id='eform')}
41 41 <div id="body" class="codeblock">
42 <div class="code-header">
43 <div class="stats">
44 <div class="left"><img src="${h.url('/images/icons/file.png')}"/></div>
45 <div class="left item">${h.link_to("r%s:%s" % (c.file.last_changeset.revision,h.short_id(c.file.last_changeset.raw_id)),h.url('changeset_home',repo_name=c.repo_name,revision=c.file.last_changeset.raw_id))}</div>
46 <div class="left item">${h.format_byte_size(c.file.size,binary=True)}</div>
47 <div class="left item last">${c.file.mimetype}</div>
48 <div class="buttons">
49 ${h.link_to(_('show annotation'),h.url('files_annotate_home',repo_name=c.repo_name,revision=c.cs.raw_id,f_path=c.f_path),class_="ui-button-small")}
50 ${h.link_to(_('show as raw'),h.url('files_raw_home',repo_name=c.repo_name,revision=c.cs.raw_id,f_path=c.f_path),class_="ui-button-small")}
51 ${h.link_to(_('download as raw'),h.url('files_rawfile_home',repo_name=c.repo_name,revision=c.cs.raw_id,f_path=c.f_path),class_="ui-button-small")}
52 % if h.HasRepoPermissionAny('repository.write','repository.admin')(c.repo_name):
53 % if not c.file.is_binary:
54 ${h.link_to(_('source'),h.url('files_home',repo_name=c.repo_name,revision=c.cs.raw_id,f_path=c.f_path),class_="ui-button-small")}
55 % endif
56 % endif
57 </div>
58 </div>
59 <div class="commit">${_('Editing file')}: ${c.file.path}</div>
60 </div>
42 61 <pre id="editor_pre"></pre>
43 62 <textarea id="editor" name="content" style="display:none">${c.file.content|n}</textarea>
44 63 <div style="padding: 10px;color:#666666">${_('commit message')}</div>
@@ -1,52 +1,50 b''
1 1 <dl>
2 <dt>${_('Revision')}</dt>
3 <dd>
4 ${h.link_to("r%s:%s" % (c.files_list.last_changeset.revision,h.short_id(c.files_list.last_changeset.raw_id)),
5 h.url('changeset_home',repo_name=c.repo_name,revision=c.files_list.last_changeset.raw_id))}
6 </dd>
7 <dt>${_('Size')}</dt>
8 <dd>${h.format_byte_size(c.files_list.size,binary=True)}</dd>
9 <dt>${_('Mimetype')}</dt>
10 <dd>${c.files_list.mimetype}</dd>
11 <dt>${_('Options')}</dt>
12 <dd>${h.link_to(_('show annotation'),
13 h.url('files_annotate_home',repo_name=c.repo_name,revision=c.changeset.raw_id,f_path=c.f_path))}
14 / ${h.link_to(_('show as raw'),
15 h.url('files_raw_home',repo_name=c.repo_name,revision=c.changeset.raw_id,f_path=c.f_path))}
16 / ${h.link_to(_('download as raw'),
17 h.url('files_rawfile_home',repo_name=c.repo_name,revision=c.changeset.raw_id,f_path=c.f_path))}
18 % if h.HasRepoPermissionAny('repository.write','repository.admin')(c.repo_name):
19 % if not c.files_list.is_binary:
20 / ${h.link_to(_('edit'),
21 h.url('files_edit_home',repo_name=c.repo_name,revision=c.changeset.raw_id,f_path=c.f_path))}
22 % endif
23 % endif
24 </dd>
25 <dt>${_('History')}</dt>
2 <dt style="padding-top:10px;font-size:16px">${_('History')}</dt>
26 3 <dd>
27 4 <div>
28 5 ${h.form(h.url('files_diff_home',repo_name=c.repo_name,f_path=c.f_path),method='get')}
29 ${h.hidden('diff2',c.files_list.last_changeset.raw_id)}
30 ${h.select('diff1',c.files_list.last_changeset.raw_id,c.file_history)}
6 ${h.hidden('diff2',c.file.last_changeset.raw_id)}
7 ${h.select('diff1',c.file.last_changeset.raw_id,c.file_history)}
31 8 ${h.submit('diff','diff to revision',class_="ui-button-small")}
32 9 ${h.submit('show_rev','show at revision',class_="ui-button-small")}
33 10 ${h.end_form()}
34 11 </div>
35 12 </dd>
36 </dl>
13 </dl>
37 14
38 15
39 16 <div id="body" class="codeblock">
40 17 <div class="code-header">
41 <div class="revision">${c.files_list.name}@r${c.files_list.last_changeset.revision}:${h.short_id(c.files_list.last_changeset.raw_id)}</div>
42 <div class="commit">"${c.files_list.last_changeset.message}"</div>
18 <div class="stats">
19 <div class="left"><img src="${h.url('/images/icons/file.png')}"/></div>
20 <div class="left item">${h.link_to("r%s:%s" % (c.file.last_changeset.revision,h.short_id(c.file.last_changeset.raw_id)),h.url('changeset_home',repo_name=c.repo_name,revision=c.file.last_changeset.raw_id))}</div>
21 <div class="left item">${h.format_byte_size(c.file.size,binary=True)}</div>
22 <div class="left item last">${c.file.mimetype}</div>
23 <div class="buttons">
24 ${h.link_to(_('show annotation'),h.url('files_annotate_home',repo_name=c.repo_name,revision=c.changeset.raw_id,f_path=c.f_path),class_="ui-button-small")}
25 ${h.link_to(_('show as raw'),h.url('files_raw_home',repo_name=c.repo_name,revision=c.changeset.raw_id,f_path=c.f_path),class_="ui-button-small")}
26 ${h.link_to(_('download as raw'),h.url('files_rawfile_home',repo_name=c.repo_name,revision=c.changeset.raw_id,f_path=c.f_path),class_="ui-button-small")}
27 % if h.HasRepoPermissionAny('repository.write','repository.admin')(c.repo_name):
28 % if not c.file.is_binary:
29 ${h.link_to(_('edit'),h.url('files_edit_home',repo_name=c.repo_name,revision=c.changeset.raw_id,f_path=c.f_path),class_="ui-button-small")}
30 % endif
31 % endif
32 </div>
33 </div>
34 <div class="author">
35 <div class="gravatar">
36 <img alt="gravatar" src="${h.gravatar_url(h.email(c.changeset.author),16)}"/>
37 </div>
38 <div title="${h.email_or_none(c.changeset.author)}" class="user">${h.person(c.changeset.author)}</div>
39 </div>
40 <div class="commit">${c.file.last_changeset.message}</div>
43 41 </div>
44 42 <div class="code-body">
45 %if c.files_list.is_binary:
46 ${_('Binary file (%s)') % c.files_list.mimetype}
43 %if c.file.is_binary:
44 ${_('Binary file (%s)') % c.file.mimetype}
47 45 %else:
48 % if c.files_list.size < c.cut_off_limit:
49 ${h.pygmentize(c.files_list,linenos=True,anchorlinenos=True,lineanchors='L',cssclass="code-highlight")}
46 % if c.file.size < c.cut_off_limit:
47 ${h.pygmentize(c.file,linenos=True,anchorlinenos=True,lineanchors='L',cssclass="code-highlight")}
50 48 %else:
51 49 ${_('File is too big to display')} ${h.link_to(_('show as raw'),
52 50 h.url('files_raw_home',repo_name=c.repo_name,revision=c.changeset.raw_id,f_path=c.f_path))}
@@ -1,8 +1,8 b''
1 %if c.files_list:
1 %if c.file:
2 2 <h3 class="files_location">
3 ${_('Location')}: ${h.files_breadcrumbs(c.repo_name,c.changeset.raw_id,c.files_list.path)}
3 ${_('Location')}: ${h.files_breadcrumbs(c.repo_name,c.changeset.raw_id,c.file.path)}
4 4 </h3>
5 %if c.files_list.is_dir():
5 %if c.file.is_dir():
6 6 <%include file='files_browser.html'/>
7 7 %else:
8 8 <%include file='files_source.html'/>
@@ -66,6 +66,7 b''
66 66 <tr class="parity${cnt%2}">
67 67 <td class="quick_repo_menu">
68 68 <ul class="menu_items hidden">
69 <li style="border-top:1px solid #003367;margin-left:18px;padding-left:-99px"></li>
69 70 <li>
70 71 <a title="${_('Summary')}" href="${h.url('summary_home',repo_name=repo['name'])}">
71 72 <span class="icon">
@@ -129,11 +129,11 b' class TestFilesController(TestController'
129 129 </optgroup>""" in response.body
130 130
131 131
132 assert """<div class="commit">"Partially implemented #16. filecontent/commit message/author/node name are safe_unicode now.
132 assert """<div class="commit">Partially implemented #16. filecontent/commit message/author/node name are safe_unicode now.
133 133 In addition some other __str__ are unicode as well
134 134 Added test for unicode
135 135 Improved test to clone into uniq repository.
136 removed extra unicode conversion in diff."</div>""" in response.body
136 removed extra unicode conversion in diff.</div>""" in response.body
137 137
138 138 assert """<span style="text-transform: uppercase;"><a href="#">branch: default</a></span>""" in response.body, 'missing or wrong branch info'
139 139
General Comments 0
You need to be logged in to leave comments. Login now