##// END OF EJS Templates
templates: add copy to clipboard for repository clone.
marcink -
r1942:f50c2856 default
parent child Browse files
Show More
@@ -1,270 +1,270 b''
1 // summary.less
1 // summary.less
2 // For use in RhodeCode applications;
2 // For use in RhodeCode applications;
3 // Used for headers and file detail summary screens.
3 // Used for headers and file detail summary screens.
4
4
5 .summary {
5 .summary {
6 float: left;
6 float: left;
7 position: relative;
7 position: relative;
8 width: 100%;
8 width: 100%;
9 margin: 0;
9 margin: 0;
10 padding: 0;
10 padding: 0;
11
11
12 .summary-detail-header {
12 .summary-detail-header {
13 float: left;
13 float: left;
14 display: block;
14 display: block;
15 width: 100%;
15 width: 100%;
16 margin-bottom: @textmargin;
16 margin-bottom: @textmargin;
17 padding: 0 0 .5em 0;
17 padding: 0 0 .5em 0;
18 border-bottom: @border-thickness solid @border-default-color;
18 border-bottom: @border-thickness solid @border-default-color;
19
19
20 .breadcrumbs {
20 .breadcrumbs {
21 float: left;
21 float: left;
22 display: inline;
22 display: inline;
23 margin: 0;
23 margin: 0;
24 padding: 0;
24 padding: 0;
25 }
25 }
26 h4 {
26 h4 {
27 float: left;
27 float: left;
28 margin: 0 1em 0 0;
28 margin: 0 1em 0 0;
29 padding: 0;
29 padding: 0;
30 line-height: 1.2em;
30 line-height: 1.2em;
31 font-size: @basefontsize;
31 font-size: @basefontsize;
32 }
32 }
33
33
34 .action_link {
34 .action_link {
35 float: right;
35 float: right;
36 }
36 }
37
37
38 .new-file {
38 .new-file {
39 float: right;
39 float: right;
40 margin-top: -1.5em;
40 margin-top: -1.5em;
41 }
41 }
42 }
42 }
43
43
44 .summary-detail {
44 .summary-detail {
45 float: left;
45 float: left;
46 position: relative;
46 position: relative;
47 width: 73%;
47 width: 73%;
48 margin: 0 3% @space 0;
48 margin: 0 3% @space 0;
49 padding: 0;
49 padding: 0;
50
50
51 .file_diff_buttons {
51 .file_diff_buttons {
52 margin-top: @space;
52 margin-top: @space;
53 }
53 }
54
54
55 // commit message
55 // commit message
56 .commit {
56 .commit {
57 white-space: pre-wrap;
57 white-space: pre-wrap;
58 }
58 }
59
59
60 #clone_url {
60 #clone_url {
61 width: ~"calc(100% - 96px)";
61 width: ~"calc(100% - 103px)";
62 padding: @padding/4;
62 padding: @padding/4;
63 }
63 }
64
64
65 #clone_url_id {
65 #clone_url_id {
66 width: ~"calc(100% - 118px)";
66 width: ~"calc(100% - 125px)";
67 padding: @padding/4;
67 padding: @padding/4;
68 }
68 }
69
69
70 &.directory {
70 &.directory {
71 margin-bottom: 0;
71 margin-bottom: 0;
72 }
72 }
73
73
74 .desc {
74 .desc {
75 white-space: pre-wrap;
75 white-space: pre-wrap;
76 }
76 }
77 .disabled {
77 .disabled {
78 opacity: .5;
78 opacity: .5;
79 cursor: inherit;
79 cursor: inherit;
80 }
80 }
81 .help-block {
81 .help-block {
82 color: inherit;
82 color: inherit;
83 margin: 0;
83 margin: 0;
84 }
84 }
85 }
85 }
86
86
87 .sidebar-right {
87 .sidebar-right {
88 float: left;
88 float: left;
89 width: 24%;
89 width: 24%;
90 margin: 0;
90 margin: 0;
91 padding: 0;
91 padding: 0;
92
92
93 ul {
93 ul {
94 margin-left: 0;
94 margin-left: 0;
95 padding-left: 0;
95 padding-left: 0;
96
96
97 li {
97 li {
98
98
99 &:before {
99 &:before {
100 content: none;
100 content: none;
101 width: 0;
101 width: 0;
102 }
102 }
103 }
103 }
104 }
104 }
105 }
105 }
106
106
107 #clone_by_name, #clone_by_id{
107 #clone_by_name, #clone_by_id{
108 display: inline-block;
108 display: inline-block;
109 margin-left: @padding;
109 margin-left: 0px;
110 }
110 }
111
111
112 .codeblock {
112 .codeblock {
113 border: none;
113 border: none;
114 background-color: transparent;
114 background-color: transparent;
115 }
115 }
116
116
117 .code-body {
117 .code-body {
118 border: @border-thickness solid @border-default-color;
118 border: @border-thickness solid @border-default-color;
119 .border-radius(@border-radius);
119 .border-radius(@border-radius);
120 }
120 }
121 }
121 }
122
122
123 // this is used outside of just the summary
123 // this is used outside of just the summary
124 .fieldset, // similar to form fieldset
124 .fieldset, // similar to form fieldset
125 .summary .sidebar-right-content { // these have to match
125 .summary .sidebar-right-content { // these have to match
126 clear: both;
126 clear: both;
127 float: left;
127 float: left;
128 position: relative;
128 position: relative;
129 display:block;
129 display:block;
130 width: 100%;
130 width: 100%;
131 min-height: 1em;
131 min-height: 1em;
132 margin-bottom: @textmargin;
132 margin-bottom: @textmargin;
133 padding: 0;
133 padding: 0;
134 line-height: 1.2em;
134 line-height: 1.2em;
135
135
136 &:after { // clearfix
136 &:after { // clearfix
137 content: "";
137 content: "";
138 clear: both;
138 clear: both;
139 width: 100%;
139 width: 100%;
140 height: 1em;
140 height: 1em;
141 }
141 }
142 }
142 }
143
143
144 .summary .sidebar-right-content {
144 .summary .sidebar-right-content {
145 margin-bottom: @space;
145 margin-bottom: @space;
146
146
147 .rc-user {
147 .rc-user {
148 min-width: 0;
148 min-width: 0;
149 }
149 }
150 }
150 }
151
151
152 .fieldset {
152 .fieldset {
153
153
154 .left-label { // similar to form legend
154 .left-label { // similar to form legend
155 float: left;
155 float: left;
156 display: block;
156 display: block;
157 width: 25%;
157 width: 25%;
158 margin: 0;
158 margin: 0;
159 padding: 0;
159 padding: 0;
160 font-family: @text-semibold;
160 font-family: @text-semibold;
161 }
161 }
162
162
163 .right-content { // similar to form fields
163 .right-content { // similar to form fields
164 float: left;
164 float: left;
165 display: block;
165 display: block;
166 width: 75%;
166 width: 75%;
167 margin: 0 0 0 -15%;
167 margin: 0 0 0 -15%;
168 padding: 0 0 0 15%;
168 padding: 0 0 0 15%;
169
169
170 .truncate-wrap,
170 .truncate-wrap,
171 .truncate {
171 .truncate {
172 max-width: 100%;
172 max-width: 100%;
173 width: 100%;
173 width: 100%;
174 }
174 }
175
175
176 .commit-long {
176 .commit-long {
177 overflow-x: auto;
177 overflow-x: auto;
178 }
178 }
179 }
179 }
180 .commit.truncate-wrap {
180 .commit.truncate-wrap {
181 overflow:hidden;
181 overflow:hidden;
182 text-overflow: ellipsis;
182 text-overflow: ellipsis;
183 }
183 }
184 }
184 }
185
185
186 // expand commit message
186 // expand commit message
187 #message_expand {
187 #message_expand {
188 clear: both;
188 clear: both;
189 display: block;
189 display: block;
190 color: @rcblue;
190 color: @rcblue;
191 cursor: pointer;
191 cursor: pointer;
192 }
192 }
193
193
194 #trimmed_message_box {
194 #trimmed_message_box {
195 max-height: floor(2 * @basefontsize * 1.2); // 2 lines * line-height
195 max-height: floor(2 * @basefontsize * 1.2); // 2 lines * line-height
196 overflow: hidden;
196 overflow: hidden;
197 }
197 }
198
198
199 // show/hide comments button
199 // show/hide comments button
200 .show-inline-comments {
200 .show-inline-comments {
201 display: inline;
201 display: inline;
202 cursor: pointer;
202 cursor: pointer;
203
203
204 .comments-show { display: inline; }
204 .comments-show { display: inline; }
205 .comments-hide { display: none; }
205 .comments-hide { display: none; }
206
206
207 &.comments-visible {
207 &.comments-visible {
208 .comments-show { display: none; }
208 .comments-show { display: none; }
209 .comments-hide { display: inline; }
209 .comments-hide { display: inline; }
210 }
210 }
211 }
211 }
212
212
213 // Quick Start section
213 // Quick Start section
214 .quick_start {
214 .quick_start {
215 float: left;
215 float: left;
216 display: block;
216 display: block;
217 position: relative;
217 position: relative;
218 width: 100%;
218 width: 100%;
219
219
220 // adds some space to make copy and paste easier
220 // adds some space to make copy and paste easier
221 .left-label,
221 .left-label,
222 .right-content {
222 .right-content {
223 line-height: 1.6em;
223 line-height: 1.6em;
224 }
224 }
225 }
225 }
226
226
227 .submodule {
227 .submodule {
228 .summary-detail {
228 .summary-detail {
229 width: 100%;
229 width: 100%;
230
230
231 .btn-collapse {
231 .btn-collapse {
232 display: none;
232 display: none;
233 }
233 }
234 }
234 }
235 }
235 }
236
236
237 .codeblock-header {
237 .codeblock-header {
238 float: left;
238 float: left;
239 display: block;
239 display: block;
240 width: 100%;
240 width: 100%;
241 margin: 0;
241 margin: 0;
242 padding: @space 0 @padding 0;
242 padding: @space 0 @padding 0;
243 border-top: @border-thickness solid @border-default-color;
243 border-top: @border-thickness solid @border-default-color;
244
244
245 .stats {
245 .stats {
246 float: left;
246 float: left;
247 width: 50%;
247 width: 50%;
248 }
248 }
249
249
250 .buttons {
250 .buttons {
251 float: right;
251 float: right;
252 width: 50%;
252 width: 50%;
253 text-align: right;
253 text-align: right;
254 color: @grey4;
254 color: @grey4;
255 }
255 }
256 }
256 }
257
257
258 #summary-menu-stats {
258 #summary-menu-stats {
259
259
260 .stats-bullet {
260 .stats-bullet {
261 color: @grey3;
261 color: @grey3;
262 min-width: 3em;
262 min-width: 3em;
263 }
263 }
264
264
265 .repo-size {
265 .repo-size {
266 margin-bottom: .5em;
266 margin-bottom: .5em;
267 }
267 }
268
268
269 }
269 }
270
270
@@ -1,202 +1,211 b''
1 <%def name="refs_counters(branches, closed_branches, tags, bookmarks)">
1 <%def name="refs_counters(branches, closed_branches, tags, bookmarks)">
2 <span class="branchtag tag">
2 <span class="branchtag tag">
3 <a href="${h.route_path('branches_home',repo_name=c.repo_name)}" class="childs">
3 <a href="${h.route_path('branches_home',repo_name=c.repo_name)}" class="childs">
4 <i class="icon-branch"></i>${_ungettext(
4 <i class="icon-branch"></i>${_ungettext(
5 '%(num)s Branch','%(num)s Branches', len(branches)) % {'num': len(branches)}}</a>
5 '%(num)s Branch','%(num)s Branches', len(branches)) % {'num': len(branches)}}</a>
6 </span>
6 </span>
7
7
8 %if closed_branches:
8 %if closed_branches:
9 <span class="branchtag tag">
9 <span class="branchtag tag">
10 <a href="${h.route_path('branches_home',repo_name=c.repo_name)}" class="childs">
10 <a href="${h.route_path('branches_home',repo_name=c.repo_name)}" class="childs">
11 <i class="icon-branch"></i>${_ungettext(
11 <i class="icon-branch"></i>${_ungettext(
12 '%(num)s Closed Branch', '%(num)s Closed Branches', len(closed_branches)) % {'num': len(closed_branches)}}</a>
12 '%(num)s Closed Branch', '%(num)s Closed Branches', len(closed_branches)) % {'num': len(closed_branches)}}</a>
13 </span>
13 </span>
14 %endif
14 %endif
15
15
16 <span class="tagtag tag">
16 <span class="tagtag tag">
17 <a href="${h.route_path('tags_home',repo_name=c.repo_name)}" class="childs">
17 <a href="${h.route_path('tags_home',repo_name=c.repo_name)}" class="childs">
18 <i class="icon-tag"></i>${_ungettext(
18 <i class="icon-tag"></i>${_ungettext(
19 '%(num)s Tag', '%(num)s Tags', len(tags)) % {'num': len(tags)}}</a>
19 '%(num)s Tag', '%(num)s Tags', len(tags)) % {'num': len(tags)}}</a>
20 </span>
20 </span>
21
21
22 %if bookmarks:
22 %if bookmarks:
23 <span class="booktag tag">
23 <span class="booktag tag">
24 <a href="${h.route_path('bookmarks_home',repo_name=c.repo_name)}" class="childs">
24 <a href="${h.route_path('bookmarks_home',repo_name=c.repo_name)}" class="childs">
25 <i class="icon-bookmark"></i>${_ungettext(
25 <i class="icon-bookmark"></i>${_ungettext(
26 '%(num)s Bookmark', '%(num)s Bookmarks', len(bookmarks)) % {'num': len(bookmarks)}}</a>
26 '%(num)s Bookmark', '%(num)s Bookmarks', len(bookmarks)) % {'num': len(bookmarks)}}</a>
27 </span>
27 </span>
28 %endif
28 %endif
29 </%def>
29 </%def>
30
30
31 <%def name="summary_detail(breadcrumbs_links, show_downloads=True)">
31 <%def name="summary_detail(breadcrumbs_links, show_downloads=True)">
32 <% summary = lambda n:{False:'summary-short'}.get(n) %>
32 <% summary = lambda n:{False:'summary-short'}.get(n) %>
33
33
34 <div id="summary-menu-stats" class="summary-detail">
34 <div id="summary-menu-stats" class="summary-detail">
35 <div class="summary-detail-header">
35 <div class="summary-detail-header">
36 <div class="breadcrumbs files_location">
36 <div class="breadcrumbs files_location">
37 <h4>
37 <h4>
38 ${breadcrumbs_links}
38 ${breadcrumbs_links}
39 </h4>
39 </h4>
40 </div>
40 </div>
41 <div id="summary_details_expand" class="btn-collapse" data-toggle="summary-details">
41 <div id="summary_details_expand" class="btn-collapse" data-toggle="summary-details">
42 ${_('Show More')}
42 ${_('Show More')}
43 </div>
43 </div>
44 </div>
44 </div>
45
45
46 <div class="fieldset">
46 <div class="fieldset">
47 %if h.is_svn_without_proxy(c.rhodecode_db_repo):
47 %if h.is_svn_without_proxy(c.rhodecode_db_repo):
48 <div class="left-label disabled">
48 <div class="left-label disabled">
49 ${_('Read-only url')}:
49 ${_('Read-only url')}:
50 </div>
50 </div>
51 <div class="right-content disabled">
51 <div class="right-content disabled">
52 <input type="text" class="input-monospace" id="clone_url" disabled value="${c.clone_repo_url}"/>
52 <input type="text" class="input-monospace" id="clone_url" disabled value="${c.clone_repo_url}"/>
53 <i id="clone_by_name_copy" class="tooltip icon-clipboard clipboard-action" data-clipboard-text="${c.clone_repo_url}" title="${_('Copy the clone url')}"></i>
54
53 <input type="text" class="input-monospace" id="clone_url_id" disabled value="${c.clone_repo_url_id}" style="display: none;"/>
55 <input type="text" class="input-monospace" id="clone_url_id" disabled value="${c.clone_repo_url_id}" style="display: none;"/>
56 <i id="clone_by_id_copy" class="tooltip icon-clipboard clipboard-action" data-clipboard-text="${c.clone_repo_url_id}" title="${_('Copy the clone by id url')}" style="display: none"></i>
57
54 <a id="clone_by_name" class="clone" style="display: none;">${_('Show by Name')}</a>
58 <a id="clone_by_name" class="clone" style="display: none;">${_('Show by Name')}</a>
55 <a id="clone_by_id" class="clone">${_('Show by ID')}</a>
59 <a id="clone_by_id" class="clone">${_('Show by ID')}</a>
60
56 <p class="help-block">${_('SVN Protocol is disabled. To enable it, see the')} <a href="${h.route_url('enterprise_svn_setup')}" target="_blank">${_('documentation here')}</a>.</p>
61 <p class="help-block">${_('SVN Protocol is disabled. To enable it, see the')} <a href="${h.route_url('enterprise_svn_setup')}" target="_blank">${_('documentation here')}</a>.</p>
57 </div>
62 </div>
58 %else:
63 %else:
59 <div class="left-label">
64 <div class="left-label">
60 ${_('Clone url')}:
65 ${_('Clone url')}:
61 </div>
66 </div>
62 <div class="right-content">
67 <div class="right-content">
63 <input type="text" class="input-monospace" id="clone_url" readonly="readonly" value="${c.clone_repo_url}"/>
68 <input type="text" class="input-monospace" id="clone_url" readonly="readonly" value="${c.clone_repo_url}"/>
69 <i id="clone_by_name_copy" class="tooltip icon-clipboard clipboard-action" data-clipboard-text="${c.clone_repo_url}" title="${_('Copy the clone url')}"></i>
70
64 <input type="text" class="input-monospace" id="clone_url_id" readonly="readonly" value="${c.clone_repo_url_id}" style="display: none;"/>
71 <input type="text" class="input-monospace" id="clone_url_id" readonly="readonly" value="${c.clone_repo_url_id}" style="display: none;"/>
72 <i id="clone_by_id_copy" class="tooltip icon-clipboard clipboard-action" data-clipboard-text="${c.clone_repo_url_id}" title="${_('Copy the clone by id url')}" style="display: none"></i>
73
65 <a id="clone_by_name" class="clone" style="display: none;">${_('Show by Name')}</a>
74 <a id="clone_by_name" class="clone" style="display: none;">${_('Show by Name')}</a>
66 <a id="clone_by_id" class="clone">${_('Show by ID')}</a>
75 <a id="clone_by_id" class="clone">${_('Show by ID')}</a>
67 </div>
76 </div>
68 %endif
77 %endif
69 </div>
78 </div>
70
79
71 <div class="fieldset collapsable-content" data-toggle="summary-details" style="display: none;">
80 <div class="fieldset collapsable-content" data-toggle="summary-details" style="display: none;">
72 <div class="left-label">
81 <div class="left-label">
73 ${_('Description')}:
82 ${_('Description')}:
74 </div>
83 </div>
75 <div class="right-content">
84 <div class="right-content">
76 %if c.visual.stylify_metatags:
85 %if c.visual.stylify_metatags:
77 <div class="input ${summary(c.show_stats)} desc">${h.urlify_text(h.escaped_stylize(c.rhodecode_db_repo.description))}</div>
86 <div class="input ${summary(c.show_stats)} desc">${h.urlify_text(h.escaped_stylize(c.rhodecode_db_repo.description))}</div>
78 %else:
87 %else:
79 <div class="input ${summary(c.show_stats)} desc">${h.urlify_text(h.html_escape(c.rhodecode_db_repo.description))}</div>
88 <div class="input ${summary(c.show_stats)} desc">${h.urlify_text(h.html_escape(c.rhodecode_db_repo.description))}</div>
80 %endif
89 %endif
81 </div>
90 </div>
82 </div>
91 </div>
83
92
84 <div class="fieldset collapsable-content" data-toggle="summary-details" style="display: none;">
93 <div class="fieldset collapsable-content" data-toggle="summary-details" style="display: none;">
85 <div class="left-label">
94 <div class="left-label">
86 ${_('Information')}:
95 ${_('Information')}:
87 </div>
96 </div>
88 <div class="right-content">
97 <div class="right-content">
89
98
90 <div class="repo-size">
99 <div class="repo-size">
91 <% commit_rev = c.rhodecode_db_repo.changeset_cache.get('revision') %>
100 <% commit_rev = c.rhodecode_db_repo.changeset_cache.get('revision') %>
92
101
93 ## commits
102 ## commits
94 % if commit_rev == -1:
103 % if commit_rev == -1:
95 ${_ungettext('%(num)s Commit', '%(num)s Commits', 0) % {'num': 0}},
104 ${_ungettext('%(num)s Commit', '%(num)s Commits', 0) % {'num': 0}},
96 % else:
105 % else:
97 <a href="${h.route_path('repo_changelog', repo_name=c.repo_name)}">
106 <a href="${h.route_path('repo_changelog', repo_name=c.repo_name)}">
98 ${_ungettext('%(num)s Commit', '%(num)s Commits', commit_rev) % {'num': commit_rev}}</a>,
107 ${_ungettext('%(num)s Commit', '%(num)s Commits', commit_rev) % {'num': commit_rev}}</a>,
99 % endif
108 % endif
100
109
101 ## forks
110 ## forks
102 <a title="${_('Number of Repository Forks')}" href="${h.url('repo_forks_home', repo_name=c.repo_name)}">
111 <a title="${_('Number of Repository Forks')}" href="${h.url('repo_forks_home', repo_name=c.repo_name)}">
103 ${c.repository_forks} ${_ungettext('Fork', 'Forks', c.repository_forks)}</a>,
112 ${c.repository_forks} ${_ungettext('Fork', 'Forks', c.repository_forks)}</a>,
104
113
105 ## repo size
114 ## repo size
106 % if commit_rev == -1:
115 % if commit_rev == -1:
107 <span class="stats-bullet">0 B</span>
116 <span class="stats-bullet">0 B</span>
108 % else:
117 % else:
109 <span class="stats-bullet" id="repo_size_container">
118 <span class="stats-bullet" id="repo_size_container">
110 ${_('Calculating Repository Size...')}
119 ${_('Calculating Repository Size...')}
111 </span>
120 </span>
112 % endif
121 % endif
113 </div>
122 </div>
114
123
115 <div class="commit-info">
124 <div class="commit-info">
116 <div class="tags">
125 <div class="tags">
117 % if c.rhodecode_repo:
126 % if c.rhodecode_repo:
118 ${refs_counters(
127 ${refs_counters(
119 c.rhodecode_repo.branches,
128 c.rhodecode_repo.branches,
120 c.rhodecode_repo.branches_closed,
129 c.rhodecode_repo.branches_closed,
121 c.rhodecode_repo.tags,
130 c.rhodecode_repo.tags,
122 c.rhodecode_repo.bookmarks)}
131 c.rhodecode_repo.bookmarks)}
123 % else:
132 % else:
124 ## missing requirements can make c.rhodecode_repo None
133 ## missing requirements can make c.rhodecode_repo None
125 ${refs_counters([], [], [], [])}
134 ${refs_counters([], [], [], [])}
126 % endif
135 % endif
127 </div>
136 </div>
128 </div>
137 </div>
129
138
130 </div>
139 </div>
131 </div>
140 </div>
132
141
133 <div class="fieldset collapsable-content" data-toggle="summary-details" style="display: none;">
142 <div class="fieldset collapsable-content" data-toggle="summary-details" style="display: none;">
134 <div class="left-label">
143 <div class="left-label">
135 ${_('Statistics')}:
144 ${_('Statistics')}:
136 </div>
145 </div>
137 <div class="right-content">
146 <div class="right-content">
138 <div class="input ${summary(c.show_stats)} statistics">
147 <div class="input ${summary(c.show_stats)} statistics">
139 % if c.show_stats:
148 % if c.show_stats:
140 <div id="lang_stats" class="enabled">
149 <div id="lang_stats" class="enabled">
141 ${_('Calculating Code Statistics...')}
150 ${_('Calculating Code Statistics...')}
142 </div>
151 </div>
143 % else:
152 % else:
144 <span class="disabled">
153 <span class="disabled">
145 ${_('Statistics are disabled for this repository')}
154 ${_('Statistics are disabled for this repository')}
146 </span>
155 </span>
147 % if h.HasPermissionAll('hg.admin')('enable stats on from summary'):
156 % if h.HasPermissionAll('hg.admin')('enable stats on from summary'):
148 , ${h.link_to(_('enable statistics'),h.route_path('edit_repo',repo_name=c.repo_name, anchor='repo_enable_statistics'))}
157 , ${h.link_to(_('enable statistics'),h.route_path('edit_repo',repo_name=c.repo_name, anchor='repo_enable_statistics'))}
149 % endif
158 % endif
150 % endif
159 % endif
151 </div>
160 </div>
152
161
153 </div>
162 </div>
154 </div>
163 </div>
155
164
156 % if show_downloads:
165 % if show_downloads:
157 <div class="fieldset collapsable-content" data-toggle="summary-details" style="display: none;">
166 <div class="fieldset collapsable-content" data-toggle="summary-details" style="display: none;">
158 <div class="left-label">
167 <div class="left-label">
159 ${_('Downloads')}:
168 ${_('Downloads')}:
160 </div>
169 </div>
161 <div class="right-content">
170 <div class="right-content">
162 <div class="input ${summary(c.show_stats)} downloads">
171 <div class="input ${summary(c.show_stats)} downloads">
163 % if c.rhodecode_repo and len(c.rhodecode_repo.revisions) == 0:
172 % if c.rhodecode_repo and len(c.rhodecode_repo.revisions) == 0:
164 <span class="disabled">
173 <span class="disabled">
165 ${_('There are no downloads yet')}
174 ${_('There are no downloads yet')}
166 </span>
175 </span>
167 % elif not c.enable_downloads:
176 % elif not c.enable_downloads:
168 <span class="disabled">
177 <span class="disabled">
169 ${_('Downloads are disabled for this repository')}
178 ${_('Downloads are disabled for this repository')}
170 </span>
179 </span>
171 % if h.HasPermissionAll('hg.admin')('enable downloads on from summary'):
180 % if h.HasPermissionAll('hg.admin')('enable downloads on from summary'):
172 , ${h.link_to(_('enable downloads'),h.route_path('edit_repo',repo_name=c.repo_name, anchor='repo_enable_downloads'))}
181 , ${h.link_to(_('enable downloads'),h.route_path('edit_repo',repo_name=c.repo_name, anchor='repo_enable_downloads'))}
173 % endif
182 % endif
174 % else:
183 % else:
175 <span class="enabled">
184 <span class="enabled">
176 <a id="archive_link" class="btn btn-small" href="${h.route_path('repo_archivefile',repo_name=c.rhodecode_db_repo.repo_name,fname='tip.zip')}">
185 <a id="archive_link" class="btn btn-small" href="${h.route_path('repo_archivefile',repo_name=c.rhodecode_db_repo.repo_name,fname='tip.zip')}">
177 <i class="icon-archive"></i> tip.zip
186 <i class="icon-archive"></i> tip.zip
178 ## replaced by some JS on select
187 ## replaced by some JS on select
179 </a>
188 </a>
180 </span>
189 </span>
181 ${h.hidden('download_options')}
190 ${h.hidden('download_options')}
182 % endif
191 % endif
183 </div>
192 </div>
184 </div>
193 </div>
185 </div>
194 </div>
186 % endif
195 % endif
187
196
188 </div><!--end summary-detail-->
197 </div><!--end summary-detail-->
189 </%def>
198 </%def>
190
199
191 <%def name="summary_stats(gravatar_function)">
200 <%def name="summary_stats(gravatar_function)">
192 <div class="sidebar-right">
201 <div class="sidebar-right">
193 <div class="summary-detail-header">
202 <div class="summary-detail-header">
194 <h4 class="item">
203 <h4 class="item">
195 ${_('Owner')}
204 ${_('Owner')}
196 </h4>
205 </h4>
197 </div>
206 </div>
198 <div class="sidebar-right-content">
207 <div class="sidebar-right-content">
199 ${gravatar_function(c.rhodecode_db_repo.user.email, 16)}
208 ${gravatar_function(c.rhodecode_db_repo.user.email, 16)}
200 </div>
209 </div>
201 </div><!--end sidebar-right-->
210 </div><!--end sidebar-right-->
202 </%def>
211 </%def>
@@ -1,128 +1,136 b''
1 <%inherit file="/summary/base.mako"/>
1 <%inherit file="/summary/base.mako"/>
2
2
3 <%namespace name="components" file="/summary/components.mako"/>
3 <%namespace name="components" file="/summary/components.mako"/>
4
4
5
5
6 <%def name="menu_bar_subnav()">
6 <%def name="menu_bar_subnav()">
7 ${self.repo_menu(active='summary')}
7 ${self.repo_menu(active='summary')}
8 </%def>
8 </%def>
9
9
10 <%def name="main()">
10 <%def name="main()">
11
11
12 <div class="title">
12 <div class="title">
13 ${self.repo_page_title(c.rhodecode_db_repo)}
13 ${self.repo_page_title(c.rhodecode_db_repo)}
14 <ul class="links icon-only-links block-right">
14 <ul class="links icon-only-links block-right">
15 <li>
15 <li>
16 %if c.rhodecode_user.username != h.DEFAULT_USER:
16 %if c.rhodecode_user.username != h.DEFAULT_USER:
17 <a href="${h.route_path('atom_feed_home', repo_name=c.rhodecode_db_repo.repo_name, _query=dict(auth_token=c.rhodecode_user.feed_token))}" title="${_('RSS Feed')}"><i class="icon-rss-sign"></i></a>
17 <a href="${h.route_path('atom_feed_home', repo_name=c.rhodecode_db_repo.repo_name, _query=dict(auth_token=c.rhodecode_user.feed_token))}" title="${_('RSS Feed')}"><i class="icon-rss-sign"></i></a>
18 %else:
18 %else:
19 <a href="${h.route_path('atom_feed_home', repo_name=c.rhodecode_db_repo.repo_name)}" title="${_('RSS Feed')}"><i class="icon-rss-sign"></i></a>
19 <a href="${h.route_path('atom_feed_home', repo_name=c.rhodecode_db_repo.repo_name)}" title="${_('RSS Feed')}"><i class="icon-rss-sign"></i></a>
20 %endif
20 %endif
21 </li>
21 </li>
22 </ul>
22 </ul>
23 </div>
23 </div>
24
24
25 <div id="repo-summary" class="summary">
25 <div id="repo-summary" class="summary">
26 ${components.summary_detail(breadcrumbs_links=self.breadcrumbs_links(), show_downloads=True)}
26 ${components.summary_detail(breadcrumbs_links=self.breadcrumbs_links(), show_downloads=True)}
27 ${components.summary_stats(gravatar_function=self.gravatar_with_user)}
27 ${components.summary_stats(gravatar_function=self.gravatar_with_user)}
28 </div><!--end repo-summary-->
28 </div><!--end repo-summary-->
29
29
30
30
31 <div class="box" >
31 <div class="box" >
32 %if not c.repo_commits:
32 %if not c.repo_commits:
33 <div class="title">
33 <div class="title">
34 <h3>${_('Quick start')}</h3>
34 <h3>${_('Quick start')}</h3>
35 </div>
35 </div>
36 %endif
36 %endif
37 <div class="table">
37 <div class="table">
38 <div id="shortlog_data">
38 <div id="shortlog_data">
39 <%include file='summary_commits.mako'/>
39 <%include file='summary_commits.mako'/>
40 </div>
40 </div>
41 </div>
41 </div>
42 </div>
42 </div>
43
43
44 %if c.readme_data:
44 %if c.readme_data:
45 <div id="readme" class="anchor">
45 <div id="readme" class="anchor">
46 <div class="box" >
46 <div class="box" >
47 <div class="title" title="${h.tooltip(_('Readme file from commit %s:%s') % (c.rhodecode_db_repo.landing_rev[0], c.rhodecode_db_repo.landing_rev[1]))}">
47 <div class="title" title="${h.tooltip(_('Readme file from commit %s:%s') % (c.rhodecode_db_repo.landing_rev[0], c.rhodecode_db_repo.landing_rev[1]))}">
48 <h3 class="breadcrumbs">
48 <h3 class="breadcrumbs">
49 <a href="${h.route_path('repo_files',repo_name=c.repo_name,commit_id=c.rhodecode_db_repo.landing_rev[1],f_path=c.readme_file)}">${c.readme_file}</a>
49 <a href="${h.route_path('repo_files',repo_name=c.repo_name,commit_id=c.rhodecode_db_repo.landing_rev[1],f_path=c.readme_file)}">${c.readme_file}</a>
50 </h3>
50 </h3>
51 </div>
51 </div>
52 <div class="readme codeblock">
52 <div class="readme codeblock">
53 <div class="readme_box">
53 <div class="readme_box">
54 ${c.readme_data|n}
54 ${c.readme_data|n}
55 </div>
55 </div>
56 </div>
56 </div>
57 </div>
57 </div>
58 </div>
58 </div>
59 %endif
59 %endif
60
60
61 <script type="text/javascript">
61 <script type="text/javascript">
62 $(document).ready(function(){
62 $(document).ready(function(){
63 $('#clone_by_name').on('click',function(e){
63 $('#clone_by_name').on('click',function(e){
64 // show url by name and hide name button
64 // show url by name and hide name button
65 $('#clone_url').show();
65 $('#clone_url').show();
66 $('#clone_by_name').hide();
66 $('#clone_by_name').hide();
67
67
68 // hide url by id and show name button
68 // hide url by id and show name button
69 $('#clone_by_id').show();
69 $('#clone_by_id').show();
70 $('#clone_url_id').hide();
70 $('#clone_url_id').hide();
71
71
72 // hide copy by id
73 $('#clone_by_name_copy').show();
74 $('#clone_by_id_copy').hide();
75
72 });
76 });
73 $('#clone_by_id').on('click',function(e){
77 $('#clone_by_id').on('click',function(e){
74
78
75 // show url by id and hide id button
79 // show url by id and hide id button
76 $('#clone_by_id').hide();
80 $('#clone_by_id').hide();
77 $('#clone_url_id').show();
81 $('#clone_url_id').show();
78
82
79 // hide url by name and show id button
83 // hide url by name and show id button
80 $('#clone_by_name').show();
84 $('#clone_by_name').show();
81 $('#clone_url').hide();
85 $('#clone_url').hide();
86
87 // hide copy by id
88 $('#clone_by_id_copy').show();
89 $('#clone_by_name_copy').hide();
82 });
90 });
83
91
84 var initialCommitData = {
92 var initialCommitData = {
85 id: null,
93 id: null,
86 text: 'tip',
94 text: 'tip',
87 type: 'tag',
95 type: 'tag',
88 raw_id: null,
96 raw_id: null,
89 files_url: null
97 files_url: null
90 };
98 };
91
99
92 select2RefSwitcher('#download_options', initialCommitData);
100 select2RefSwitcher('#download_options', initialCommitData);
93
101
94 // on change of download options
102 // on change of download options
95 $('#download_options').on('change', function(e) {
103 $('#download_options').on('change', function(e) {
96 // format of Object {text: "v0.0.3", type: "tag", id: "rev"}
104 // format of Object {text: "v0.0.3", type: "tag", id: "rev"}
97 var selected_cs = e.added;
105 var selected_cs = e.added;
98 var fname= e.added.raw_id + ".zip";
106 var fname= e.added.raw_id + ".zip";
99 var href = pyroutes.url('repo_archivefile', {'repo_name': templateContext.repo_name, 'fname':fname});
107 var href = pyroutes.url('repo_archivefile', {'repo_name': templateContext.repo_name, 'fname':fname});
100 // set new label
108 // set new label
101 $('#archive_link').html('<i class="icon-archive"></i> '+ e.added.text+".zip");
109 $('#archive_link').html('<i class="icon-archive"></i> '+ e.added.text+".zip");
102
110
103 // set new url to button,
111 // set new url to button,
104 $('#archive_link').attr('href', href)
112 $('#archive_link').attr('href', href)
105 });
113 });
106
114
107
115
108 // load details on summary page expand
116 // load details on summary page expand
109 $('#summary_details_expand').on('click', function() {
117 $('#summary_details_expand').on('click', function() {
110
118
111 var callback = function (data) {
119 var callback = function (data) {
112 % if c.show_stats:
120 % if c.show_stats:
113 showRepoStats('lang_stats', data);
121 showRepoStats('lang_stats', data);
114 % endif
122 % endif
115 };
123 };
116
124
117 showRepoSize(
125 showRepoSize(
118 'repo_size_container',
126 'repo_size_container',
119 templateContext.repo_name,
127 templateContext.repo_name,
120 templateContext.repo_landing_commit,
128 templateContext.repo_landing_commit,
121 callback);
129 callback);
122
130
123 })
131 })
124
132
125 })
133 })
126 </script>
134 </script>
127
135
128 </%def>
136 </%def>
General Comments 0
You need to be logged in to leave comments. Login now