##// END OF EJS Templates
commits: use no-wrap version of commit td in commits/summary grids.
marcink -
r3903:b8898776 default
parent child Browse files
Show More
@@ -1,98 +1,98 b''
1 <%namespace name="base" file="/base/base.mako"/>
1 <%namespace name="base" file="/base/base.mako"/>
2 <%namespace name="search" file="/search/search.mako"/>
2 <%namespace name="search" file="/search/search.mako"/>
3
3
4 % if c.formatted_results:
4 % if c.formatted_results:
5
5
6 <table class="rctable search-results">
6 <table class="rctable search-results">
7 <tr>
7 <tr>
8 <th>${_('Repository')}</th>
8 <th>${_('Repository')}</th>
9 <th>${_('Commit')}</th>
9 <th>${_('Commit')}</th>
10 <th></th>
10 <th></th>
11 <th>${_('Commit message')}</th>
11 <th>${_('Commit message')}</th>
12 <th>
12 <th>
13 %if c.sort == 'newfirst':
13 %if c.sort == 'newfirst':
14 <a href="${c.url_generator(sort='oldfirst')}">${_('Age (new first)')}</a>
14 <a href="${c.url_generator(sort='oldfirst')}">${_('Age (new first)')}</a>
15 %else:
15 %else:
16 <a href="${c.url_generator(sort='newfirst')}">${_('Age (old first)')}</a>
16 <a href="${c.url_generator(sort='newfirst')}">${_('Age (old first)')}</a>
17 %endif
17 %endif
18 </th>
18 </th>
19 <th>${_('Author')}</th>
19 <th>${_('Author')}</th>
20 </tr>
20 </tr>
21 %for entry in c.formatted_results:
21 %for entry in c.formatted_results:
22 ## search results are additionally filtered, and this check is just a safe gate
22 ## search results are additionally filtered, and this check is just a safe gate
23 % if c.rhodecode_user.is_admin or h.HasRepoPermissionAny('repository.write','repository.read','repository.admin')(entry['repository'], 'search results commit check'):
23 % if c.rhodecode_user.is_admin or h.HasRepoPermissionAny('repository.write','repository.read','repository.admin')(entry['repository'], 'search results commit check'):
24 <tr class="body">
24 <tr class="body">
25 <td class="td-componentname">
25 <td class="td-componentname">
26 <% repo_type = entry.get('repo_type') or h.get_repo_type_by_name(entry.get('repository')) %>
26 <% repo_type = entry.get('repo_type') or h.get_repo_type_by_name(entry.get('repository')) %>
27 ${search.repo_icon(repo_type)}
27 ${search.repo_icon(repo_type)}
28 ${h.link_to(entry['repository'], h.route_path('repo_summary',repo_name=entry['repository']))}
28 ${h.link_to(entry['repository'], h.route_path('repo_summary',repo_name=entry['repository']))}
29 </td>
29 </td>
30 <td class="td-commit">
30 <td class="td-hash">
31 ${h.link_to(h._shorten_commit_id(entry['commit_id']),
31 ${h.link_to(h._shorten_commit_id(entry['commit_id']),
32 h.route_path('repo_commit',repo_name=entry['repository'],commit_id=entry['commit_id']))}
32 h.route_path('repo_commit',repo_name=entry['repository'],commit_id=entry['commit_id']))}
33 </td>
33 </td>
34 <td class="td-message expand_commit search open" data-commit-id="${h.md5_safe(entry['repository'])+entry['commit_id']}" id="t-${h.md5_safe(entry['repository'])+entry['commit_id']}" title="${_('Expand commit message')}">
34 <td class="td-message expand_commit search open" data-commit-id="${h.md5_safe(entry['repository'])+entry['commit_id']}" id="t-${h.md5_safe(entry['repository'])+entry['commit_id']}" title="${_('Expand commit message')}">
35 <div>
35 <div>
36 <i class="icon-expand-linked"></i>&nbsp;
36 <i class="icon-expand-linked"></i>&nbsp;
37 </div>
37 </div>
38 </td>
38 </td>
39 <td data-commit-id="${h.md5_safe(entry['repository'])+entry['commit_id']}" id="c-${h.md5_safe(entry['repository'])+entry['commit_id']}" class="message td-description open">
39 <td data-commit-id="${h.md5_safe(entry['repository'])+entry['commit_id']}" id="c-${h.md5_safe(entry['repository'])+entry['commit_id']}" class="message td-description open">
40 %if entry.get('message_hl'):
40 %if entry.get('message_hl'):
41 ${h.literal(entry['message_hl'])}
41 ${h.literal(entry['message_hl'])}
42 %else:
42 %else:
43 ${h.urlify_commit_message(entry['message'], entry['repository'])}
43 ${h.urlify_commit_message(entry['message'], entry['repository'])}
44 %endif
44 %endif
45 </td>
45 </td>
46 <td class="td-time">
46 <td class="td-time">
47 ${h.age_component(h.time_to_utcdatetime(entry['date']))}
47 ${h.age_component(h.time_to_utcdatetime(entry['date']))}
48 </td>
48 </td>
49
49
50 <td class="td-user author">
50 <td class="td-user author">
51 <%
51 <%
52 ## es6 stores this as object
52 ## es6 stores this as object
53 author = entry['author']
53 author = entry['author']
54 if isinstance(author, dict):
54 if isinstance(author, dict):
55 author = author['email']
55 author = author['email']
56 %>
56 %>
57 ${base.gravatar_with_user(author)}
57 ${base.gravatar_with_user(author)}
58 </td>
58 </td>
59 </tr>
59 </tr>
60 % endif
60 % endif
61 %endfor
61 %endfor
62 </table>
62 </table>
63
63
64 %if c.cur_query:
64 %if c.cur_query:
65 <div class="pagination-wh pagination-left">
65 <div class="pagination-wh pagination-left">
66 ${c.formatted_results.pager('$link_previous ~2~ $link_next')}
66 ${c.formatted_results.pager('$link_previous ~2~ $link_next')}
67 </div>
67 </div>
68 %endif
68 %endif
69
69
70 <script>
70 <script>
71 $('.expand_commit').on('click',function(e){
71 $('.expand_commit').on('click',function(e){
72 var target_expand = $(this);
72 var target_expand = $(this);
73 var cid = target_expand.data('commit-id');
73 var cid = target_expand.data('commit-id');
74
74
75 if (target_expand.hasClass('open')){
75 if (target_expand.hasClass('open')){
76 $('#c-'+cid).css({'height': '1.5em', 'white-space': 'nowrap', 'text-overflow': 'ellipsis', 'overflow':'hidden'});
76 $('#c-'+cid).css({'height': '1.5em', 'white-space': 'nowrap', 'text-overflow': 'ellipsis', 'overflow':'hidden'});
77 $('#t-'+cid).css({'height': 'auto', 'line-height': '.9em', 'text-overflow': 'ellipsis', 'overflow':'hidden'});
77 $('#t-'+cid).css({'height': 'auto', 'line-height': '.9em', 'text-overflow': 'ellipsis', 'overflow':'hidden'});
78 target_expand.removeClass('open');
78 target_expand.removeClass('open');
79 }
79 }
80 else {
80 else {
81 $('#c-'+cid).css({'height': 'auto', 'white-space': 'normal', 'text-overflow': 'initial', 'overflow':'visible'});
81 $('#c-'+cid).css({'height': 'auto', 'white-space': 'normal', 'text-overflow': 'initial', 'overflow':'visible'});
82 $('#t-'+cid).css({'height': 'auto', 'max-height': 'none', 'text-overflow': 'initial', 'overflow':'visible'});
82 $('#t-'+cid).css({'height': 'auto', 'max-height': 'none', 'text-overflow': 'initial', 'overflow':'visible'});
83 target_expand.addClass('open');
83 target_expand.addClass('open');
84 }
84 }
85 });
85 });
86
86
87 $(".message.td-description").mark(
87 $(".message.td-description").mark(
88 "${c.searcher.query_to_mark(c.cur_query, 'message')}",
88 "${c.searcher.query_to_mark(c.cur_query, 'message')}",
89 {
89 {
90 "className": 'match',
90 "className": 'match',
91 "accuracy": "complementary",
91 "accuracy": "complementary",
92 "ignorePunctuation": ":._(){}[]!'+=".split("")
92 "ignorePunctuation": ":._(){}[]!'+=".split("")
93 }
93 }
94 );
94 );
95
95
96 </script>
96 </script>
97
97
98 % endif
98 % endif
@@ -1,167 +1,167 b''
1 ## -*- coding: utf-8 -*-
1 ## -*- coding: utf-8 -*-
2 <%namespace name="base" file="/base/base.mako"/>
2 <%namespace name="base" file="/base/base.mako"/>
3 %if c.repo_commits:
3 %if c.repo_commits:
4 <table class="rctable repo_summary table_disp">
4 <table class="rctable repo_summary table_disp">
5 <tr>
5 <tr>
6
6
7 <th class="status"></th>
7 <th class="status"></th>
8 <th>${_('Commit')}</th>
8 <th>${_('Commit')}</th>
9 <th>${_('Commit message')}</th>
9 <th>${_('Commit message')}</th>
10 <th>${_('Age')}</th>
10 <th>${_('Age')}</th>
11 <th>${_('Author')}</th>
11 <th>${_('Author')}</th>
12 <th colspan="2">${_('Refs')}</th>
12 <th colspan="2">${_('Refs')}</th>
13 </tr>
13 </tr>
14
14
15 ## to speed up lookups cache some functions before the loop
15 ## to speed up lookups cache some functions before the loop
16 <%
16 <%
17 active_patterns = h.get_active_pattern_entries(c.repo_name)
17 active_patterns = h.get_active_pattern_entries(c.repo_name)
18 urlify_commit_message = h.partial(h.urlify_commit_message, active_pattern_entries=active_patterns)
18 urlify_commit_message = h.partial(h.urlify_commit_message, active_pattern_entries=active_patterns)
19 %>
19 %>
20 %for cnt,cs in enumerate(c.repo_commits):
20 %for cnt,cs in enumerate(c.repo_commits):
21 <tr class="parity${cnt%2}">
21 <tr class="parity${cnt%2}">
22
22
23 <td class="td-status">
23 <td class="td-status">
24 %if c.statuses.get(cs.raw_id):
24 %if c.statuses.get(cs.raw_id):
25 <div class="changeset-status-ico shortlog">
25 <div class="changeset-status-ico shortlog">
26 %if c.statuses.get(cs.raw_id)[2]:
26 %if c.statuses.get(cs.raw_id)[2]:
27 <a class="tooltip" title="${_('Commit status: %s\nClick to open associated pull request #%s') % (c.statuses.get(cs.raw_id)[0], c.statuses.get(cs.raw_id)[2])}" href="${h.route_path('pullrequest_show',repo_name=c.statuses.get(cs.raw_id)[3],pull_request_id=c.statuses.get(cs.raw_id)[2])}">
27 <a class="tooltip" title="${_('Commit status: %s\nClick to open associated pull request #%s') % (c.statuses.get(cs.raw_id)[0], c.statuses.get(cs.raw_id)[2])}" href="${h.route_path('pullrequest_show',repo_name=c.statuses.get(cs.raw_id)[3],pull_request_id=c.statuses.get(cs.raw_id)[2])}">
28 <i class="icon-circle review-status-${c.statuses.get(cs.raw_id)[0]}"></i>
28 <i class="icon-circle review-status-${c.statuses.get(cs.raw_id)[0]}"></i>
29 </a>
29 </a>
30 %else:
30 %else:
31 <a class="tooltip" title="${_('Commit status: {}').format(h.commit_status_lbl(c.statuses.get(cs.raw_id)[0]))}" href="${h.route_path('repo_commit',repo_name=c.repo_name,commit_id=cs.raw_id,_anchor='comment-%s' % c.comments[cs.raw_id][0].comment_id)}">
31 <a class="tooltip" title="${_('Commit status: {}').format(h.commit_status_lbl(c.statuses.get(cs.raw_id)[0]))}" href="${h.route_path('repo_commit',repo_name=c.repo_name,commit_id=cs.raw_id,_anchor='comment-%s' % c.comments[cs.raw_id][0].comment_id)}">
32 <i class="icon-circle review-status-${c.statuses.get(cs.raw_id)[0]}"></i>
32 <i class="icon-circle review-status-${c.statuses.get(cs.raw_id)[0]}"></i>
33 </a>
33 </a>
34 %endif
34 %endif
35 </div>
35 </div>
36 %else:
36 %else:
37 <i class="icon-circle review-status-not_reviewed" title="${_('Commit status: Not Reviewed')}"></i>
37 <i class="icon-circle review-status-not_reviewed" title="${_('Commit status: Not Reviewed')}"></i>
38 %endif
38 %endif
39 </td>
39 </td>
40 <td class="td-commit">
40 <td class="td-hash">
41 <code>
41 <code>
42 <a href="${h.route_path('repo_commit', repo_name=c.repo_name, commit_id=cs.raw_id)}">${h.show_id(cs)}</a>
42 <a href="${h.route_path('repo_commit', repo_name=c.repo_name, commit_id=cs.raw_id)}">${h.show_id(cs)}</a>
43 <i class="tooltip icon-clipboard clipboard-action" data-clipboard-text="${cs.raw_id}" title="${_('Copy the full commit id')}"></i>
43 <i class="tooltip icon-clipboard clipboard-action" data-clipboard-text="${cs.raw_id}" title="${_('Copy the full commit id')}"></i>
44 </code>
44 </code>
45 </td>
45 </td>
46
46
47 <td class="td-description mid">
47 <td class="td-description mid">
48 <div class="log-container truncate-wrap">
48 <div class="log-container truncate-wrap">
49 <div class="message truncate" id="c-${cs.raw_id}">${urlify_commit_message(cs.message, c.repo_name)}</div>
49 <div class="message truncate" id="c-${cs.raw_id}">${urlify_commit_message(cs.message, c.repo_name)}</div>
50 </div>
50 </div>
51 </td>
51 </td>
52
52
53 <td class="td-time">
53 <td class="td-time">
54 ${h.age_component(cs.date)}
54 ${h.age_component(cs.date)}
55 </td>
55 </td>
56 <td class="td-user author">
56 <td class="td-user author">
57 ${base.gravatar_with_user(cs.author)}
57 ${base.gravatar_with_user(cs.author)}
58 </td>
58 </td>
59
59
60 <td class="td-tags">
60 <td class="td-tags">
61 <div class="autoexpand">
61 <div class="autoexpand">
62 %if h.is_hg(c.rhodecode_repo):
62 %if h.is_hg(c.rhodecode_repo):
63 %for book in cs.bookmarks:
63 %for book in cs.bookmarks:
64 <span class="booktag tag" title="${h.tooltip(_('Bookmark %s') % book)}">
64 <span class="booktag tag" title="${h.tooltip(_('Bookmark %s') % book)}">
65 <a href="${h.route_path('repo_files:default_path',repo_name=c.repo_name,commit_id=cs.raw_id, _query=dict(at=book))}"><i class="icon-bookmark"></i>${h.shorter(book)}</a>
65 <a href="${h.route_path('repo_files:default_path',repo_name=c.repo_name,commit_id=cs.raw_id, _query=dict(at=book))}"><i class="icon-bookmark"></i>${h.shorter(book)}</a>
66 </span>
66 </span>
67 %endfor
67 %endfor
68 %endif
68 %endif
69 ## tags
69 ## tags
70 %for tag in cs.tags:
70 %for tag in cs.tags:
71 <span class="tagtag tag" title="${h.tooltip(_('Tag %s') % tag)}">
71 <span class="tagtag tag" title="${h.tooltip(_('Tag %s') % tag)}">
72 <a href="${h.route_path('repo_files:default_path',repo_name=c.repo_name,commit_id=cs.raw_id, _query=dict(at=tag))}"><i class="icon-tag"></i>${h.shorter(tag)}</a>
72 <a href="${h.route_path('repo_files:default_path',repo_name=c.repo_name,commit_id=cs.raw_id, _query=dict(at=tag))}"><i class="icon-tag"></i>${h.shorter(tag)}</a>
73 </span>
73 </span>
74 %endfor
74 %endfor
75
75
76 ## branch
76 ## branch
77 %if cs.branch:
77 %if cs.branch:
78 <span class="branchtag tag" title="${h.tooltip(_('Branch %s') % cs.branch)}">
78 <span class="branchtag tag" title="${h.tooltip(_('Branch %s') % cs.branch)}">
79 <a href="${h.route_path('repo_commits',repo_name=c.repo_name,_query=dict(branch=cs.branch))}"><i class="icon-code-fork"></i>${h.shorter(cs.branch)}</a>
79 <a href="${h.route_path('repo_commits',repo_name=c.repo_name,_query=dict(branch=cs.branch))}"><i class="icon-code-fork"></i>${h.shorter(cs.branch)}</a>
80 </span>
80 </span>
81 %endif
81 %endif
82 </div>
82 </div>
83 </td>
83 </td>
84 <td class="td-comments">
84 <td class="td-comments">
85 <% cs_comments = c.comments.get(cs.raw_id,[]) %>
85 <% cs_comments = c.comments.get(cs.raw_id,[]) %>
86 % if cs_comments:
86 % if cs_comments:
87 <a title="${_('Commit has comments')}" href="${h.route_path('repo_commit',repo_name=c.repo_name,commit_id=cs.raw_id,_anchor='comment-%s' % cs_comments[0].comment_id)}">
87 <a title="${_('Commit has comments')}" href="${h.route_path('repo_commit',repo_name=c.repo_name,commit_id=cs.raw_id,_anchor='comment-%s' % cs_comments[0].comment_id)}">
88 <i class="icon-comment"></i> ${len(cs_comments)}
88 <i class="icon-comment"></i> ${len(cs_comments)}
89 </a>
89 </a>
90 % else:
90 % else:
91 <i class="icon-comment"></i> ${len(cs_comments)}
91 <i class="icon-comment"></i> ${len(cs_comments)}
92 % endif
92 % endif
93 </td>
93 </td>
94 </tr>
94 </tr>
95 %endfor
95 %endfor
96
96
97 </table>
97 </table>
98
98
99 <script type="text/javascript">
99 <script type="text/javascript">
100 $(document).pjax('#shortlog_data .pager_link','#shortlog_data', {timeout: 5000, scrollTo: false, push: false});
100 $(document).pjax('#shortlog_data .pager_link','#shortlog_data', {timeout: 5000, scrollTo: false, push: false});
101 $(document).on('pjax:success', function(){ timeagoActivate(); });
101 $(document).on('pjax:success', function(){ timeagoActivate(); });
102 $(document).on('pjax:timeout', function(event) {
102 $(document).on('pjax:timeout', function(event) {
103 // Prevent default timeout redirection behavior
103 // Prevent default timeout redirection behavior
104 event.preventDefault()
104 event.preventDefault()
105 })
105 })
106
106
107 </script>
107 </script>
108
108
109 <div class="pagination-wh pagination-left">
109 <div class="pagination-wh pagination-left">
110 ${c.repo_commits.pager('$link_previous ~2~ $link_next')}
110 ${c.repo_commits.pager('$link_previous ~2~ $link_next')}
111 </div>
111 </div>
112 %else:
112 %else:
113
113
114 %if h.HasRepoPermissionAny('repository.write','repository.admin')(c.repo_name):
114 %if h.HasRepoPermissionAny('repository.write','repository.admin')(c.repo_name):
115 <div class="quick_start">
115 <div class="quick_start">
116 <div class="fieldset">
116 <div class="fieldset">
117 <p><b>${_('Add or upload files directly via RhodeCode:')}</b></p>
117 <p><b>${_('Add or upload files directly via RhodeCode:')}</b></p>
118 <div class="pull-left">
118 <div class="pull-left">
119 <a href="${h.route_path('repo_files_add_file',repo_name=c.repo_name,commit_id=0, f_path='')}" class="btn btn-default">${_('Add New File')}</a>
119 <a href="${h.route_path('repo_files_add_file',repo_name=c.repo_name,commit_id=0, f_path='')}" class="btn btn-default">${_('Add New File')}</a>
120 </div>
120 </div>
121 <div class="pull-left">
121 <div class="pull-left">
122 <a href="${h.route_path('repo_files_upload_file',repo_name=c.repo_name,commit_id=0, f_path='')}" class="btn btn-default">${_('Upload New File')}</a>
122 <a href="${h.route_path('repo_files_upload_file',repo_name=c.repo_name,commit_id=0, f_path='')}" class="btn btn-default">${_('Upload New File')}</a>
123 </div>
123 </div>
124 %endif
124 %endif
125 </div>
125 </div>
126
126
127 <div class="fieldset">
127 <div class="fieldset">
128 <p><b>${_('Push new repo:')}</b></p>
128 <p><b>${_('Push new repo:')}</b></p>
129 <pre>
129 <pre>
130 %if h.is_git(c.rhodecode_repo):
130 %if h.is_git(c.rhodecode_repo):
131 git clone ${c.clone_repo_url}
131 git clone ${c.clone_repo_url}
132 git add README # add first file
132 git add README # add first file
133 git commit -m "Initial commit" # commit with message
133 git commit -m "Initial commit" # commit with message
134 git remote add origin ${c.clone_repo_url}
134 git remote add origin ${c.clone_repo_url}
135 git push -u origin master # push changes back to default master branch
135 git push -u origin master # push changes back to default master branch
136 %elif h.is_hg(c.rhodecode_repo):
136 %elif h.is_hg(c.rhodecode_repo):
137 hg clone ${c.clone_repo_url}
137 hg clone ${c.clone_repo_url}
138 hg add README # add first file
138 hg add README # add first file
139 hg commit -m "Initial commit" # commit with message
139 hg commit -m "Initial commit" # commit with message
140 hg push ${c.clone_repo_url}
140 hg push ${c.clone_repo_url}
141 %elif h.is_svn(c.rhodecode_repo):
141 %elif h.is_svn(c.rhodecode_repo):
142 svn co ${c.clone_repo_url}
142 svn co ${c.clone_repo_url}
143 svn add README # add first file
143 svn add README # add first file
144 svn commit -m "Initial commit"
144 svn commit -m "Initial commit"
145 svn commit # send changes back to the server
145 svn commit # send changes back to the server
146 %endif
146 %endif
147 </pre>
147 </pre>
148 </div>
148 </div>
149
149
150 <div class="fieldset">
150 <div class="fieldset">
151 <p><b>${_('Existing repository?')}</b></p>
151 <p><b>${_('Existing repository?')}</b></p>
152 <pre>
152 <pre>
153 %if h.is_git(c.rhodecode_repo):
153 %if h.is_git(c.rhodecode_repo):
154 git remote add origin ${c.clone_repo_url}
154 git remote add origin ${c.clone_repo_url}
155 git push -u origin master
155 git push -u origin master
156 %elif h.is_hg(c.rhodecode_repo):
156 %elif h.is_hg(c.rhodecode_repo):
157 hg push ${c.clone_repo_url}
157 hg push ${c.clone_repo_url}
158 %elif h.is_svn(c.rhodecode_repo):
158 %elif h.is_svn(c.rhodecode_repo):
159 svn co ${c.clone_repo_url}
159 svn co ${c.clone_repo_url}
160 %endif
160 %endif
161 </pre>
161 </pre>
162
162
163 </div>
163 </div>
164
164
165
165
166 </div>
166 </div>
167 %endif
167 %endif
General Comments 0
You need to be logged in to leave comments. Login now