##// END OF EJS Templates
html: fixed found syntax problems
marcink -
r1283:cebaf5cb default
parent child Browse files
Show More
@@ -1,116 +1,116 b''
1 1 ## -*- coding: utf-8 -*-
2 2 <%inherit file="/base/base.mako"/>
3 3
4 4 <%def name="title()">
5 5 ${_('Authentication Settings')}
6 6 %if c.rhodecode_name:
7 7 &middot; ${h.branding(c.rhodecode_name)}}
8 8 %endif
9 9 </%def>
10 10
11 11 <%def name="breadcrumbs_links()">
12 12 ${h.link_to(_('Admin'),h.url('admin_home'))}
13 13 &raquo;
14 14 ${_('Authentication Plugins')}
15 15 </%def>
16 16
17 17 <%def name="menu_bar_nav()">
18 18 ${self.menu_items(active='admin')}
19 19 </%def>
20 20
21 21 <%def name="main()">
22 22
23 23 <div class="box">
24 24 <div class="title">
25 25 ${self.breadcrumbs()}
26 26 </div>
27 27
28 28 <div class='sidebar-col-wrapper'>
29 29
30 30 <div class="sidebar">
31 31 <ul class="nav nav-pills nav-stacked">
32 32 % for item in resource.get_root().get_nav_list():
33 33 <li ${'class=active' if item == resource else ''}>
34 34 <a href="${request.resource_path(item, route_name='auth_home')}">${item.display_name}</a>
35 35 </li>
36 36 % endfor
37 37 </ul>
38 38 </div>
39 39
40 40 <div class="main-content-full-width">
41 41 ${h.secure_form(request.resource_path(resource, route_name='auth_home'))}
42 42 <div class="form">
43 43
44 44 <div class="panel panel-default">
45 45
46 46 <div class="panel-heading">
47 47 <h3 class="panel-title">${_("Enabled and Available Plugins")}</h3>
48 48 </div>
49 49
50 50 <div class="fields panel-body">
51 51
52 52 <div class="field">
53 53 <div class="label">${_("Enabled Plugins")}</div>
54 54 <div class="textarea text-area editor">
55 55 ${h.textarea('auth_plugins',cols=23,rows=5,class_="medium")}
56 56 </div>
57 57 <p class="help-block">
58 58 ${_('Add a list of plugins, separated by commas. '
59 59 'The order of the plugins is also the order in which '
60 60 'RhodeCode Enterprise will try to authenticate a user.')}
61 61 </p>
62 62 </div>
63 63
64 64 <div class="field">
65 65 <div class="label">${_('Available Built-in Plugins')}</div>
66 66 <ul class="auth_plugins">
67 67 %for plugin in available_plugins:
68 68 <li>
69 69 <div class="auth_buttons">
70 70 <span plugin_id="${plugin.get_id()}" class="toggle-plugin btn ${'btn-success' if plugin.get_id() in enabled_plugins else ''}">
71 71 ${_('enabled') if plugin.get_id() in enabled_plugins else _('disabled')}
72 72 </span>
73 73 ${plugin.get_display_name()} (${plugin.get_id()})
74 74 </div>
75 75 </li>
76 76 %endfor
77 77 </ul>
78 78 </div>
79 79
80 80 <div class="buttons">
81 81 ${h.submit('save',_('Save'),class_="btn")}
82 82 </div>
83 83 </div>
84 84 </div>
85 85 </div>
86 86 ${h.end_form()}
87 87 </div>
88 88 </div>
89 89 </div>
90 90
91 91 <script>
92 92 $('.toggle-plugin').click(function(e){
93 93 var auth_plugins_input = $('#auth_plugins');
94 94 var notEmpty = function(element, index, array) {
95 95 return (element != "");
96 }
96 };
97 97 var elems = auth_plugins_input.val().split(',').filter(notEmpty);
98 98 var cur_button = e.currentTarget;
99 99 var plugin_id = $(cur_button).attr('plugin_id');
100 100 if($(cur_button).hasClass('btn-success')){
101 101 elems.splice(elems.indexOf(plugin_id), 1);
102 102 auth_plugins_input.val(elems.join(','));
103 103 $(cur_button).removeClass('btn-success');
104 104 cur_button.innerHTML = _gettext('disabled');
105 105 }
106 106 else{
107 107 if(elems.indexOf(plugin_id) == -1){
108 108 elems.push(plugin_id);
109 109 }
110 110 auth_plugins_input.val(elems.join(','));
111 111 $(cur_button).addClass('btn-success');
112 112 cur_button.innerHTML = _gettext('enabled');
113 113 }
114 114 });
115 115 </script>
116 116 </%def>
@@ -1,252 +1,252 b''
1 1 ## -*- coding: utf-8 -*-
2 2 <%inherit file="base.mako"/>
3 3
4 4 <%def name="breadcrumbs_links()">
5 5 %if c.repo:
6 6 ${h.link_to('Settings',h.url('edit_repo', repo_name=c.repo.repo_name))}
7 7 %elif c.repo_group:
8 8 ${h.link_to(_('Admin'),h.url('admin_home'))}
9 9 &raquo;
10 10 ${h.link_to(_('Repository Groups'),h.url('repo_groups'))}
11 11 &raquo;
12 12 ${h.link_to(c.repo_group.group_name,h.url('edit_repo_group', group_name=c.repo_group.group_name))}
13 13 %else:
14 14 ${h.link_to(_('Admin'),h.url('admin_home'))}
15 15 &raquo;
16 16 ${h.link_to(_('Settings'),h.url('admin_settings'))}
17 17 %endif
18 18 %if current_IntegrationType:
19 19 &raquo;
20 20 %if c.repo:
21 21 ${h.link_to(_('Integrations'),
22 22 request.route_url(route_name='repo_integrations_home',
23 23 repo_name=c.repo.repo_name))}
24 24 %elif c.repo_group:
25 25 ${h.link_to(_('Integrations'),
26 26 request.route_url(route_name='repo_group_integrations_home',
27 27 repo_group_name=c.repo_group.group_name))}
28 28 %else:
29 29 ${h.link_to(_('Integrations'),
30 30 request.route_url(route_name='global_integrations_home'))}
31 31 %endif
32 32 &raquo;
33 33 ${current_IntegrationType.display_name}
34 34 %else:
35 35 &raquo;
36 36 ${_('Integrations')}
37 37 %endif
38 38 </%def>
39 39
40 40 <div class="panel panel-default">
41 41 <div class="panel-heading">
42 42 <h3 class="panel-title">
43 43 %if c.repo:
44 44 ${_('Current Integrations for Repository: {repo_name}').format(repo_name=c.repo.repo_name)}
45 45 %elif c.repo_group:
46 46 ${_('Current Integrations for repository group: {repo_group_name}').format(repo_group_name=c.repo_group.group_name)}
47 47 %else:
48 48 ${_('Current Integrations')}
49 49 %endif
50 50 </h3>
51 51 </div>
52 52 <div class="panel-body">
53 53 <%
54 54 if c.repo:
55 55 home_url = request.route_path('repo_integrations_home',
56 56 repo_name=c.repo.repo_name)
57 57 elif c.repo_group:
58 58 home_url = request.route_path('repo_group_integrations_home',
59 59 repo_group_name=c.repo_group.group_name)
60 60 else:
61 61 home_url = request.route_path('global_integrations_home')
62 62 %>
63 63
64 64 <a href="${home_url}" class="btn ${not current_IntegrationType and 'btn-primary' or ''}">${_('All')}</a>
65 65
66 66 %for integration_key, IntegrationType in available_integrations.items():
67 67 <%
68 68 if c.repo:
69 69 list_url = request.route_path('repo_integrations_list',
70 70 repo_name=c.repo.repo_name,
71 71 integration=integration_key)
72 72 elif c.repo_group:
73 73 list_url = request.route_path('repo_group_integrations_list',
74 74 repo_group_name=c.repo_group.group_name,
75 75 integration=integration_key)
76 76 else:
77 77 list_url = request.route_path('global_integrations_list',
78 78 integration=integration_key)
79 79 %>
80 80 <a href="${list_url}"
81 81 class="btn ${current_IntegrationType and integration_key == current_IntegrationType.key and 'btn-primary' or ''}">
82 82 ${IntegrationType.display_name}
83 83 </a>
84 84 %endfor
85 85
86 86 <%
87 87 if c.repo:
88 88 create_url = h.route_path('repo_integrations_new', repo_name=c.repo.repo_name)
89 89 elif c.repo_group:
90 90 create_url = h.route_path('repo_group_integrations_new', repo_group_name=c.repo_group.group_name)
91 91 else:
92 92 create_url = h.route_path('global_integrations_new')
93 93 %>
94 94 <p class="pull-right">
95 95 <a href="${create_url}" class="btn btn-small btn-success">${_(u'Create new integration')}</a>
96 96 </p>
97 97
98 98 <table class="rctable integrations">
99 99 <thead>
100 100 <tr>
101 101 <th><a href="?sort=enabled:${rev_sort_dir}">${_('Enabled')}</a></th>
102 102 <th><a href="?sort=name:${rev_sort_dir}">${_('Name')}</a></th>
103 103 <th colspan="2"><a href="?sort=integration_type:${rev_sort_dir}">${_('Type')}</a></th>
104 104 <th><a href="?sort=scope:${rev_sort_dir}">${_('Scope')}</a></th>
105 105 <th>${_('Actions')}</th>
106 106 <th></th>
107 107 </tr>
108 108 </thead>
109 109 <tbody>
110 110 %if not integrations_list:
111 111 <tr>
112 112 <td colspan="7">
113 113 <% integration_type = current_IntegrationType and current_IntegrationType.display_name or '' %>
114 114 %if c.repo:
115 115 ${_('No {type} integrations for repo {repo} exist yet.').format(type=integration_type, repo=c.repo.repo_name)}
116 116 %elif c.repo_group:
117 117 ${_('No {type} integrations for repogroup {repogroup} exist yet.').format(type=integration_type, repogroup=c.repo_group.group_name)}
118 118 %else:
119 119 ${_('No {type} integrations exist yet.').format(type=integration_type)}
120 120 %endif
121 121
122 122 %if current_IntegrationType:
123 123 <%
124 124 if c.repo:
125 125 create_url = h.route_path('repo_integrations_create', repo_name=c.repo.repo_name, integration=current_IntegrationType.key)
126 126 elif c.repo_group:
127 127 create_url = h.route_path('repo_group_integrations_create', repo_group_name=c.repo_group.group_name, integration=current_IntegrationType.key)
128 128 else:
129 129 create_url = h.route_path('global_integrations_create', integration=current_IntegrationType.key)
130 130 %>
131 131 %endif
132 132
133 133 <a href="${create_url}">${_(u'Create one')}</a>
134 134 </td>
135 135 </tr>
136 136 %endif
137 137 %for IntegrationType, integration in integrations_list:
138 138 <tr id="integration_${integration.integration_id}">
139 139 <td class="td-enabled">
140 140 %if integration.enabled:
141 141 <div class="flag_status approved pull-left"></div>
142 142 %else:
143 143 <div class="flag_status rejected pull-left"></div>
144 144 %endif
145 145 </td>
146 146 <td class="td-description">
147 147 ${integration.name}
148 148 </td>
149 149 <td class="td-icon">
150 150 %if integration.integration_type in available_integrations:
151 151 <div class="integration-icon">
152 152 ${available_integrations[integration.integration_type].icon|n}
153 153 </div>
154 154 %else:
155 155 ?
156 156 %endif
157 157 </td>
158 158 <td class="td-type">
159 159 ${integration.integration_type}
160 160 </td>
161 161 <td class="td-scope">
162 162 %if integration.repo:
163 163 <a href="${h.url('summary_home', repo_name=integration.repo.repo_name)}">
164 164 ${_('repo')}:${integration.repo.repo_name}
165 165 </a>
166 166 %elif integration.repo_group:
167 167 <a href="${h.url('repo_group_home', group_name=integration.repo_group.group_name)}">
168 168 ${_('repogroup')}:${integration.repo_group.group_name}
169 169 %if integration.child_repos_only:
170 170 ${_('child repos only')}
171 171 %else:
172 172 ${_('cascade to all')}
173 173 %endif
174 174 </a>
175 175 %else:
176 176 %if integration.child_repos_only:
177 177 ${_('top level repos only')}
178 178 %else:
179 179 ${_('global')}
180 180 %endif
181 181 </td>
182 182 %endif
183 183 <td class="td-action">
184 184 %if not IntegrationType:
185 185 ${_('unknown integration')}
186 186 %else:
187 187 <%
188 188 if c.repo:
189 189 edit_url = request.route_path('repo_integrations_edit',
190 190 repo_name=c.repo.repo_name,
191 191 integration=integration.integration_type,
192 192 integration_id=integration.integration_id)
193 193 elif c.repo_group:
194 194 edit_url = request.route_path('repo_group_integrations_edit',
195 195 repo_group_name=c.repo_group.group_name,
196 196 integration=integration.integration_type,
197 197 integration_id=integration.integration_id)
198 198 else:
199 199 edit_url = request.route_path('global_integrations_edit',
200 200 integration=integration.integration_type,
201 201 integration_id=integration.integration_id)
202 202 %>
203 203 <div class="grid_edit">
204 204 <a href="${edit_url}">${_('Edit')}</a>
205 205 </div>
206 206 <div class="grid_delete">
207 207 <a href="${edit_url}"
208 208 class="btn btn-link btn-danger delete_integration_entry"
209 209 data-desc="${integration.name}"
210 210 data-uid="${integration.integration_id}">
211 211 ${_('Delete')}
212 212 </a>
213 213 </div>
214 214 %endif
215 215 </td>
216 216 </tr>
217 217 %endfor
218 218 <tr id="last-row"></tr>
219 219 </tbody>
220 220 </table>
221 221 <div class="integrations-paginator">
222 222 <div class="pagination-wh pagination-left">
223 223 ${integrations_list.pager('$link_previous ~2~ $link_next')}
224 224 </div>
225 225 </div>
226 226 </div>
227 227 </div>
228 228 <script type="text/javascript">
229 229 var delete_integration = function(entry) {
230 230 if (confirm("Confirm to remove this integration: "+$(entry).data('desc'))) {
231 231 var request = $.ajax({
232 232 type: "POST",
233 233 url: $(entry).attr('href'),
234 234 data: {
235 235 'delete': 'delete',
236 236 'csrf_token': CSRF_TOKEN
237 237 },
238 238 success: function(){
239 239 location.reload();
240 240 },
241 241 error: function(data, textStatus, errorThrown){
242 242 alert("Error while deleting entry.\nError code {0} ({1}). URL: {2}".format(data.status,data.statusText,$(entry)[0].url));
243 243 }
244 244 });
245 245 };
246 }
246 };
247 247
248 248 $('.delete_integration_entry').on('click', function(e){
249 249 e.preventDefault();
250 250 delete_integration(this);
251 251 });
252 252 </script> No newline at end of file
@@ -1,78 +1,78 b''
1 1 ## -*- coding: utf-8 -*-
2 2 <%inherit file="/base/base.mako"/>
3 3
4 4 <%def name="title()">
5 5 ${_('My Notifications')} ${c.rhodecode_user.username}
6 6 %if c.rhodecode_name:
7 7 &middot; ${h.branding(c.rhodecode_name)}
8 8 %endif
9 9 </%def>
10 10
11 11 <%def name="breadcrumbs_links()">
12 12 ${_('My Notifications')}
13 13 </%def>
14 14
15 15 <%def name="menu_bar_nav()">
16 16 ${self.menu_items(active='admin')}
17 17 </%def>
18 18
19 19 <%def name="main()">
20 20 <div class="box">
21 21 <!-- box / title -->
22 22 <div class="title">
23 23 ${self.breadcrumbs()}
24 24 ##<ul class="links">
25 25 ## <li>
26 26 ## <span ><a href="#">${_('Compose message')}</a></span>
27 27 ## </li>
28 28 ##</ul>
29 29
30 30 <div class="notifications_buttons">
31 31 <span id='all' class="action-link first ${'active' if c.current_filter=='all' else ''}"><a href="${h.url.current()}">${_('All')}</a></span>
32 32 <span id='comment' class="action-link ${'active' if c.current_filter=='comment' else ''}"><a href="${h.url.current(type=c.comment_type)}">${_('Comments')}</a></span>
33 33 <span id='pull_request' class="action-link last ${'active' if c.current_filter=='pull_request' else ''}"><a href="${h.url.current(type=c.pull_request_type)}">${_('Pull Requests')}</a></span>
34 34
35 35 %if c.notifications:
36 36
37 37 <span id='mark_all_read' class="btn btn-default">${_('Mark all as read')}</span>
38 38
39 39 %endif
40 40 </div>
41 41 </div>
42 42 <div id='notification_data' class='main-content-full'>
43 43 <%include file='notifications_data.mako'/>
44 44 </div>
45 45 </div>
46 46 <script type="text/javascript">
47 47 var url_action = "${url('notification', notification_id='__NOTIFICATION_ID__')}";
48 48 var run = function(){
49 49 $('#notification_data').on('click','.delete-notification',function(e){
50 50 var notification_id = e.currentTarget.id;
51 51 deleteNotification(url_action,notification_id)
52 })
52 });
53 53 $('#notification_data').on('click','.read-notification',function(e){
54 54 var notification_id = e.currentTarget.id;
55 55 readNotification(url_action,notification_id)
56 56 })
57 }
57 };
58 58 run();
59 59 $('#mark_all_read').on('click',function(e){
60 60 //set notifications as read
61 61 var url = "${h.url('notifications_mark_all_read', **request.GET.mixed())}";
62 62 $.post(url, {'csrf_token': CSRF_TOKEN}).
63 63 done(function(data){
64 64 // hide notifications counter
65 65 $('#quick_login_link > .menu_link_notifications').hide();
66 66 $('#notification_data').html(data);
67 67 })
68 68 .fail(function(data, textStatus, errorThrown){
69 69 alert("Error while saving notifications.\nError code {0} ({1}). URL: {2}".format(data.status,data.statusText,$(this)[0].url));
70 70 });
71 })
71 });
72 72
73 73 var current_filter = $("${c.current_filter}");
74 74 if (current_filter.length){
75 75 current_filter.addClass('active');
76 76 }
77 77 </script>
78 78 </%def>
@@ -1,296 +1,295 b''
1 1 ${h.secure_form(url('admin_settings_global'), method='post')}
2 2
3 3 <div class="panel panel-default">
4 4 <div class="panel-heading" id="branding-options">
5 5 <h3 class="panel-title">${_('Branding')} <a class="permalink" href="#branding-options"> ΒΆ</a></h3>
6 6 </div>
7 7 <div class="panel-body">
8 8 <div class="label">
9 9 <label for="rhodecode_title">${_('Title')}</label>
10 10 </div>
11 11 <div class="field input">
12 12 ${h.text('rhodecode_title',size=60)}
13 13 </div>
14 14 <div class="field">
15 15 <span class="help-block">
16 16 ${_('Set a custom title for your RhodeCode instance (limited to 40 characters).')}
17 17 </span>
18 18 </div>
19 19 <div class="label">
20 20 <label for="rhodecode_realm">${_('HTTP[S] authentication realm')}</label>
21 21 </div>
22 22 <div class="field input">
23 23 ${h.text('rhodecode_realm',size=60)}
24 24 </div>
25 25 <div class="field">
26 26 <span class="help-block">
27 27 ${_('Set a custom text that is shown as authentication message to clients trying to connect.')}
28 28 </span>
29 29 </div>
30 30 </div>
31 31 </div>
32 32
33 33
34 34 <div class="panel panel-default">
35 35 <div class="panel-heading" id="personal-group-options">
36 36 <h3 class="panel-title">${_('Personal Repository Group')} <a class="permalink" href="#personal-group-options"> ΒΆ</a></h3>
37 37 </div>
38 38 <div class="panel-body">
39 39 <div class="checkbox">
40 40 ${h.checkbox('rhodecode_create_personal_repo_group','True')}
41 41 <label for="rhodecode_create_personal_repo_group">${_('Create Personal Repository Group')}</label>
42 42 </div>
43 43 <span class="help-block">
44 44 ${_('Always create Personal Repository Groups for new users.')} <br/>
45 45 ${_('When creating new users from add user form or API you can still turn this off via a checkbox or flag')}
46 46 </span>
47 47
48 48 <div class="label">
49 49 <label for="rhodecode_personal_repo_group_pattern">${_('Personal Repo Group Pattern')}</label>
50 50 </div>
51 51 <div class="field input">
52 52 ${h.text('rhodecode_personal_repo_group_pattern',size=60, placeholder=c.personal_repo_group_default_pattern)}
53 53 </div>
54 54 <span class="help-block">
55 55 ${_('Pattern used to create Personal Repository Groups. Prefix can be other existing repository group path[s], eg. /u/${username}')} <br/>
56 56 ${_('Available variables are currently ${username} and ${user_id}')}
57 57 </span>
58 58 </div>
59 59 </div>
60 60
61 61
62 62 <div class="panel panel-default">
63 63 <div class="panel-heading" id="captcha-options">
64 64 <h3 class="panel-title">${_('Registration Captcha')} <a class="permalink" href="#captcha-options"> ΒΆ</a></h3>
65 65 </div>
66 66 <div class="panel-body">
67 67 <div class="label">
68 68 <label for="rhodecode_captcha_public_key">${_('Google ReCaptcha public key')}</label>
69 69 </div>
70 70 <div class="field input">
71 71 ${h.text('rhodecode_captcha_public_key',size=60)}
72 72 </div>
73 73 <div class="field">
74 74 <span class="help-block">
75 75 ${_('Public key for reCaptcha system.')}
76 76 </span>
77 77 </div>
78 78
79 79 <div class="label">
80 80 <label for="rhodecode_captcha_private_key">${_('Google ReCaptcha private key')}</label>
81 81 </div>
82 82 <div class="field input">
83 83 ${h.text('rhodecode_captcha_private_key',size=60)}
84 84 </div>
85 85 <div class="field">
86 86 <span class="help-block">
87 87 ${_('Private key for reCaptcha system. Setting this value will enable captcha on registration')}
88 88 </span>
89 89 </div>
90 90 </div>
91 91 </div>
92 92
93 93 <div class="panel panel-default">
94 94 <div class="panel-heading" id="header-code-options">
95 95 <h3 class="panel-title">${_('Custom Header Code')} <a class="permalink" href="#header-code-options"> ΒΆ</a></h3>
96 96 </div>
97 97 <div class="panel-body">
98 98 <div class="select">
99 99 <select id="pre_template" >
100 100 <option value="#">${_('Templates...')}</option>
101 101 <option value="ga">Google Analytics</option>
102 102 <option value="clicky">Clicky</option>
103 103 <option value="server_announce">${_('Server Announcement')}</option>
104 104 <option value="flash_filtering">${_('Flash message filtering')}</option>
105 105 </select>
106 106 </div>
107 107 <div style="padding: 10px 0px"></div>
108 108 <div class="textarea text-area">
109 109 ${h.textarea('rhodecode_pre_code',cols=23,rows=5,class_="medium")}
110 110 <span class="help-block">${_('Custom js/css code added at the end of the <header/> tag.')}
111 111 ${_('Use <script/> or <css/> tags to define custom styling or scripting')}</span>
112 112 </div>
113 113 </div>
114 114 </div>
115 115
116 116 <div class="panel panel-default">
117 117 <div class="panel-heading" id="footer-code-options">
118 118 <h3 class="panel-title">${_('Custom Footer Code')} <a class="permalink" href="#footer-code-options"> ΒΆ</a></h3>
119 119 </div>
120 120 <div class="panel-body">
121 121 <div class="select">
122 122 <select id="post_template" >
123 123 <option value="#">${_('Templates...')}</option>
124 124 <option value="ga">Google Analytics</option>
125 125 <option value="clicky">Clicky</option>
126 126 <option value="server_announce">${_('Server Announcement')}</option>
127 127 </select>
128 128 </div>
129 129 <div style="padding: 10px 0px"></div>
130 130 <div class="textarea text-area">
131 131 ${h.textarea('rhodecode_post_code',cols=23,rows=5, class_="medium")}
132 132 <span class="help-block">${_('Custom js/css code added at the end of the <body> tag.')}
133 133 ${_('Use <script> or <css> tags to define custom styling or scripting')}</span>
134 134 </div>
135 135 </div>
136 136 </div>
137 137
138 138 <div class="buttons">
139 139 ${h.submit('save',_('Save settings'),class_="btn")}
140 140 ${h.reset('reset',_('Reset'),class_="btn")}
141 141 </div>
142 142 ${h.end_form()}
143 143
144 144
145 145
146 146 ## TEMPLATES ##
147 147 ###############
148 148
149 149 <script id="ga_tmpl" type="text/x-template">
150 150 <%text filter="h">
151 151 <script>
152 152 // Google Analytics
153 153 // Put your Google Analytics code instead of _GACODE_
154 154 var _gaq_code = '_GACODE_';
155 155 var _gaq = _gaq || [];
156 156 _gaq.push(['_setAccount', _gaq_code]);
157 157 _gaq.push(['_trackPageview']);
158 158
159 159 (function() {
160 160 var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
161 161 ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
162 162 var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
163 163 })();
164 164
165 165 rhodecode_statechange_callback = function(url, data){
166 166 // ANALYTICS callback on html5 history state changed
167 167 // triggered by file browser, url is the new url,
168 168 // data is extra info passed from the State object
169 169 if (typeof window._gaq !== 'undefined') {
170 170 _gaq.push(['_trackPageview', url]);
171 171 }
172 172 };
173 173 </script>
174 174 </%text>
175 175 </script>
176 176
177 177
178 178
179 179 <script id="clicky_tmpl" type="text/x-template">
180 180 <%text filter="h">
181 181 <script src="//static.getclicky.com/js" type="text/javascript"></script>
182 182 <script type="text/javascript">
183 183 // Clicky Analytics - should be used in the footer code section.
184 184 // Put your Clicky code instead of _CLICKYCODE_ here,
185 185 // and below in the <img> tag.
186 186 var _cl_code = _CLICKYCODE_;
187 187 try{clicky.init(_cl_code);}catch(e){}
188 188
189 189 rhodecode_statechange_callback = function(url, data){
190 190 // ANALYTICS callback on html5 history state changed
191 191 // triggered by file browser, url is the new url,
192 192 // data is extra info passed from the State object
193 193 if (typeof window.clicky !== 'undefined') {
194 194 clicky.log(url);
195 195 }
196 196 }
197 197 </script>
198 198 <noscript>
199 199 // Put your clicky code in the src file.
200 200 <p><img alt="Clicky" width="1" height="1"
201 201 src="//in.getclicky.com/_CLICKYCODE_ns.gif" /></p>
202 202 </noscript>
203 203 </%text>
204 204 </script>
205 205
206 206
207 207
208 208 <script id="server_announce_tmpl" type='text/x-template'>
209 209 <%text filter="h">
210 210 <script>
211 211 // Server announcement displayed on the top of the page.
212 212 // This can be used to send a global maintainance messages or other
213 213 // important messages to all users of the RhodeCode Enterprise system.
214 214
215 215 $(document).ready(function(e){
216 216
217 217 // EDIT - put your message below
218 218 var message = "TYPE YOUR MESSAGE HERE";
219 219
220 220 // EDIT - choose "info"/"warning"/"error"/"success"/"neutral" as appropriate
221 221 var alert_level = "info";
222 222
223 223 $("#body").prepend(
224 224 ("<div id='server-announcement' class='"+alert_level+"'>_MSG_"+"</div>").replace("_MSG_", message)
225 225 )
226 226 })
227 227 </script>
228 228 </%text>
229 229 </script>
230 230
231 231 <script id="flash_filtering_tmpl" type='text/x-template'>
232 232 <%text filter="h">
233 233 <script>
234 234 // This filters out some flash messages before they are presented to user
235 235 // based on their contents. Could be used to filter out warnings/errors
236 236 // of license messages
237 237
238 238 var filteredMessages = [];
239 239 for(var i =0; i< alertMessagePayloads.length; i++){
240 240 if (typeof alertMessagePayloads[i].message.subdata.subtype !== 'undefined' &&
241 241 alertMessagePayloads[i].message.subdata.subtype.indexOf('rc_license') !== -1){
242 242 continue
243 243 }
244 244 filteredMessages.push(alertMessagePayloads[i]);
245 245 }
246 246 alertMessagePayloads = filteredMessages;
247 247 </script>
248 248 </%text>
249 249 </script>
250 250
251 251 <script>
252 252 var pre_cm = initCodeMirror('rhodecode_pre_code', '', false);
253 253 var pre_old = pre_cm.getValue();
254 254
255 255 var post_cm = initCodeMirror('rhodecode_post_code', '', false);
256 256 var post_old = post_cm.getValue();
257 257
258 258 var get_data = function(type, old){
259 259 var get_tmpl = function(tmpl_name){
260 260 // unescape some stuff
261 var html = htmlEnDeCode.htmlDecode($('#'+tmpl_name+'_tmpl').html());
262 return html;
261 return htmlEnDeCode.htmlDecode($('#'+tmpl_name+'_tmpl').html());
263 262 };
264 263 return {
265 264 '#': old,
266 265 'ga': get_tmpl('ga'),
267 266 'clicky': get_tmpl('clicky'),
268 267 'server_announce': get_tmpl('server_announce'),
269 268 'flash_filtering': get_tmpl('flash_filtering')
270 269 }[type]
271 270 };
272 271
273 272 $('#pre_template').select2({
274 273 containerCssClass: 'drop-menu',
275 274 dropdownCssClass: 'drop-menu-dropdown',
276 275 dropdownAutoWidth: true,
277 276 minimumResultsForSearch: -1
278 277 });
279 278
280 279 $('#post_template').select2({
281 280 containerCssClass: 'drop-menu',
282 281 dropdownCssClass: 'drop-menu-dropdown',
283 282 dropdownAutoWidth: true,
284 283 minimumResultsForSearch: -1
285 284 });
286 285
287 286 $('#post_template').on('change', function(e){
288 287 var sel = this.value;
289 288 post_cm.setValue(get_data(sel, post_old))
290 289 });
291 290
292 291 $('#pre_template').on('change', function(e){
293 292 var sel = this.value;
294 293 pre_cm.setValue(get_data(sel, pre_old))
295 294 })
296 295 </script>
@@ -1,147 +1,147 b''
1 1 ## -*- coding: utf-8 -*-
2 2 <%inherit file="/base/base.mako"/>
3 3
4 4 <%def name="title()">
5 5 ${_('Add user')}
6 6 %if c.rhodecode_name:
7 7 &middot; ${h.branding(c.rhodecode_name)}
8 8 %endif
9 9 </%def>
10 10 <%def name="breadcrumbs_links()">
11 11 ${h.link_to(_('Admin'),h.url('admin_home'))}
12 12 &raquo;
13 13 ${h.link_to(_('Users'),h.url('users'))}
14 14 &raquo;
15 15 ${_('Add User')}
16 16 </%def>
17 17
18 18 <%def name="menu_bar_nav()">
19 19 ${self.menu_items(active='admin')}
20 20 </%def>
21 21
22 22 <%def name="main()">
23 23 <div class="box">
24 24 <!-- box / title -->
25 25 <div class="title">
26 26 ${self.breadcrumbs()}
27 27 </div>
28 28 <!-- end box / title -->
29 29 ${h.secure_form(url('users'))}
30 30 <div class="form">
31 31 <!-- fields -->
32 32 <div class="fields">
33 33 <div class="field">
34 34 <div class="label">
35 35 <label for="username">${_('Username')}:</label>
36 36 </div>
37 37 <div class="input">
38 38 ${h.text('username', class_='medium')}
39 39 </div>
40 40 </div>
41 41
42 42 <div class="field">
43 43 <div class="label">
44 44 <label for="password">${_('Password')}:</label>
45 45 </div>
46 46 <div class="input">
47 47 ${h.password('password', class_='medium')}
48 48 </div>
49 49 </div>
50 50
51 51 <div class="field">
52 52 <div class="label">
53 53 <label for="password_confirmation">${_('Password confirmation')}:</label>
54 54 </div>
55 55 <div class="input">
56 56 ${h.password('password_confirmation',autocomplete="off", class_='medium')}
57 57 <div class="info-block">
58 58 <a id="generate_password" href="#">
59 59 <i class="icon-lock"></i> ${_('Generate password')}
60 60 </a>
61 61 <span id="generate_password_preview"></span>
62 62 </div>
63 63 </div>
64 64 </div>
65 65
66 66 <div class="field">
67 67 <div class="label">
68 68 <label for="firstname">${_('First Name')}:</label>
69 69 </div>
70 70 <div class="input">
71 71 ${h.text('firstname', class_='medium')}
72 72 </div>
73 73 </div>
74 74
75 75 <div class="field">
76 76 <div class="label">
77 77 <label for="lastname">${_('Last Name')}:</label>
78 78 </div>
79 79 <div class="input">
80 80 ${h.text('lastname', class_='medium')}
81 81 </div>
82 82 </div>
83 83
84 84 <div class="field">
85 85 <div class="label">
86 86 <label for="email">${_('Email')}:</label>
87 87 </div>
88 88 <div class="input">
89 89 ${h.text('email', class_='medium')}
90 90 ${h.hidden('extern_name', c.default_extern_type)}
91 91 ${h.hidden('extern_type', c.default_extern_type)}
92 92 </div>
93 93 </div>
94 94
95 95 <div class="field">
96 96 <div class="label label-checkbox">
97 97 <label for="active">${_('Active')}:</label>
98 98 </div>
99 99 <div class="checkboxes">
100 100 ${h.checkbox('active',value=True,checked='checked')}
101 101 </div>
102 102 </div>
103 103
104 104 <div class="field">
105 105 <div class="label label-checkbox">
106 106 <label for="password_change">${_('Password change')}:</label>
107 107 </div>
108 108 <div class="checkboxes">
109 109 ${h.checkbox('password_change',value=True)}
110 110 <span class="help-block">${_('Force user to change his password on the next login')}</span>
111 111 </div>
112 112 </div>
113 113
114 114 <div class="field">
115 115 <div class="label label-checkbox">
116 116 <label for="create_repo_group">${_('Add personal repository group')}:</label>
117 117 </div>
118 118 <div class="checkboxes">
119 119 ${h.checkbox('create_repo_group',value=True, checked=c.default_create_repo_group)}
120 120 <span class="help-block">
121 121 ${_('New group will be created at: `/%(path)s`') % {'path': c.personal_repo_group_name}}<br/>
122 122 ${_('User will be automatically set as this group owner.')}
123 123 </span>
124 124 </div>
125 125 </div>
126 126
127 127 <div class="buttons">
128 128 ${h.submit('save',_('Save'),class_="btn")}
129 129 </div>
130 130 </div>
131 131 </div>
132 132 ${h.end_form()}
133 133 </div>
134 134 <script>
135 135 $(document).ready(function(){
136 136 $('#username').focus();
137 137
138 138 $('#generate_password').on('click', function(e){
139 var tmpl = "(${_('generated password:')} {0})"
140 var new_passwd = generatePassword(12)
141 $('#generate_password_preview').html(tmpl.format(new_passwd))
139 var tmpl = "(${_('generated password:')} {0})";
140 var new_passwd = generatePassword(12);
141 $('#generate_password_preview').html(tmpl.format(new_passwd));
142 142 $('#password').val(new_passwd);
143 143 $('#password_confirmation').val(new_passwd);
144 144 })
145 145 })
146 146 </script>
147 147 </%def>
@@ -1,71 +1,71 b''
1 1 <%namespace name="base" file="/base/base.mako"/>
2 2
3 3 <div class="panel panel-default">
4 4 <div class="panel-heading">
5 5 <h3 class="panel-title">${_('Additional Email Addresses')}</h3>
6 6 </div>
7 7 <div class="panel-body">
8 8 <div class="emails_wrap">
9 9 <table class="rctable account_emails useremails">
10 10 <tr>
11 11 <td class="td-user">
12 12 ${base.gravatar(c.user.email, 16)}
13 <span class="user email">${c.user.email}
13 <span class="user email">${c.user.email}</span>
14 14 </td>
15 15 <td class="td-tags">
16 16 <span class="tag">${_('Primary')}</span>
17 17 </td>
18 18 </tr>
19 19 %if c.user_email_map:
20 20 %for em in c.user_email_map:
21 21 <tr>
22 22 <td class="td-user">
23 23 ${base.gravatar(em.email, 16)}
24 24 <span class="user email">${em.email}</span>
25 25 </td>
26 26 <td class="td-action">
27 27 ${h.secure_form(url('edit_user_emails', user_id=c.user.user_id),method='delete')}
28 28 ${h.hidden('del_email_id',em.email_id)}
29 29 <button class="btn btn-link btn-danger" type="submit"
30 30 onclick="return confirm('${_('Confirm to delete this email: %s') % em.email}');">
31 31 ${_('Delete')}
32 32 </button>
33 33 ${h.end_form()}
34 34 </td>
35 35 </tr>
36 36 %endfor
37 37 %else:
38 38 <tr class="noborder">
39 39 <td colspan="3">
40 40 <div class="td-email">
41 41 ${_('No additional emails specified')}
42 42 </div>
43 43 </td>
44 44 </tr>
45 45 %endif
46 46 </table>
47 47 </div>
48 48
49 49 ${h.secure_form(url('edit_user_emails', user_id=c.user.user_id),method='put')}
50 50 <div class="form">
51 51 <!-- fields -->
52 52 <div class="fields">
53 53 <div class="field">
54 54 <div class="label">
55 55 <label for="new_email">${_('New email address')}:</label>
56 56 </div>
57 57 <div class="input">
58 58 ${h.text('new_email', class_='medium')}
59 59 </div>
60 60 </div>
61 61 <div class="buttons">
62 62 ${h.submit('save',_('Add'),class_="btn btn-small")}
63 63 ${h.reset('reset',_('Reset'),class_="btn btn-small")}
64 64 </div>
65 65 </div>
66 66 </div>
67 67 ${h.end_form()}
68 68 </div>
69 69 </div>
70 70
71 71
@@ -1,418 +1,418 b''
1 1 ## -*- coding: utf-8 -*-
2 2
3 3 <%inherit file="/base/base.mako"/>
4 4
5 5 <%def name="title()">
6 6 ${_('%s Changelog') % c.repo_name}
7 7 %if c.changelog_for_path:
8 8 /${c.changelog_for_path}
9 9 %endif
10 10 %if c.rhodecode_name:
11 11 &middot; ${h.branding(c.rhodecode_name)}
12 12 %endif
13 13 </%def>
14 14
15 15 <%def name="breadcrumbs_links()">
16 16 %if c.changelog_for_path:
17 17 /${c.changelog_for_path}
18 18 %endif
19 19 ${ungettext('showing %d out of %d commit', 'showing %d out of %d commits', c.showing_commits) % (c.showing_commits, c.total_cs)}
20 20 </%def>
21 21
22 22 <%def name="menu_bar_nav()">
23 23 ${self.menu_items(active='repositories')}
24 24 </%def>
25 25
26 26 <%def name="menu_bar_subnav()">
27 27 ${self.repo_menu(active='changelog')}
28 28 </%def>
29 29
30 30 <%def name="main()">
31 31
32 32 <div class="box">
33 33 <div class="title">
34 34 ${self.repo_page_title(c.rhodecode_db_repo)}
35 35 <ul class="links">
36 36 <li>
37 37 <a href="#" class="btn btn-small" id="rev_range_container" style="display:none;"></a>
38 38 %if c.rhodecode_db_repo.fork:
39 39 <span>
40 40 <a id="compare_fork_button"
41 41 title="${_('Compare fork with %s' % c.rhodecode_db_repo.fork.repo_name)}"
42 42 class="btn btn-small"
43 43 href="${h.url('compare_url',
44 44 repo_name=c.rhodecode_db_repo.fork.repo_name,
45 45 source_ref_type=c.rhodecode_db_repo.landing_rev[0],
46 46 source_ref=c.rhodecode_db_repo.landing_rev[1],
47 47 target_repo=c.repo_name,
48 48 target_ref_type='branch' if request.GET.get('branch') else c.rhodecode_db_repo.landing_rev[0],
49 49 target_ref=request.GET.get('branch') or c.rhodecode_db_repo.landing_rev[1],
50 merge=1)
51 }">
50 merge=1)}"
51 >
52 52 <i class="icon-loop"></i>
53 53 ${_('Compare fork with Parent (%s)' % c.rhodecode_db_repo.fork.repo_name)}
54 54 </a>
55 55 </span>
56 56 %endif
57 57
58 58 ## pr open link
59 59 %if h.is_hg(c.rhodecode_repo) or h.is_git(c.rhodecode_repo):
60 60 <span>
61 61 <a id="open_new_pull_request" class="btn btn-small btn-success" href="${h.url('pullrequest_home',repo_name=c.repo_name)}">
62 62 ${_('Open new pull request')}
63 63 </a>
64 64 </span>
65 65 %endif
66 66
67 67 ## clear selection
68 68 <div title="${_('Clear selection')}" class="btn" id="rev_range_clear" style="display:none">
69 69 ${_('Clear selection')}
70 70 </div>
71 71
72 72 </li>
73 73 </ul>
74 74 </div>
75 75
76 76 % if c.pagination:
77 77
78 78 <div class="graph-header">
79 79 <div id="filter_changelog">
80 80 ${h.hidden('branch_filter')}
81 81 %if c.selected_name:
82 82 <div class="btn btn-default" id="clear_filter" >
83 83 ${_('Clear filter')}
84 84 </div>
85 85 %endif
86 86 </div>
87 87 ${self.breadcrumbs('breadcrumbs_light')}
88 88 </div>
89 89
90 90 <div id="graph">
91 91 <div class="graph-col-wrapper">
92 92 <div id="graph_nodes">
93 93 <div id="graph_canvas" data-graph='${c.jsdata|n}'></div>
94 94 </div>
95 95 <div id="graph_content" class="main-content graph_full_width">
96 96
97 97 <div class="table">
98 98 <table id="changesets" class="rctable">
99 99 <tr>
100 100 ## checkbox
101 101 <th></th>
102 102 <th colspan="2"></th>
103 103
104 104 <th>${_('Commit')}</th>
105 105 ## commit message expand arrow
106 106 <th></th>
107 107 <th>${_('Commit Message')}</th>
108 108
109 109 <th>${_('Age')}</th>
110 110 <th>${_('Author')}</th>
111 111
112 112 <th>${_('Refs')}</th>
113 113 </tr>
114 114 <tbody>
115 115 %for cnt,commit in enumerate(c.pagination):
116 116 <tr id="chg_${cnt+1}" class="container ${'tablerow%s' % (cnt%2)}">
117 117
118 118 <td class="td-checkbox">
119 119 ${h.checkbox(commit.raw_id,class_="commit-range")}
120 120 </td>
121 121 <td class="td-status">
122 122
123 123 %if c.statuses.get(commit.raw_id):
124 124 <div class="changeset-status-ico">
125 125 %if c.statuses.get(commit.raw_id)[2]:
126 126 <a class="tooltip" title="${_('Commit status: %s\nClick to open associated pull request #%s') % (h.commit_status_lbl(c.statuses.get(commit.raw_id)[0]), c.statuses.get(commit.raw_id)[2])}" href="${h.url('pullrequest_show',repo_name=c.statuses.get(commit.raw_id)[3],pull_request_id=c.statuses.get(commit.raw_id)[2])}">
127 127 <div class="${'flag_status %s' % c.statuses.get(commit.raw_id)[0]}"></div>
128 128 </a>
129 129 %else:
130 130 <a class="tooltip" title="${_('Commit status: %s') % h.commit_status_lbl(c.statuses.get(commit.raw_id)[0])}" href="${h.url('changeset_home',repo_name=c.repo_name,revision=commit.raw_id,anchor='comment-%s' % c.comments[commit.raw_id][0].comment_id)}">
131 131 <div class="${'flag_status %s' % c.statuses.get(commit.raw_id)[0]}"></div>
132 132 </a>
133 133 %endif
134 134 </div>
135 135 %else:
136 136 <div class="tooltip flag_status not_reviewed" title="${_('Commit status: Not Reviewed')}"></div>
137 137 %endif
138 138 </td>
139 139 <td class="td-comments comments-col">
140 140 %if c.comments.get(commit.raw_id):
141 141 <a title="${_('Commit has comments')}" href="${h.url('changeset_home',repo_name=c.repo_name,revision=commit.raw_id,anchor='comment-%s' % c.comments[commit.raw_id][0].comment_id)}">
142 142 <i class="icon-comment"></i> ${len(c.comments[commit.raw_id])}
143 143 </a>
144 144 %endif
145 145 </td>
146 146 <td class="td-hash">
147 147 <code>
148 148 <a href="${h.url('changeset_home',repo_name=c.repo_name,revision=commit.raw_id)}">
149 149 <span class="commit_hash">${h.show_id(commit)}</span>
150 150 </a>
151 151 </code>
152 152 </td>
153 153 <td class="td-message expand_commit" data-commit-id="${commit.raw_id}" title="${_('Expand commit message')}">
154 154 <div class="show_more_col">
155 155 <i class="show_more"></i>&nbsp;
156 156 </div>
157 157 </td>
158 158 <td class="td-description mid">
159 159 <div class="log-container truncate-wrap">
160 160 <div class="message truncate" id="c-${commit.raw_id}">${h.urlify_commit_message(commit.message, c.repo_name)}</div>
161 161 </div>
162 162 </td>
163 163
164 164 <td class="td-time">
165 165 ${h.age_component(commit.date)}
166 166 </td>
167 167 <td class="td-user">
168 168 ${self.gravatar_with_user(commit.author)}
169 169 </td>
170 170
171 171 <td class="td-tags tags-col">
172 172 <div id="t-${commit.raw_id}">
173 173 ## branch
174 174 %if commit.branch:
175 175 <span class="branchtag tag" title="${_('Branch %s') % commit.branch}">
176 176 <a href="${h.url('changelog_home',repo_name=c.repo_name,branch=commit.branch)}"><i class="icon-code-fork"></i>${h.shorter(commit.branch)}</a>
177 177 </span>
178 178 %endif
179 179
180 180 ## bookmarks
181 181 %if h.is_hg(c.rhodecode_repo):
182 182 %for book in commit.bookmarks:
183 183 <span class="tag booktag" title="${_('Bookmark %s') % book}">
184 184 <a href="${h.url('files_home',repo_name=c.repo_name,revision=commit.raw_id)}"><i class="icon-bookmark"></i>${h.shorter(book)}</a>
185 185 </span>
186 186 %endfor
187 187 %endif
188 188
189 189 ## tags
190 190 %for tag in commit.tags:
191 191 <span class="tagtag tag" title="${_('Tag %s') % tag}">
192 192 <a href="${h.url('files_home',repo_name=c.repo_name,revision=commit.raw_id)}"><i class="icon-tag"></i>${h.shorter(tag)}</a>
193 193 </span>
194 194 %endfor
195 195
196 196 </div>
197 197 </td>
198 198 </tr>
199 199 %endfor
200 200 </tbody>
201 201 </table>
202 202 </div>
203 203 </div>
204 204 </div>
205 205 <div class="pagination-wh pagination-left">
206 206 ${c.pagination.pager('$link_previous ~2~ $link_next')}
207 207 </div>
208 208
209 209 <script type="text/javascript" src="${h.asset('js/jquery.commits-graph.js')}"></script>
210 210 <script type="text/javascript">
211 211 var cache = {};
212 212 $(function(){
213 213
214 214 // Create links to commit ranges when range checkboxes are selected
215 215 var $commitCheckboxes = $('.commit-range');
216 216 // cache elements
217 217 var $commitRangeContainer = $('#rev_range_container');
218 218 var $commitRangeClear = $('#rev_range_clear');
219 219
220 220 var checkboxRangeSelector = function(e){
221 221 var selectedCheckboxes = [];
222 222 for (pos in $commitCheckboxes){
223 223 if($commitCheckboxes[pos].checked){
224 224 selectedCheckboxes.push($commitCheckboxes[pos]);
225 225 }
226 226 }
227 227 var open_new_pull_request = $('#open_new_pull_request');
228 228 if(open_new_pull_request){
229 229 var selected_changes = selectedCheckboxes.length;
230 230 if (selected_changes > 1 || selected_changes == 1 && templateContext.repo_type != 'hg') {
231 231 open_new_pull_request.hide();
232 232 } else {
233 233 if (selected_changes == 1) {
234 234 open_new_pull_request.html(_gettext('Open new pull request for selected commit'));
235 235 } else if (selected_changes == 0) {
236 236 open_new_pull_request.html(_gettext('Open new pull request'));
237 237 }
238 238 open_new_pull_request.show();
239 239 }
240 240 }
241 241
242 242 if (selectedCheckboxes.length>0){
243 243 var revEnd = selectedCheckboxes[0].name;
244 244 var revStart = selectedCheckboxes[selectedCheckboxes.length-1].name;
245 245 var url = pyroutes.url('changeset_home',
246 246 {'repo_name': '${c.repo_name}',
247 247 'revision': revStart+'...'+revEnd});
248 248
249 249 var link = (revStart == revEnd)
250 250 ? _gettext('Show selected commit __S')
251 251 : _gettext('Show selected commits __S ... __E');
252 252
253 253 link = link.replace('__S', revStart.substr(0,6));
254 254 link = link.replace('__E', revEnd.substr(0,6));
255 255
256 256 $commitRangeContainer
257 257 .attr('href',url)
258 258 .html(link)
259 259 .show();
260 260
261 261 $commitRangeClear.show();
262 262 var _url = pyroutes.url('pullrequest_home',
263 263 {'repo_name': '${c.repo_name}',
264 264 'commit': revEnd});
265 265 open_new_pull_request.attr('href', _url);
266 266 $('#compare_fork_button').hide();
267 267 } else {
268 268 $commitRangeContainer.hide();
269 269 $commitRangeClear.hide();
270 270
271 271 %if c.branch_name:
272 272 var _url = pyroutes.url('pullrequest_home',
273 273 {'repo_name': '${c.repo_name}',
274 274 'branch':'${c.branch_name}'});
275 275 open_new_pull_request.attr('href', _url);
276 276 %else:
277 277 var _url = pyroutes.url('pullrequest_home',
278 278 {'repo_name': '${c.repo_name}'});
279 279 open_new_pull_request.attr('href', _url);
280 280 %endif
281 281 $('#compare_fork_button').show();
282 282 }
283 283 };
284 284
285 285 $commitCheckboxes.on('click', checkboxRangeSelector);
286 286
287 287 $commitRangeClear.on('click',function(e) {
288 $commitCheckboxes.attr('checked', false)
288 $commitCheckboxes.attr('checked', false);
289 289 checkboxRangeSelector();
290 290 e.preventDefault();
291 291 });
292 292
293 293 // make sure the buttons are consistent when navigate back and forth
294 294 checkboxRangeSelector();
295 295
296 296
297 297 var msgs = $('.message');
298 298 // get first element height
299 299 var el = $('#graph_content .container')[0];
300 300 var row_h = el.clientHeight;
301 301 for (var i=0; i < msgs.length; i++) {
302 302 var m = msgs[i];
303 303
304 304 var h = m.clientHeight;
305 305 var pad = $(m).css('padding');
306 306 if (h > row_h) {
307 307 var offset = row_h - (h+12);
308 308 $(m.nextElementSibling).css('display','block');
309 309 $(m.nextElementSibling).css('margin-top',offset+'px');
310 310 }
311 311 }
312 312
313 313 $('.expand_commit').on('click',function(e){
314 314 var target_expand = $(this);
315 315 var cid = target_expand.data('commitId');
316 316
317 317 if (target_expand.hasClass('open')){
318 318 $('#c-'+cid).css({'height': '1.5em', 'white-space': 'nowrap', 'text-overflow': 'ellipsis', 'overflow':'hidden'});
319 319 $('#t-'+cid).css({'height': 'auto', 'line-height': '.9em', 'text-overflow': 'ellipsis', 'overflow':'hidden', 'white-space':'nowrap'});
320 320 target_expand.removeClass('open');
321 321 }
322 322 else {
323 323 $('#c-'+cid).css({'height': 'auto', 'white-space': 'pre-line', 'text-overflow': 'initial', 'overflow':'visible'});
324 324 $('#t-'+cid).css({'height': 'auto', 'max-height': 'none', 'text-overflow': 'initial', 'overflow':'visible', 'white-space':'normal'});
325 325 target_expand.addClass('open');
326 326 }
327 327 // redraw the graph
328 328 graph_options.height = $("#changesets").height();
329 329 $("canvas").remove();
330 330 $("[data-graph]").commits(graph_options);
331 331 });
332 332
333 333 $("#clear_filter").on("click", function() {
334 334 var filter = {'repo_name': '${c.repo_name}'};
335 335 window.location = pyroutes.url('changelog_home', filter);
336 336 });
337 337
338 338 $("#branch_filter").select2({
339 339 'dropdownAutoWidth': true,
340 340 'width': 'resolve',
341 341 'placeholder': "${c.selected_name or _('Filter changelog')}",
342 342 containerCssClass: "drop-menu",
343 343 dropdownCssClass: "drop-menu-dropdown",
344 344 query: function(query){
345 345 var key = 'cache';
346 346 var cached = cache[key] ;
347 347 if(cached) {
348 348 var data = {results: []};
349 349 //filter results
350 350 $.each(cached.results, function(){
351 351 var section = this.text;
352 352 var children = [];
353 353 $.each(this.children, function(){
354 354 if(query.term.length == 0 || this.text.toUpperCase().indexOf(query.term.toUpperCase()) >= 0 ){
355 355 children.push({'id': this.id, 'text': this.text, 'type': this.type})
356 356 }
357 357 });
358 358 data.results.push({'text': section, 'children': children});
359 359 query.callback({results: data.results});
360 360 });
361 361 }else{
362 362 $.ajax({
363 363 url: pyroutes.url('repo_refs_changelog_data', {'repo_name': '${c.repo_name}'}),
364 364 data: {},
365 365 dataType: 'json',
366 366 type: 'GET',
367 367 success: function(data) {
368 368 cache[key] = data;
369 369 query.callback({results: data.results});
370 370 }
371 371 })
372 372 }
373 373 }
374 374 });
375 375
376 376 $('#branch_filter').on('change', function(e){
377 377 var data = $('#branch_filter').select2('data');
378 378 var selected = data.text;
379 379 var filter = {'repo_name': '${c.repo_name}'};
380 380 if(data.type == 'branch' || data.type == 'branch_closed'){
381 381 filter["branch"] = selected;
382 382 }
383 383 else if (data.type == 'book'){
384 384 filter["bookmark"] = selected;
385 385 }
386 386 window.location = pyroutes.url('changelog_home', filter);
387 387 });
388 388
389 389 // Determine max number of edges per row in graph
390 390 var jsdata = $.parseJSON($("[data-graph]").attr('data-graph'));
391 391 var edgeCount = 1;
392 392 $.each(jsdata, function(i, item){
393 393 $.each(item[2], function(key, value) {
394 394 if (value[1] > edgeCount){
395 395 edgeCount = value[1];
396 396 }
397 397 });
398 398 });
399 399 var x_step = Math.min(18, Math.floor(86 / edgeCount));
400 400 var graph_options = {
401 401 width: 100,
402 402 height: $("#changesets").height(),
403 403 x_step: x_step,
404 404 y_step: 42,
405 405 dotRadius: 3.5,
406 406 lineWidth: 2.5
407 407 };
408 408 $("[data-graph]").commits(graph_options);
409 409
410 410 });
411 411
412 412 </script>
413 413 %else:
414 414 ${_('There are no changes yet')}
415 415 %endif
416 416 </div>
417 417 </div>
418 418 </%def>
@@ -1,314 +1,314 b''
1 1 ## -*- coding: utf-8 -*-
2 2
3 3 <%inherit file="/base/base.mako"/>
4 4 <%namespace name="diff_block" file="/changeset/diff_block.mako"/>
5 5
6 6 <%def name="title()">
7 7 ${_('%s Commit') % c.repo_name} - ${h.show_id(c.commit)}
8 8 %if c.rhodecode_name:
9 9 &middot; ${h.branding(c.rhodecode_name)}
10 10 %endif
11 11 </%def>
12 12
13 13 <%def name="menu_bar_nav()">
14 14 ${self.menu_items(active='repositories')}
15 15 </%def>
16 16
17 17 <%def name="menu_bar_subnav()">
18 18 ${self.repo_menu(active='changelog')}
19 19 </%def>
20 20
21 21 <%def name="main()">
22 22 <script>
23 23 // TODO: marcink switch this to pyroutes
24 24 AJAX_COMMENT_DELETE_URL = "${url('changeset_comment_delete',repo_name=c.repo_name,comment_id='__COMMENT_ID__')}";
25 25 templateContext.commit_data.commit_id = "${c.commit.raw_id}";
26 26 </script>
27 27 <div class="box">
28 28 <div class="title">
29 29 ${self.repo_page_title(c.rhodecode_db_repo)}
30 30 </div>
31 31
32 32 <div id="changeset_compare_view_content" class="summary changeset">
33 33 <div class="summary-detail">
34 34 <div class="summary-detail-header">
35 35 <span class="breadcrumbs files_location">
36 36 <h4>${_('Commit')}
37 37 <code>
38 38 ${h.show_id(c.commit)}
39 39 </code>
40 40 </h4>
41 41 </span>
42 42 <span id="parent_link">
43 43 <a href="#" title="${_('Parent Commit')}">${_('Parent')}</a>
44 44 </span>
45 45 |
46 46 <span id="child_link">
47 47 <a href="#" title="${_('Child Commit')}">${_('Child')}</a>
48 48 </span>
49 49 </div>
50 50
51 51 <div class="fieldset">
52 52 <div class="left-label">
53 53 ${_('Description')}:
54 54 </div>
55 55 <div class="right-content">
56 56 <div id="trimmed_message_box" class="commit">${h.urlify_commit_message(c.commit.message,c.repo_name)}</div>
57 57 <div id="message_expand" style="display:none;">
58 58 ${_('Expand')}
59 59 </div>
60 60 </div>
61 61 </div>
62 62
63 63 %if c.statuses:
64 64 <div class="fieldset">
65 65 <div class="left-label">
66 66 ${_('Commit status')}:
67 67 </div>
68 68 <div class="right-content">
69 69 <div class="changeset-status-ico">
70 70 <div class="${'flag_status %s' % c.statuses[0]} pull-left"></div>
71 71 </div>
72 72 <div title="${_('Commit status')}" class="changeset-status-lbl">[${h.commit_status_lbl(c.statuses[0])}]</div>
73 73 </div>
74 74 </div>
75 75 %endif
76 76
77 77 <div class="fieldset">
78 78 <div class="left-label">
79 79 ${_('References')}:
80 80 </div>
81 81 <div class="right-content">
82 82 <div class="tags">
83 83
84 84 %if c.commit.merge:
85 85 <span class="mergetag tag">
86 86 <i class="icon-merge"></i>${_('merge')}
87 87 </span>
88 88 %endif
89 89
90 90 %if h.is_hg(c.rhodecode_repo):
91 91 %for book in c.commit.bookmarks:
92 92 <span class="booktag tag" title="${_('Bookmark %s') % book}">
93 93 <a href="${h.url('files_home',repo_name=c.repo_name,revision=c.commit.raw_id)}"><i class="icon-bookmark"></i>${h.shorter(book)}</a>
94 94 </span>
95 95 %endfor
96 96 %endif
97 97
98 98 %for tag in c.commit.tags:
99 99 <span class="tagtag tag" title="${_('Tag %s') % tag}">
100 100 <a href="${h.url('files_home',repo_name=c.repo_name,revision=c.commit.raw_id)}"><i class="icon-tag"></i>${tag}</a>
101 101 </span>
102 102 %endfor
103 103
104 104 %if c.commit.branch:
105 105 <span class="branchtag tag" title="${_('Branch %s') % c.commit.branch}">
106 106 <a href="${h.url('files_home',repo_name=c.repo_name,revision=c.commit.raw_id)}"><i class="icon-code-fork"></i>${h.shorter(c.commit.branch)}</a>
107 107 </span>
108 108 %endif
109 109 </div>
110 110 </div>
111 111 </div>
112 112
113 113 <div class="fieldset">
114 114 <div class="left-label">
115 115 ${_('Diff options')}:
116 116 </div>
117 117 <div class="right-content">
118 118 <div class="diff-actions">
119 119 <a href="${h.url('changeset_raw_home',repo_name=c.repo_name,revision=c.commit.raw_id)}" class="tooltip" title="${h.tooltip(_('Raw diff'))}">
120 120 ${_('Raw Diff')}
121 121 </a>
122 122 |
123 123 <a href="${h.url('changeset_patch_home',repo_name=c.repo_name,revision=c.commit.raw_id)}" class="tooltip" title="${h.tooltip(_('Patch diff'))}">
124 124 ${_('Patch Diff')}
125 125 </a>
126 126 |
127 127 <a href="${h.url('changeset_download_home',repo_name=c.repo_name,revision=c.commit.raw_id,diff='download')}" class="tooltip" title="${h.tooltip(_('Download diff'))}">
128 128 ${_('Download Diff')}
129 129 </a>
130 130 |
131 131 ${c.ignorews_url(request.GET)}
132 132 |
133 133 ${c.context_url(request.GET)}
134 134 </div>
135 135 </div>
136 136 </div>
137 137
138 138 <div class="fieldset">
139 139 <div class="left-label">
140 140 ${_('Comments')}:
141 141 </div>
142 142 <div class="right-content">
143 143 <div class="comments-number">
144 144 %if c.comments:
145 145 <a href="#comments">${ungettext("%d Commit comment", "%d Commit comments", len(c.comments)) % len(c.comments)}</a>,
146 146 %else:
147 147 ${ungettext("%d Commit comment", "%d Commit comments", len(c.comments)) % len(c.comments)}
148 148 %endif
149 149 %if c.inline_cnt:
150 150 <a href="#" onclick="return Rhodecode.comments.nextComment();" id="inline-comments-counter">${ungettext("%d Inline Comment", "%d Inline Comments", c.inline_cnt) % c.inline_cnt}</a>
151 151 %else:
152 152 ${ungettext("%d Inline Comment", "%d Inline Comments", c.inline_cnt) % c.inline_cnt}
153 153 %endif
154 154 </div>
155 155 </div>
156 156 </div>
157 157
158 158 </div> <!-- end summary-detail -->
159 159
160 160 <div id="commit-stats" class="sidebar-right">
161 161 <div class="summary-detail-header">
162 162 <h4 class="item">
163 163 ${_('Author')}
164 164 </h4>
165 165 </div>
166 166 <div class="sidebar-right-content">
167 167 ${self.gravatar_with_user(c.commit.author)}
168 168 <div class="user-inline-data">- ${h.age_component(c.commit.date)}</div>
169 169 </div>
170 170 </div><!-- end sidebar -->
171 171 </div> <!-- end summary -->
172 172 <div class="cs_files">
173 173 <%namespace name="cbdiffs" file="/codeblocks/diffs.mako"/>
174 174 ${cbdiffs.render_diffset_menu()}
175 175 ${cbdiffs.render_diffset(
176 176 c.changes[c.commit.raw_id], commit=c.commit, use_comments=True)}
177 177 </div>
178 178
179 179 ## template for inline comment form
180 180 <%namespace name="comment" file="/changeset/changeset_file_comment.mako"/>
181 181
182 182 ## render comments
183 183 ${comment.generate_comments()}
184 184
185 185 ## main comment form and it status
186 186 ${comment.comments(h.url('changeset_comment', repo_name=c.repo_name, revision=c.commit.raw_id),
187 187 h.commit_status(c.rhodecode_db_repo, c.commit.raw_id))}
188 188 </div>
189 189
190 190 ## FORM FOR MAKING JS ACTION AS CHANGESET COMMENTS
191 191 <script type="text/javascript">
192 192
193 193 $(document).ready(function() {
194 194
195 195 var boxmax = parseInt($('#trimmed_message_box').css('max-height'), 10);
196 196 if($('#trimmed_message_box').height() === boxmax){
197 197 $('#message_expand').show();
198 198 }
199 199
200 200 $('#message_expand').on('click', function(e){
201 201 $('#trimmed_message_box').css('max-height', 'none');
202 202 $(this).hide();
203 203 });
204 204
205 205 $('.show-inline-comments').on('click', function(e){
206 206 var boxid = $(this).attr('data-comment-id');
207 207 var button = $(this);
208 208
209 209 if(button.hasClass("comments-visible")) {
210 210 $('#{0} .inline-comments'.format(boxid)).each(function(index){
211 211 $(this).hide();
212 212 });
213 213 button.removeClass("comments-visible");
214 214 } else {
215 215 $('#{0} .inline-comments'.format(boxid)).each(function(index){
216 216 $(this).show();
217 217 });
218 218 button.addClass("comments-visible");
219 219 }
220 220 });
221 221
222 222
223 223 // next links
224 224 $('#child_link').on('click', function(e){
225 225 // fetch via ajax what is going to be the next link, if we have
226 226 // >1 links show them to user to choose
227 227 if(!$('#child_link').hasClass('disabled')){
228 228 $.ajax({
229 229 url: '${h.url('changeset_children',repo_name=c.repo_name, revision=c.commit.raw_id)}',
230 230 success: function(data) {
231 231 if(data.results.length === 0){
232 232 $('#child_link').html("${_('No Child Commits')}").addClass('disabled');
233 233 }
234 234 if(data.results.length === 1){
235 235 var commit = data.results[0];
236 236 window.location = pyroutes.url('changeset_home', {'repo_name': '${c.repo_name}','revision': commit.raw_id});
237 237 }
238 238 else if(data.results.length === 2){
239 239 $('#child_link').addClass('disabled');
240 240 $('#child_link').addClass('double');
241 241 var _html = '';
242 242 _html +='<a title="__title__" href="__url__">__rev__</a> '
243 243 .replace('__rev__','r{0}:{1}'.format(data.results[0].revision, data.results[0].raw_id.substr(0,6)))
244 244 .replace('__title__', data.results[0].message)
245 245 .replace('__url__', pyroutes.url('changeset_home', {'repo_name': '${c.repo_name}','revision': data.results[0].raw_id}));
246 _html +=' | '
246 _html +=' | ';
247 247 _html +='<a title="__title__" href="__url__">__rev__</a> '
248 248 .replace('__rev__','r{0}:{1}'.format(data.results[1].revision, data.results[1].raw_id.substr(0,6)))
249 249 .replace('__title__', data.results[1].message)
250 250 .replace('__url__', pyroutes.url('changeset_home', {'repo_name': '${c.repo_name}','revision': data.results[1].raw_id}));
251 251 $('#child_link').html(_html);
252 252 }
253 253 }
254 254 });
255 255 e.preventDefault();
256 256 }
257 257 });
258 258
259 259 // prev links
260 260 $('#parent_link').on('click', function(e){
261 261 // fetch via ajax what is going to be the next link, if we have
262 262 // >1 links show them to user to choose
263 263 if(!$('#parent_link').hasClass('disabled')){
264 264 $.ajax({
265 265 url: '${h.url("changeset_parents",repo_name=c.repo_name, revision=c.commit.raw_id)}',
266 266 success: function(data) {
267 267 if(data.results.length === 0){
268 268 $('#parent_link').html('${_('No Parent Commits')}').addClass('disabled');
269 269 }
270 270 if(data.results.length === 1){
271 271 var commit = data.results[0];
272 272 window.location = pyroutes.url('changeset_home', {'repo_name': '${c.repo_name}','revision': commit.raw_id});
273 273 }
274 274 else if(data.results.length === 2){
275 275 $('#parent_link').addClass('disabled');
276 276 $('#parent_link').addClass('double');
277 277 var _html = '';
278 278 _html +='<a title="__title__" href="__url__">Parent __rev__</a>'
279 279 .replace('__rev__','r{0}:{1}'.format(data.results[0].revision, data.results[0].raw_id.substr(0,6)))
280 280 .replace('__title__', data.results[0].message)
281 281 .replace('__url__', pyroutes.url('changeset_home', {'repo_name': '${c.repo_name}','revision': data.results[0].raw_id}));
282 _html +=' | '
282 _html +=' | ';
283 283 _html +='<a title="__title__" href="__url__">Parent __rev__</a>'
284 284 .replace('__rev__','r{0}:{1}'.format(data.results[1].revision, data.results[1].raw_id.substr(0,6)))
285 285 .replace('__title__', data.results[1].message)
286 286 .replace('__url__', pyroutes.url('changeset_home', {'repo_name': '${c.repo_name}','revision': data.results[1].raw_id}));
287 287 $('#parent_link').html(_html);
288 288 }
289 289 }
290 290 });
291 291 e.preventDefault();
292 292 }
293 293 });
294 294
295 295 if (location.hash) {
296 296 var result = splitDelimitedHash(location.hash);
297 297 var line = $('html').find(result.loc);
298 298 if (line.length > 0){
299 299 offsetScroll(line, 70);
300 300 }
301 301 }
302 302
303 303 // browse tree @ revision
304 304 $('#files_link').on('click', function(e){
305 305 window.location = '${h.url('files_home',repo_name=c.repo_name, revision=c.commit.raw_id, f_path='')}';
306 306 e.preventDefault();
307 307 });
308 308
309 309 // inject comments into their proper positions
310 310 var file_comments = $('.inline-comment-placeholder');
311 311 })
312 312 </script>
313 313
314 314 </%def>
@@ -1,264 +1,263 b''
1 1 ## -*- coding: utf-8 -*-
2 2 ## usage:
3 3 ## <%namespace name="comment" file="/changeset/changeset_file_comment.mako"/>
4 4 ## ${comment.comment_block(comment)}
5 5 ##
6 6 <%namespace name="base" file="/base/base.mako"/>
7 7
8 8 <%def name="comment_block(comment, inline=False)">
9 9 <% outdated_at_ver = comment.outdated_at_version(getattr(c, 'at_version', None)) %>
10 10
11 11 <div class="comment
12 12 ${'comment-inline' if inline else ''}
13 13 ${'comment-outdated' if outdated_at_ver else 'comment-current'}"
14 14 id="comment-${comment.comment_id}"
15 15 line="${comment.line_no}"
16 16 data-comment-id="${comment.comment_id}"
17 17 style="${'display: none;' if outdated_at_ver else ''}">
18 18
19 19 <div class="meta">
20 20 <div class="author">
21 21 ${base.gravatar_with_user(comment.author.email, 16)}
22 22 </div>
23 23 <div class="date">
24 24 ${h.age_component(comment.modified_at, time_is_local=True)}
25 25 </div>
26 26 <div class="status-change">
27 27 % if comment.pull_request:
28 28 % if comment.outdated:
29 29 <a href="?version=${comment.pull_request_version_id}#comment-${comment.comment_id}">
30 30 ${_('Outdated comment from pull request version {}').format(comment.pull_request_version_id)}
31 31 </a>
32 32 % else:
33 33 <a href="${h.url('pullrequest_show',repo_name=comment.pull_request.target_repo.repo_name,pull_request_id=comment.pull_request.pull_request_id)}">
34 34 %if comment.status_change:
35 35 ${_('Vote on pull request #%s') % comment.pull_request.pull_request_id}:
36 36 %else:
37 37 ${_('Comment on pull request #%s') % comment.pull_request.pull_request_id}
38 38 %endif
39 39 </a>
40 40 % endif
41 41 % else:
42 42 % if comment.status_change:
43 43 ${_('Status change on commit')}:
44 44 % else:
45 45 ${_('Comment on commit')}
46 46 % endif
47 47 % endif
48 48 </div>
49 49 %if comment.status_change:
50 50 <div class="${'flag_status %s' % comment.status_change[0].status}"></div>
51 51 <div title="${_('Commit status')}" class="changeset-status-lbl">
52 52 ${comment.status_change[0].status_lbl}
53 53 </div>
54 54 %endif
55 55 <a class="permalink" href="#comment-${comment.comment_id}"> &para;</a>
56 56
57 57 <div class="comment-links-block">
58 58 ## show delete comment if it's not a PR (regular comments) or it's PR that is not closed
59 59 ## only super-admin, repo admin OR comment owner can delete, also hide delete if currently viewed comment is outdated
60 60 %if not outdated_at_ver and (not comment.pull_request or (comment.pull_request and not comment.pull_request.is_closed())):
61 61 ## permissions to delete
62 62 %if h.HasPermissionAny('hg.admin')() or h.HasRepoPermissionAny('repository.admin')(c.repo_name) or comment.author.user_id == c.rhodecode_user.user_id:
63 63 ## TODO: dan: add edit comment here
64 64 <a onclick="return Rhodecode.comments.deleteComment(this);" class="delete-comment"> ${_('Delete')}</a>
65 65 %else:
66 66 <button class="btn-link" disabled="disabled"> ${_('Delete')}</button>
67 67 %endif
68 68 %else:
69 69 <button class="btn-link" disabled="disabled"> ${_('Delete')}</button>
70 70 %endif
71 71
72 72 %if not outdated_at_ver:
73 73 | <a onclick="return Rhodecode.comments.prevComment(this);" class="prev-comment"> ${_('Prev')}</a>
74 74 | <a onclick="return Rhodecode.comments.nextComment(this);" class="next-comment"> ${_('Next')}</a>
75 75 %endif
76 76
77 77 </div>
78 78 </div>
79 79 <div class="text">
80 80 ${comment.render(mentions=True)|n}
81 81 </div>
82 82
83 83 </div>
84 84 </%def>
85 85 ## generate main comments
86 86 <%def name="generate_comments(include_pull_request=False, is_pull_request=False)">
87 87 <div id="comments">
88 88 %for comment in c.comments:
89 89 <div id="comment-tr-${comment.comment_id}">
90 90 ## only render comments that are not from pull request, or from
91 91 ## pull request and a status change
92 92 %if not comment.pull_request or (comment.pull_request and comment.status_change) or include_pull_request:
93 93 ${comment_block(comment)}
94 94 %endif
95 95 </div>
96 96 %endfor
97 97 ## to anchor ajax comments
98 98 <div id="injected_page_comments"></div>
99 99 </div>
100 100 </%def>
101 101
102 102 ## MAIN COMMENT FORM
103 103 <%def name="comments(post_url, cur_status, is_pull_request=False, is_compare=False, change_status=True, form_extras=None)">
104 104
105 105 %if is_compare:
106 106 <% form_id = "comments_form_compare" %>
107 107 %else:
108 108 <% form_id = "comments_form" %>
109 109 %endif
110 110
111 111
112 112 %if is_pull_request:
113 113 <div class="pull-request-merge">
114 114 %if c.allowed_to_merge:
115 115 <div class="pull-request-wrap">
116 116 <div class="pull-right">
117 117 ${h.secure_form(url('pullrequest_merge', repo_name=c.repo_name, pull_request_id=c.pull_request.pull_request_id), id='merge_pull_request_form')}
118 118 <span data-role="merge-message">${c.pr_merge_msg} ${c.approval_msg if c.approval_msg else ''}</span>
119 119 <% merge_disabled = ' disabled' if c.pr_merge_status is False else '' %>
120 120 <input type="submit" id="merge_pull_request" value="${_('Merge Pull Request')}" class="btn${merge_disabled}"${merge_disabled}>
121 121 ${h.end_form()}
122 122 </div>
123 123 </div>
124 124 %else:
125 125 <div class="pull-request-wrap">
126 126 <div class="pull-right">
127 127 <span>${c.pr_merge_msg} ${c.approval_msg if c.approval_msg else ''}</span>
128 128 </div>
129 129 </div>
130 130 %endif
131 131 </div>
132 132 %endif
133 133 <div class="comments">
134 134 <%
135 135 if is_pull_request:
136 136 placeholder = _('Leave a comment on this Pull Request.')
137 137 elif is_compare:
138 138 placeholder = _('Leave a comment on all commits in this range.')
139 139 else:
140 140 placeholder = _('Leave a comment on this Commit.')
141 141 %>
142 142 % if c.rhodecode_user.username != h.DEFAULT_USER:
143 143 <div class="comment-form ac">
144 144 ${h.secure_form(post_url, id_=form_id)}
145 145 <div class="comment-area">
146 146 <div class="comment-area-header">
147 147 <ul class="nav-links clearfix">
148 148 <li class="active">
149 149 <a href="#edit-btn" tabindex="-1" id="edit-btn">${_('Write')}</a>
150 150 </li>
151 151 <li class="">
152 152 <a href="#preview-btn" tabindex="-1" id="preview-btn">${_('Preview')}</a>
153 153 </li>
154 154 </ul>
155 155 </div>
156 156
157 157 <div class="comment-area-write" style="display: block;">
158 158 <div id="edit-container">
159 159 <textarea id="text" name="text" class="comment-block-ta ac-input"></textarea>
160 160 </div>
161 161 <div id="preview-container" class="clearfix" style="display: none;">
162 162 <div id="preview-box" class="preview-box"></div>
163 163 </div>
164 164 </div>
165 165
166 166 <div class="comment-area-footer">
167 167 <div class="toolbar">
168 168 <div class="toolbar-text">
169 169 ${(_('Comments parsed using %s syntax with %s support.') % (
170 170 ('<a href="%s">%s</a>' % (h.url('%s_help' % c.visual.default_renderer), c.visual.default_renderer.upper())),
171 171 ('<span class="tooltip" title="%s">@mention</span>' % _('Use @username inside this text to send notification to this RhodeCode user'))
172 172 )
173 )|n
174 }
173 )|n}
175 174 </div>
176 175 </div>
177 176 </div>
178 177 </div>
179 178
180 179 <div id="comment_form_extras">
181 180 %if form_extras and isinstance(form_extras, (list, tuple)):
182 181 % for form_ex_el in form_extras:
183 182 ${form_ex_el|n}
184 183 % endfor
185 184 %endif
186 185 </div>
187 186 <div class="comment-footer">
188 187 %if change_status:
189 188 <div class="status_box">
190 189 <select id="change_status" name="changeset_status">
191 190 <option></option> # Placeholder
192 191 %for status,lbl in c.commit_statuses:
193 192 <option value="${status}" data-status="${status}">${lbl}</option>
194 193 %if is_pull_request and change_status and status in ('approved', 'rejected'):
195 194 <option value="${status}_closed" data-status="${status}">${lbl} & ${_('Closed')}</option>
196 195 %endif
197 196 %endfor
198 197 </select>
199 198 </div>
200 199 %endif
201 200 <div class="action-buttons">
202 201 <div class="comment-button">${h.submit('save', _('Comment'), class_="btn btn-success comment-button-input")}</div>
203 202 </div>
204 203 </div>
205 204 ${h.end_form()}
206 205 </div>
207 206 % else:
208 207 <div class="comment-form ac">
209 208
210 209 <div class="comment-area">
211 210 <div class="comment-area-header">
212 211 <ul class="nav-links clearfix">
213 212 <li class="active">
214 213 <a class="disabled" href="#edit-btn" disabled="disabled" onclick="return false">${_('Write')}</a>
215 214 </li>
216 215 <li class="">
217 216 <a class="disabled" href="#preview-btn" disabled="disabled" onclick="return false">${_('Preview')}</a>
218 217 </li>
219 218 </ul>
220 219 </div>
221 220
222 221 <div class="comment-area-write" style="display: block;">
223 222 <div id="edit-container">
224 223 <div style="padding: 40px 0">
225 224 ${_('You need to be logged in to leave comments.')}
226 225 <a href="${h.route_path('login', _query={'came_from': h.url.current()})}">${_('Login now')}</a>
227 226 </div>
228 227 </div>
229 228 <div id="preview-container" class="clearfix" style="display: none;">
230 229 <div id="preview-box" class="preview-box"></div>
231 230 </div>
232 231 </div>
233 232
234 233 <div class="comment-area-footer">
235 234 <div class="toolbar">
236 235 <div class="toolbar-text">
237 236 </div>
238 237 </div>
239 238 </div>
240 239 </div>
241 240
242 241 <div class="comment-footer">
243 242 </div>
244 243
245 244 </div>
246 245 % endif
247 246
248 247 </div>
249 248
250 249 <script>
251 250 // init active elements of commentForm
252 251 var commitId = templateContext.commit_data.commit_id;
253 252 var pullRequestId = templateContext.pull_request_data.pull_request_id;
254 253 var lineNo;
255 254
256 255 var mainCommentForm = new CommentForm(
257 256 "#${form_id}", commitId, pullRequestId, lineNo, true);
258 257
259 258 mainCommentForm.cm.setOption('placeholder', "${placeholder}");
260 259
261 260 mainCommentForm.initStatusChangeSelector();
262 261 bindToggleButtons();
263 262 </script>
264 263 </%def>
@@ -1,64 +1,64 b''
1 1 ## -*- coding: utf-8 -*-
2 2 ##usage:
3 3 ## <%namespace name="diff_block" file="/changeset/diff_block.mako"/>
4 4 ## ${diff_block.diff_block_changeset_table(change)}
5 5 ##
6 6 <%def name="changeset_message()">
7 7 <h5>${_('The requested commit is too big and content was truncated.')} <a href="${h.url.current(fulldiff=1, **request.GET.mixed())}" onclick="return confirm('${_("Showing a big diff might take some time and resources, continue?")}')">${_('Show full diff')}</a></h5>
8 8 </%def>
9 9 <%def name="file_message()">
10 10 <h5>${_('The requested file is too big and its content is not shown.')} <a href="${h.url.current(fulldiff=1, **request.GET.mixed())}" onclick="return confirm('${_("Showing a big diff might take some time and resources, continue?")}')">${_('Show full diff')}</a></h5>
11 11 </%def>
12 12
13 13 <%def name="diff_block_changeset_table(change)">
14 14 <div class="diff-container" id="${'diff-container-%s' % (id(change))}">
15 %for FID,(cs1, cs2, change, filenode_path, diff, stats, file) in change.iteritems():
15 %for FID,(cs1, cs2, change, filenode_path, diff, stats, file_data) in change.iteritems():
16 16 <div id="${h.FID('',filenode_path)}_target" ></div>
17 17 <div id="${h.FID('',filenode_path)}" class="diffblock margined comm">
18 18 <div class="code-body">
19 19 <div class="full_f_path" path="${h.safe_unicode(filenode_path)}" style="display: none"></div>
20 20 ${diff|n}
21 % if file["is_limited_diff"]:
22 % if file["exceeds_limit"]:
21 % if file_data["is_limited_diff"]:
22 % if file_data["exceeds_limit"]:
23 23 ${self.file_message()}
24 24 % else:
25 25 <h5>${_('Diff was truncated. File content available only in full diff.')} <a href="${h.url.current(fulldiff=1, **request.GET.mixed())}" onclick="return confirm('${_("Showing a big diff might take some time and resources, continue?")}')">${_('Show full diff')}</a></h5>
26 26 % endif
27 27 % endif
28 28 </div>
29 29 </div>
30 30 %endfor
31 31 </div>
32 32 </%def>
33 33
34 34 <%def name="diff_block_simple(change)">
35 35 <div class="diff-container" id="${'diff-container-%s' % (id(change))}">
36 %for op,filenode_path,diff,file in change:
36 %for op,filenode_path,diff,file_data in change:
37 37 <div id="${h.FID('',filenode_path)}_target" ></div>
38 38 <div id="${h.FID('',filenode_path)}" class="diffblock margined comm" >
39 39 <div class="code-body">
40 40 <div class="full_f_path" path="${h.safe_unicode(filenode_path)}" style="display: none;"></div>
41 41 ${diff|n}
42 % if file["is_limited_diff"]:
43 % if file["exceeds_limit"]:
42 % if file_data["is_limited_diff"]:
43 % if file_data["exceeds_limit"]:
44 44 ${self.file_message()}
45 45 % else:
46 46 <h5>${_('Diff was truncated. File content available only in full diff.')} <a href="${h.url.current(fulldiff=1, **request.GET.mixed())}" onclick="return confirm('${_("Showing a big diff might take some time and resources, continue?")}')">${_('Show full diff')}</a></h5>
47 47 % endif
48 48 % endif
49 49 </div>
50 50 </div>
51 51 %endfor
52 52 </div>
53 53 </%def>
54 54
55 55
56 56 <%def name="diff_summary_text(changed_files, lines_added, lines_deleted, limited_diff=False)">
57 57 % if limited_diff:
58 58 ${ungettext('%(num)s file changed', '%(num)s files changed', changed_files) % {'num': changed_files}}
59 59 % else:
60 60 ${ungettext('%(num)s file changed: %(linesadd)s inserted, ''%(linesdel)s deleted',
61 61 '%(num)s files changed: %(linesadd)s inserted, %(linesdel)s deleted', changed_files) % {'num': changed_files, 'linesadd': lines_added, 'linesdel': lines_deleted}}
62 62 %endif
63 63 </%def>
64 64
@@ -1,705 +1,711 b''
1 1 <%def name="diff_line_anchor(filename, line, type)"><%
2 2 return '%s_%s_%i' % (h.safeid(filename), type, line)
3 3 %></%def>
4 4
5 <%def name="action_class(action)"><%
5 <%def name="action_class(action)">
6 <%
6 7 return {
7 8 '-': 'cb-deletion',
8 9 '+': 'cb-addition',
9 10 ' ': 'cb-context',
10 11 }.get(action, 'cb-empty')
11 %></%def>
12 %>
13 </%def>
12 14
13 <%def name="op_class(op_id)"><%
15 <%def name="op_class(op_id)">
16 <%
14 17 return {
15 18 DEL_FILENODE: 'deletion', # file deleted
16 19 BIN_FILENODE: 'warning' # binary diff hidden
17 20 }.get(op_id, 'addition')
18 %></%def>
21 %>
22 </%def>
19 23
20 <%def name="link_for(**kw)"><%
24 <%def name="link_for(**kw)">
25 <%
21 26 new_args = request.GET.mixed()
22 27 new_args.update(kw)
23 28 return h.url('', **new_args)
24 %></%def>
29 %>
30 </%def>
25 31
26 32 <%def name="render_diffset(diffset, commit=None,
27 33
28 34 # collapse all file diff entries when there are more than this amount of files in the diff
29 35 collapse_when_files_over=20,
30 36
31 37 # collapse lines in the diff when more than this amount of lines changed in the file diff
32 38 lines_changed_limit=500,
33 39
34 40 # add a ruler at to the output
35 41 ruler_at_chars=0,
36 42
37 43 # show inline comments
38 44 use_comments=False,
39 45
40 46 # disable new comments
41 47 disable_new_comments=False,
42 48
43 49 # special file-comments that were deleted in previous versions
44 50 # it's used for showing outdated comments for deleted files in a PR
45 51 deleted_files_comments=None
46 52
47 53 )">
48 54
49 55 %if use_comments:
50 56 <div id="cb-comments-inline-container-template" class="js-template">
51 57 ${inline_comments_container([])}
52 58 </div>
53 59 <div class="js-template" id="cb-comment-inline-form-template">
54 60 <div class="comment-inline-form ac">
55 61
56 62 %if c.rhodecode_user.username != h.DEFAULT_USER:
57 63 ${h.form('#', method='get')}
58 64 <div class="comment-area">
59 65 <div class="comment-area-header">
60 66 <ul class="nav-links clearfix">
61 67 <li class="active">
62 68 <a href="#edit-btn" tabindex="-1" id="edit-btn_{1}">${_('Write')}</a>
63 69 </li>
64 70 <li class="">
65 71 <a href="#preview-btn" tabindex="-1" id="preview-btn_{1}">${_('Preview')}</a>
66 72 </li>
67 73 </ul>
68 74 </div>
69 75
70 76 <div class="comment-area-write" style="display: block;">
71 77 <div id="edit-container_{1}">
72 78 <textarea id="text_{1}" name="text" class="comment-block-ta ac-input"></textarea>
73 79 </div>
74 80 <div id="preview-container_{1}" class="clearfix" style="display: none;">
75 81 <div id="preview-box_{1}" class="preview-box"></div>
76 82 </div>
77 83 </div>
78 84
79 85 <div class="comment-area-footer">
80 86 <div class="toolbar">
81 87 <div class="toolbar-text">
82 88 ${(_('Comments parsed using %s syntax with %s support.') % (
83 89 ('<a href="%s">%s</a>' % (h.url('%s_help' % c.visual.default_renderer), c.visual.default_renderer.upper())),
84 90 ('<span class="tooltip" title="%s">@mention</span>' % _('Use @username inside this text to send notification to this RhodeCode user'))
85 91 )
86 )|n
87 }
92 )|n}
88 93 </div>
89 94 </div>
90 95 </div>
91 96 </div>
92 97
93 98 <div class="comment-footer">
94 99 <div class="action-buttons">
95 100 <input type="hidden" name="f_path" value="{0}">
96 101 <input type="hidden" name="line" value="{1}">
97 102 <button type="button" class="cb-comment-cancel" onclick="return Rhodecode.comments.cancelComment(this);">
98 103 ${_('Cancel')}
99 104 </button>
100 105 ${h.submit('save', _('Comment'), class_='btn btn-success save-inline-form')}
101 106 </div>
102 107 ${h.end_form()}
103 108 </div>
104 109 %else:
105 110 ${h.form('', class_='inline-form comment-form-login', method='get')}
106 111 <div class="pull-left">
107 112 <div class="comment-help pull-right">
108 113 ${_('You need to be logged in to leave comments.')} <a href="${h.route_path('login', _query={'came_from': h.url.current()})}">${_('Login now')}</a>
109 114 </div>
110 115 </div>
111 116 <div class="comment-button pull-right">
112 117 <button type="button" class="cb-comment-cancel" onclick="return Rhodecode.comments.cancelComment(this);">
113 118 ${_('Cancel')}
114 119 </button>
115 120 </div>
116 121 <div class="clearfix"></div>
117 122 ${h.end_form()}
118 123 %endif
119 124 </div>
120 125 </div>
121 126
122 127 %endif
123 128 <%
124 129 collapse_all = len(diffset.files) > collapse_when_files_over
125 130 %>
126 131
127 132 %if c.diffmode == 'sideside':
128 133 <style>
129 134 .wrapper {
130 135 max-width: 1600px !important;
131 136 }
132 137 </style>
133 138 %endif
134 139
135 140 %if ruler_at_chars:
136 141 <style>
137 142 .diff table.cb .cb-content:after {
138 143 content: "";
139 144 border-left: 1px solid blue;
140 145 position: absolute;
141 146 top: 0;
142 147 height: 18px;
143 148 opacity: .2;
144 149 z-index: 10;
145 150 //## +5 to account for diff action (+/-)
146 151 left: ${ruler_at_chars + 5}ch;
147 152 </style>
148 153 %endif
149 154
150 155 <div class="diffset ${disable_new_comments and 'diffset-comments-disabled'}">
151 156 <div class="diffset-heading ${diffset.limited_diff and 'diffset-heading-warning' or ''}">
152 157 %if commit:
153 158 <div class="pull-right">
154 159 <a class="btn tooltip" title="${_('Browse Files at revision {}').format(commit.raw_id)}" href="${h.url('files_home',repo_name=diffset.repo_name, revision=commit.raw_id, f_path='')}">
155 160 ${_('Browse Files')}
156 161 </a>
157 162 </div>
158 163 %endif
159 164 <h2 class="clearinner">
160 165 %if commit:
161 166 <a class="tooltip revision" title="${h.tooltip(commit.message)}" href="${h.url('changeset_home',repo_name=c.repo_name,revision=commit.raw_id)}">${'r%s:%s' % (commit.revision,h.short_id(commit.raw_id))}</a> -
162 167 ${h.age_component(commit.date)} -
163 168 %endif
164 169 %if diffset.limited_diff:
165 170 ${_('The requested commit is too big and content was truncated.')}
166 171
167 172 ${ungettext('%(num)s file changed.', '%(num)s files changed.', diffset.changed_files) % {'num': diffset.changed_files}}
168 173 <a href="${link_for(fulldiff=1)}" onclick="return confirm('${_("Showing a big diff might take some time and resources, continue?")}')">${_('Show full diff')}</a>
169 174 %else:
170 175 ${ungettext('%(num)s file changed: %(linesadd)s inserted, ''%(linesdel)s deleted',
171 176 '%(num)s files changed: %(linesadd)s inserted, %(linesdel)s deleted', diffset.changed_files) % {'num': diffset.changed_files, 'linesadd': diffset.lines_added, 'linesdel': diffset.lines_deleted}}
172 177 %endif
173 178
174 179 <% at_ver = getattr(c, 'at_version_num', None) %>
175 180 % if at_ver:
176 181 <div class="pull-right">
177 182 ${_('Changes at version %d') % at_ver}
178 183 </div>
179 184 % endif
180 185
181 186 </h2>
182 187 </div>
183 188
184 189 %if not diffset.files:
185 190 <p class="empty_data">${_('No files')}</p>
186 191 %endif
187 192
188 193 <div class="filediffs">
189 194 %for i, filediff in enumerate(diffset.files):
190 195
191 196 <%
192 197 lines_changed = filediff['patch']['stats']['added'] + filediff['patch']['stats']['deleted']
193 198 over_lines_changed_limit = lines_changed > lines_changed_limit
194 199 %>
195 200 <input ${collapse_all and 'checked' or ''} class="filediff-collapse-state" id="filediff-collapse-${id(filediff)}" type="checkbox">
196 201 <div
197 202 class="filediff"
198 203 data-f-path="${filediff['patch']['filename']}"
199 204 id="a_${h.FID('', filediff['patch']['filename'])}">
200 205 <label for="filediff-collapse-${id(filediff)}" class="filediff-heading">
201 206 <div class="filediff-collapse-indicator"></div>
202 207 ${diff_ops(filediff)}
203 208 </label>
204 209 ${diff_menu(filediff, use_comments=use_comments)}
205 210 <table class="cb cb-diff-${c.diffmode} code-highlight ${over_lines_changed_limit and 'cb-collapsed' or ''}">
206 211 %if not filediff.hunks:
207 212 %for op_id, op_text in filediff['patch']['stats']['ops'].items():
208 213 <tr>
209 214 <td class="cb-text cb-${op_class(op_id)}" ${c.diffmode == 'unified' and 'colspan=4' or 'colspan=6'}>
210 215 %if op_id == DEL_FILENODE:
211 216 ${_('File was deleted')}
212 217 %elif op_id == BIN_FILENODE:
213 218 ${_('Binary file hidden')}
214 219 %else:
215 220 ${op_text}
216 221 %endif
217 222 </td>
218 223 </tr>
219 224 %endfor
220 225 %endif
221 226 %if filediff.patch['is_limited_diff']:
222 227 <tr class="cb-warning cb-collapser">
223 228 <td class="cb-text" ${c.diffmode == 'unified' and 'colspan=4' or 'colspan=6'}>
224 229 ${_('The requested commit is too big and content was truncated.')} <a href="${link_for(fulldiff=1)}" onclick="return confirm('${_("Showing a big diff might take some time and resources, continue?")}')">${_('Show full diff')}</a>
225 230 </td>
226 231 </tr>
227 232 %else:
228 233 %if over_lines_changed_limit:
229 234 <tr class="cb-warning cb-collapser">
230 235 <td class="cb-text" ${c.diffmode == 'unified' and 'colspan=4' or 'colspan=6'}>
231 236 ${_('This diff has been collapsed as it changes many lines, (%i lines changed)' % lines_changed)}
232 237 <a href="#" class="cb-expand"
233 238 onclick="$(this).closest('table').removeClass('cb-collapsed'); return false;">${_('Show them')}
234 239 </a>
235 240 <a href="#" class="cb-collapse"
236 241 onclick="$(this).closest('table').addClass('cb-collapsed'); return false;">${_('Hide them')}
237 242 </a>
238 243 </td>
239 244 </tr>
240 245 %endif
241 246 %endif
242 247
243 248 %for hunk in filediff.hunks:
244 249 <tr class="cb-hunk">
245 250 <td ${c.diffmode == 'unified' and 'colspan=3' or ''}>
246 251 ## TODO: dan: add ajax loading of more context here
247 252 ## <a href="#">
248 253 <i class="icon-more"></i>
249 254 ## </a>
250 255 </td>
251 256 <td ${c.diffmode == 'sideside' and 'colspan=5' or ''}>
252 257 @@
253 258 -${hunk.source_start},${hunk.source_length}
254 259 +${hunk.target_start},${hunk.target_length}
255 260 ${hunk.section_header}
256 261 </td>
257 262 </tr>
258 263 %if c.diffmode == 'unified':
259 264 ${render_hunk_lines_unified(hunk, use_comments=use_comments)}
260 265 %elif c.diffmode == 'sideside':
261 266 ${render_hunk_lines_sideside(hunk, use_comments=use_comments)}
262 267 %else:
263 268 <tr class="cb-line">
264 269 <td>unknown diff mode</td>
265 270 </tr>
266 271 %endif
267 272 %endfor
268 273
269 274 ## outdated comments that do not fit into currently displayed lines
270 275 % for lineno, comments in filediff.left_comments.items():
271 276
272 277 %if c.diffmode == 'unified':
273 278 <tr class="cb-line">
274 279 <td class="cb-data cb-context"></td>
275 280 <td class="cb-lineno cb-context"></td>
276 281 <td class="cb-lineno cb-context"></td>
277 282 <td class="cb-content cb-context">
278 283 ${inline_comments_container(comments)}
279 284 </td>
280 285 </tr>
281 286 %elif c.diffmode == 'sideside':
282 287 <tr class="cb-line">
283 288 <td class="cb-data cb-context"></td>
284 289 <td class="cb-lineno cb-context"></td>
285 290 <td class="cb-content cb-context"></td>
286 291
287 292 <td class="cb-data cb-context"></td>
288 293 <td class="cb-lineno cb-context"></td>
289 294 <td class="cb-content cb-context">
290 295 ${inline_comments_container(comments)}
291 296 </td>
292 297 </tr>
293 298 %endif
294 299
295 300 % endfor
296 301
297 302 </table>
298 303 </div>
299 304 %endfor
300 305
301 306 ## outdated comments that are made for a file that has been deleted
302 307 % for filename, comments_dict in (deleted_files_comments or {}).items():
303 308
304 309 <div class="filediffs filediff-outdated" style="display: none">
305 310 <input ${collapse_all and 'checked' or ''} class="filediff-collapse-state" id="filediff-collapse-${id(filename)}" type="checkbox">
306 311 <div class="filediff" data-f-path="${filename}" id="a_${h.FID('', filename)}">
307 312 <label for="filediff-collapse-${id(filename)}" class="filediff-heading">
308 313 <div class="filediff-collapse-indicator"></div>
309 314 <span class="pill">
310 315 ## file was deleted
311 316 <strong>${filename}</strong>
312 317 </span>
313 318 <span class="pill-group" style="float: left">
314 319 ## file op, doesn't need translation
315 320 <span class="pill" op="removed">removed in this version</span>
316 321 </span>
317 322 <a class="pill filediff-anchor" href="#a_${h.FID('', filename)}">ΒΆ</a>
318 323 <span class="pill-group" style="float: right">
319 324 <span class="pill" op="deleted">-${comments_dict['stats']}</span>
320 325 </span>
321 326 </label>
322 327
323 328 <table class="cb cb-diff-${c.diffmode} code-highlight ${over_lines_changed_limit and 'cb-collapsed' or ''}">
324 329 <tr>
325 330 % if c.diffmode == 'unified':
326 331 <td></td>
327 332 %endif
328 333
329 334 <td></td>
330 335 <td class="cb-text cb-${op_class(BIN_FILENODE)}" ${c.diffmode == 'unified' and 'colspan=4' or 'colspan=5'}>
331 336 ${_('File was deleted in this version, and outdated comments were made on it')}
332 337 </td>
333 338 </tr>
334 339 %if c.diffmode == 'unified':
335 340 <tr class="cb-line">
336 341 <td class="cb-data cb-context"></td>
337 342 <td class="cb-lineno cb-context"></td>
338 343 <td class="cb-lineno cb-context"></td>
339 344 <td class="cb-content cb-context">
340 345 ${inline_comments_container(comments_dict['comments'])}
341 346 </td>
342 347 </tr>
343 348 %elif c.diffmode == 'sideside':
344 349 <tr class="cb-line">
345 350 <td class="cb-data cb-context"></td>
346 351 <td class="cb-lineno cb-context"></td>
347 352 <td class="cb-content cb-context"></td>
348 353
349 354 <td class="cb-data cb-context"></td>
350 355 <td class="cb-lineno cb-context"></td>
351 356 <td class="cb-content cb-context">
352 357 ${inline_comments_container(comments_dict['comments'])}
353 358 </td>
354 359 </tr>
355 360 %endif
356 361 </table>
357 362 </div>
358 363 </div>
359 364 % endfor
360 365
361 366 </div>
362 367 </div>
363 368 </%def>
364 369
365 370 <%def name="diff_ops(filediff)">
366 371 <%
367 372 stats = filediff['patch']['stats']
368 373 from rhodecode.lib.diffs import NEW_FILENODE, DEL_FILENODE, \
369 374 MOD_FILENODE, RENAMED_FILENODE, CHMOD_FILENODE, BIN_FILENODE
370 375 %>
371 376 <span class="pill">
372 377 %if filediff.source_file_path and filediff.target_file_path:
373 %if filediff.source_file_path != filediff.target_file_path: # file was renamed
374 <strong>${filediff.target_file_path}</strong> β¬… <del>${filediff.source_file_path}</del>
378 %if filediff.source_file_path != filediff.target_file_path:
379 ## file was renamed
380 <strong>${filediff.target_file_path}</strong> β¬… <del>${filediff.source_file_path}</del>
375 381 %else:
376 382 ## file was modified
377 383 <strong>${filediff.source_file_path}</strong>
378 384 %endif
379 385 %else:
380 386 %if filediff.source_file_path:
381 387 ## file was deleted
382 388 <strong>${filediff.source_file_path}</strong>
383 389 %else:
384 390 ## file was added
385 391 <strong>${filediff.target_file_path}</strong>
386 392 %endif
387 393 %endif
388 394 </span>
389 395 <span class="pill-group" style="float: left">
390 396 %if filediff.patch['is_limited_diff']:
391 397 <span class="pill tooltip" op="limited" title="The stats for this diff are not complete">limited diff</span>
392 398 %endif
393 399 %if RENAMED_FILENODE in stats['ops']:
394 400 <span class="pill" op="renamed">renamed</span>
395 401 %endif
396 402
397 403 %if NEW_FILENODE in stats['ops']:
398 404 <span class="pill" op="created">created</span>
399 405 %if filediff['target_mode'].startswith('120'):
400 406 <span class="pill" op="symlink">symlink</span>
401 407 %else:
402 408 <span class="pill" op="mode">${nice_mode(filediff['target_mode'])}</span>
403 409 %endif
404 410 %endif
405 411
406 412 %if DEL_FILENODE in stats['ops']:
407 413 <span class="pill" op="removed">removed</span>
408 414 %endif
409 415
410 416 %if CHMOD_FILENODE in stats['ops']:
411 417 <span class="pill" op="mode">
412 418 ${nice_mode(filediff['source_mode'])} ➑ ${nice_mode(filediff['target_mode'])}
413 419 </span>
414 420 %endif
415 421 </span>
416 422
417 423 <a class="pill filediff-anchor" href="#a_${h.FID('', filediff.patch['filename'])}">ΒΆ</a>
418 424
419 425 <span class="pill-group" style="float: right">
420 426 %if BIN_FILENODE in stats['ops']:
421 427 <span class="pill" op="binary">binary</span>
422 428 %if MOD_FILENODE in stats['ops']:
423 429 <span class="pill" op="modified">modified</span>
424 430 %endif
425 431 %endif
426 432 %if stats['added']:
427 433 <span class="pill" op="added">+${stats['added']}</span>
428 434 %endif
429 435 %if stats['deleted']:
430 436 <span class="pill" op="deleted">-${stats['deleted']}</span>
431 437 %endif
432 438 </span>
433 439
434 440 </%def>
435 441
436 442 <%def name="nice_mode(filemode)">
437 443 ${filemode.startswith('100') and filemode[3:] or filemode}
438 444 </%def>
439 445
440 446 <%def name="diff_menu(filediff, use_comments=False)">
441 447 <div class="filediff-menu">
442 448 %if filediff.diffset.source_ref:
443 449 %if filediff.patch['operation'] in ['D', 'M']:
444 450 <a
445 451 class="tooltip"
446 452 href="${h.url('files_home',repo_name=filediff.diffset.repo_name,f_path=filediff.source_file_path,revision=filediff.diffset.source_ref)}"
447 453 title="${h.tooltip(_('Show file at commit: %(commit_id)s') % {'commit_id': filediff.diffset.source_ref[:12]})}"
448 454 >
449 455 ${_('Show file before')}
450 456 </a> |
451 457 %else:
452 458 <span
453 459 class="tooltip"
454 460 title="${h.tooltip(_('File no longer present at commit: %(commit_id)s') % {'commit_id': filediff.diffset.source_ref[:12]})}"
455 461 >
456 462 ${_('Show file before')}
457 463 </span> |
458 464 %endif
459 465 %if filediff.patch['operation'] in ['A', 'M']:
460 466 <a
461 467 class="tooltip"
462 468 href="${h.url('files_home',repo_name=filediff.diffset.source_repo_name,f_path=filediff.target_file_path,revision=filediff.diffset.target_ref)}"
463 469 title="${h.tooltip(_('Show file at commit: %(commit_id)s') % {'commit_id': filediff.diffset.target_ref[:12]})}"
464 470 >
465 471 ${_('Show file after')}
466 472 </a> |
467 473 %else:
468 474 <span
469 475 class="tooltip"
470 476 title="${h.tooltip(_('File no longer present at commit: %(commit_id)s') % {'commit_id': filediff.diffset.target_ref[:12]})}"
471 477 >
472 478 ${_('Show file after')}
473 479 </span> |
474 480 %endif
475 481 <a
476 482 class="tooltip"
477 483 title="${h.tooltip(_('Raw diff'))}"
478 484 href="${h.url('files_diff_home',repo_name=filediff.diffset.repo_name,f_path=filediff.target_file_path,diff2=filediff.diffset.target_ref,diff1=filediff.diffset.source_ref,diff='raw')}"
479 485 >
480 486 ${_('Raw diff')}
481 487 </a> |
482 488 <a
483 489 class="tooltip"
484 490 title="${h.tooltip(_('Download diff'))}"
485 491 href="${h.url('files_diff_home',repo_name=filediff.diffset.repo_name,f_path=filediff.target_file_path,diff2=filediff.diffset.target_ref,diff1=filediff.diffset.source_ref,diff='download')}"
486 492 >
487 493 ${_('Download diff')}
488 494 </a>
489 495 % if use_comments:
490 496 |
491 497 % endif
492 498
493 499 ## TODO: dan: refactor ignorews_url and context_url into the diff renderer same as diffmode=unified/sideside. Also use ajax to load more context (by clicking hunks)
494 500 %if hasattr(c, 'ignorews_url'):
495 501 ${c.ignorews_url(request.GET, h.FID('', filediff['patch']['filename']))}
496 502 %endif
497 503 %if hasattr(c, 'context_url'):
498 504 ${c.context_url(request.GET, h.FID('', filediff['patch']['filename']))}
499 505 %endif
500 506
501 507 %if use_comments:
502 508 <a href="#" onclick="return Rhodecode.comments.toggleComments(this);">
503 509 <span class="show-comment-button">${_('Show comments')}</span><span class="hide-comment-button">${_('Hide comments')}</span>
504 510 </a>
505 511 %endif
506 512 %endif
507 513 </div>
508 514 </%def>
509 515
510 516
511 517 <%namespace name="commentblock" file="/changeset/changeset_file_comment.mako"/>
512 518 <%def name="inline_comments_container(comments)">
513 519 <div class="inline-comments">
514 520 %for comment in comments:
515 521 ${commentblock.comment_block(comment, inline=True)}
516 522 %endfor
517 523
518 524 % if comments and comments[-1].outdated:
519 525 <span class="btn btn-secondary cb-comment-add-button comment-outdated}"
520 526 style="display: none;}">
521 527 ${_('Add another comment')}
522 528 </span>
523 529 % else:
524 530 <span onclick="return Rhodecode.comments.createComment(this)"
525 531 class="btn btn-secondary cb-comment-add-button">
526 532 ${_('Add another comment')}
527 533 </span>
528 534 % endif
529 535
530 536 </div>
531 537 </%def>
532 538
533 539
534 540 <%def name="render_hunk_lines_sideside(hunk, use_comments=False)">
535 541 %for i, line in enumerate(hunk.sideside):
536 542 <%
537 543 old_line_anchor, new_line_anchor = None, None
538 544 if line.original.lineno:
539 545 old_line_anchor = diff_line_anchor(hunk.filediff.source_file_path, line.original.lineno, 'o')
540 546 if line.modified.lineno:
541 547 new_line_anchor = diff_line_anchor(hunk.filediff.target_file_path, line.modified.lineno, 'n')
542 548 %>
543 549
544 550 <tr class="cb-line">
545 551 <td class="cb-data ${action_class(line.original.action)}"
546 552 data-line-number="${line.original.lineno}"
547 553 >
548 554 <div>
549 555 %if line.original.comments:
550 556 <i class="icon-comment" onclick="return Rhodecode.comments.toggleLineComments(this)"></i>
551 557 %endif
552 558 </div>
553 559 </td>
554 560 <td class="cb-lineno ${action_class(line.original.action)}"
555 561 data-line-number="${line.original.lineno}"
556 562 %if old_line_anchor:
557 563 id="${old_line_anchor}"
558 564 %endif
559 565 >
560 566 %if line.original.lineno:
561 567 <a name="${old_line_anchor}" href="#${old_line_anchor}">${line.original.lineno}</a>
562 568 %endif
563 569 </td>
564 570 <td class="cb-content ${action_class(line.original.action)}"
565 571 data-line-number="o${line.original.lineno}"
566 572 >
567 573 %if use_comments and line.original.lineno:
568 574 ${render_add_comment_button()}
569 575 %endif
570 576 <span class="cb-code">${line.original.action} ${line.original.content or '' | n}</span>
571 577 %if use_comments and line.original.lineno and line.original.comments:
572 578 ${inline_comments_container(line.original.comments)}
573 579 %endif
574 580 </td>
575 581 <td class="cb-data ${action_class(line.modified.action)}"
576 582 data-line-number="${line.modified.lineno}"
577 583 >
578 584 <div>
579 585 %if line.modified.comments:
580 586 <i class="icon-comment" onclick="return Rhodecode.comments.toggleLineComments(this)"></i>
581 587 %endif
582 588 </div>
583 589 </td>
584 590 <td class="cb-lineno ${action_class(line.modified.action)}"
585 591 data-line-number="${line.modified.lineno}"
586 592 %if new_line_anchor:
587 593 id="${new_line_anchor}"
588 594 %endif
589 595 >
590 596 %if line.modified.lineno:
591 597 <a name="${new_line_anchor}" href="#${new_line_anchor}">${line.modified.lineno}</a>
592 598 %endif
593 599 </td>
594 600 <td class="cb-content ${action_class(line.modified.action)}"
595 601 data-line-number="n${line.modified.lineno}"
596 602 >
597 603 %if use_comments and line.modified.lineno:
598 604 ${render_add_comment_button()}
599 605 %endif
600 606 <span class="cb-code">${line.modified.action} ${line.modified.content or '' | n}</span>
601 607 %if use_comments and line.modified.lineno and line.modified.comments:
602 608 ${inline_comments_container(line.modified.comments)}
603 609 %endif
604 610 </td>
605 611 </tr>
606 612 %endfor
607 613 </%def>
608 614
609 615
610 616 <%def name="render_hunk_lines_unified(hunk, use_comments=False)">
611 617 %for old_line_no, new_line_no, action, content, comments in hunk.unified:
612 618 <%
613 619 old_line_anchor, new_line_anchor = None, None
614 620 if old_line_no:
615 621 old_line_anchor = diff_line_anchor(hunk.filediff.source_file_path, old_line_no, 'o')
616 622 if new_line_no:
617 623 new_line_anchor = diff_line_anchor(hunk.filediff.target_file_path, new_line_no, 'n')
618 624 %>
619 625 <tr class="cb-line">
620 626 <td class="cb-data ${action_class(action)}">
621 627 <div>
622 628 %if comments:
623 629 <i class="icon-comment" onclick="return Rhodecode.comments.toggleLineComments(this)"></i>
624 630 %endif
625 631 </div>
626 632 </td>
627 633 <td class="cb-lineno ${action_class(action)}"
628 634 data-line-number="${old_line_no}"
629 635 %if old_line_anchor:
630 636 id="${old_line_anchor}"
631 637 %endif
632 638 >
633 639 %if old_line_anchor:
634 640 <a name="${old_line_anchor}" href="#${old_line_anchor}">${old_line_no}</a>
635 641 %endif
636 642 </td>
637 643 <td class="cb-lineno ${action_class(action)}"
638 644 data-line-number="${new_line_no}"
639 645 %if new_line_anchor:
640 646 id="${new_line_anchor}"
641 647 %endif
642 648 >
643 649 %if new_line_anchor:
644 650 <a name="${new_line_anchor}" href="#${new_line_anchor}">${new_line_no}</a>
645 651 %endif
646 652 </td>
647 653 <td class="cb-content ${action_class(action)}"
648 654 data-line-number="${new_line_no and 'n' or 'o'}${new_line_no or old_line_no}"
649 655 >
650 656 %if use_comments:
651 657 ${render_add_comment_button()}
652 658 %endif
653 659 <span class="cb-code">${action} ${content or '' | n}</span>
654 660 %if use_comments and comments:
655 661 ${inline_comments_container(comments)}
656 662 %endif
657 663 </td>
658 664 </tr>
659 665 %endfor
660 666 </%def>
661 667
662 668 <%def name="render_add_comment_button()">
663 669 <button class="btn btn-small btn-primary cb-comment-box-opener" onclick="return Rhodecode.comments.createComment(this)">
664 670 <span><i class="icon-comment"></i></span>
665 671 </button>
666 672 </%def>
667 673
668 674 <%def name="render_diffset_menu()">
669 675
670 676 <div class="diffset-menu clearinner">
671 677 <div class="pull-right">
672 678 <div class="btn-group">
673 679
674 680 <a
675 681 class="btn ${c.diffmode == 'sideside' and 'btn-primary'} tooltip"
676 682 title="${_('View side by side')}"
677 683 href="${h.url_replace(diffmode='sideside')}">
678 684 <span>${_('Side by Side')}</span>
679 685 </a>
680 686 <a
681 687 class="btn ${c.diffmode == 'unified' and 'btn-primary'} tooltip"
682 688 title="${_('View unified')}" href="${h.url_replace(diffmode='unified')}">
683 689 <span>${_('Unified')}</span>
684 690 </a>
685 691 </div>
686 692 </div>
687 693
688 694 <div class="pull-left">
689 695 <div class="btn-group">
690 696 <a
691 697 class="btn"
692 698 href="#"
693 699 onclick="$('input[class=filediff-collapse-state]').prop('checked', false); return false">${_('Expand All Files')}</a>
694 700 <a
695 701 class="btn"
696 702 href="#"
697 703 onclick="$('input[class=filediff-collapse-state]').prop('checked', true); return false">${_('Collapse All Files')}</a>
698 704 <a
699 705 class="btn"
700 706 href="#"
701 707 onclick="return Rhodecode.comments.toggleWideMode(this)">${_('Wide Mode Diff')}</a>
702 708 </div>
703 709 </div>
704 710 </div>
705 711 </%def>
@@ -1,68 +1,66 b''
1 1 <%def name="render_line(line_num, tokens,
2 2 annotation=None,
3 3 bgcolor=None)">
4 4 <%
5 5 from rhodecode.lib.codeblocks import render_tokenstream
6 6 # avoid module lookup for performance
7 7 html_escape = h.html_escape
8 8 %>
9 9 <tr class="cb-line cb-line-fresh"
10 10 %if annotation:
11 11 data-revision="${annotation.revision}"
12 12 %endif
13 13 >
14 14 <td class="cb-lineno" id="L${line_num}">
15 15 <a data-line-no="${line_num}" href="#L${line_num}"></a>
16 16 </td>
17 17 <td class="cb-content cb-content-fresh"
18 18 %if bgcolor:
19 19 style="background: ${bgcolor}"
20 20 %endif
21 21 >
22 22 ## newline at end is necessary for highlight to work when line is empty
23 23 ## and for copy pasting code to work as expected
24 24 <span class="cb-code">${render_tokenstream(tokens)|n}${'\n'}</span>
25 25 </td>
26 26 </tr>
27 27 </%def>
28 28
29 29 <%def name="render_annotation_lines(annotation, lines, color_hasher)">
30 30 <%
31 31 rowspan = len(lines) + 1 # span the line's <tr> and annotation <tr>
32 32 %>
33 33 %if not annotation:
34 34 <tr class="cb-annotate">
35 35 <td class="cb-annotate-message" rowspan="${rowspan}"></td>
36 36 <td class="cb-annotate-revision" rowspan="${rowspan}"></td>
37 37 </tr>
38 38 %else:
39 39 <tr class="cb-annotate">
40 40 <td class="cb-annotate-info tooltip"
41 41 rowspan="${rowspan}"
42 42 title="Author: ${annotation.author | entity}<br>Date: ${annotation.date}<br>Message: ${annotation.message | entity}"
43 43 >
44 44 ${h.gravatar_with_user(annotation.author, 16) | n}
45 <strong class="cb-annotate-message">${
46 h.truncate(annotation.message, len(lines) * 30)
47 }</strong>
45 <strong class="cb-annotate-message">${h.truncate(annotation.message, len(lines) * 30)}</strong>
48 46 </td>
49 47 <td
50 48 class="cb-annotate-revision"
51 49 rowspan="${rowspan}"
52 50 data-revision="${annotation.revision}"
53 51 onclick="$('[data-revision=${annotation.revision}]').toggleClass('cb-line-fresh')"
54 52 style="background: ${color_hasher(annotation.raw_id)}">
55 53 <a href="${h.url('changeset_home',repo_name=c.repo_name,revision=annotation.raw_id)}">
56 54 r${annotation.revision}
57 55 </a>
58 56 </td>
59 57 </tr>
60 58 %endif
61 59
62 60 %for line_num, tokens in lines:
63 61 ${render_line(line_num, tokens,
64 62 bgcolor=color_hasher(annotation and annotation.raw_id or ''),
65 63 annotation=annotation,
66 64 )}
67 65 %endfor
68 66 </%def>
@@ -1,1160 +1,1160 b''
1 1 ## -*- coding: utf-8 -*-
2 2 <%namespace name="base" file="/base/base.mako"/>
3 3 <%inherit file="/debug_style/index.html"/>
4 4
5 5 <%def name="breadcrumbs_links()">
6 6 ${h.link_to(_('Style'), h.url('debug_style_home'))}
7 7 &raquo;
8 8 ${c.active}
9 9 </%def>
10 10
11 11 <%def name="js_extra()">
12 12 </%def>
13 13
14 14 <%def name="css_extra()">
15 15 </%def>
16 16
17 17
18 18 <%def name="real_main()">
19 19 <div class="box">
20 20 <div class="title">
21 21 ${self.breadcrumbs()}
22 22 </div>
23 23
24 24 ##main
25 25 <div class='sidebar-col-wrapper'>
26 26 ${self.sidebar()}
27 27
28 28 <div class="main-content">
29 29
30 30
31 31
32 32 <h2>Code Blocks</h2>
33 33
34 34 <dl class="dl-horizontal">
35 35 <dt><code>.codeblock</code></dt>
36 36 <dd>Used as a wrapping element around <code>.code-header</code> and
37 37 <code>.code-body</code>. Used to show the content of a file or a
38 38 Gist.</dd>
39 39
40 40 <dt><code>.diffblock</code></dt>
41 41 <dd>Used as a wrapping element to show a diff in a Commit or Pull
42 42 Request page. Contains usually <code>.code-header</code>,
43 43 <code>.code-body</code> and in the edit case a <code>.message</code>.
44 44 </dd>
45 45 </dl>
46 46
47 47
48 48 <p>Code Blocks are used in the following areas:</p>
49 49
50 50 <ul>
51 51 <li>Commit: Showing the Diff (still called Changeset in a few
52 52 places).</li>
53 53 <li>File: Display a file, annotations, and edit a file.</li>
54 54 <li>Gist: Show the Gist and edit it.</li>
55 55 <li>Pull Request: Display the Diff of a Pull Request.</li>
56 56 </ul>
57 57
58 58
59 59
60 60 <!--
61 61 Compare Commits
62 62 -->
63 63 <h2>Compare Commits</h2>
64 64
65 65 <div id="c-e589e34d6be8-5ab783e6d81b" class="diffblock margined comm">
66 66 <div class="code-header">
67 67 <div title="Go back to changed files overview">
68 68 <a href="#changes_box">
69 69 <i class="icon-circle-arrow-up"></i>
70 70 </a>
71 71 </div>
72 72 <div class="changeset_header">
73 73 <div class="changeset_file">
74 74 <i class="icon-file"></i>
75 75 <a href="/example/files/e589e34d6be8ec2b44017f6c2e0bbe782f1aba6d/rhodecode/public/css/code-block.less">rhodecode/public/css/code-block.less</a>
76 76 </div>
77 77 <div class="diff-actions">
78 78 <a href="/example/diff/rhodecode/public/css/code-block.less?fulldiff=1&amp;diff1=d12301bafcc0aea15c9283d3af018daee2b04cd9&amp;diff=diff&amp;diff2=e589e34d6be8ec2b44017f6c2e0bbe782f1aba6d" class="tooltip" title="Show full diff for this file">
79 79 <img class="icon" src="/images/icons/page_white_go.png">
80 80 </a>
81 81 <a href="/example/diff-2way/rhodecode/public/css/code-block.less?fulldiff=1&amp;diff1=d12301bafcc0aea15c9283d3af018daee2b04cd9&amp;diff=diff&amp;diff2=e589e34d6be8ec2b44017f6c2e0bbe782f1aba6d" class="tooltip" title="Show full side-by-side diff for this file">
82 82 <img class="icon" src="/images/icons/application_double.png">
83 83 </a>
84 84 <a href="/example/diff/rhodecode/public/css/code-block.less?diff1=d12301bafcc0aea15c9283d3af018daee2b04cd9&amp;diff=raw&amp;diff2=e589e34d6be8ec2b44017f6c2e0bbe782f1aba6d" class="tooltip" title="Raw diff" tt_title="Raw diff">
85 85 <img class="icon" src="/images/icons/page_white.png">
86 86 </a>
87 87 <a href="/example/diff/rhodecode/public/css/code-block.less?diff1=d12301bafcc0aea15c9283d3af018daee2b04cd9&amp;diff=download&amp;diff2=e589e34d6be8ec2b44017f6c2e0bbe782f1aba6d" class="tooltip" title="Download diff">
88 88 <img class="icon" src="/images/icons/page_save.png">
89 89 </a>
90 90 <a class="tooltip" href="/example/changeset/d12301bafcc0aea15c9283d3af018daee2b04cd9...80ead1899f50a894889e19ffeb49c9cebf5bf045?c-e589e34d6be8-5ab783e6d81b=WS%3A1&amp;c-e589e34d6be8-5ab783e6d81b=C%3A3#c-e589e34d6be8-5ab783e6d81b" title="Ignore white space"><img alt="Ignore white space" class="icon" src="/images/icons/text_strikethrough.png"></a>
91 91 <a class="tooltip" href="/example/changeset/d12301bafcc0aea15c9283d3af018daee2b04cd9...80ead1899f50a894889e19ffeb49c9cebf5bf045?c-e589e34d6be8-5ab783e6d81b=C%3A6#c-e589e34d6be8-5ab783e6d81b" title="increase diff context to 6 lines"><img alt="increase diff context to 6 lines" class="icon" src="/images/icons/table_add.png"></a>
92 92 </div>
93 93 <span>
94 94 <label>
95 95 Show inline comments
96 96 <input checked="checked" class="show-inline-comments" id="" id_for="c-e589e34d6be8-5ab783e6d81b" name="" type="checkbox" value="1">
97 97 </label>
98 98 </span>
99 99 </div>
100 100 </div>
101 101 <div class="code-body">
102 102 <div class="full_f_path" path="rhodecode/public/css/code-block.less"></div>
103 103 <table class="code-difftable">
104 104 <tbody><tr class="line context">
105 105 <td class="lineno old"><a href="#rhodecodepubliccsscode-blockless_o...">...</a></td>
106 106 <td class="lineno new"><a href="#rhodecodepubliccsscode-blockless_n...">...</a></td>
107 107 <td class="code no-comment">
108 108 <pre>@@ -391,7 +391,7 @@
109 109 </pre>
110 110 </td>
111 111 </tr>
112 112 <tr class="line unmod">
113 113 <td id="rhodecodepubliccsscode-blockless_o391" class="lineno old"><a href="#rhodecodepubliccsscode-blockless_o391">391</a></td>
114 114 <td id="rhodecodepubliccsscode-blockless_n391" class="lineno new"><a href="#rhodecodepubliccsscode-blockless_n391">391</a></td>
115 115 <td class="code no-comment">
116 116 <pre>} /* Existing line, it might have a quite long content actually and in this case we might need some horizontal scrolling. The remaining text here is just used to make this line very long.
117 117 </pre>
118 118 </td>
119 119 </tr>
120 120 <tr class="line unmod">
121 121 <td id="rhodecodepubliccsscode-blockless_o392" class="lineno old"><a href="#rhodecodepubliccsscode-blockless_o392">392</a></td>
122 122 <td id="rhodecodepubliccsscode-blockless_n392" class="lineno new"><a href="#rhodecodepubliccsscode-blockless_n392">392</a></td>
123 123 <td class="code no-comment">
124 124 <pre></pre>
125 125 </td>
126 126 </tr>
127 127 <tr class="line unmod">
128 128 <td id="rhodecodepubliccsscode-blockless_o393" class="lineno old"><a href="#rhodecodepubliccsscode-blockless_o393">393</a></td>
129 129 <td id="rhodecodepubliccsscode-blockless_n393" class="lineno new"><a href="#rhodecodepubliccsscode-blockless_n393">393</a></td>
130 130 <td class="code no-comment">
131 131 <pre>.code-body.textarea.editor,
132 132 </pre>
133 133 </td>
134 134 </tr>
135 135 <tr class="line del">
136 136 <td id="rhodecodepubliccsscode-blockless_o394" class="lineno old"><a href="#rhodecodepubliccsscode-blockless_o394">394</a></td>
137 137 <td class="lineno new"><a href="#rhodecodepubliccsscode-blockless_n"></a></td>
138 138 <td class="code no-comment">
139 139 <pre>div.code-body{
140 140 </pre>
141 141 </td>
142 142 </tr>
143 143 <tr class="line add">
144 144 <td class="lineno old"><a href="#rhodecodepubliccsscode-blockless_o"></a></td>
145 145 <td id="rhodecodepubliccsscode-blockless_n394" class="lineno new"><a href="#rhodecodepubliccsscode-blockless_n394">394</a></td>
146 146 <td class="code no-comment">
147 147 <pre>div.code-body<ins> </ins>{
148 148 </pre>
149 149 </td>
150 150 </tr>
151 151 <tr class="line unmod">
152 152 <td id="rhodecodepubliccsscode-blockless_o395" class="lineno old"><a href="#rhodecodepubliccsscode-blockless_o395">395</a></td>
153 153 <td id="rhodecodepubliccsscode-blockless_n395" class="lineno new"><a href="#rhodecodepubliccsscode-blockless_n395">395</a></td>
154 154 <td class="code no-comment">
155 155 <pre> float: left;
156 156 </pre>
157 157 </td>
158 158 </tr>
159 159 <tr class="line unmod">
160 160 <td id="rhodecodepubliccsscode-blockless_o396" class="lineno old"><a href="#rhodecodepubliccsscode-blockless_o396">396</a></td>
161 161 <td id="rhodecodepubliccsscode-blockless_n396" class="lineno new"><a href="#rhodecodepubliccsscode-blockless_n396">396</a></td>
162 162 <td class="code no-comment">
163 163 <pre> position: relative;
164 164 </pre>
165 165 </td>
166 166 </tr>
167 167 <tr class="line unmod">
168 168 <td id="rhodecodepubliccsscode-blockless_o397" class="lineno old"><a href="#rhodecodepubliccsscode-blockless_o397">397</a></td>
169 169 <td id="rhodecodepubliccsscode-blockless_n397" class="lineno new"><a href="#rhodecodepubliccsscode-blockless_n397">397</a></td>
170 170 <td class="code no-comment">
171 171 <pre> max-width: none;
172 172 </pre>
173 173 </td>
174 174 </tr>
175 175 <tr class="line context">
176 176 <td class="lineno old"><a href="#rhodecodepubliccsscode-blockless_o...">...</a></td>
177 177 <td class="lineno new"><a href="#rhodecodepubliccsscode-blockless_n...">...</a></td>
178 178 <td class="code no-comment">
179 179 <pre>@@ -399,3 +399,6 @@
180 180 </pre>
181 181 </td>
182 182 </tr>
183 183 <tr class="line unmod">
184 184 <td id="rhodecodepubliccsscode-blockless_o399" class="lineno old"><a href="#rhodecodepubliccsscode-blockless_o399">399</a></td>
185 185 <td id="rhodecodepubliccsscode-blockless_n399" class="lineno new"><a href="#rhodecodepubliccsscode-blockless_n399">399</a></td>
186 186 <td class="code no-comment">
187 187 <pre> box-sizing: border-box;
188 188 </pre>
189 189 </td>
190 190 </tr>
191 191 <tr class="line unmod">
192 192 <td id="rhodecodepubliccsscode-blockless_o400" class="lineno old"><a href="#rhodecodepubliccsscode-blockless_o400">400</a></td>
193 193 <td id="rhodecodepubliccsscode-blockless_n400" class="lineno new"><a href="#rhodecodepubliccsscode-blockless_n400">400</a></td>
194 194 <td class="code no-comment">
195 195 <pre>}
196 196 </pre>
197 197 </td>
198 198 </tr>
199 199 <tr class="line unmod">
200 200 <td id="rhodecodepubliccsscode-blockless_o401" class="lineno old"><a href="#rhodecodepubliccsscode-blockless_o401">401</a></td>
201 201 <td id="rhodecodepubliccsscode-blockless_n401" class="lineno new"><a href="#rhodecodepubliccsscode-blockless_n401">401</a></td>
202 202 <td class="code no-comment">
203 203 <pre></pre>
204 204 </td>
205 205 </tr>
206 206 <tr class="line add">
207 207 <td class="lineno old"><a href="#rhodecodepubliccsscode-blockless_o"></a></td>
208 208 <td id="rhodecodepubliccsscode-blockless_n402" class="lineno new"><a href="#rhodecodepubliccsscode-blockless_n402">402</a></td>
209 209 <td class="code no-comment">
210 210 <pre>.code-body td{
211 211 </pre>
212 212 </td>
213 213 </tr>
214 214 <tr class="line add">
215 215 <td class="lineno old"><a href="#rhodecodepubliccsscode-blockless_o"></a></td>
216 216 <td id="rhodecodepubliccsscode-blockless_n403" class="lineno new"><a href="#rhodecodepubliccsscode-blockless_n403">403</a></td>
217 217 <td class="code no-comment">
218 218 <pre> line-height: 1.2em;
219 219 </pre>
220 220 </td>
221 221 </tr>
222 222 <tr class="line add">
223 223 <td class="lineno old"><a href="#rhodecodepubliccsscode-blockless_o"></a></td>
224 224 <td id="rhodecodepubliccsscode-blockless_n404" class="lineno new"><a href="#rhodecodepubliccsscode-blockless_n404">404</a></td>
225 225 <td class="code no-comment">
226 226 <pre>}
227 227 </pre>
228 228 </td>
229 229 </tr>
230 230 <tr class="line context">
231 231 <td class="lineno old"><a href="#rhodecodepubliccsscode-blockless_o...">...</a></td>
232 232 <td class="lineno new"><a href="#rhodecodepubliccsscode-blockless_n...">...</a></td>
233 233 <td class="code no-comment">
234 234 <pre> No newline at end of file
235 235 </pre>
236 236 </td>
237 237 </tr>
238 238 </tbody></table>
239 239 </div>
240 240 </div>
241 241
242 242
243 243
244 244
245 245
246 246
247 247 <!--
248 248 Pull Request
249 249 -->
250 250
251 251 <h2>Pull Request</h2>
252 252
253 253 <div class="cs_files">
254 254 <table class="compare_view_files">
255 255
256 256 <tbody><tr class="cs_M collapse_file" fid="c--5f1d017cf13b">
257 257 <td class="cs_icon_td">
258 258 <span class="collapse_file_icon" fid="c--5f1d017cf13b"></span>
259 259 </td>
260 260 <td class="cs_icon_td">
261 261 <div class="flag_status not_reviewed hidden"></div>
262 262 </td>
263 263 <td id="a_c--5f1d017cf13b">
264 264 <a class="compare_view_filepath" href="#a_c--5f1d017cf13b">
265 265 rhodecode/public/css/main.less
266 266 </a>
267 267 <span id="diff_c--5f1d017cf13b" class="diff_links" style="">
268 268 <a href="/example/diff/rhodecode/public/css/main.less?fulldiff=1&amp;diff1=f73e9946825c8a7ef2c1178cd1e67986d5831f8f&amp;diff=diff&amp;diff2=27eb56cf467ca849112536d62decb2ed020b3ebc">
269 269 Unified Diff
270 270 </a>
271 271 |
272 272 <a href="/example/diff-2way/rhodecode/public/css/main.less?fulldiff=1&amp;diff1=f73e9946825c8a7ef2c1178cd1e67986d5831f8f&amp;diff=diff&amp;diff2=27eb56cf467ca849112536d62decb2ed020b3ebc">
273 273 Side-by-side Diff
274 274 </a>
275 275 </span>
276 276 </td>
277 277 <td>
278 278 <div class="changes pull-right"><div style="width:100px"><div class="added top-left-rounded-corner-mid bottom-left-rounded-corner-mid" style="width:33.3333333333%">1</div><div class="deleted top-right-rounded-corner-mid bottom-right-rounded-corner-mid" style="width:66.6666666667%">2</div></div></div>
279 279 <div class="comment-bubble pull-right" data-path="rhodecode/public/css/main.less">
280 280 <i class="icon-comment"></i>
281 281 </div>
282 282 </td>
283 283 </tr>
284 284 <tr id="tr_c--5f1d017cf13b">
285 285 <td></td>
286 286 <td></td>
287 287 <td class="injected_diff" colspan="2">
288 288
289 289 <div class="diff-container" id="diff-container-140360026534904">
290 290 <div id="c--5f1d017cf13b_target"></div>
291 291 <div id="c--5f1d017cf13b" class="diffblock margined comm">
292 292 <div class="code-body">
293 293 <div class="full_f_path" path="rhodecode/public/css/main.less" style="display: none;"></div>
294 294 <table class="code-difftable">
295 295 <tbody><tr class="line context">
296 296 <td class="lineno old"><a href="#rhodecodepubliccssmainless_o...">...</a></td>
297 297 <td class="lineno new"><a href="#rhodecodepubliccssmainless_n...">...</a></td>
298 298 <td class="code ">
299 299 <pre>@@ -2110,7 +2110,6 @@
300 300 </pre>
301 301 </td>
302 302 </tr>
303 303 <tr class="line unmod">
304 304 <td id="rhodecodepubliccssmainless_o2110" class="lineno old"><a href="#rhodecodepubliccssmainless_o2110">2110</a></td>
305 305 <td id="rhodecodepubliccssmainless_n2110" class="lineno new"><a href="#rhodecodepubliccssmainless_n2110">2110</a></td>
306 306 <td class="code ">
307 307 <pre><span class="tab-escape"> </span>width: auto !important;
308 308 </pre>
309 309 </td>
310 310 </tr>
311 311 <tr class="line unmod">
312 312 <td id="rhodecodepubliccssmainless_o2111" class="lineno old"><a href="#rhodecodepubliccssmainless_o2111">2111</a></td>
313 313 <td id="rhodecodepubliccssmainless_n2111" class="lineno new"><a href="#rhodecodepubliccssmainless_n2111">2111</a></td>
314 314 <td class="code ">
315 315 <pre><span class="tab-escape"> </span>min-width: 160px;
316 316 </pre>
317 317 </td>
318 318 </tr>
319 319 <tr class="line unmod">
320 320 <td id="rhodecodepubliccssmainless_o2112" class="lineno old"><a href="#rhodecodepubliccssmainless_o2112">2112</a></td>
321 321 <td id="rhodecodepubliccssmainless_n2112" class="lineno new"><a href="#rhodecodepubliccssmainless_n2112">2112</a></td>
322 322 <td class="code ">
323 323 <pre><span class="tab-escape"> </span>margin: @padding @padding @padding 0;
324 324 </pre>
325 325 </td>
326 326 </tr>
327 327 <tr class="line del">
328 328 <td id="rhodecodepubliccssmainless_o2113" class="lineno old"><a href="#rhodecodepubliccssmainless_o2113">2113</a></td>
329 329 <td class="lineno new"><a href="#rhodecodepubliccssmainless_n"></a></td>
330 330 <td class="code ">
331 331 <pre><span class="tab-escape"> </span>padding: .9em; /* Old comment which was making this line a very long line so that we might have to deal with it by either adding horizontal scrolling or some smart way of breaking this line. */
332 332 </pre>
333 333 </td>
334 334 </tr>
335 335 <tr class="line unmod">
336 336 <td id="rhodecodepubliccssmainless_o2114" class="lineno old"><a href="#rhodecodepubliccssmainless_o2114">2114</a></td>
337 337 <td id="rhodecodepubliccssmainless_n2113" class="lineno new"><a href="#rhodecodepubliccssmainless_n2113">2113</a></td>
338 338 <td class="code ">
339 339 <pre> line-height: 1em;
340 340 </pre>
341 341 </td>
342 342 </tr>
343 343 <tr class="line unmod">
344 344 <td id="rhodecodepubliccssmainless_o2115" class="lineno old"><a href="#rhodecodepubliccssmainless_o2115">2115</a></td>
345 345 <td id="rhodecodepubliccssmainless_n2114" class="lineno new"><a href="#rhodecodepubliccssmainless_n2114">2114</a></td>
346 346 <td class="code ">
347 347 <pre><span class="tab-escape"> </span>z-index: 100;//js sets the menu below it to 9999
348 348 </pre>
349 349 </td>
350 350 </tr>
351 351 <tr class="line unmod">
352 352 <td id="rhodecodepubliccssmainless_o2116" class="lineno old"><a href="#rhodecodepubliccssmainless_o2116">2116</a></td>
353 353 <td id="rhodecodepubliccssmainless_n2115" class="lineno new"><a href="#rhodecodepubliccssmainless_n2115">2115</a></td>
354 354 <td class="code ">
355 355 <pre><span class="tab-escape"> </span>background-color: white;
356 356 </pre>
357 357 </td>
358 358 </tr>
359 359 <tr class="line context">
360 360 <td class="lineno old"><a href="#rhodecodepubliccssmainless_o...">...</a></td>
361 361 <td class="lineno new"><a href="#rhodecodepubliccssmainless_n...">...</a></td>
362 362 <td class="code ">
363 363 <pre>@@ -2118,7 +2117,7 @@
364 364 </pre>
365 365 </td>
366 366 </tr>
367 367 <tr class="line unmod">
368 368 <td id="rhodecodepubliccssmainless_o2118" class="lineno old"><a href="#rhodecodepubliccssmainless_o2118">2118</a></td>
369 369 <td id="rhodecodepubliccssmainless_n2117" class="lineno new"><a href="#rhodecodepubliccssmainless_n2117">2117</a></td>
370 370 <td class="code ">
371 371 <pre></pre>
372 372 </td>
373 373 </tr>
374 374 <tr class="line unmod">
375 375 <td id="rhodecodepubliccssmainless_o2119" class="lineno old"><a href="#rhodecodepubliccssmainless_o2119">2119</a></td>
376 376 <td id="rhodecodepubliccssmainless_n2118" class="lineno new"><a href="#rhodecodepubliccssmainless_n2118">2118</a></td>
377 377 <td class="code ">
378 378 <pre><span class="tab-escape"> </span>a {
379 379 </pre>
380 380 </td>
381 381 </tr>
382 382 <tr class="line unmod">
383 383 <td id="rhodecodepubliccssmainless_o2120" class="lineno old"><a href="#rhodecodepubliccssmainless_o2120">2120</a></td>
384 384 <td id="rhodecodepubliccssmainless_n2119" class="lineno new"><a href="#rhodecodepubliccssmainless_n2119">2119</a></td>
385 385 <td class="code ">
386 386 <pre><span class="tab-escape"> </span><span class="tab-escape"> </span>display:block;
387 387 </pre>
388 388 </td>
389 389 </tr>
390 390 <tr class="line del">
391 391 <td id="rhodecodepubliccssmainless_o2121" class="lineno old"><a href="#rhodecodepubliccssmainless_o2121">2121</a></td>
392 392 <td class="lineno new"><a href="#rhodecodepubliccssmainless_n"></a></td>
393 393 <td class="code ">
394 394 <pre><span class="tab-escape"> </span><del><span< del=""> <del>class=</del><del>"tab-escape"</del><del>&gt; </del>padding: <del>0</del>;
395 395 </span<></del></pre>
396 396 </td>
397 397 </tr>
398 398 <tr class="line add">
399 399 <td class="lineno old"><a href="#rhodecodepubliccssmainless_o"></a></td>
400 400 <td id="rhodecodepubliccssmainless_n2120" class="lineno new"><a href="#rhodecodepubliccssmainless_n2120">2120</a></td>
401 401 <td class="code ">
402 402 <pre><span class="tab-escape"> </span><ins> </ins> <ins> </ins><ins> </ins>padding: <ins>.9em</ins>;
403 403 </pre>
404 404 </td>
405 405 </tr>
406 406 <tr class="line unmod">
407 407 <td id="rhodecodepubliccssmainless_o2122" class="lineno old"><a href="#rhodecodepubliccssmainless_o2122">2122</a></td>
408 408 <td id="rhodecodepubliccssmainless_n2121" class="lineno new"><a href="#rhodecodepubliccssmainless_n2121">2121</a></td>
409 409 <td class="code ">
410 410 <pre></pre>
411 411 </td>
412 412 </tr>
413 413 <tr class="line unmod">
414 414 <td id="rhodecodepubliccssmainless_o2123" class="lineno old"><a href="#rhodecodepubliccssmainless_o2123">2123</a></td>
415 415 <td id="rhodecodepubliccssmainless_n2122" class="lineno new"><a href="#rhodecodepubliccssmainless_n2122">2122</a></td>
416 416 <td class="code ">
417 417 <pre><span class="tab-escape"> </span><span class="tab-escape"> </span>&amp;:after {
418 418 </pre>
419 419 </td>
420 420 </tr>
421 421 <tr class="line unmod">
422 422 <td id="rhodecodepubliccssmainless_o2124" class="lineno old"><a href="#rhodecodepubliccssmainless_o2124">2124</a></td>
423 423 <td id="rhodecodepubliccssmainless_n2123" class="lineno new"><a href="#rhodecodepubliccssmainless_n2123">2123</a></td>
424 424 <td class="code ">
425 425 <pre><span class="tab-escape"> </span><span class="tab-escape"> </span><span class="tab-escape"> </span>content: "\00A0\25BE";
426 426 </pre>
427 427 </td>
428 428 </tr>
429 429 </tbody></table>
430 430 </div>
431 431 </div>
432 432 </div>
433 433
434 434 </td>
435 435 </tr>
436 436 </tbody></table>
437 437 </div>
438 438
439 439
440 440
441 441
442 442
443 443
444 444
445 445
446 446
447 447 <!--
448 448 File View
449 449 -->
450 450
451 451 ##TODO: lisa: I believe this needs to be updated as the layout has changed.
452 452 <h2>File View</h2>
453 453
454 454 <div class="codeblock">
455 455 <div class="code-header">
456 456 <div class="stats">
457 457 <div class="img">
458 458 <i class="icon-file"></i>
459 459 <span class="revision_id item"><a href="/example/changeset/fc252256eb0fcb4f2613e66f0126ea27967ae28c">r5487:fc252256eb0f</a></span>
460 460 <span>1.2 KiB</span>
461 461 <span class="item last">text/x-python</span>
462 462 <div class="buttons">
463 463
464 464 <a id="file_history_overview" class="btn btn-mini" href="#">
465 465 <i class="icon-time"></i> history
466 466 </a>
467 467 <a id="file_history_overview_full" class="btn btn-mini" style="display: none" href="/example/changelog/fc252256eb0fcb4f2613e66f0126ea27967ae28c/rhodecode/websetup.py">
468 468 <i class="icon-time"></i> show full history
469 469 </a>
470 470 <a class="btn btn-mini" href="/example/annotate/fc252256eb0fcb4f2613e66f0126ea27967ae28c/rhodecode/websetup.py">annotation</a>
471 471 <a class="btn btn-mini" href="/example/raw/fc252256eb0fcb4f2613e66f0126ea27967ae28c/rhodecode/websetup.py">raw</a>
472 472 <a class="btn btn-mini" href="/example/rawfile/fc252256eb0fcb4f2613e66f0126ea27967ae28c/rhodecode/websetup.py">
473 473 <i class="icon-archive"></i> download
474 474 </a>
475 475
476 476 <a class="btn btn-mini disabled tooltip" href="#" title="Editing files allowed only when on branch head commit">edit</a>
477 477 <a class="btn btn-mini btn-danger disabled tooltip" href="#" title="Deleting files allowed only when on branch head commit">delete</a>
478 478 </div>
479 479 </div>
480 480 </div>
481 481 <div id="file_history_container"></div>
482 482 <div class="author">
483 483 <div class="gravatar">
484 484 <img alt="gravatar" src="https://secure.gravatar.com/avatar/99e27b99c64003ca8c9875c9e3843495?d=identicon&amp;s=32" height="16" width="16">
485 485 </div>
486 486 <div title="Marcin Kuzminski <marcin@python-works.com>" class="user">Marcin Kuzminski - <span class="tooltip" title="Wed, 02 Jul 2014 08:48:15">6m and 12d ago</span></div>
487 487 </div>
488 488 <div id="trimmed_message_box" class="commit">License changes</div>
489 489 <div id="message_expand" style="display: none;">
490 490 <i class="icon-resize-vertical"></i>
491 491 expand
492 492 <i class="icon-resize-vertical"></i>
493 493 </div>
494 494 </div>
495 495 <div class="code-body">
496 496 <table class="code-highlighttable"><tbody><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L1"> 1</a>
497 497 <a href="#L2"> 2</a>
498 498 <a href="#L3"> 3</a>
499 499 <a href="#L4"> 4</a>
500 500 <a href="#L5"> 5</a>
501 501 <a href="#L6"> 6</a>
502 502 <a href="#L7"> 7</a>
503 503 <a href="#L8"> 8</a>
504 504 <a href="#L9"> 9</a>
505 505 <a href="#L10">10</a>
506 506 <a href="#L11">11</a>
507 507 <a href="#L12">12</a>
508 508 <a href="#L13">13</a>
509 509 <a href="#L14">14</a>
510 510 <a href="#L15">15</a>
511 511 <a href="#L16">16</a>
512 512 <a href="#L17">17</a>
513 513 <a href="#L18">18</a>
514 514 <a href="#L19">19</a>
515 515 <a href="#L20">20</a>
516 516 <a href="#L21">21</a>
517 517 <a href="#L22">22</a>
518 518 <a href="#L23">23</a>
519 519 <a href="#L24">24</a>
520 520 <a href="#L25">25</a>
521 521 <a href="#L26">26</a>
522 522 <a href="#L27">27</a>
523 523 <a href="#L28">28</a>
524 524 <a href="#L29">29</a>
525 525 <a href="#L30">30</a>
526 526 <a href="#L31">31</a>
527 527 <a href="#L32">32</a>
528 528 <a href="#L33">33</a>
529 529 <a href="#L34">34</a>
530 530 <a href="#L35">35</a>
531 531 <a href="#L36">36</a>
532 532 <a href="#L37">37</a>
533 533 <a href="#L38">38</a>
534 534 <a href="#L39">39</a>
535 535 <a href="#L40">40</a>
536 536 <a href="#L41">41</a>
537 537 <a href="#L42">42</a></pre></div></td><td id="hlcode" class="code"><div class="code-highlight"><pre><div id="L1"><a name="L-1"></a><span class="c"># -*- coding: utf-8 -*-</span>
538 538 </div><div id="L2"><a name="L-2"></a>
539 539 </div><div id="L3"><a name="L-3"></a><span class="c"># Published under Business Source License.</span>
540 540 </div><div id="L4"><a name="L-4"></a><span class="c"># Read the full license text at https://rhodecode.com/licenses.</span>
541 541 </div><div id="L5"><a name="L-5"></a><span class="sd">"""</span>
542 542 </div><div id="L6"><a name="L-6"></a><span class="sd">rhodecode.websetup</span>
543 543 </div><div id="L7"><a name="L-7"></a><span class="sd">~~~~~~~~~~~~~~~~~~</span>
544 544 </div><div id="L8"><a name="L-8"></a>
545 545 </div><div id="L9"><a name="L-9"></a><span class="sd">Weboperations and setup for rhodecode. Intentionally long line to show what will happen if this line does not fit onto the screen. It might have some horizontal scrolling applied or some other fancy mechanism to deal with it.</span>
546 546 </div><div id="L10"><a name="L-10"></a>
547 547 </div><div id="L11"><a name="L-11"></a><span class="sd">:created_on: Dec 11, 2010</span>
548 548 </div><div id="L12"><a name="L-12"></a><span class="sd">:author: marcink</span>
549 549 </div><div id="L13"><a name="L-13"></a><span class="sd">:copyright: (c) 2013-2015 RhodeCode GmbH.</span>
550 550 </div><div id="L14"><a name="L-14"></a><span class="sd">:license: Business Source License, see LICENSE for more details.</span>
551 551 </div><div id="L15"><a name="L-15"></a><span class="sd">"""</span>
552 552 </div><div id="L16"><a name="L-16"></a>
553 553 </div><div id="L17"><a name="L-17"></a><span class="kn">import</span> <span class="nn">logging</span>
554 554 </div><div id="L18"><a name="L-18"></a>
555 555 </div><div id="L19"><a name="L-19"></a><span class="kn">from</span> <span class="nn">rhodecode.config.environment</span> <span class="kn">import</span> <span class="n">load_environment</span>
556 556 </div><div id="L20"><a name="L-20"></a><span class="kn">from</span> <span class="nn">rhodecode.lib.db_manage</span> <span class="kn">import</span> <span class="n">DbManage</span>
557 557 </div><div id="L21"><a name="L-21"></a><span class="kn">from</span> <span class="nn">rhodecode.model.meta</span> <span class="kn">import</span> <span class="n">Session</span>
558 558 </div><div id="L22"><a name="L-22"></a>
559 559 </div><div id="L23"><a name="L-23"></a>
560 560 </div><div id="L24"><a name="L-24"></a><span class="n">log</span> <span class="o">=</span> <span class="n">logging</span><span class="o">.</span><span class="n">getLogger</span><span class="p">(</span><span class="n">__name__</span><span class="p">)</span>
561 561 </div><div id="L25"><a name="L-25"></a>
562 562 </div><div id="L26"><a name="L-26"></a>
563 563 </div><div id="L27"><a name="L-27"></a><span class="k">def</span> <span class="nf">setup_app</span><span class="p">(</span><span class="n">command</span><span class="p">,</span> <span class="n">conf</span><span class="p">,</span> <span class="nb">vars</span><span class="p">):</span>
564 564 </div><div id="L28"><a name="L-28"></a> <span class="sd">"""Place any commands to setup rhodecode here"""</span>
565 565 </div><div id="L29"><a name="L-29"></a> <span class="n">dbconf</span> <span class="o">=</span> <span class="n">conf</span><span class="p">[</span><span class="s">'sqlalchemy.db1.url'</span><span class="p">]</span>
566 566 </div><div id="L30"><a name="L-30"></a> <span class="n">dbmanage</span> <span class="o">=</span> <span class="n">DbManage</span><span class="p">(</span><span class="n">log_sql</span><span class="o">=</span><span class="bp">True</span><span class="p">,</span> <span class="n">dbconf</span><span class="o">=</span><span class="n">dbconf</span><span class="p">,</span> <span class="n">root</span><span class="o">=</span><span class="n">conf</span><span class="p">[</span><span class="s">'here'</span><span class="p">],</span>
567 567 </div><div id="L31"><a name="L-31"></a> <span class="n">tests</span><span class="o">=</span><span class="bp">False</span><span class="p">,</span> <span class="n">cli_args</span><span class="o">=</span><span class="n">command</span><span class="o">.</span><span class="n">options</span><span class="o">.</span><span class="n">__dict__</span><span class="p">)</span>
568 568 </div><div id="L32"><a name="L-32"></a> <span class="n">dbmanage</span><span class="o">.</span><span class="n">create_tables</span><span class="p">(</span><span class="n">override</span><span class="o">=</span><span class="bp">True</span><span class="p">)</span>
569 569 </div><div id="L33"><a name="L-33"></a> <span class="n">dbmanage</span><span class="o">.</span><span class="n">set_db_version</span><span class="p">()</span>
570 570 </div><div id="L34"><a name="L-34"></a> <span class="n">opts</span> <span class="o">=</span> <span class="n">dbmanage</span><span class="o">.</span><span class="n">config_prompt</span><span class="p">(</span><span class="bp">None</span><span class="p">)</span>
571 571 </div><div id="L35"><a name="L-35"></a> <span class="n">dbmanage</span><span class="o">.</span><span class="n">create_settings</span><span class="p">(</span><span class="n">opts</span><span class="p">)</span>
572 572 </div><div id="L36"><a name="L-36"></a> <span class="n">dbmanage</span><span class="o">.</span><span class="n">create_default_user</span><span class="p">()</span>
573 573 </div><div id="L37"><a name="L-37"></a> <span class="n">dbmanage</span><span class="o">.</span><span class="n">admin_prompt</span><span class="p">()</span>
574 574 </div><div id="L38"><a name="L-38"></a> <span class="n">dbmanage</span><span class="o">.</span><span class="n">create_permissions</span><span class="p">()</span>
575 575 </div><div id="L39"><a name="L-39"></a> <span class="n">dbmanage</span><span class="o">.</span><span class="n">populate_default_permissions</span><span class="p">()</span>
576 576 </div><div id="L40"><a name="L-40"></a> <span class="n">Session</span><span class="p">()</span><span class="o">.</span><span class="n">commit</span><span class="p">()</span>
577 577 </div><div id="L41"><a name="L-41"></a> <span class="n">load_environment</span><span class="p">(</span><span class="n">conf</span><span class="o">.</span><span class="n">global_conf</span><span class="p">,</span> <span class="n">conf</span><span class="o">.</span><span class="n">local_conf</span><span class="p">,</span> <span class="n">initial</span><span class="o">=</span><span class="bp">True</span><span class="p">)</span>
578 578 </div><div id="L42"><a name="L-42"></a> <span class="n">DbManage</span><span class="o">.</span><span class="n">check_waitress</span><span class="p">()</span>
579 579 </div></pre></div>
580 580 </td></tr></tbody></table>
581 581 </div>
582 582 </div>
583 583
584 584
585 585
586 586
587 587
588 588
589 589
590 590
591 591
592 592 <!--
593 593 Gist Edit
594 594 -->
595 595
596 596
597 597 <h2>Gist Edit</h2>
598 598
599 599 <div class="codeblock">
600 600 <div class="code-header">
601 601 <div class="form">
602 602 <div class="fields">
603 603 <input id="filename" name="filename" placeholder="name this file..." size="30" type="text">
604 604 <div class="select2-container drop-menu" id="s2id_mimetype"><a href="javascript:void(0)" class="select2-choice" tabindex="-1"> <span class="select2-chosen" id="select2-chosen-3">Python</span><abbr class="select2-search-choice-close"></abbr> <span class="select2-arrow" role="presentation"><b role="presentation"></b></span></a><label for="s2id_autogen3" class="select2-offscreen"></label><input class="select2-focusser select2-offscreen" type="text" aria-haspopup="true" role="button" aria-labelledby="select2-chosen-3" id="s2id_autogen3"><div class="select2-drop select2-display-none drop-menu-dropdown select2-with-searchbox"> <div class="select2-search"> <label for="s2id_autogen3_search" class="select2-offscreen"></label> <input type="text" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" class="select2-input" role="combobox" aria-expanded="true" aria-autocomplete="list" aria-owns="select2-results-3" id="s2id_autogen3_search" placeholder=""> </div> <ul class="select2-results" role="listbox" id="select2-results-3"> </ul></div></div><select id="mimetype" name="mimetype" tabindex="-1" title="" style="display: none;">
605 605 <option selected="selected" value="plain">plain</option>
606 606 <option value="text/apl" mode="apl">APL</option><option value="text/x-asterisk" mode="asterisk">Asterisk</option><option value="text/x-csrc" mode="clike">C</option><option value="text/x-c++src" mode="clike">C++</option><option value="text/x-cobol" mode="cobol">Cobol</option><option value="text/x-java" mode="clike">Java</option><option value="text/x-csharp" mode="clike">C#</option><option value="text/x-scala" mode="clike">Scala</option><option value="text/x-clojure" mode="clojure">Clojure</option><option value="text/x-coffeescript" mode="coffeescript">CoffeeScript</option><option value="text/x-common-lisp" mode="commonlisp">Common Lisp</option><option value="text/css" mode="css">CSS</option><option value="text/x-d" mode="d">D</option><option value="text/x-diff" mode="diff">diff</option><option value="application/xml-dtd" mode="dtd">DTD</option><option value="text/x-dylan" mode="dylan">Dylan</option><option value="text/x-ecl" mode="ecl">ECL</option><option value="text/x-eiffel" mode="eiffel">Eiffel</option><option value="text/x-erlang" mode="erlang">Erlang</option><option value="text/x-fortran" mode="fortran">Fortran</option><option value="text/x-fsharp" mode="mllike">F#</option><option value="text/x-gas" mode="gas">Gas</option><option value="text/x-go" mode="go">GO</option><option value="text/x-feature" mode="gherkin">Gherkin</option><option value="text/x-go" mode="go">Go</option><option value="text/x-groovy" mode="groovy">Groovy</option><option value="text/x-haml" mode="haml">HAML</option><option value="text/x-haskell" mode="haskell">Haskell</option><option value="text/x-haxe" mode="haxe">Haxe</option><option value="application/x-aspx" mode="htmlembedded">ASP.NET</option><option value="application/x-ejs" mode="htmlembedded">Embedded Javascript</option><option value="application/x-jsp" mode="htmlembedded">JavaServer Pages</option><option value="text/html" mode="htmlmixed">HTML</option><option value="message/http" mode="http">HTTP</option><option value="text/x-jade" mode="jade">Jade</option><option value="text/javascript" mode="javascript">JavaScript</option><option value="application/json" mode="javascript">JSON</option><option value="application/typescript" mode="javascript">TypeScript</option><option value="jinja2" mode="jinja2">Jinja2</option><option value="text/x-julia" mode="julia">Julia</option><option value="text/x-less" mode="less">LESS</option><option value="text/x-livescript" mode="livescript">LiveScript</option><option value="text/x-lua" mode="lua">Lua</option><option value="text/x-markdown" mode="markdown">Markdown (GitHub-flavour)</option><option value="text/mirc" mode="mirc">mIRC</option><option value="text/x-nginx-conf" mode="nginx">Nginx</option><option value="text/n-triples" mode="ntriples">NTriples</option><option value="text/x-ocaml" mode="ocaml">OCaml</option><option value="text/x-ocaml" mode="mllike">OCaml</option><option value="text/x-octave" mode="octave">Octave</option><option value="text/x-pascal" mode="pascal">Pascal</option><option value="null" mode="pegjs">PEG.js</option><option value="text/x-perl" mode="perl">Perl</option><option value="text/x-php" mode="php">PHP</option><option value="text/x-pig" mode="pig">Pig</option><option value="text/plain" mode="null">Plain Text</option><option value="text/x-properties" mode="properties">Properties files</option><option value="text/x-python" mode="python">Python</option><option value="text/x-puppet" mode="puppet">Puppet</option><option value="text/x-rsrc" mode="r">R</option><option value="text/x-rst" mode="rst">reStructuredText</option><option value="text/x-ruby" mode="ruby">Ruby</option><option value="text/x-rustsrc" mode="rust">Rust</option><option value="text/x-sass" mode="sass">Sass</option><option value="text/x-scheme" mode="scheme">Scheme</option><option value="text/x-scss" mode="css">SCSS</option><option value="text/x-sh" mode="shell">Shell</option><option value="application/sieve" mode="sieve">Sieve</option><option value="text/x-stsrc" mode="smalltalk">Smalltalk</option><option value="text/x-smarty" mode="smarty">Smarty</option><option value="text/x-smarty" mode="smartymixed">SmartyMixed</option><option value="text/x-solr" mode="solr">Solr</option><option value="application/x-sparql-query" mode="sparql">SPARQL</option><option value="text/x-sql" mode="sql">SQL</option><option value="text/x-mariadb" mode="sql">MariaDB</option><option value="text/x-stex" mode="stex">sTeX</option><option value="text/x-latex" mode="stex">LaTeX</option><option value="text/x-systemverilog" mode="verilog">SystemVerilog</option><option value="text/x-tcl" mode="tcl">Tcl</option><option value="text/x-tiddlywiki" mode="tiddlywiki">TiddlyWiki </option><option value="text/tiki" mode="tiki">Tiki wiki</option><option value="text/x-toml" mode="toml">TOML</option><option value="text/turtle" mode="turtle">Turtle</option><option value="text/x-vb" mode="vb">VB.NET</option><option value="text/vbscript" mode="vbscript">VBScript</option><option value="text/velocity" mode="velocity">Velocity</option><option value="text/x-verilog" mode="verilog">Verilog</option><option value="application/xml" mode="xml">XML</option><option value="text/html" mode="xml">HTML</option><option value="application/xquery" mode="xquery">XQuery</option><option value="text/x-yaml" mode="yaml">YAML</option><option value="text/x-z80" mode="z80">Z80</option></select>
607 607 <script>
608 608 $(document).ready(function() {
609 609 $('#mimetype').select2({
610 610 containerCssClass: 'drop-menu',
611 611 dropdownCssClass: 'drop-menu-dropdown',
612 612 dropdownAutoWidth: true
613 613 });
614 614 });
615 615 </script>
616 616
617 617 </div>
618 618 </div>
619 619 </div>
620 620 <div id="editor_container">
621 621 <div id="editor_pre"></div>
622 622 <textarea id="editor" name="content" style="display: none;"></textarea><div class="CodeMirror cm-s-default"><div style="overflow: hidden; position: relative; width: 3px; height: 0px; top: 484px; left: 219.4091796875px;"><textarea autocorrect="off" autocapitalize="off" spellcheck="false" style="position: absolute; padding: 0px; width: 1000px; height: 1em; outline: none;" tabindex="0"></textarea></div><div class="CodeMirror-hscrollbar" style="left: 29px; min-height: 18px;"><div style="height: 100%; min-height: 1px; width: 0px;"></div></div><div class="CodeMirror-vscrollbar" style="min-width: 18px; display: block; bottom: 0px;"><div style="min-width: 1px; height: 619px;"></div></div><div class="CodeMirror-scrollbar-filler"></div><div class="CodeMirror-gutter-filler"></div><div class="CodeMirror-scroll" tabindex="-1"><div class="CodeMirror-sizer" style="min-width: 700.269653320313px; margin-left: 29px; min-height: 619px;"><div style="position: relative; top: 0px;"><div class="CodeMirror-lines"><div style="position: relative; outline: none;"><div class="CodeMirror-measure"><div class="CodeMirror-linenumber CodeMirror-gutter-elt"><div>47</div></div></div><div style="position: relative; z-index: 1; display: none;"></div><div class="CodeMirror-code"><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="position: absolute; left: -29px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 20px;">1</div></div><pre><span class="cm-keyword">import</span> <span class="cm-variable">re</span></pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="position: absolute; left: -29px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 20px;">2</div></div><pre>&nbsp;</pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="position: absolute; left: -29px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 20px;">3</div></div><pre><span class="cm-keyword">from</span> <span class="cm-variable">django</span>.<span class="cm-variable">utils</span>.<span class="cm-variable">text</span> <span class="cm-keyword">import</span> <span class="cm-variable">compress_sequence</span>, <span class="cm-variable">compress_string</span></pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="position: absolute; left: -29px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 20px;">4</div></div><pre><span class="cm-keyword">from</span> <span class="cm-variable">django</span>.<span class="cm-variable">utils</span>.<span class="cm-variable">cache</span> <span class="cm-keyword">import</span> <span class="cm-variable">patch_vary_headers</span></pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="position: absolute; left: -29px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 20px;">5</div></div><pre>&nbsp;</pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="position: absolute; left: -29px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 20px;">6</div></div><pre><span class="cm-variable">re_accepts_gzip</span> = <span class="cm-variable">re</span>.<span class="cm-builtin">compile</span>(<span class="cm-string">r'\bgzip\b'</span>)</pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="position: absolute; left: -29px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 20px;">7</div></div><pre>&nbsp;</pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="position: absolute; left: -29px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 20px;">8</div></div><pre>&nbsp;</pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="position: absolute; left: -29px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 20px;">9</div></div><pre><span class="cm-keyword">class</span> <span class="cm-def">GZipMiddleware</span>(<span class="cm-builtin">object</span>): # Intentionally long line to show what will happen if this line does not fit onto the screen. It might have some horizontal scrolling applied or some other fancy mechanism to deal with it.</pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="position: absolute; left: -29px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 20px;">10</div></div><pre> <span class="cm-string">"""</span></pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="position: absolute; left: -29px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 20px;">11</div></div><pre><span class="cm-string"> This middleware compresses content if the browser allows gzip compression.</span></pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="position: absolute; left: -29px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 20px;">12</div></div><pre><span class="cm-string"> It sets the Vary header accordingly, so that caches will base their storage</span></pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="position: absolute; left: -29px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 20px;">13</div></div><pre><span class="cm-string"> on the Accept-Encoding header.</span></pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="position: absolute; left: -29px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 20px;">14</div></div><pre><span class="cm-string"> """</span></pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="position: absolute; left: -29px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 20px;">15</div></div><pre> <span class="cm-keyword">def</span> <span class="cm-def">process_response</span>(<span class="cm-variable-2">self</span>, <span class="cm-variable">request</span>, <span class="cm-variable">response</span>):</pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="position: absolute; left: -29px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 20px;">16</div></div><pre> <span class="cm-comment"># It's not worth attempting to compress really short responses.</span></pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="position: absolute; left: -29px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 20px;">17</div></div><pre> <span class="cm-keyword">if</span> <span class="cm-operator">not</span> <span class="cm-variable">response</span>.<span class="cm-variable">streaming</span> <span class="cm-operator">and</span> <span class="cm-builtin">len</span>(<span class="cm-variable">response</span>.<span class="cm-variable">content</span>) <span class="cm-operator">&lt;</span> <span class="cm-number">200</span>:</pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="position: absolute; left: -29px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 20px;">18</div></div><pre> <span class="cm-keyword">return</span> <span class="cm-variable">response</span></pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="position: absolute; left: -29px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 20px;">19</div></div><pre>&nbsp;</pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="position: absolute; left: -29px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 20px;">20</div></div><pre> <span class="cm-comment"># Avoid gzipping if we've already got a content-encoding.</span></pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="position: absolute; left: -29px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 20px;">21</div></div><pre> <span class="cm-keyword">if</span> <span class="cm-variable">response</span>.<span class="cm-variable">has_header</span>(<span class="cm-string">'Content-Encoding'</span>):</pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="position: absolute; left: -29px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 20px;">22</div></div><pre> <span class="cm-keyword">return</span> <span class="cm-variable">response</span></pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="position: absolute; left: -29px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 20px;">23</div></div><pre>&nbsp;</pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="position: absolute; left: -29px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 20px;">24</div></div><pre> <span class="cm-variable">patch_vary_headers</span>(<span class="cm-variable">response</span>, (<span class="cm-string">'Accept-Encoding'</span>,))</pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="position: absolute; left: -29px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 20px;">25</div></div><pre>&nbsp;</pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="position: absolute; left: -29px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 20px;">26</div></div><pre> <span class="cm-variable">ae</span> = <span class="cm-variable">request</span>.<span class="cm-variable">META</span>.<span class="cm-variable">get</span>(<span class="cm-string">'HTTP_ACCEPT_ENCODING'</span>, <span class="cm-string">''</span>)</pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="position: absolute; left: -29px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 20px;">27</div></div><pre> <span class="cm-keyword">if</span> <span class="cm-operator">not</span> <span class="cm-variable">re_accepts_gzip</span>.<span class="cm-variable">search</span>(<span class="cm-variable">ae</span>):</pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="position: absolute; left: -29px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 20px;">28</div></div><pre> <span class="cm-keyword">return</span> <span class="cm-variable">response</span></pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="position: absolute; left: -29px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 20px;">29</div></div><pre>&nbsp;</pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="position: absolute; left: -29px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 20px;">30</div></div><pre> <span class="cm-keyword">if</span> <span class="cm-variable">response</span>.<span class="cm-variable">streaming</span>:</pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="position: absolute; left: -29px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 20px;">31</div></div><pre> <span class="cm-comment"># Delete the `Content-Length` header for streaming content, because</span></pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="position: absolute; left: -29px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 20px;">32</div></div><pre> <span class="cm-comment"># we won't know the compressed size until we stream it.</span></pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="position: absolute; left: -29px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 20px;">33</div></div><pre> <span class="cm-variable">response</span>.<span class="cm-variable">streaming_content</span> = <span class="cm-variable">compress_sequence</span>(<span class="cm-variable">response</span>.<span class="cm-variable">streaming_content</span>)</pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="position: absolute; left: -29px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 20px;">34</div></div><pre> <span class="cm-keyword">del</span> <span class="cm-variable">response</span>[<span class="cm-string">'Content-Length'</span>]</pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="position: absolute; left: -29px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 20px;">35</div></div><pre> <span class="cm-keyword">else</span>:</pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="position: absolute; left: -29px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 20px;">36</div></div><pre> <span class="cm-comment"># Return the compressed content only if it's actually shorter.</span></pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="position: absolute; left: -29px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 20px;">37</div></div><pre> <span class="cm-variable">compressed_content</span> = <span class="cm-variable">compress_string</span>(<span class="cm-variable">response</span>.<span class="cm-variable">content</span>)</pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="position: absolute; left: -29px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 20px;">38</div></div><pre> <span class="cm-keyword">if</span> <span class="cm-builtin">len</span>(<span class="cm-variable">compressed_content</span>) <span class="cm-operator">&gt;=</span> <span class="cm-builtin">len</span>(<span class="cm-variable">response</span>.<span class="cm-variable">content</span>):</pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="position: absolute; left: -29px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 20px;">39</div></div><pre> <span class="cm-keyword">return</span> <span class="cm-variable">response</span></pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="position: absolute; left: -29px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 20px;">40</div></div><pre> <span class="cm-variable">response</span>.<span class="cm-variable">content</span> = <span class="cm-variable">compressed_content</span></pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="position: absolute; left: -29px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 20px;">41</div></div><pre> <span class="cm-variable">response</span>[<span class="cm-string">'Content-Length'</span>] = <span class="cm-builtin">str</span>(<span class="cm-builtin">len</span>(<span class="cm-variable">response</span>.<span class="cm-variable">content</span>))</pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="position: absolute; left: -29px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 20px;">42</div></div><pre>&nbsp;</pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="position: absolute; left: -29px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 20px;">43</div></div><pre> <span class="cm-keyword">if</span> <span class="cm-variable">response</span>.<span class="cm-variable">has_header</span>(<span class="cm-string">'ETag'</span>):</pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="position: absolute; left: -29px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 20px;">44</div></div><pre> <span class="cm-variable">response</span>[<span class="cm-string">'ETag'</span>] = <span class="cm-variable">re</span>.<span class="cm-variable">sub</span>(<span class="cm-string">'"$'</span>, <span class="cm-string">';gzip"'</span>, <span class="cm-variable">response</span>[<span class="cm-string">'ETag'</span>])</pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="position: absolute; left: -29px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 20px;">45</div></div><pre> <span class="cm-variable">response</span>[<span class="cm-string">'Content-Encoding'</span>] = <span class="cm-string">'gzip'</span></pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="position: absolute; left: -29px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 20px;">46</div></div><pre>&nbsp;</pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="position: absolute; left: -29px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 20px;">47</div></div><pre> <span class="cm-keyword">return</span> <span class="cm-variable">response</span></pre></div></div><div class="CodeMirror-cursor" style="left: 189.4091796875px; top: 598px; height: 13px;">&nbsp;</div><div class="CodeMirror-cursor CodeMirror-secondarycursor" style="display: none;">&nbsp;</div></div></div></div></div><div style="position: absolute; height: 30px; width: 1px; top: 619px;"></div><div class="CodeMirror-gutters" style="height: 619px;"><div class="CodeMirror-gutter CodeMirror-linenumbers" style="width: 28px;"></div></div></div></div>
623 623 </div>
624 624 </div>
625 625
626 626
627 627
628 628
629 629
630 630 <!--
631 631 File Edit
632 632 -->
633 633
634 634 <h2>File Edit</h2>
635 635
636 636 <div class="codeblock">
637 637 <div class="code-header">
638 638 <div class="stats">
639 639 <i class="icon-file"></i>
640 640 <span class="item"><a href="/example/changeset/80ead1899f50a894889e19ffeb49c9cebf5bf045">r8248:80ead1899f50</a></span>
641 641 <span class="item">1.2 KiB</span>
642 642 <span class="item last">text/x-python</span>
643 643 <div class="buttons">
644 644 <a class="btn btn-mini" href="/example/changelog/80ead1899f50a894889e19ffeb49c9cebf5bf045/rhodecode/websetup.py">
645 645 <i class="icon-time"></i> history
646 646 </a>
647 647
648 648 <a class="btn btn-mini" href="/example/files/80ead1899f50a894889e19ffeb49c9cebf5bf045/rhodecode/websetup.py">source</a>
649 649 <a class="btn btn-mini" href="/example/raw/80ead1899f50a894889e19ffeb49c9cebf5bf045/rhodecode/websetup.py">raw</a>
650 650 <a class="btn btn-mini" href="/example/rawfile/80ead1899f50a894889e19ffeb49c9cebf5bf045/rhodecode/websetup.py">
651 651 <i class="icon-archive"></i> download
652 652 </a>
653 653 </div>
654 654 </div>
655 655 <div class="form">
656 656 <label for="set_mode">Editing file:</label>
657 657 rhodecode /
658 658 <input type="text" name="filename" value="websetup.py">
659 659
660 660 <div class="select2-container drop-menu" id="s2id_set_mode"><a href="javascript:void(0)" class="select2-choice" tabindex="-1"> <span class="select2-chosen" id="select2-chosen-2">plain</span><abbr class="select2-search-choice-close"></abbr> <span class="select2-arrow" role="presentation"><b role="presentation"></b></span></a><label for="s2id_autogen2" class="select2-offscreen">Editing file:</label><input class="select2-focusser select2-offscreen" type="text" aria-haspopup="true" role="button" aria-labelledby="select2-chosen-2" id="s2id_autogen2"><div class="select2-drop select2-display-none drop-menu-dropdown select2-with-searchbox"> <div class="select2-search"> <label for="s2id_autogen2_search" class="select2-offscreen">Editing file:</label> <input type="text" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" class="select2-input" role="combobox" aria-expanded="true" aria-autocomplete="list" aria-owns="select2-results-2" id="s2id_autogen2_search" placeholder=""> </div> <ul class="select2-results" role="listbox" id="select2-results-2"> </ul></div></div><select id="set_mode" name="set_mode" tabindex="-1" title="Editing file:" style="display: none;">
661 661 <option selected="selected" value="plain">plain</option>
662 662 <option value="apl">APL</option><option value="asterisk">Asterisk</option><option value="clike">C</option><option value="clike">C++</option><option value="cobol">Cobol</option><option value="clike">Java</option><option value="clike">C#</option><option value="clike">Scala</option><option value="clojure">Clojure</option><option value="coffeescript">CoffeeScript</option><option value="commonlisp">Common Lisp</option><option value="css">CSS</option><option value="d">D</option><option value="diff">diff</option><option value="dtd">DTD</option><option value="dylan">Dylan</option><option value="ecl">ECL</option><option value="eiffel">Eiffel</option><option value="erlang">Erlang</option><option value="fortran">Fortran</option><option value="mllike">F#</option><option value="gas">Gas</option><option value="go">GO</option><option value="gherkin">Gherkin</option><option value="go">Go</option><option value="groovy">Groovy</option><option value="haml">HAML</option><option value="haskell">Haskell</option><option value="haxe">Haxe</option><option value="htmlembedded">ASP.NET</option><option value="htmlembedded">Embedded Javascript</option><option value="htmlembedded">JavaServer Pages</option><option value="htmlmixed">HTML</option><option value="http">HTTP</option><option value="jade">Jade</option><option value="javascript">JavaScript</option><option value="javascript">JSON</option><option value="javascript">TypeScript</option><option value="jinja2">Jinja2</option><option value="julia">Julia</option><option value="less">LESS</option><option value="livescript">LiveScript</option><option value="lua">Lua</option><option value="markdown">Markdown (GitHub-flavour)</option><option value="mirc">mIRC</option><option value="nginx">Nginx</option><option value="ntriples">NTriples</option><option value="ocaml">OCaml</option><option value="mllike">OCaml</option><option value="octave">Octave</option><option value="pascal">Pascal</option><option value="pegjs">PEG.js</option><option value="perl">Perl</option><option value="php">PHP</option><option value="pig">Pig</option><option value="null">Plain Text</option><option value="properties">Properties files</option><option value="python" selected="selected">Python</option><option value="puppet">Puppet</option><option value="r">R</option><option value="rst">reStructuredText</option><option value="ruby">Ruby</option><option value="rust">Rust</option><option value="sass">Sass</option><option value="scheme">Scheme</option><option value="css">SCSS</option><option value="shell">Shell</option><option value="sieve">Sieve</option><option value="smalltalk">Smalltalk</option><option value="smarty">Smarty</option><option value="smartymixed">SmartyMixed</option><option value="solr">Solr</option><option value="sparql">SPARQL</option><option value="sql">SQL</option><option value="sql">MariaDB</option><option value="stex">sTeX</option><option value="stex">LaTeX</option><option value="verilog">SystemVerilog</option><option value="tcl">Tcl</option><option value="tiddlywiki">TiddlyWiki </option><option value="tiki">Tiki wiki</option><option value="toml">TOML</option><option value="turtle">Turtle</option><option value="vb">VB.NET</option><option value="vbscript">VBScript</option><option value="velocity">Velocity</option><option value="verilog">Verilog</option><option value="xml">XML</option><option value="xml">HTML</option><option value="xquery">XQuery</option><option value="yaml">YAML</option><option value="z80">Z80</option></select>
663 663 <script>
664 664 $(document).ready(function() {
665 665 $('#set_mode').select2({
666 666 containerCssClass: 'drop-menu',
667 667 dropdownCssClass: 'drop-menu-dropdown',
668 668 dropdownAutoWidth: true
669 669 });
670 670 });
671 671 </script>
672 672
673 673 <label for="line_wrap">line wraps</label>
674 674 <div class="select2-container drop-menu" id="s2id_line_wrap"><a href="javascript:void(0)" class="select2-choice" tabindex="-1"> <span class="select2-chosen" id="select2-chosen-3">off</span><abbr class="select2-search-choice-close"></abbr> <span class="select2-arrow" role="presentation"><b role="presentation"></b></span></a><label for="s2id_autogen3" class="select2-offscreen">line wraps</label><input class="select2-focusser select2-offscreen" type="text" aria-haspopup="true" role="button" aria-labelledby="select2-chosen-3" id="s2id_autogen3"><div class="select2-drop select2-display-none drop-menu-dropdown"> <div class="select2-search select2-search-hidden select2-offscreen"> <label for="s2id_autogen3_search" class="select2-offscreen">line wraps</label> <input type="text" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" class="select2-input" role="combobox" aria-expanded="true" aria-autocomplete="list" aria-owns="select2-results-3" id="s2id_autogen3_search" placeholder=""> </div> <ul class="select2-results" role="listbox" id="select2-results-3"> </ul></div></div><select id="line_wrap" name="line_wrap" tabindex="-1" title="line wraps" style="display: none;">
675 675 <option value="on">on</option>
676 676 <option selected="selected" value="off">off</option>
677 677 </select>
678 678 <script>
679 679 $(document).ready(function() {
680 680 $('#line_wrap').select2({
681 681 containerCssClass: 'drop-menu',
682 682 dropdownCssClass: 'drop-menu-dropdown',
683 683 dropdownAutoWidth: true,
684 684 minimumResultsForSearch: -1
685 685
686 686 });
687 687 });
688 688 </script>
689 689
690 690 <div id="render_preview" class="btn btn-mini hidden disabled">Preview</div>
691 691 </div>
692 692 </div>
693 693 <div id="editor_container">
694 694 <pre id="editor_pre"></pre>
695 695 <textarea id="editor" name="content" style="display: none;"># -*- coding: utf-8 -*-
696 696
697 697 # Published under Commercial License.
698 698 # Read the full license text at https://rhodecode.com/licenses.
699 699 """
700 700 rhodecode.websetup
701 701 ~~~~~~~~~~~~~~~~~~
702 702
703 703 Weboperations and setup for rhodecode
704 704
705 705 :created_on: Dec 11, 2010
706 706 :author: marcink
707 707 :copyright: (c) 2013-2015 RhodeCode GmbH.
708 708 :license: Commercial License, see LICENSE for more details.
709 709 """
710 710
711 711 import logging
712 712
713 713 from rhodecode.config.environment import load_environment
714 714 from rhodecode.lib.db_manage import DbManage
715 715 from rhodecode.model.meta import Session
716 716
717 717
718 718 log = logging.getLogger(__name__)
719 719
720 720
721 721 def setup_app(command, conf, vars):
722 722 """Place any commands to setup rhodecode here"""
723 723 dbconf = conf['sqlalchemy.db1.url']
724 724 dbmanage = DbManage(log_sql=True, dbconf=dbconf, root=conf['here'],
725 725 tests=False, cli_args=command.options.__dict__)
726 726 dbmanage.create_tables(override=True)
727 727 dbmanage.set_db_version()
728 728 opts = dbmanage.config_prompt(None)
729 729 dbmanage.create_settings(opts)
730 730 dbmanage.create_default_user()
731 731 dbmanage.admin_prompt()
732 732 dbmanage.create_permissions()
733 733 dbmanage.populate_default_permissions()
734 734 Session().commit()
735 735 load_environment(conf.global_conf, conf.local_conf, initial=True)
736 736 </textarea><div class="CodeMirror cm-s-default CodeMirror-focused"><div style="overflow: hidden; position: relative; width: 3px; height: 0px; top: 5px; left: 34px;"><textarea autocorrect="off" autocapitalize="off" spellcheck="false" style="position: absolute; padding: 0px; width: 1000px; height: 1em; outline: none;" tabindex="0"></textarea></div><div class="CodeMirror-hscrollbar" style="left: 29px; min-height: 18px;"><div style="height: 100%; min-height: 1px; width: 0px;"></div></div><div class="CodeMirror-vscrollbar" style="display: block; bottom: 0px; min-width: 18px;"><div style="min-width: 1px; height: 554px;"></div></div><div class="CodeMirror-scrollbar-filler"></div><div class="CodeMirror-gutter-filler"></div><div class="CodeMirror-scroll" tabindex="-1"><div class="CodeMirror-sizer" style="min-width: 579.350463867188px; margin-left: 29px; min-height: 554px;"><div style="position: relative; top: 0px;"><div class="CodeMirror-lines"><div style="position: relative; outline: none;"><div class="CodeMirror-measure"><div style="width: 50px; height: 50px; overflow-x: scroll;"></div></div><div style="position: relative; z-index: 1; display: none;"></div><div class="CodeMirror-code"><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="position: absolute; left: -29px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 20px;">1</div></div><pre><span class="cm-comment"># -*- coding: utf-8 -*-</span></pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="position: absolute; left: -29px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 20px;">2</div></div><pre>&nbsp;</pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="position: absolute; left: -29px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 20px;">3</div></div><pre><span class="cm-comment"># Published under Commercial License.</span></pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="position: absolute; left: -29px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 20px;">4</div></div><pre><span class="cm-comment"># Read the full license text at https://rhodecode.com/licenses.</span></pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="position: absolute; left: -29px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 20px;">5</div></div><pre><span class="cm-string">"""</span></pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="position: absolute; left: -29px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 20px;">6</div></div><pre><span class="cm-string">rhodecode.websetup</span></pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="position: absolute; left: -29px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 20px;">7</div></div><pre><span class="cm-string">~~~~~~~~~~~~~~~~~~</span></pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="position: absolute; left: -29px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 20px;">8</div></div><pre>&nbsp;</pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="position: absolute; left: -29px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 20px;">9</div></div><pre><span class="cm-string">Weboperations and setup for rhodecode</span></pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="position: absolute; left: -29px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 20px;">10</div></div><pre>&nbsp;</pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="position: absolute; left: -29px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 20px;">11</div></div><pre><span class="cm-string">:created_on: Dec 11, 2010</span></pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="position: absolute; left: -29px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 20px;">12</div></div><pre><span class="cm-string">:author: marcink</span></pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="position: absolute; left: -29px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 20px;">13</div></div><pre><span class="cm-string">:copyright: (c) 2013-2015 RhodeCode GmbH.</span></pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="position: absolute; left: -29px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 20px;">14</div></div><pre><span class="cm-string">:license: Commercial License, see LICENSE for more details.</span></pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="position: absolute; left: -29px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 20px;">15</div></div><pre><span class="cm-string">"""</span></pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="position: absolute; left: -29px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 20px;">16</div></div><pre>&nbsp;</pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="position: absolute; left: -29px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 20px;">17</div></div><pre><span class="cm-keyword">import</span> <span class="cm-variable">logging</span></pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="position: absolute; left: -29px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 20px;">18</div></div><pre>&nbsp;</pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="position: absolute; left: -29px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 20px;">19</div></div><pre><span class="cm-keyword">from</span> <span class="cm-variable">rhodecode</span>.<span class="cm-variable">config</span>.<span class="cm-variable">environment</span> <span class="cm-keyword">import</span> <span class="cm-variable">load_environment</span></pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="position: absolute; left: -29px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 20px;">20</div></div><pre><span class="cm-keyword">from</span> <span class="cm-variable">rhodecode</span>.<span class="cm-variable">lib</span>.<span class="cm-variable">db_manage</span> <span class="cm-keyword">import</span> <span class="cm-variable">DbManage</span></pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="position: absolute; left: -29px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 20px;">21</div></div><pre><span class="cm-keyword">from</span> <span class="cm-variable">rhodecode</span>.<span class="cm-variable">model</span>.<span class="cm-variable">meta</span> <span class="cm-keyword">import</span> <span class="cm-variable">Session</span></pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="position: absolute; left: -29px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 20px;">22</div></div><pre>&nbsp;</pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="position: absolute; left: -29px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 20px;">23</div></div><pre>&nbsp;</pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="position: absolute; left: -29px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 20px;">24</div></div><pre><span class="cm-variable">log</span> = <span class="cm-variable">logging</span>.<span class="cm-variable">getLogger</span>(<span class="cm-variable">__name__</span>) # Intentionally long line to show what will happen if this line does not fit onto the screen. It might have some horizontal scrolling applied or some other fancy mechanism to deal with it.</pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="position: absolute; left: -29px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 20px;">25</div></div><pre>&nbsp;</pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="position: absolute; left: -29px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 20px;">26</div></div><pre>&nbsp;</pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="position: absolute; left: -29px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 20px;">27</div></div><pre><span class="cm-keyword">def</span> <span class="cm-def">setup_app</span>(<span class="cm-variable">command</span>, <span class="cm-variable">conf</span>, <span class="cm-builtin">vars</span>):</pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="position: absolute; left: -29px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 20px;">28</div></div><pre> <span class="cm-string">"""Place any commands to setup rhodecode here"""</span></pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="position: absolute; left: -29px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 20px;">29</div></div><pre> <span class="cm-variable">dbconf</span> = <span class="cm-variable">conf</span>[<span class="cm-string">'sqlalchemy.db1.url'</span>]</pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="position: absolute; left: -29px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 20px;">30</div></div><pre> <span class="cm-variable">dbmanage</span> = <span class="cm-variable">DbManage</span>(<span class="cm-variable">log_sql</span>=<span class="cm-builtin">True</span>, <span class="cm-variable">dbconf</span>=<span class="cm-variable">dbconf</span>, <span class="cm-variable">root</span>=<span class="cm-variable">conf</span>[<span class="cm-string">'here'</span>],</pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="position: absolute; left: -29px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 20px;">31</div></div><pre> <span class="cm-variable">tests</span>=<span class="cm-builtin">False</span>, <span class="cm-variable">cli_args</span>=<span class="cm-variable">command</span>.<span class="cm-variable">options</span>.<span class="cm-variable">__dict__</span>)</pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="position: absolute; left: -29px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 20px;">32</div></div><pre> <span class="cm-variable">dbmanage</span>.<span class="cm-variable">create_tables</span>(<span class="cm-variable">override</span>=<span class="cm-builtin">True</span>)</pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="position: absolute; left: -29px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 20px;">33</div></div><pre> <span class="cm-variable">dbmanage</span>.<span class="cm-variable">set_db_version</span>()</pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="position: absolute; left: -29px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 20px;">34</div></div><pre> <span class="cm-variable">opts</span> = <span class="cm-variable">dbmanage</span>.<span class="cm-variable">config_prompt</span>(<span class="cm-builtin">None</span>)</pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="position: absolute; left: -29px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 20px;">35</div></div><pre> <span class="cm-variable">dbmanage</span>.<span class="cm-variable">create_settings</span>(<span class="cm-variable">opts</span>)</pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="position: absolute; left: -29px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 20px;">36</div></div><pre> <span class="cm-variable">dbmanage</span>.<span class="cm-variable">create_default_user</span>()</pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="position: absolute; left: -29px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 20px;">37</div></div><pre> <span class="cm-variable">dbmanage</span>.<span class="cm-variable">admin_prompt</span>()</pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="position: absolute; left: -29px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 20px;">38</div></div><pre> <span class="cm-variable">dbmanage</span>.<span class="cm-variable">create_permissions</span>()</pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="position: absolute; left: -29px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 20px;">39</div></div><pre> <span class="cm-variable">dbmanage</span>.<span class="cm-variable">populate_default_permissions</span>()</pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="position: absolute; left: -29px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 20px;">40</div></div><pre> <span class="cm-variable">Session</span>().<span class="cm-variable">commit</span>()</pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="position: absolute; left: -29px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 20px;">41</div></div><pre> <span class="cm-variable">load_environment</span>(<span class="cm-variable">conf</span>.<span class="cm-variable">global_conf</span>, <span class="cm-variable">conf</span>.<span class="cm-variable">local_conf</span>, <span class="cm-variable">initial</span>=<span class="cm-builtin">True</span>)</pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="position: absolute; left: -29px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 20px;">42</div></div><pre>&nbsp;</pre></div></div><div class="CodeMirror-cursor" style="left: 4px; top: 0px; height: 13px;">&nbsp;</div><div class="CodeMirror-cursor CodeMirror-secondarycursor" style="display: none;">&nbsp;</div></div></div></div></div><div style="position: absolute; height: 30px; width: 1px; top: 554px;"></div><div class="CodeMirror-gutters" style="height: 554px;"><div class="CodeMirror-gutter CodeMirror-linenumbers" style="width: 28px;"></div></div></div></div>
737 737 <div id="editor_preview"></div>
738 738 </div>
739 739 <div class="message">
740 740 <label class="codeblock-label">Commit Message</label>
741 741 <textarea id="commit" name="message" placeholder="Edited file rhodecode/websetup.py via RhodeCode"></textarea>
742 742 </div>
743 743 </div>
744 744
745 745
746 746
747 747
748 748
749 749
750 750 <!--
751 751 Commit with comments
752 752 -->
753 753
754 754 <h2>Commit with comments</h2>
755 755
756 756 <div class="diff-container" id="diff-container-140360037209920">
757 757 <div id="c-4e5ee86997c6-7046e4320b26_target"></div>
758 758 <div id="c-4e5ee86997c6-7046e4320b26" class="diffblock margined comm">
759 759 <div class="code-header">
760 760 <div title="Go back to changed files overview">
761 761 <a href="#changes_box">
762 762 <i class="icon-circle-arrow-up"></i>
763 763 </a>
764 764 </div>
765 765 <div class="changeset_header">
766 766 <div class="changeset_file">
767 767 <i class="icon-file"></i>
768 768 <a href="/andersonsantos/rhodecode-dev-fork/files/4e5ee86997c64981d85cf62283af448624e26929/rhodecode/tests/functional/test_compare_local.py">rhodecode/tests/functional/test_compare_local.py</a>
769 769 </div>
770 770 <div class="diff-actions">
771 771 <a href="/andersonsantos/rhodecode-dev-fork/diff/rhodecode/tests/functional/test_compare_local.py?fulldiff=1&amp;diff1=682135c2e3958d7c84db06d716efe482bd3ce7c6&amp;diff=diff&amp;diff2=4e5ee86997c64981d85cf62283af448624e26929" class="tooltip" title="Show full diff for this file">
772 772 <img class="icon" src="/images/icons/page_white_go.png">
773 773 </a>
774 774 <a href="/andersonsantos/rhodecode-dev-fork/diff-2way/rhodecode/tests/functional/test_compare_local.py?fulldiff=1&amp;diff1=682135c2e3958d7c84db06d716efe482bd3ce7c6&amp;diff=diff&amp;diff2=4e5ee86997c64981d85cf62283af448624e26929" class="tooltip" title="Show full side-by-side diff for this file">
775 775 <img class="icon" src="/images/icons/application_double.png">
776 776 </a>
777 777 <a href="/andersonsantos/rhodecode-dev-fork/diff/rhodecode/tests/functional/test_compare_local.py?diff1=682135c2e3958d7c84db06d716efe482bd3ce7c6&amp;diff=raw&amp;diff2=4e5ee86997c64981d85cf62283af448624e26929" class="tooltip" title="Raw diff">
778 778 <img class="icon" src="/images/icons/page_white.png">
779 779 </a>
780 780 <a href="/andersonsantos/rhodecode-dev-fork/diff/rhodecode/tests/functional/test_compare_local.py?diff1=682135c2e3958d7c84db06d716efe482bd3ce7c6&amp;diff=download&amp;diff2=4e5ee86997c64981d85cf62283af448624e26929" class="tooltip" title="Download diff">
781 781 <img class="icon" src="/images/icons/page_save.png">
782 782 </a>
783 783 <a class="tooltip" href="/andersonsantos/rhodecode-dev-fork/changeset/4e5ee86997c64981d85cf62283af448624e26929?c-4e5ee86997c6-7046e4320b26=WS%3A1&amp;c-4e5ee86997c6-7046e4320b26=C%3A3#c-4e5ee86997c6-7046e4320b26" title="Ignore white space"><img alt="Ignore white space" class="icon" src="/images/icons/text_strikethrough.png"></a>
784 784 <a class="tooltip" href="/andersonsantos/rhodecode-dev-fork/changeset/4e5ee86997c64981d85cf62283af448624e26929?c-4e5ee86997c6-7046e4320b26=C%3A6#c-4e5ee86997c6-7046e4320b26" title="increase diff context to 6 lines"><img alt="increase diff context to 6 lines" class="icon" src="/images/icons/table_add.png"></a>
785 785 </div>
786 786 <span>
787 787 <label>
788 788 Show inline comments
789 789 <input checked="checked" class="show-inline-comments" id="" id_for="c-4e5ee86997c6-7046e4320b26" name="" type="checkbox" value="1">
790 790 </label>
791 791 </span>
792 792 </div>
793 793 </div>
794 794 <div class="code-body">
795 795 <div class="full_f_path" path="rhodecode/tests/functional/test_compare_local.py"></div>
796 796 <table class="code-difftable">
797 797 <tbody><tr class="line context">
798 798 <td class="lineno old"><a href="#rhodecodetestsfunctionaltest_compare_localpy_o...">...</a></td>
799 799 <td class="lineno new"><a href="#rhodecodetestsfunctionaltest_compare_localpy_n...">...</a></td>
800 800 <td class="code ">
801 801 <pre>@@ -59,7 +59,7 @@
802 802 </pre>
803 803 </td>
804 804 </tr>
805 805 <tr class="line unmod">
806 806 <td id="rhodecodetestsfunctionaltest_compare_localpy_o59" class="lineno old"><a href="#rhodecodetestsfunctionaltest_compare_localpy_o59">59</a></td>
807 807 <td id="rhodecodetestsfunctionaltest_compare_localpy_n59" class="lineno new"><a href="#rhodecodetestsfunctionaltest_compare_localpy_n59">59</a></td>
808 808 <td class="code ">
809 809 <pre> 'tag': 'v0.2.0',
810 810 </pre>
811 811 </td>
812 812 </tr>
813 813 <tr class="line unmod">
814 814 <td id="rhodecodetestsfunctionaltest_compare_localpy_o60" class="lineno old"><a href="#rhodecodetestsfunctionaltest_compare_localpy_o60">60</a></td>
815 815 <td id="rhodecodetestsfunctionaltest_compare_localpy_n60" class="lineno new"><a href="#rhodecodetestsfunctionaltest_compare_localpy_n60">60</a></td>
816 816 <td class="code ">
817 817 <pre> 'branch': 'default',
818 818 </pre>
819 819 </td>
820 820 </tr>
821 821 <tr class="line unmod">
822 822 <td id="rhodecodetestsfunctionaltest_compare_localpy_o61" class="lineno old"><a href="#rhodecodetestsfunctionaltest_compare_localpy_o61">61</a></td>
823 823 <td id="rhodecodetestsfunctionaltest_compare_localpy_n61" class="lineno new"><a href="#rhodecodetestsfunctionaltest_compare_localpy_n61">61</a></td>
824 824 <td class="code ">
825 825 <pre> 'response': # Intentionally long line to show what will happen if this line does not fit onto the screen. It might have some horizontal scrolling applied or some other fancy mechanism to deal with it.
826 826 </pre>
827 827 </td>
828 828 </tr>
829 829 <tr class="line del">
830 830 <td id="rhodecodetestsfunctionaltest_compare_localpy_o62" class="lineno old"><a href="#rhodecodetestsfunctionaltest_compare_localpy_o62">62</a></td>
831 831 <td class="lineno new"><a href="#rhodecodetestsfunctionaltest_compare_localpy_n"></a></td>
832 832 <td class="code ">
833 833 <pre> '147 files changed: 5700 inserted, 10176 deleted'
834 834 </pre>
835 835 </td>
836 836 </tr>
837 837 <tr class="line add">
838 838 <td class="lineno old"><a href="#rhodecodetestsfunctionaltest_compare_localpy_o"></a></td>
839 839 <td id="rhodecodetestsfunctionaltest_compare_localpy_n62" class="lineno new"><a href="#rhodecodetestsfunctionaltest_compare_localpy_n62">62</a></td>
840 840 <td class="code ">
841 841 <pre><ins> </ins> '147 files changed: 5700 inserted, 10176 deleted'
842 842 </pre>
843 843 </td>
844 844 </tr>
845 845 <tr class="line unmod">
846 846 <td id="rhodecodetestsfunctionaltest_compare_localpy_o63" class="lineno old"><a href="#rhodecodetestsfunctionaltest_compare_localpy_o63">63</a></td>
847 847 <td id="rhodecodetestsfunctionaltest_compare_localpy_n63" class="lineno new"><a href="#rhodecodetestsfunctionaltest_compare_localpy_n63">63</a></td>
848 848 <td class="code ">
849 849 <pre> },
850 850 </pre>
851 851 </td>
852 852 </tr>
853 853 <tr class="line unmod">
854 854 <td id="rhodecodetestsfunctionaltest_compare_localpy_o64" class="lineno old"><a href="#rhodecodetestsfunctionaltest_compare_localpy_o64">64</a></td>
855 855 <td id="rhodecodetestsfunctionaltest_compare_localpy_n64" class="lineno new"><a href="#rhodecodetestsfunctionaltest_compare_localpy_n64">64</a></td>
856 856 <td class="code ">
857 857 <pre> 'git': {
858 858 </pre>
859 859 </td>
860 860 </tr>
861 861 <tr class="line unmod">
862 862 <td id="rhodecodetestsfunctionaltest_compare_localpy_o65" class="lineno old"><a href="#rhodecodetestsfunctionaltest_compare_localpy_o65">65</a></td>
863 863 <td id="rhodecodetestsfunctionaltest_compare_localpy_n65" class="lineno new"><a href="#rhodecodetestsfunctionaltest_compare_localpy_n65">65</a></td>
864 864 <td class="code ">
865 865 <pre> 'tag': 'v0.2.2',
866 866 </pre>
867 867 </td>
868 868 </tr>
869 869 <tr class="line context">
870 870 <td class="lineno old"><a href="#rhodecodetestsfunctionaltest_compare_localpy_o...">...</a></td>
871 871 <td class="lineno new"><a href="#rhodecodetestsfunctionaltest_compare_localpy_n...">...</a></td>
872 872 <td class="code ">
873 873 <pre>@@ -77,9 +77,11 @@
874 874 </pre>
875 875 </td>
876 876 </tr>
877 877 <tr class="line unmod">
878 878 <td id="rhodecodetestsfunctionaltest_compare_localpy_o77" class="lineno old"><a href="#rhodecodetestsfunctionaltest_compare_localpy_o77">77</a></td>
879 879 <td id="rhodecodetestsfunctionaltest_compare_localpy_n77" class="lineno new"><a href="#rhodecodetestsfunctionaltest_compare_localpy_n77">77</a></td>
880 880 <td class="code ">
881 881 <pre> target_ref=revisions[backend.alias]['tag'],
882 882 </pre>
883 883 </td>
884 884 </tr>
885 885 <tr class="line unmod">
886 886 <td id="rhodecodetestsfunctionaltest_compare_localpy_o78" class="lineno old"><a href="#rhodecodetestsfunctionaltest_compare_localpy_o78">78</a></td>
887 887 <td id="rhodecodetestsfunctionaltest_compare_localpy_n78" class="lineno new"><a href="#rhodecodetestsfunctionaltest_compare_localpy_n78">78</a></td>
888 888 <td class="code ">
889 889 <pre> ))
890 890 </pre>
891 891 </td>
892 892 </tr><tr id="comment-tr-3754" class="inline-comments"><td></td><td></td><td>
893 893
894 894 <div class="comment" id="comment-3754" line="n78">
895 895 <div class="comment-wrapp">
896 896 <div class="meta">
897 897 <span class="gravatar">
898 898 <img src="https://secure.gravatar.com/avatar/72706ebd30734451af9ff3fb59f05ff1?d=identicon&amp;s=40" height="20" width="20">
899 899 </span>
900 900 <span class="user">
901 901 anderson
902 902 </span>
903 903 <span class="date">
904 904 just now |
905 905 </span>
906 906 <span class="status-change">
907 907 Comment on commit
908 908 </span>
909 909 <a class="permalink" href="#comment-3754">ΒΆ</a>
910 910 </div>
911 911 <div class="text">
912 912 <div class="rst-block"><p>commented line
913 913 with multiple lines</p>
914 914 </div>
915 915 </div>
916 916 </div>
917 917 </div><div class="add-comment"><span class="btn btn-default">Add another comment</span></div>
918 918
919 919 </td></tr>
920 920 <tr class="line unmod">
921 921 <td id="rhodecodetestsfunctionaltest_compare_localpy_o79" class="lineno old"><a href="#rhodecodetestsfunctionaltest_compare_localpy_o79">79</a></td>
922 922 <td id="rhodecodetestsfunctionaltest_compare_localpy_n79" class="lineno new"><a href="#rhodecodetestsfunctionaltest_compare_localpy_n79">79</a></td>
923 923 <td class="code ">
924 924 <pre></pre>
925 925 </td>
926 926 </tr>
927 927 <tr class="line del form-open hl-comment">
928 928 <td id="rhodecodetestsfunctionaltest_compare_localpy_o80" class="lineno old"><a href="#rhodecodetestsfunctionaltest_compare_localpy_o80">80</a></td>
929 929 <td class="lineno new"><a href="#rhodecodetestsfunctionaltest_compare_localpy_n"></a></td>
930 930 <td class="code ">
931 931 <pre> response.mustcontain('%s@%s' % (<del>backend.repo_name,</del>
932 932 </pre>
933 933 </td>
934 934 </tr><tr id="comment-tr-undefined" class="comment-form-inline"><td></td><td></td><td>
935 935 <div class="comment-inline-form ac">
936 936 <div class="overlay"><div class="overlay-text">Submitting...</div></div>
937 937 <form action="#" class="inline-form" method="get">
938 938 <div id="edit-container_o80" class="clearfix">
939 939 <div class="comment-title pull-left">
940 940 Commenting on line o80.
941 941 </div>
942 942 <div class="comment-help pull-right">
943 943 Comments parsed using <a href="http://docutils.sourceforge.net/docs/user/rst/quickref.html">RST</a> syntax with <span class="tooltip" title="Use @username inside this text to send notification to this RhodeCode user">@mention</span> support.
944 944 </div>
945 945 <div style="clear: both"></div>
946 946 <textarea id="text_o80" name="text" class="comment-block-ta ac-input" autocomplete="off"></textarea>
947 947 </div>
948 948 <div id="preview-container_o80" class="clearfix" style="display: none;">
949 949 <div class="comment-help">
950 950 Comment preview
951 951 </div>
952 952 <div id="preview-box_o80" class="preview-box"></div>
953 953 </div>
954 954 <div class="comment-button pull-right">
955 955 <input type="hidden" name="f_path" value="rhodecode/tests/functional/test_compare_local.py">
956 956 <input type="hidden" name="line" value="o80">
957 957 <div id="preview-btn_o80" class="btn btn-default">Preview</div>
958 958 <div id="edit-btn_o80" class="btn" style="display: none;">Edit</div>
959 959 <input class="btn btn-success save-inline-form" id="save" name="save" type="submit" value="Comment">
960 960 </div>
961 961 <div class="comment-button hide-inline-form-button">
962 962 <input class="btn hide-inline-form" id="hide-inline-form" name="hide-inline-form" type="reset" value="Cancel">
963 963 </div>
964 964 </form>
965 965 </div>
966 966 </td></tr>
967 967 <tr class="line add">
968 968 <td class="lineno old"><a href="#rhodecodetestsfunctionaltest_compare_localpy_o"></a></td>
969 969 <td id="rhodecodetestsfunctionaltest_compare_localpy_n80" class="lineno new"><a href="#rhodecodetestsfunctionaltest_compare_localpy_n80">80</a></td>
970 970 <td class="code ">
971 971 <pre> response.mustcontain('%s@%s' % (
972 972 </pre>
973 973 </td>
974 974 </tr>
975 975 <tr class="line add">
976 976 <td class="lineno old"><a href="#rhodecodetestsfunctionaltest_compare_localpy_o"></a></td>
977 977 <td id="rhodecodetestsfunctionaltest_compare_localpy_n81" class="lineno new"><a href="#rhodecodetestsfunctionaltest_compare_localpy_n81">81</a></td>
978 978 <td class="code ">
979 979 <pre> backend.repo_name,
980 980 </pre>
981 981 </td>
982 982 </tr>
983 983 <tr class="line unmod">
984 984 <td id="rhodecodetestsfunctionaltest_compare_localpy_o81" class="lineno old"><a href="#rhodecodetestsfunctionaltest_compare_localpy_o81">81</a></td>
985 985 <td id="rhodecodetestsfunctionaltest_compare_localpy_n82" class="lineno new"><a href="#rhodecodetestsfunctionaltest_compare_localpy_n82">82</a></td>
986 986 <td class="code ">
987 987 <pre> revisions[backend.alias]['branch']))
988 988 </pre>
989 989 </td>
990 990 </tr>
991 991 <tr class="line del">
992 992 <td id="rhodecodetestsfunctionaltest_compare_localpy_o82" class="lineno old"><a href="#rhodecodetestsfunctionaltest_compare_localpy_o82">82</a></td>
993 993 <td class="lineno new"><a href="#rhodecodetestsfunctionaltest_compare_localpy_n"></a></td>
994 994 <td class="code ">
995 995 <pre> response.mustcontain('%s@%s' % (<del>backend.repo_name,</del>
996 996 </pre>
997 997 </td>
998 998 </tr>
999 999 <tr class="line add">
1000 1000 <td class="lineno old"><a href="#rhodecodetestsfunctionaltest_compare_localpy_o"></a></td>
1001 1001 <td id="rhodecodetestsfunctionaltest_compare_localpy_n83" class="lineno new"><a href="#rhodecodetestsfunctionaltest_compare_localpy_n83">83</a></td>
1002 1002 <td class="code ">
1003 1003 <pre> response.mustcontain('%s@%s' % (
1004 1004 </pre>
1005 1005 </td>
1006 1006 </tr>
1007 1007 <tr class="line add">
1008 1008 <td class="lineno old"><a href="#rhodecodetestsfunctionaltest_compare_localpy_o"></a></td>
1009 1009 <td id="rhodecodetestsfunctionaltest_compare_localpy_n84" class="lineno new"><a href="#rhodecodetestsfunctionaltest_compare_localpy_n84">84</a></td>
1010 1010 <td class="code ">
1011 1011 <pre> backend.repo_name,
1012 1012 </pre>
1013 1013 </td>
1014 1014 </tr>
1015 1015 <tr class="line unmod">
1016 1016 <td id="rhodecodetestsfunctionaltest_compare_localpy_o83" class="lineno old"><a href="#rhodecodetestsfunctionaltest_compare_localpy_o83">83</a></td>
1017 1017 <td id="rhodecodetestsfunctionaltest_compare_localpy_n85" class="lineno new"><a href="#rhodecodetestsfunctionaltest_compare_localpy_n85">85</a></td>
1018 1018 <td class="code ">
1019 1019 <pre> revisions[backend.alias]['tag']))
1020 1020 </pre>
1021 1021 </td>
1022 1022 </tr>
1023 1023 <tr class="line unmod">
1024 1024 <td id="rhodecodetestsfunctionaltest_compare_localpy_o84" class="lineno old"><a href="#rhodecodetestsfunctionaltest_compare_localpy_o84">84</a></td>
1025 1025 <td id="rhodecodetestsfunctionaltest_compare_localpy_n86" class="lineno new"><a href="#rhodecodetestsfunctionaltest_compare_localpy_n86">86</a></td>
1026 1026 <td class="code ">
1027 1027 <pre> response.mustcontain(revisions[backend.alias]['response'])
1028 1028 </pre>
1029 1029 </td>
1030 1030 </tr>
1031 1031 <tr class="line unmod">
1032 1032 <td id="rhodecodetestsfunctionaltest_compare_localpy_o85" class="lineno old"><a href="#rhodecodetestsfunctionaltest_compare_localpy_o85">85</a></td>
1033 1033 <td id="rhodecodetestsfunctionaltest_compare_localpy_n87" class="lineno new"><a href="#rhodecodetestsfunctionaltest_compare_localpy_n87">87</a></td>
1034 1034 <td class="code ">
1035 1035 <pre></pre>
1036 1036 </td>
1037 1037 </tr>
1038 1038 </tbody></table>
1039 1039 </div>
1040 1040 </div>
1041 1041 </div>
1042 1042
1043 1043
1044 1044
1045 1045 <!--
1046 1046 Side-by-side diff
1047 1047 -->
1048 1048
1049 1049 <h2>Side-by-side diff</h2>
1050 1050
1051 1051 <div class="box">
1052 1052 <div class="diff-container" style="overflow-x: hidden">
1053 1053 <div class="diffblock comm" style="margin:3px; padding:1px">
1054 1054 <div class="code-header">
1055 1055 <div class="changeset_header">
1056 1056 <div class="changeset_file">
1057 1057 <i class="icon-file"></i>
1058 1058 <a href="/pygments/files/ea295cfb622620f5ba13e226ec531e3fe5296399/tests/test_basic_api.py">tests/test_basic_api.py</a>
1059 1059 [mode: <span id="selected_mode">python</span>]
1060 1060 </div>
1061 1061 <div class="diff-actions">
1062 1062 <a href="/pygments/diff/tests/test_basic_api.py?diff2=ea295cfb622620f5ba13e226ec531e3fe5296399&amp;diff=diff&amp;diff1=de45f950b669e2d991c4ba512fa6fe450c6616db&amp;fulldiff=1" class="tooltip" title="Show full diff for this file">
1063 1063 <img class="icon" src="/images/icons/page_white_go.png">
1064 1064 </a>
1065 1065 <a href="/pygments/diff-2way/tests/test_basic_api.py?diff2=ea295cfb622620f5ba13e226ec531e3fe5296399&amp;diff=diff&amp;diff1=de45f950b669e2d991c4ba512fa6fe450c6616db&amp;fulldiff=1" class="tooltip" title="Show full side-by-side diff for this file" tt_title="Show full side-by-side diff for this file">
1066 1066 <img class="icon" src="/images/icons/application_double.png">
1067 1067 </a>
1068 1068 <a href="/pygments/diff/tests/test_basic_api.py?diff2=ea295cfb622620f5ba13e226ec531e3fe5296399&amp;diff1=de45f950b669e2d991c4ba512fa6fe450c6616db&amp;diff=raw" class="tooltip" title="Raw diff">
1069 1069 <img class="icon" src="/images/icons/page_white.png">
1070 1070 </a>
1071 1071 <a href="/pygments/diff/tests/test_basic_api.py?diff2=ea295cfb622620f5ba13e226ec531e3fe5296399&amp;diff1=de45f950b669e2d991c4ba512fa6fe450c6616db&amp;diff=download" class="tooltip" title="Download diff">
1072 1072 <img class="icon" src="/images/icons/page_save.png">
1073 1073 </a>
1074 1074 <label><input id="ignorews" name="ignorews" type="checkbox" value="1">ignore white space</label>
1075 1075 <label><input id="edit_mode" name="edit_mode" type="checkbox" value="1">turn on edit mode</label>
1076 1076
1077 1077 </div>
1078 1078 <div style="float: right; padding: 0px 10px 0px 0px">
1079 1079 r1538:de45f950b669 ... r1539:ea295cfb6226
1080 1080 </div>
1081 1081 </div>
1082 1082 </div>
1083 1083 <div id="compare"></div>
1084 1084 </div>
1085 1085 </div>
1086 1086
1087 1087 <script>
1088 1088 $(document).ready(function () {
1089 1089 var example_lines = '1\n2\n3\n4\n5\n6\n7\n8\n9\n \n';
1090 1090
1091 1091 $('#compare').mergely({
1092 1092 width: 'auto',
1093 1093 height: '600',
1094 1094 fgcolor: {a:'#ddffdd',c:'#cccccc',d:'#ffdddd'},
1095 1095 bgcolor: '#fff',
1096 1096 viewport: true,
1097 1097 cmsettings: {mode: 'text/plain', readOnly: true, lineWrapping: false, lineNumbers: true},
1098 1098 lhs: function(setValue) {
1099 1099 if("False" == "True"){
1100 1100 setValue('Binary file')
1101 1101 }
1102 1102 else if("MercurialCommit" == "EmptyCommit"){
1103 1103 setValue('');
1104 1104 }
1105 1105 else{
1106 1106 var left_value = example_lines.slice(0, 10) +
1107 1107 '123456789 '.repeat(10) +
1108 1108 '\n'+
1109 1109 example_lines.slice(10, 20);
1110 1110 setValue(left_value + example_lines.repeat(9));
1111 1111 }
1112 1112
1113 1113 },
1114 1114 rhs: function(setValue) {
1115 1115 if("False" == "True"){
1116 1116 setValue('Binary file')
1117 1117 }
1118 1118 else if("MercurialCommit" == "EmptyCommit"){
1119 1119 setValue('');
1120 1120 }
1121 1121 else{
1122 1122 var right_value = example_lines +
1123 1123 example_lines.slice(0, 8) +
1124 1124 'abcdefghi '.repeat(10) +
1125 1125 '\n'+
1126 1126 example_lines.slice(8, 20);
1127 1127 setValue(right_value + example_lines.repeat(9));
1128 1128 }
1129 1129 },
1130 1130 });
1131 1131
1132 1132 var detected_mode = detectCodeMirrorModeFromExt('test_basic_api.py', true);
1133 1133 if(detected_mode){
1134 1134 setCodeMirrorMode($('#compare').mergely('cm', 'lhs'), detected_mode);
1135 1135 setCodeMirrorMode($('#compare').mergely('cm', 'rhs'), detected_mode);
1136 1136 $('#selected_mode').html(detected_mode);
1137 1137 }
1138 1138
1139 1139 $('#ignorews').change(function(e){
1140 1140 var val = e.currentTarget.checked;
1141 1141 $('#compare').mergely('options', {ignorews: val});
1142 1142 $('#compare').mergely('update');
1143 })
1143 });
1144 1144 $('#edit_mode').change(function(e){
1145 1145 var val = !e.currentTarget.checked;
1146 1146 $('#compare').mergely('cm', 'lhs').setOption('readOnly', val);
1147 1147 $('#compare').mergely('cm', 'rhs').setOption('readOnly', val);
1148 1148 $('#compare').mergely('update');
1149 1149 })
1150 1150 });
1151 1151 </script>
1152 1152
1153 1153 </div>
1154 1154
1155 1155 <!-- end examples -->
1156 1156
1157 1157 </div>
1158 1158 </div>
1159 1159 </div>
1160 1160 </%def>
@@ -1,545 +1,545 b''
1 1 ## -*- coding: utf-8 -*-
2 2 <%inherit file="/debug_style/index.html"/>
3 3
4 4 <%def name="breadcrumbs_links()">
5 5 ${h.link_to(_('Style'), h.url('debug_style_home'))}
6 6 &raquo;
7 7 ${c.active}
8 8 </%def>
9 9
10 10
11 11 <%def name="real_main()">
12 12 <div class="box">
13 13 <div class="title">
14 14 ${self.breadcrumbs()}
15 15 </div>
16 16
17 17 <div class='sidebar-col-wrapper'>
18 18 ##main
19 19 ${self.sidebar()}
20 20
21 21 <div class="main-content">
22 22
23 23 <div style="opacity:.5">
24 24
25 25 <h2>Simple tables</h2>
26 26
27 27 <p>These styles will be adjusted later to provide a baseline style
28 28 for all tables without classes added, whether part of the
29 29 application or not. Currently, some of the
30 30 application-specific styles are applied to this table.</p>
31 31 <p>This is a baseline style for all tables, whether part of the
32 32 application or not. It has no class applied for styling. Use
33 33 the "rctable" class as outlined before for tables which are
34 34 part of the RhodeCode application.</p>
35 35 <table>
36 36 <tbody>
37 37 <tr>
38 38 <th>Header A</th>
39 39 <th>Header B</th>
40 40 <th>Header C</th>
41 41 <th>Header D</th>
42 42 </tr>
43 43 <tr>
44 44 <td>Content of col A</td>
45 45 <td>Content of col B</td>
46 46 <td>Content of col C</td>
47 47 <td>Content of col D</td>
48 48 </tr>
49 49 <tr>
50 50 <td>Content of col A</td>
51 51 <td>Content of col B</td>
52 52 <td>Content of col C</td>
53 53 <td>Content of col D</td>
54 54 </tr>
55 55 <tr>
56 56 <td>Content of col A</td>
57 57 <td>Content of col B</td>
58 58 <td>Content of col C</td>
59 59 <td>Content of col D</td>
60 60 </tr>
61 61 <tr>
62 62 <td>Content of col A</td>
63 63 <td>Content of col B</td>
64 64 <td>Content of col C</td>
65 65 <td>Content of col D</td>
66 66 </tr>
67 67 </tbody>
68 68 </table>
69 69 </div>
70 70
71 71
72 72
73 73
74 74 <h2>RC application table with examples</h2>
75 75
76 76 <p>This is a standard table which applies the rhodecode-specific styling to be used
77 77 throughout the application; it has <code>&lt;table class="rctable"&gt;</code>.
78 78 <br/>
79 79 By default, table data is not truncated, and wraps inside of the <code>&lt;td&gt
80 80 ;</code>. To prevent wrapping and contain data on one line, use the <code>&lt;
81 81 class="truncate-wrap"&gt;</code> on the <code>&lt;td&gt;</code>, and <code>span
82 82 class="truncate"</code> around the specific data to be truncated.
83 83 </p>
84 84 <p>
85 85 Ellipsis is added via CSS. Please always add a row of headers using <code>&lt;th
86 86 &gt;</code> to the top of a table.
87 87 </p>
88 88
89 89 ## TODO: johbo: in case we have more tables with examples, we should
90 90 ## create a generic class here.
91 91 <table class="rctable issuetracker">
92 92 <thead>
93 93 <tr>
94 94 <th>Header A</th>
95 95 <th>Header B</th>
96 96 <th>Header C</th>
97 97 <th>Header D</th>
98 98 </tr>
99 99 </thead>
100 100 <tbody>
101 101 <tr>
102 102 <td class="issue-tracker-example">
103 103 Example of col A
104 104 </td>
105 105 <td class="issue-tracker-example">
106 106 Example of col B
107 107 </td>
108 108 <td class="issue-tracker-example">
109 109 Example of col C
110 110 </td>
111 111 <td class="issue-tracker-example">
112 112 Example of col D
113 113 </td>
114 114 </tr>
115 115 <tr>
116 116 <td>Content of col A</td>
117 117 <td>Content of col B</td>
118 118 <td>Content of col C which is very long and will not be
119 119 truncated because sometimes people just want to write
120 120 really, really long commit messages which explain what
121 121 they did in excruciating detail and you really, really
122 122 want to read them.</td>
123 123 <td>Content of col D</td>
124 124 </tr>
125 125 <tr>
126 126 <td>Content of col A</td>
127 127 <td>Content of col B</td>
128 128 <td>Content of col C</td>
129 129 <td class="truncate-wrap"><span class="truncate">Truncated
130 130 content of column D truncate truncate truncatetruncate
131 131 truncate truncate</span></td>
132 132 </tr>
133 133 </tbody>
134 134 </table>
135 135
136 136 <h2>RC application table data classes</h2>
137 137
138 138 <p>The following tables contain documentation of all existing table data classes.
139 139 Please update when new classes are made.
140 140 </p>
141 141 <table class="rctable examples">
142 142 <thead>
143 143 <tr>
144 144 <th>Class</th>
145 145 <th>Description</th>
146 146 <th>Example</th>
147 147 </tr>
148 148 </thead>
149 149 <tbody>
150 150 <td>td-user</td>
151 151 <td>Any username/gravatar combination (see also Icons style).</td>
152 152 <td class="td-user author">
153 153 <img class="gravatar" alt="gravatar" src="https://secure.gravatar.com/avatar/0c9a7e6674b6f0b35d98dbe073e3f0ab?d=identicon&amp;s=32" height="16" width="16">
154 154 <span title="Oliver Strobel <oliver@rhodecode.com>" class="user">ostrobel (Oliver Strobel)</span>
155 155 </td>
156 156 </tr>
157 157 <tr>
158 158 <td>td-hash</td>
159 159 <td>Any hash; a commit, revision, etc. Use <code>&lt;pre&gt;</code> and header 'Commit'</td>
160 160 <td class="td-commit">
161 161 <pre><a href="/anothercpythonforkkkk/files/8d6b27837c6979983b037693fe975cdbb761b500/">r93699:8d6b27837c69</a></pre>
162 162 </td>
163 163 </tr>
164 164 <tr>
165 165 <td>td-rss</td>
166 166 <td>RSS feed link icon</td>
167 167 <td class="td-rss">
168 168 <a title="Subscribe to rss feed" href="/feed/rss"><i class="icon-rss-sign"></i></a>
169 169 </td>
170 170 </tr>
171 171 <tr>
172 172 <td>td-componentname</td>
173 173 <td>Any group, file, gist, or directory name.</td>
174 174 <td class="td-componentname">
175 175 <a href="/cpythonfork">
176 176 <span title="Mercurial repository"><i class="icon-hg"></i></span>
177 177 <i class="icon-unlock-alt" title="Public repository"></i>
178 178 rhodecode-dev-restyle-fork
179 179 </a>
180 180 </td>
181 181 </tr>
182 182 <tr>
183 183 <td>td-tags</td>
184 184 <td>Any cell containing tags, including branches and bookmarks.</td>
185 185 <td class="td-tags">
186 186 <span class="branchtag tag" title="Branch default">
187 187 <a href="/rhodecode-dev-restyle- fork/changelog?branch=default"><i class="icon-code-fork"></i>default</a>
188 188 </span>
189 189 </td>
190 190 </tr>
191 191 <tr>
192 192 <td>tags-truncate</td>
193 193 <td>Used to truncate a cell containing tags; avoid if possible.</td>
194 194 <td class="td-tags truncate-wrap">
195 195 <div class="truncate tags-truncate">
196 196 <div class="autoexpand">
197 197 <span class="tagtag tag" title="Tag tip">
198 198 <a href="/rhodecode-dev-restyle-fork/files/e519d5a0e71466d27257ddff921c4a13c540408e/"><i class="icon-tag"></i>tip</a>
199 199 </span>
200 200 <span class="branchtag tag" title="Branch default">
201 201 <a href="/rhodecode-dev-restyle-fork/changelog?branch=default"><i class="icon-code-fork"></i>default</a>
202 202 </span>
203 203 <span class="branchtag tag" title="Branch default">
204 204 <a href="/rhodecode-dev-restyle-fork/changelog?branch=default"><i class="icon-code-fork"></i>default</a>
205 205 </span>
206 206 </div>
207 207 </div>
208 208 </td>
209 209 </tr>
210 210 <tr>
211 211 <td>td-ip</td>
212 212 <td>Any ip address.</td>
213 213 <td class="td-ip">
214 214 172.16.115.168
215 215 </td>
216 216 </tr>
217 217 <tr>
218 218 <td>td-type</td>
219 219 <td>A state or an auth type.</td>
220 220 <td class="td-type">
221 221 rhodecode
222 222 </td>
223 223 </tr>
224 224 <tr>
225 225 <td>td-authtoken</td>
226 226 <td>For auth tokens. Use truncate classes for hover expand; see html.</td>
227 227 <td class="truncate-wrap td-authtoken">
228 228 <div class="truncate autoexpand">
229 229 <code>688df65b87d3ad16ae9f8fc6338a551d40f41c7a</code>
230 230 </div>
231 231 </td>
232 232 </tr>
233 233 <tr>
234 234 <td>td-action</td>
235 235 <td>Buttons which perform an action.</td>
236 236 <td class="td-action">
237 237 <div class="grid_edit">
238 238 <a href="/_admin/users/2/edit" title="edit">
239 239 <i class="icon-pencil"></i>Edit</a>
240 240 </div>
241 241 <div class="grid_delete">
242 242 <form action="/_admin/users/2" method="post">
243 243 <i class="icon-remove-sign"></i>
244 244 <input class="btn btn-danger btn-link" id="remove_user_2" name="remove_" type="submit" value="delete">
245 245 </form>
246 246 </div>
247 247 </td>
248 248 </tr>
249 249 <tr>
250 250 <td>td-radio</td>
251 251 <td>Radio buttons for a form. Centers element.</td>
252 252 <td class="td-radio">
253 253 <input type="radio" checked="checked" value="" name="1" id="read"></td>
254 254 </tr>
255 255 <tr>
256 256 <td>td-checkbox</td>
257 257 <td>Checkbox for a form. Centers element.</td>
258 258 <td class="td-checkbox">
259 259 <input type="checkbox" checked="checked" value="" name="1" id="read"></td>
260 260 </tr>
261 261 <tr>
262 262 <tr>
263 263 <td>td-buttons</td>
264 264 <td>Buttons.</td>
265 265 <td class="td-buttons">
266 266 <span class="btn btn-mini btn-primary">feed access</span>
267 267 </td>
268 268 </tr>
269 269 <tr>
270 270 <td>td-compare</td>
271 271 <td>Radio buttons to compare commits.</td>
272 272 <td class=" td-compare">
273 273 <input class="compare-radio-button" type="radio" name="compare_source" value="2.0">
274 274 <input class="compare-radio-button" type="radio" name="compare_target" value="2.0">
275 275 </td>
276 276 </tr>
277 277 <tr>
278 278 <td>td-comments</td>
279 279 <td>Comments indicator icon.</td>
280 280 <td>
281 281 <i class="icon-comment"></i> 0
282 282 </td>
283 283 </tr>
284 284 <tr>
285 285 <td>td-status</td>
286 286 <td>Status indicator icon.</td>
287 287 <td class="td-description">
288 288 <div class="flag_status under_review pull-left"></div>
289 289 </td>
290 290 </tr>
291 291 </tbody>
292 292 </table>
293 293 <table class="dataTable rctable examples">
294 294 <tbody>
295 295 <tr>
296 296 <td>quick_repo_menu</td>
297 297 <td>Hidden menu generated by dataTable.</td>
298 298 <td class="quick_repo_menu">
299 299 <i class="pointer icon-more"></i>
300 300 <div class="menu_items_container" style="display: none;">
301 301 <ul class="menu_items">
302 302 <li>
303 303 <a title="Summary" href="/anothercpythonforkkkk-fork">
304 304 <span>Summary</span>
305 305 </a>
306 306 </li>
307 307 <li>
308 308 <a title="Changelog" href="/anothercpythonforkkkk-fork/changelog">
309 309 <span>Changelog</span>
310 310 </a>
311 311 </li>
312 312 <li>
313 313 <a title="Files" href="/anothercpythonforkkkk-fork/files/tip/">
314 314 <span>Files</span>
315 315 </a>
316 316 </li>
317 317 <li>
318 318 <a title="Fork" href="/anothercpythonforkkkk-fork/fork">
319 319 <span>Fork</span>
320 320 </a>
321 321 </li>
322 322 </ul>
323 323 </div>
324 324 </td>
325 325 <td></td>
326 326 </tr>
327 327 </tbody>
328 328 </table>
329 329 <script>quick_repo_menu();</script>
330 330 <table class="rctable examples">
331 331 <tbody>
332 332 <tr>
333 333 <td>td-description</td>
334 334 <td>Any description. They may be rather long, and using the expand_commit outlined below is recommended.</td>
335 335 <td class="td-description">
336 336 Ultrices mattis! Enim pellentesque lacus, sit magna natoque risus turpis ut, auctor ultrices facilisis dapibus odio? Parturient! Porta egestas nascetur, quis, elementum dolor, in magna ac dis sit etiam turpis, scelerisque! Integer tristique aliquam.
337 337 </td>
338 338 </tr>
339 339 </tbody>
340 340 </table>
341 341 <table id="changesets" class="rctable examples end">
342 342 <tbody>
343 343 <tr>
344 344 <td>expand_commit</td>
345 345 <td>Expands a long message; see html+js.</td>
346 346 <td class="expand_commit" data-commit-id="2ffc6faabc7a9c790b1b452943a3f0c047b8b436" title="Expand commit message">
347 347 <div class="show_more_col">
348 348 <i class="show_more"></i>
349 349 </div>
350 350 </td>
351 351 <td class="mid td-description">
352 352 <div class="log-container truncate-wrap">
353 353 <div id="c-2ffc6faabc7a9c790b1b452943a3f0c047b8b436" class="message truncate" data-message-raw="tests: Test echo method on the server object
354 354
355 355 This only works for Pyro4 so far, have to extend it still for HTTP to work.">tests: Test echo method on the server object
356 356
357 357 This only works for Pyro4 so far, have to extend it still for HTTP to work.</div>
358 358 </div>
359 359 </td>
360 360 </tr>
361 361 </tbody>
362 362 </table>
363 363 <script type="text/javascript">
364 var cache = {}
364 var cache = {};
365 365 $('.expand_commit').on('click',function(e){
366 366 var target_expand = $(this);
367 367 var cid = target_expand.data('commitId');
368 368
369 369 if (target_expand.hasClass('open')){
370 370 $('#c-'+cid).css({'height': '1.5em', 'white-space': 'nowrap', 'text-overflow': 'ellipsis', 'overflow':'hidden'});
371 371 $('#t-'+cid).css({'height': '1.5em', 'max-height': '1.5em', 'text-overflow': 'ellipsis', 'overflow':'hidden', 'white-space':'nowrap'});
372 372 target_expand.removeClass('open');
373 373 }
374 374 else {
375 375 $('#c-'+cid).css({'height': 'auto', 'white-space': 'pre-line', 'text-overflow': 'initial', 'overflow':'visible'});
376 376 $('#t-'+cid).css({'height': 'auto', 'max-height': 'none', 'text-overflow': 'initial', 'overflow':'visible', 'white-space':'normal'});
377 377 target_expand.addClass('open');
378 378 }
379 379 });
380 380
381 381 </script>
382 382 <p>The following classes currently do not have unique styles applied.</p>
383 383 <table class="rctable examples end">
384 384 <tbody>
385 385 <tr>
386 386 <td>td-regex</td>
387 387 <td>Regex patterns</td>
388 388 <td class="td-regex">(?:#)(?P<issue_id>\d+)</td>
389 389 </tr>
390 390 <tr>
391 391 <td>td-url</td>
392 392 <td>Any URL.</td>
393 393 <td class="td-url">https://rhodecode.com</td>
394 394 </tr>
395 395 <tr>
396 396 <td>td-journalaction</td>
397 397 <td>Action listed in a journal</td>
398 398 <td class="td-journalaction">started following repository supervisor-fork-4</td>
399 399 </tr>
400 400 <tr>
401 401 <td>td-iprange</td>
402 402 <td>Any ip address.</td>
403 403 <td class="td-ip">127.0.0.1-127.0.0.10</td>
404 404 </tr>
405 405 <tr>
406 406 <td>td-exp</td>
407 407 <td>Expiration time.</td>
408 408 <td class="td-exp">never</td>
409 409 </tr>
410 410 <tr>
411 411 <td>td-prefix</td>
412 412 <td>Prefixes outlined in settings.</td>
413 413 <td class="td-prefix">ubuntu-92539</td>
414 414 </tr>
415 415 <tr>
416 416 <td>td-cachekey</td>
417 417 <td>Cache key value.</td>
418 418 <td class="td-cachekey">ubuntu-92539supervisor</td>
419 419 </tr>
420 420 <tr>
421 421 <td>td-email</td>
422 422 <td>Any email address.</td>
423 423 <td class="td-email">example@rhodecode.com</td>
424 424 </tr>
425 425 <tr>
426 426 <td>td-active</td>
427 427 <td>Shows active state with icon-true/icon-false.</td>
428 428 <td class="td-active"><i class="icon-false"></i></td>
429 429 </tr>
430 430 <tr>
431 431 <td>td-size</td>
432 432 <td>File, repo, or directory size.</td>
433 433 <td class="td-size">89 MB</td>
434 434 </tr>
435 435 <tr>
436 436 <td>td-number</td>
437 437 <td>Any numerical data.</td>
438 438 <td class="td-number">42</td>
439 439 </tr>
440 440 <tr>
441 441 <td>td-message</td>
442 442 <td>Any commit message. Often treated with the truncate class used for descriptions as well.</td>
443 443 <td class="td-message">Updated the files</td>
444 444 </tr>
445 445 </tbody>
446 446 </table>
447 447
448 448
449 449 <h2>Permissions table</h2>
450 450
451 451 <p>
452 452 This is a special-case table; it has
453 453 <code>table class="rctable permissions"</code>
454 454 where "rctable" applies the rhodecode styling as above, and
455 455 "permissions" adds an extra layer of customization specific to
456 456 permissions tables. Other special-case tables may exist or be
457 457 created if necessary.
458 458 </p>
459 459
460 460 <table class="rctable permissions">
461 461 <tr>
462 462 <th class="td-radio">none</th>
463 463 <th class="td-radio">read</th>
464 464 <th class="td-radio">write</th>
465 465 <th class="td-radio">admin</th>
466 466 <th>user/user group</th>
467 467 <th></th>
468 468 </tr>
469 469 <tr class="perm_admin_row">
470 470 <td class="td-radio"><input type="radio" value="repository.none"
471 471 name="admin_perm_2" id="admin_perm_2_repositorynone"
472 472 disabled="disabled"></td>
473 473 <td class="td-radio"><input type="radio" value="repository.read"
474 474 name="admin_perm_2" id="admin_perm_2_repositoryread"
475 475 disabled="disabled"></td>
476 476 <td class="td-radio"><input type="radio" value="repository.write"
477 477 name="admin_perm_2" id="admin_perm_2_repositorywrite"
478 478 disabled="disabled"></td>
479 479 <td class="td-radio"><input type="radio" value="repository.admin"
480 480 name="admin_perm_2" id="admin_perm_2_repositoryadmin"
481 481 disabled="disabled" checked="checked"></td>
482 482 <td>
483 483 <img class="gravatar" src="https://secure.gravatar.com/avatar/be9d18f611892a738e54f2a3a171e2f9?d=identicon&amp;s=32" height="16" width="16">
484 484 <span class="user">dev (super admin) (owner)</span>
485 485 </td>
486 486 <td></td>
487 487 </tr>
488 488 <tr>
489 489 <td colspan="4">
490 490 <span class="private_repo_msg">
491 491 private repository
492 492 </span>
493 493 </td>
494 494 <td class="private_repo_msg">
495 495 <i class="icon-user"></i>
496 496 default - only people explicitly added here will have access</td>
497 497 <td></td>
498 498 </tr>
499 499 <tr>
500 500 <td class="td-radio"><input type="radio" value="repository.none"
501 501 name="u_perm_1" id="u_perm_1_repositorynone"></td>
502 502 <td class="td-radio"><input type="radio" checked="checked"
503 503 value="repository.read" name="u_perm_1"
504 504 id="u_perm_1_repositoryread"></td>
505 505 <td class="td-radio"><input type="radio" value="repository.write"
506 506 name="u_perm_1" id="u_perm_1_repositorywrite"></td>
507 507 <td class="td-radio"><input type="radio" value="repository.admin"
508 508 name="u_perm_1" id="u_perm_1_repositoryadmin"></td>
509 509 <td>
510 510 <img class="gravatar" src="/_static/rhodecode/images/user30.png" height="16" width="16">
511 511 <span class="user">default</span>
512 512 </td>
513 513 <td></td>
514 514 </tr>
515 515 <tr>
516 516 <td class="td-radio"><input type="radio" value="repository.none"
517 517 name="u_perm_2" id="u_perm_2_repositorynone"></td>
518 518 <td class="td-radio"><input type="radio" checked="checked"
519 519 value="repository.read" name="u_perm_2"
520 520 id="u_perm_2_repositoryread"></td>
521 521 <td class="td-radio"><input type="radio" value="repository.write"
522 522 name="u_perm_2" id="u_perm_2_repositorywrite"></td>
523 523 <td class="td-radio"><input type="radio" value="repository.admin"
524 524 name="u_perm_2" id="u_perm_2_repositoryadmin"></td>
525 525 <td>
526 526 <img class="gravatar" src="https://secure.gravatar.com/avatar/be9d18f611892a738e54f2a3a171e2f9?d=identicon&amp;s=32" height="16" width="16">
527 527 <a class="user" href="/_admin/users/2/edit">dev</a>
528 528 </td>
529 529 <td>
530 530 <span member_type="user" member="2"
531 531 class="btn action_button btn-link btn-danger">revoke</span>
532 532 </td>
533 533 </tr>
534 534 </tbody>
535 535 </table>
536 536 <div class="link" id="add_perm">
537 537 Add new
538 538 </div>
539 539
540 540
541 541
542 542 </div>
543 543 </div>
544 544 </div>
545 545 </%def>
@@ -1,21 +1,21 b''
1 1 ## -*- coding: utf-8 -*-
2 2 <%inherit file="base.mako"/>
3 3
4 4 <%def name="subject()" filter="n,trim">
5 5 </%def>
6 6
7 7
8 8 ## plain text version of the email. Empty by default
9 9 <%def name="body_plaintext()" filter="n,trim">
10 10 ${body}
11 11
12 12 ${self.plaintext_footer()}
13 13 </%def>
14 14
15 15 ## BODY GOES BELOW
16 16 <table style="text-align:left;vertical-align:top;">
17 17 <tr><td style="padding-right:20px;padding-top:15px;white-space:pre-wrap">${body}</td></tr>
18 </table
18 </table>
19 19 <p><a style="margin-top:15px;margin-left:1%;font-family:sans-serif;font-weight:100;font-size:11px;display:block;color:#666666;text-decoration:none;" href="${instance_url}">
20 20 ${self.plaintext_footer()}
21 21 </a></p> No newline at end of file
@@ -1,27 +1,27 b''
1 1 ## -*- coding: utf-8 -*-
2 2 <%inherit file="base.mako"/>
3 3
4 4 <%def name="subject()" filter="n,trim">
5 5 RhodeCode new user registration: ${user.username}
6 6 </%def>
7 7
8 8 <%def name="body_plaintext()" filter="n,trim">
9 9
10 10 A new user `${user.username}` has registered on ${h.format_date(date)}
11 11
12 12 - Username: ${user.username}
13 13 - Full Name: ${user.firstname} ${user.lastname}
14 14 - Email: ${user.email}
15 15 - Profile link: ${h.url('user_profile', username=user.username, qualified=True)}
16 16
17 17 ${self.plaintext_footer()}
18 18 </%def>
19 19
20 20 ## BODY GOES BELOW
21 21 <table style="text-align:left;vertical-align:middle;">
22 <tr><td colspan="2" style="width:100%;padding-bottom:15px;border-bottom:1px solid #dbd9da;"><h4><a href="${h.url('user_profile', username=user.username, qualified=True)}" style="color:#427cc9;text-decoration:none;cursor:pointer">${_('New user %(user)s has registered on %(date)s') % {'user': user.username, 'date': h.format_date(date)}}</h4></td></tr>
22 <tr><td colspan="2" style="width:100%;padding-bottom:15px;border-bottom:1px solid #dbd9da;"><h4><a href="${h.url('user_profile', username=user.username, qualified=True)}" style="color:#427cc9;text-decoration:none;cursor:pointer">${_('New user %(user)s has registered on %(date)s') % {'user': user.username, 'date': h.format_date(date)}}</a></h4></td></tr>
23 23 <tr><td style="padding-right:20px;padding-top:20px;">${_('Username')}</td><td style="line-height:1;padding-top:20px;"><img style="margin-bottom:-5px;text-align:left;border:1px solid #dbd9da" src="${h.gravatar_url(user.email, 16)}" height="16" width="16">&nbsp;${user.username}</td></tr>
24 24 <tr><td style="padding-right:20px;">${_('Full Name')}</td><td>${user.firstname} ${user.lastname}</td></tr>
25 25 <tr><td style="padding-right:20px;">${_('Email')}</td><td>${user.email}</td></tr>
26 26 <tr><td style="padding-right:20px;">${_('Profile')}</td><td><a href="${h.url('user_profile', username=user.username, qualified=True)}">${h.url('user_profile', username=user.username, qualified=True)}</a></td></tr>
27 27 </table> No newline at end of file
@@ -1,90 +1,90 b''
1 1 ## -*- coding: utf-8 -*-
2 2 <%inherit file="base/root.mako"/>
3 3
4 4 <%def name="title()">
5 5 ${_('Reset Password')}
6 6 %if c.rhodecode_name:
7 7 &middot; ${h.branding(c.rhodecode_name)}
8 8 %endif
9 9 </%def>
10 10 <style>body{background-color:#eeeeee;}</style>
11 11
12 12 <div class="loginbox">
13 13 <div class="header">
14 14 <div id="header-inner" class="title">
15 15 <div id="logo">
16 16 <div class="logo-wrapper">
17 17 <a href="${h.url('home')}"><img src="${h.asset('images/rhodecode-logo-white-216x60.png')}" alt="RhodeCode"/></a>
18 18 </div>
19 19 %if c.rhodecode_name:
20 20 <div class="branding"> ${h.branding(c.rhodecode_name)}</div>
21 21 %endif
22 22 </div>
23 23 </div>
24 24 </div>
25 25
26 26 <div class="loginwrapper">
27 27 <div class="left-column">
28 28 <img class="sign-in-image" src="${h.asset('images/sign-in.png')}" alt="RhodeCode"/>
29 29 </div>
30 30
31 31 %if h.HasPermissionAny('hg.password_reset.disabled')():
32 32 <div class="right-column">
33 33 <p>
34 34 ${_('Password reset is disabled. Please contact ')}
35 35 % if c.visual.rhodecode_support_url:
36 36 <a href="${c.visual.rhodecode_support_url}" target="_blank">${_('Support')}</a>
37 37 ${_('or')}
38 38 % endif
39 39 ${_('an administrator if you need help.')}
40 40 </p>
41 41 </div>
42 42 %else:
43 43 <div id="register" class="right-column">
44 44 <!-- login -->
45 45 <div class="sign-in-title">
46 46 <h1>${_('Reset your Password')}</h1>
47 47 <h4>${h.link_to(_("Go to the login page to sign in."), request.route_path('login'))}</h4>
48 48 </div>
49 49 <div class="inner form">
50 50 ${h.form(request.route_path('reset_password'), needs_csrf_token=False)}
51 51 <label for="email">${_('Email Address')}:</label>
52 52 ${h.text('email', defaults.get('email'))}
53 53 %if 'email' in errors:
54 54 <span class="error-message">${errors.get('email')}</span>
55 55 <br />
56 56 %endif
57 57
58 58 %if captcha_active:
59 <div class="login-captcha"
59 <div class="login-captcha">
60 60 <label for="email">${_('Captcha')}:</label>
61 61 ${h.hidden('recaptcha_field')}
62 62 <div id="recaptcha"></div>
63 63 %if 'recaptcha_field' in errors:
64 64 <span class="error-message">${errors.get('recaptcha_field')}</span>
65 65 <br />
66 66 %endif
67 67 </div>
68 68 %endif
69 69
70 70 ${h.submit('send', _('Send password reset email'), class_="btn sign-in")}
71 71 <div class="activation_msg">${_('Password reset link will be sent to matching email address')}</div>
72 72
73 73 ${h.end_form()}
74 74 </div>
75 75 </div>
76 76 %endif
77 77 </div>
78 78 </div>
79 79
80 80 %if captcha_active:
81 81 <script type="text/javascript" src="https://www.google.com/recaptcha/api/js/recaptcha_ajax.js"></script>
82 82 %endif
83 83 <script type="text/javascript">
84 84 $(document).ready(function(){
85 85 $('#email').focus();
86 86 %if captcha_active:
87 87 Recaptcha.create("${captcha_public_key}", "recaptcha", {theme: "white"});
88 88 %endif
89 89 });
90 90 </script>
@@ -1,637 +1,638 b''
1 1 <%inherit file="/base/base.mako"/>
2 2
3 3 <%def name="title()">
4 4 ${_('%s Pull Request #%s') % (c.repo_name, c.pull_request.pull_request_id)}
5 5 %if c.rhodecode_name:
6 6 &middot; ${h.branding(c.rhodecode_name)}
7 7 %endif
8 8 </%def>
9 9
10 10 <%def name="breadcrumbs_links()">
11 11 <span id="pr-title">
12 12 ${c.pull_request.title}
13 13 %if c.pull_request.is_closed():
14 14 (${_('Closed')})
15 15 %endif
16 16 </span>
17 17 <div id="pr-title-edit" class="input" style="display: none;">
18 18 ${h.text('pullrequest_title', id_="pr-title-input", class_="large", value=c.pull_request.title)}
19 19 </div>
20 20 </%def>
21 21
22 22 <%def name="menu_bar_nav()">
23 23 ${self.menu_items(active='repositories')}
24 24 </%def>
25 25
26 26 <%def name="menu_bar_subnav()">
27 27 ${self.repo_menu(active='showpullrequest')}
28 28 </%def>
29 29
30 30 <%def name="main()">
31
31 32 <script type="text/javascript">
32 33 // TODO: marcink switch this to pyroutes
33 34 AJAX_COMMENT_DELETE_URL = "${url('pullrequest_comment_delete',repo_name=c.repo_name,comment_id='__COMMENT_ID__')}";
34 35 templateContext.pull_request_data.pull_request_id = ${c.pull_request.pull_request_id};
35 36 </script>
36 37 <div class="box">
37 38 <div class="title">
38 39 ${self.repo_page_title(c.rhodecode_db_repo)}
39 40 </div>
40 41
41 42 ${self.breadcrumbs()}
42 43
43
44 44 <div class="box pr-summary">
45 45 <div class="summary-details block-left">
46 <%summary = lambda n:{False:'summary-short'}.get(n)%>
46 <% summary = lambda n:{False:'summary-short'}.get(n) %>
47 47 <div class="pr-details-title">
48 48 <a href="${h.url('pull_requests_global', pull_request_id=c.pull_request.pull_request_id)}">${_('Pull request #%s') % c.pull_request.pull_request_id}</a> ${_('From')} ${h.format_date(c.pull_request.created_on)}
49 49 %if c.allowed_to_update:
50 50 <div id="delete_pullrequest" class="pull-right action_button ${'' if c.allowed_to_delete else 'disabled' }" style="clear:inherit;padding: 0">
51 51 % if c.allowed_to_delete:
52 52 ${h.secure_form(url('pullrequest_delete', repo_name=c.pull_request.target_repo.repo_name, pull_request_id=c.pull_request.pull_request_id),method='delete')}
53 53 ${h.submit('remove_%s' % c.pull_request.pull_request_id, _('Delete'),
54 54 class_="btn btn-link btn-danger",onclick="return confirm('"+_('Confirm to delete this pull request')+"');")}
55 55 ${h.end_form()}
56 56 % else:
57 57 ${_('Delete')}
58 58 % endif
59 59 </div>
60 60 <div id="open_edit_pullrequest" class="pull-right action_button">${_('Edit')}</div>
61 61 <div id="close_edit_pullrequest" class="pull-right action_button" style="display: none;padding: 0">${_('Cancel')}</div>
62 62 %endif
63 63 </div>
64 64
65 65 <div id="summary" class="fields pr-details-content">
66 66 <div class="field">
67 67 <div class="label-summary">
68 68 <label>${_('Origin')}:</label>
69 69 </div>
70 70 <div class="input">
71 71 <div class="pr-origininfo">
72 72 ## branch link is only valid if it is a branch
73 73 <span class="tag">
74 74 %if c.pull_request.source_ref_parts.type == 'branch':
75 75 <a href="${h.url('changelog_home', repo_name=c.pull_request.source_repo.repo_name, branch=c.pull_request.source_ref_parts.name)}">${c.pull_request.source_ref_parts.type}: ${c.pull_request.source_ref_parts.name}</a>
76 76 %else:
77 77 ${c.pull_request.source_ref_parts.type}: ${c.pull_request.source_ref_parts.name}
78 78 %endif
79 79 </span>
80 80 <span class="clone-url">
81 81 <a href="${h.url('summary_home', repo_name=c.pull_request.source_repo.repo_name)}">${c.pull_request.source_repo.clone_url()}</a>
82 82 </span>
83 83 </div>
84 84 <div class="pr-pullinfo">
85 85 %if h.is_hg(c.pull_request.source_repo):
86 86 <input type="text" value="hg pull -r ${h.short_id(c.source_ref)} ${c.pull_request.source_repo.clone_url()}" readonly="readonly">
87 87 %elif h.is_git(c.pull_request.source_repo):
88 88 <input type="text" value="git pull ${c.pull_request.source_repo.clone_url()} ${c.pull_request.source_ref_parts.name}" readonly="readonly">
89 89 %endif
90 90 </div>
91 91 </div>
92 92 </div>
93 93 <div class="field">
94 94 <div class="label-summary">
95 95 <label>${_('Target')}:</label>
96 96 </div>
97 97 <div class="input">
98 98 <div class="pr-targetinfo">
99 99 ## branch link is only valid if it is a branch
100 100 <span class="tag">
101 101 %if c.pull_request.target_ref_parts.type == 'branch':
102 102 <a href="${h.url('changelog_home', repo_name=c.pull_request.target_repo.repo_name, branch=c.pull_request.target_ref_parts.name)}">${c.pull_request.target_ref_parts.type}: ${c.pull_request.target_ref_parts.name}</a>
103 103 %else:
104 104 ${c.pull_request.target_ref_parts.type}: ${c.pull_request.target_ref_parts.name}
105 105 %endif
106 106 </span>
107 107 <span class="clone-url">
108 108 <a href="${h.url('summary_home', repo_name=c.pull_request.target_repo.repo_name)}">${c.pull_request.target_repo.clone_url()}</a>
109 109 </span>
110 110 </div>
111 111 </div>
112 112 </div>
113 113
114 114 ## Link to the shadow repository.
115 115 <div class="field">
116 116 <div class="label-summary">
117 117 <label>${_('Merge')}:</label>
118 118 </div>
119 119 <div class="input">
120 120 % if not c.pull_request.is_closed() and c.pull_request.shadow_merge_ref:
121 121 <div class="pr-mergeinfo">
122 122 %if h.is_hg(c.pull_request.target_repo):
123 123 <input type="text" value="hg clone -u ${c.pull_request.shadow_merge_ref.name} ${c.shadow_clone_url} pull-request-${c.pull_request.pull_request_id}" readonly="readonly">
124 124 %elif h.is_git(c.pull_request.target_repo):
125 125 <input type="text" value="git clone --branch ${c.pull_request.shadow_merge_ref.name} ${c.shadow_clone_url} pull-request-${c.pull_request.pull_request_id}" readonly="readonly">
126 126 %endif
127 127 </div>
128 128 % else:
129 129 <div class="">
130 130 ${_('Shadow repository data not available')}.
131 131 </div>
132 132 % endif
133 133 </div>
134 134 </div>
135 135
136 136 <div class="field">
137 137 <div class="label-summary">
138 138 <label>${_('Review')}:</label>
139 139 </div>
140 140 <div class="input">
141 141 %if c.pull_request_review_status:
142 142 <div class="${'flag_status %s' % c.pull_request_review_status} tooltip pull-left"></div>
143 143 <span class="changeset-status-lbl tooltip">
144 144 %if c.pull_request.is_closed():
145 145 ${_('Closed')},
146 146 %endif
147 147 ${h.commit_status_lbl(c.pull_request_review_status)}
148 148 </span>
149 149 - ${ungettext('calculated based on %s reviewer vote', 'calculated based on %s reviewers votes', len(c.pull_request_reviewers)) % len(c.pull_request_reviewers)}
150 150 %endif
151 151 </div>
152 152 </div>
153 153 <div class="field">
154 154 <div class="pr-description-label label-summary">
155 155 <label>${_('Description')}:</label>
156 156 </div>
157 157 <div id="pr-desc" class="input">
158 158 <div class="pr-description">${h.urlify_commit_message(c.pull_request.description, c.repo_name)}</div>
159 159 </div>
160 160 <div id="pr-desc-edit" class="input textarea editor" style="display: none;">
161 161 <textarea id="pr-description-input" size="30">${c.pull_request.description}</textarea>
162 162 </div>
163 163 </div>
164 164
165 165 <div class="field">
166 166 <div class="label-summary">
167 167 <label>${_('Versions')} (${len(c.versions)+1}):</label>
168 168 </div>
169 169
170 170 <div class="pr-versions">
171 171 % if c.show_version_changes:
172 172 <table>
173 173 ## CURRENTLY SELECT PR VERSION
174 174 <tr class="version-pr" style="display: ${'' if c.at_version_num is None else 'none'}">
175 175 <td>
176 176 % if c.at_version in [None, 'latest']:
177 177 <i class="icon-ok link"></i>
178 178 % else:
179 179 <i class="icon-comment"></i> <code>${len(c.inline_versions[None])}</code>
180 180 % endif
181 181 </td>
182 182 <td>
183 183 <code>
184 184 % if c.versions:
185 185 <a href="${h.url.current(version='latest')}">${_('latest')}</a>
186 186 % else:
187 187 ${_('initial')}
188 188 % endif
189 189 </code>
190 190 </td>
191 191 <td>
192 192 <code>${c.pull_request_latest.source_ref_parts.commit_id[:6]}</code>
193 193 </td>
194 194 <td>
195 195 ${_('created')} ${h.age_component(c.pull_request_latest.updated_on)}
196 196 </td>
197 197 <td align="right">
198 198 % if c.versions and c.at_version_num in [None, 'latest']:
199 199 <span id="show-pr-versions" class="btn btn-link" onclick="$('.version-pr').show(); $(this).hide(); return false">${_('Show all versions')}</span>
200 200 % endif
201 201 </td>
202 202 </tr>
203 203
204 204 ## SHOW ALL VERSIONS OF PR
205 205 <% ver_pr = None %>
206 206 % for ver in reversed(c.pull_request.versions()):
207 207 <% ver_pr = ver.pull_request_version_id %>
208 208 <tr class="version-pr" style="display: ${'' if c.at_version == ver_pr else 'none'}">
209 209 <td>
210 210 % if c.at_version == ver_pr:
211 211 <i class="icon-ok link"></i>
212 212 % else:
213 213 <i class="icon-comment"></i> <code>${len(c.inline_versions[ver_pr])}</code>
214 214 % endif
215 215 </td>
216 216 <td>
217 217 <code><a href="${h.url.current(version=ver_pr)}">version ${ver_pr}</a></code>
218 218 </td>
219 219 <td>
220 220 <code>${ver.source_ref_parts.commit_id[:6]}</code>
221 221 </td>
222 222 <td>
223 223 ${_('created')} ${h.age_component(ver.updated_on)}
224 224 </td>
225 225 <td align="right">
226 226 % if c.at_version == ver_pr:
227 227 <span id="show-pr-versions" class="btn btn-link" onclick="$('.version-pr').show(); $(this).hide(); return false">${_('Show all versions')}</span>
228 228 % endif
229 229 </td>
230 230 </tr>
231 231 % endfor
232 232
233 233 ## show comment/inline comments summary
234 234 <tr>
235 235 <td>
236 236 </td>
237 237
238 238 <% inline_comm_count_ver = len(c.inline_versions[ver_pr])%>
239 239 <td colspan="4" style="border-top: 1px dashed #dbd9da">
240 240 ${_('Comments for this version')}:
241 241 %if c.comments:
242 242 <a href="#comments">${_("%d General ") % len(c.comments)}</a>
243 243 %else:
244 244 ${_("%d General ") % len(c.comments)}
245 245 %endif
246 246
247 247 <% inline_comm_count_ver = len(c.inline_versions[c.at_version_num])%>
248 248 %if inline_comm_count_ver:
249 249 , <a href="#" onclick="return Rhodecode.comments.nextComment();" id="inline-comments-counter">${_("%d Inline") % inline_comm_count_ver}</a>
250 250 %else:
251 251 , ${_("%d Inline") % inline_comm_count_ver}
252 252 %endif
253 253
254 254 %if c.outdated_cnt:
255 255 , <a href="#" onclick="showOutdated(); Rhodecode.comments.nextOutdatedComment(); return false;">${_("%d Outdated") % c.outdated_cnt}</a>
256 256 <a href="#" class="showOutdatedComments" onclick="showOutdated(this); return false;"> | ${_('show outdated comments')}</a>
257 257 <a href="#" class="hideOutdatedComments" style="display: none" onclick="hideOutdated(this); return false;"> | ${_('hide outdated comments')}</a>
258 258 %else:
259 259 , ${_("%d Outdated") % c.outdated_cnt}
260 260 %endif
261 261 </td>
262 262 </tr>
263 263
264 264 <tr>
265 265 <td></td>
266 266 <td colspan="4">
267 267 % if c.at_version:
268 268 <pre>
269 269 Changed commits:
270 270 * added: ${len(c.changes.added)}
271 271 * removed: ${len(c.changes.removed)}
272 272
273 273 % if not (c.file_changes.added+c.file_changes.modified+c.file_changes.removed):
274 274 No file changes found
275 275 % else:
276 276 Changed files:
277 277 %for file_name in c.file_changes.added:
278 278 * A <a href="#${'a_' + h.FID('', file_name)}">${file_name}</a>
279 279 %endfor
280 280 %for file_name in c.file_changes.modified:
281 281 * M <a href="#${'a_' + h.FID('', file_name)}">${file_name}</a>
282 282 %endfor
283 283 %for file_name in c.file_changes.removed:
284 284 * R ${file_name}
285 285 %endfor
286 286 % endif
287 287 </pre>
288 288 % endif
289 289 </td>
290 290 </tr>
291 291 </table>
292 292 % else:
293 293 ${_('Pull request versions not available')}.
294 294 % endif
295 295 </div>
296 296 </div>
297 297
298 298 <div id="pr-save" class="field" style="display: none;">
299 299 <div class="label-summary"></div>
300 300 <div class="input">
301 301 <span id="edit_pull_request" class="btn btn-small">${_('Save Changes')}</span>
302 302 </div>
303 303 </div>
304 304 </div>
305 305 </div>
306 306 <div>
307 307 ## AUTHOR
308 308 <div class="reviewers-title block-right">
309 309 <div class="pr-details-title">
310 310 ${_('Author')}
311 311 </div>
312 312 </div>
313 313 <div class="block-right pr-details-content reviewers">
314 314 <ul class="group_members">
315 315 <li>
316 316 ${self.gravatar_with_user(c.pull_request.author.email, 16)}
317 317 </li>
318 318 </ul>
319 319 </div>
320 320 ## REVIEWERS
321 321 <div class="reviewers-title block-right">
322 322 <div class="pr-details-title">
323 323 ${_('Pull request reviewers')}
324 324 %if c.allowed_to_update:
325 325 <span id="open_edit_reviewers" class="block-right action_button">${_('Edit')}</span>
326 326 <span id="close_edit_reviewers" class="block-right action_button" style="display: none;">${_('Close')}</span>
327 327 %endif
328 328 </div>
329 329 </div>
330 330 <div id="reviewers" class="block-right pr-details-content reviewers">
331 331 ## members goes here !
332 332 <input type="hidden" name="__start__" value="review_members:sequence">
333 333 <ul id="review_members" class="group_members">
334 334 %for member,reasons,status in c.pull_request_reviewers:
335 335 <li id="reviewer_${member.user_id}">
336 336 <div class="reviewers_member">
337 337 <div class="reviewer_status tooltip" title="${h.tooltip(h.commit_status_lbl(status[0][1].status if status else 'not_reviewed'))}">
338 338 <div class="${'flag_status %s' % (status[0][1].status if status else 'not_reviewed')} pull-left reviewer_member_status"></div>
339 339 </div>
340 340 <div id="reviewer_${member.user_id}_name" class="reviewer_name">
341 341 ${self.gravatar_with_user(member.email, 16)}
342 342 </div>
343 343 <input type="hidden" name="__start__" value="reviewer:mapping">
344 344 <input type="hidden" name="__start__" value="reasons:sequence">
345 345 %for reason in reasons:
346 346 <div class="reviewer_reason">- ${reason}</div>
347 347 <input type="hidden" name="reason" value="${reason}">
348 348
349 349 %endfor
350 350 <input type="hidden" name="__end__" value="reasons:sequence">
351 351 <input id="reviewer_${member.user_id}_input" type="hidden" value="${member.user_id}" name="user_id" />
352 352 <input type="hidden" name="__end__" value="reviewer:mapping">
353 353 %if c.allowed_to_update:
354 354 <div class="reviewer_member_remove action_button" onclick="removeReviewMember(${member.user_id}, true)" style="visibility: hidden;">
355 355 <i class="icon-remove-sign" ></i>
356 356 </div>
357 357 %endif
358 358 </div>
359 359 </li>
360 360 %endfor
361 361 </ul>
362 362 <input type="hidden" name="__end__" value="review_members:sequence">
363 363 %if not c.pull_request.is_closed():
364 364 <div id="add_reviewer_input" class='ac' style="display: none;">
365 365 %if c.allowed_to_update:
366 366 <div class="reviewer_ac">
367 367 ${h.text('user', class_='ac-input', placeholder=_('Add reviewer'))}
368 368 <div id="reviewers_container"></div>
369 369 </div>
370 370 <div>
371 371 <span id="update_pull_request" class="btn btn-small">${_('Save Changes')}</span>
372 372 </div>
373 373 %endif
374 374 </div>
375 375 %endif
376 376 </div>
377 377 </div>
378 378 </div>
379 379 <div class="box">
380 380 ##DIFF
381 381 <div class="table" >
382 382 <div id="changeset_compare_view_content">
383 383 ##CS
384 384 % if c.missing_requirements:
385 385 <div class="box">
386 386 <div class="alert alert-warning">
387 387 <div>
388 388 <strong>${_('Missing requirements:')}</strong>
389 389 ${_('These commits cannot be displayed, because this repository uses the Mercurial largefiles extension, which was not enabled.')}
390 390 </div>
391 391 </div>
392 392 </div>
393 393 % elif c.missing_commits:
394 394 <div class="box">
395 395 <div class="alert alert-warning">
396 396 <div>
397 397 <strong>${_('Missing commits')}:</strong>
398 398 ${_('This pull request cannot be displayed, because one or more commits no longer exist in the source repository.')}
399 399 ${_('Please update this pull request, push the commits back into the source repository, or consider closing this pull request.')}
400 400 </div>
401 401 </div>
402 402 </div>
403 403 % endif
404 404 <div class="compare_view_commits_title">
405 405
406 406 <div class="pull-left">
407 407 <div class="btn-group">
408 408 <a
409 409 class="btn"
410 410 href="#"
411 411 onclick="$('.compare_select').show();$('.compare_select_hidden').hide(); return false">
412 412 ${ungettext('Expand %s commit','Expand %s commits', len(c.commit_ranges)) % len(c.commit_ranges)}
413 413 </a>
414 414 <a
415 415 class="btn"
416 416 href="#"
417 417 onclick="$('.compare_select').hide();$('.compare_select_hidden').show(); return false">
418 418 ${ungettext('Collapse %s commit','Collapse %s commits', len(c.commit_ranges)) % len(c.commit_ranges)}
419 419 </a>
420 420 </div>
421 421 </div>
422 422
423 423 <div class="pull-right">
424 424 % if c.allowed_to_update and not c.pull_request.is_closed():
425 425 <a id="update_commits" class="btn btn-primary pull-right">${_('Update commits')}</a>
426 426 % else:
427 427 <a class="tooltip btn disabled pull-right" disabled="disabled" title="${_('Update is disabled for current view')}">${_('Update commits')}</a>
428 428 % endif
429 429
430 430 </div>
431 431
432 432 </div>
433 433 % if not c.missing_commits:
434 434 <%include file="/compare/compare_commits.mako" />
435 <div class="cs_files">
435 <div class="cs_files">
436 436 <%namespace name="cbdiffs" file="/codeblocks/diffs.mako"/>
437 437 ${cbdiffs.render_diffset_menu()}
438 438 ${cbdiffs.render_diffset(
439 439 c.diffset, use_comments=True,
440 440 collapse_when_files_over=30,
441 441 disable_new_comments=not c.allowed_to_comment,
442 442 deleted_files_comments=c.deleted_files_comments)}
443 443
444 </div>
445 % endif
444 446 </div>
445 % endif
446 447 </div>
447 448
448 449 ## template for inline comment form
449 450 <%namespace name="comment" file="/changeset/changeset_file_comment.mako"/>
450 451
451 452 ## render general comments
452 453 ${comment.generate_comments(include_pull_request=True, is_pull_request=True)}
453 454
454 455 % if not c.pull_request.is_closed():
455 456 ## main comment form and it status
456 457 ${comment.comments(h.url('pullrequest_comment', repo_name=c.repo_name,
457 458 pull_request_id=c.pull_request.pull_request_id),
458 459 c.pull_request_review_status,
459 460 is_pull_request=True, change_status=c.allowed_to_change_status)}
460 461 %endif
461 462
462 463 <script type="text/javascript">
463 464 if (location.hash) {
464 465 var result = splitDelimitedHash(location.hash);
465 466 var line = $('html').find(result.loc);
466 467 if (line.length > 0){
467 468 offsetScroll(line, 70);
468 469 }
469 470 }
470 471 $(function(){
471 472 ReviewerAutoComplete('user');
472 473 // custom code mirror
473 474 var codeMirrorInstance = initPullRequestsCodeMirror('#pr-description-input');
474 475
475 476 var PRDetails = {
476 477 editButton: $('#open_edit_pullrequest'),
477 478 closeButton: $('#close_edit_pullrequest'),
478 479 deleteButton: $('#delete_pullrequest'),
479 480 viewFields: $('#pr-desc, #pr-title'),
480 481 editFields: $('#pr-desc-edit, #pr-title-edit, #pr-save'),
481 482
482 483 init: function() {
483 484 var that = this;
484 485 this.editButton.on('click', function(e) { that.edit(); });
485 486 this.closeButton.on('click', function(e) { that.view(); });
486 487 },
487 488
488 489 edit: function(event) {
489 490 this.viewFields.hide();
490 491 this.editButton.hide();
491 492 this.deleteButton.hide();
492 493 this.closeButton.show();
493 494 this.editFields.show();
494 495 codeMirrorInstance.refresh();
495 496 },
496 497
497 498 view: function(event) {
498 499 this.editButton.show();
499 500 this.deleteButton.show();
500 501 this.editFields.hide();
501 502 this.closeButton.hide();
502 503 this.viewFields.show();
503 504 }
504 505 };
505 506
506 507 var ReviewersPanel = {
507 508 editButton: $('#open_edit_reviewers'),
508 509 closeButton: $('#close_edit_reviewers'),
509 510 addButton: $('#add_reviewer_input'),
510 511 removeButtons: $('.reviewer_member_remove'),
511 512
512 513 init: function() {
513 514 var that = this;
514 515 this.editButton.on('click', function(e) { that.edit(); });
515 516 this.closeButton.on('click', function(e) { that.close(); });
516 517 },
517 518
518 519 edit: function(event) {
519 520 this.editButton.hide();
520 521 this.closeButton.show();
521 522 this.addButton.show();
522 523 this.removeButtons.css('visibility', 'visible');
523 524 },
524 525
525 526 close: function(event) {
526 527 this.editButton.show();
527 528 this.closeButton.hide();
528 529 this.addButton.hide();
529 530 this.removeButtons.css('visibility', 'hidden');
530 531 }
531 532 };
532 533
533 534 PRDetails.init();
534 535 ReviewersPanel.init();
535 536
536 537 showOutdated = function(self){
537 538 $('.comment-outdated').show();
538 539 $('.filediff-outdated').show();
539 540 $('.showOutdatedComments').hide();
540 541 $('.hideOutdatedComments').show();
541 542
542 543 };
543 544
544 545 hideOutdated = function(self){
545 546 $('.comment-outdated').hide();
546 547 $('.filediff-outdated').hide();
547 548 $('.hideOutdatedComments').hide();
548 549 $('.showOutdatedComments').show();
549 550 };
550 551
551 552 $('#show-outdated-comments').on('click', function(e){
552 553 var button = $(this);
553 554 var outdated = $('.comment-outdated');
554 555
555 556 if (button.html() === "(Show)") {
556 557 button.html("(Hide)");
557 558 outdated.show();
558 559 } else {
559 560 button.html("(Show)");
560 561 outdated.hide();
561 562 }
562 563 });
563 564
564 565 $('.show-inline-comments').on('change', function(e){
565 566 var show = 'none';
566 567 var target = e.currentTarget;
567 568 if(target.checked){
568 569 show = ''
569 570 }
570 571 var boxid = $(target).attr('id_for');
571 572 var comments = $('#{0} .inline-comments'.format(boxid));
572 573 var fn_display = function(idx){
573 574 $(this).css('display', show);
574 575 };
575 576 $(comments).each(fn_display);
576 577 var btns = $('#{0} .inline-comments-button'.format(boxid));
577 578 $(btns).each(fn_display);
578 579 });
579 580
580 581 $('#merge_pull_request_form').submit(function() {
581 582 if (!$('#merge_pull_request').attr('disabled')) {
582 583 $('#merge_pull_request').attr('disabled', 'disabled');
583 584 }
584 585 return true;
585 586 });
586 587
587 588 $('#edit_pull_request').on('click', function(e){
588 589 var title = $('#pr-title-input').val();
589 590 var description = codeMirrorInstance.getValue();
590 591 editPullRequest(
591 592 "${c.repo_name}", "${c.pull_request.pull_request_id}",
592 593 title, description);
593 594 });
594 595
595 596 $('#update_pull_request').on('click', function(e){
596 597 updateReviewers(undefined, "${c.repo_name}", "${c.pull_request.pull_request_id}");
597 598 });
598 599
599 600 $('#update_commits').on('click', function(e){
600 601 var isDisabled = !$(e.currentTarget).attr('disabled');
601 602 $(e.currentTarget).text(_gettext('Updating...'));
602 603 $(e.currentTarget).attr('disabled', 'disabled');
603 604 if(isDisabled){
604 605 updateCommits("${c.repo_name}", "${c.pull_request.pull_request_id}");
605 606 }
606 607
607 608 });
608 609 // fixing issue with caches on firefox
609 610 $('#update_commits').removeAttr("disabled");
610 611
611 612 $('#close_pull_request').on('click', function(e){
612 613 closePullRequest("${c.repo_name}", "${c.pull_request.pull_request_id}");
613 614 });
614 615
615 616 $('.show-inline-comments').on('click', function(e){
616 617 var boxid = $(this).attr('data-comment-id');
617 618 var button = $(this);
618 619
619 620 if(button.hasClass("comments-visible")) {
620 621 $('#{0} .inline-comments'.format(boxid)).each(function(index){
621 622 $(this).hide();
622 623 });
623 624 button.removeClass("comments-visible");
624 625 } else {
625 626 $('#{0} .inline-comments'.format(boxid)).each(function(index){
626 627 $(this).show();
627 628 });
628 629 button.addClass("comments-visible");
629 630 }
630 631 });
631 632 })
632 633 </script>
633 634
634 635 </div>
635 636 </div>
636 637
637 638 </%def>
@@ -1,101 +1,101 b''
1 1 <%def name="highlight_text_file(terms, text, url, line_context=3,
2 2 max_lines=10,
3 3 mimetype=None, filepath=None)">
4 4 <%
5 5 lines = text.split('\n')
6 6 lines_of_interest = set()
7 7 matching_lines = h.get_matching_line_offsets(lines, terms)
8 8 shown_matching_lines = 0
9 9
10 10 for line_number in matching_lines:
11 11 if len(lines_of_interest) < max_lines:
12 12 lines_of_interest |= set(range(
13 13 max(line_number - line_context, 0),
14 14 min(line_number + line_context, len(lines) + 1)))
15 15 shown_matching_lines += 1
16 16
17 17 %>
18 18 ${h.code_highlight(
19 19 text,
20 20 h.get_lexer_safe(
21 21 mimetype=mimetype,
22 22 filepath=filepath,
23 23 ),
24 24 h.SearchContentCodeHtmlFormatter(
25 25 linenos=True,
26 26 cssclass="code-highlight",
27 27 url=url,
28 28 query_terms=terms,
29 29 only_line_numbers=lines_of_interest
30 30 ))|n}
31 31 %if len(matching_lines) > shown_matching_lines:
32 32 <a href="${url}">
33 33 ${len(matching_lines) - shown_matching_lines} ${_('more matches in this file')}
34 </p>
34 </a>
35 35 %endif
36 36 </%def>
37 37
38 38 <div class="search-results">
39 39 %for entry in c.formatted_results:
40 40 ## search results are additionally filtered, and this check is just a safe gate
41 41 % if h.HasRepoPermissionAny('repository.write','repository.read','repository.admin')(entry['repository'], 'search results content check'):
42 42 <div id="codeblock" class="codeblock">
43 43 <div class="codeblock-header">
44 44 <h2>
45 45 %if h.get_repo_type_by_name(entry.get('repository')) == 'hg':
46 46 <i class="icon-hg"></i>
47 47 %elif h.get_repo_type_by_name(entry.get('repository')) == 'git':
48 48 <i class="icon-git"></i>
49 49 %elif h.get_repo_type_by_name(entry.get('repository')) == 'svn':
50 50 <i class="icon-svn"></i>
51 51 %endif
52 52 ${h.link_to(entry['repository'], h.url('summary_home',repo_name=entry['repository']))}
53 53 </h2>
54 54 <div class="stats">
55 55 ${h.link_to(h.literal(entry['f_path']), h.url('files_home',repo_name=entry['repository'],revision=entry.get('commit_id', 'tip'),f_path=entry['f_path']))}
56 56 %if entry.get('lines'):
57 57 | ${entry.get('lines', 0.)} ${ungettext('line', 'lines', entry.get('lines', 0.))}
58 58 %endif
59 59 %if entry.get('size'):
60 60 | ${h.format_byte_size_binary(entry['size'])}
61 61 %endif
62 62 %if entry.get('mimetype'):
63 63 | ${entry.get('mimetype', "unknown mimetype")}
64 64 %endif
65 65 </div>
66 66 <div class="buttons">
67 67 <a id="file_history_overview_full" href="${h.url('changelog_file_home',repo_name=entry.get('repository',''),revision=entry.get('commit_id', 'tip'),f_path=entry.get('f_path',''))}">
68 68 ${_('Show Full History')}
69 69 </a> |
70 70 ${h.link_to(_('Annotation'), h.url('files_annotate_home', repo_name=entry.get('repository',''),revision=entry.get('commit_id', 'tip'),f_path=entry.get('f_path','')))}
71 71 | ${h.link_to(_('Raw'), h.url('files_raw_home', repo_name=entry.get('repository',''),revision=entry.get('commit_id', 'tip'),f_path=entry.get('f_path','')))}
72 72 | <a href="${h.url('files_rawfile_home',repo_name=entry.get('repository',''),revision=entry.get('commit_id', 'tip'),f_path=entry.get('f_path',''))}">
73 73 ${_('Download')}
74 74 </a>
75 75 </div>
76 76 </div>
77 77 <div class="code-body search-code-body">
78 78 ${highlight_text_file(c.cur_query, entry['content'],
79 79 url=h.url('files_home',repo_name=entry['repository'],revision=entry.get('commit_id', 'tip'),f_path=entry['f_path']),
80 80 mimetype=entry.get('mimetype'), filepath=entry.get('path'))}
81 81 </div>
82 82 </div>
83 83 % endif
84 84 %endfor
85 85 </div>
86 86 %if c.cur_query and c.formatted_results:
87 87 <div class="pagination-wh pagination-left" >
88 88 ${c.formatted_results.pager('$link_previous ~2~ $link_next')}
89 89 </div>
90 90 %endif
91 91
92 92 %if c.cur_query:
93 93 <script type="text/javascript">
94 94 $(function(){
95 95 $(".code").mark(
96 96 '${' '.join(h.normalize_text_for_matching(c.cur_query).split())}',
97 97 {"className": 'match',
98 98 });
99 99 })
100 100 </script>
101 101 %endif No newline at end of file
@@ -1,202 +1,202 b''
1 1 <%def name="refs_counters(branches, closed_branches, tags, bookmarks)">
2 2 <span class="branchtag tag">
3 3 <a href="${h.url('branches_home',repo_name=c.repo_name)}" class="childs">
4 4 <i class="icon-branch"></i>${ungettext(
5 5 '%(num)s Branch','%(num)s Branches', len(branches)) % {'num': len(branches)}}</a>
6 6 </span>
7 7
8 8 %if closed_branches:
9 9 <span class="branchtag tag">
10 10 <a href="${h.url('branches_home',repo_name=c.repo_name)}" class="childs">
11 11 <i class="icon-branch"></i>${ungettext(
12 12 '%(num)s Closed Branch', '%(num)s Closed Branches', len(closed_branches)) % {'num': len(closed_branches)}}</a>
13 13 </span>
14 14 %endif
15 15
16 16 <span class="tagtag tag">
17 17 <a href="${h.url('tags_home',repo_name=c.repo_name)}" class="childs">
18 18 <i class="icon-tag"></i>${ungettext(
19 19 '%(num)s Tag', '%(num)s Tags', len(tags)) % {'num': len(tags)}}</a>
20 20 </span>
21 21
22 22 %if bookmarks:
23 23 <span class="booktag tag">
24 24 <a href="${h.url('bookmarks_home',repo_name=c.repo_name)}" class="childs">
25 25 <i class="icon-bookmark"></i>${ungettext(
26 26 '%(num)s Bookmark', '%(num)s Bookmarks', len(bookmarks)) % {'num': len(bookmarks)}}</a>
27 27 </span>
28 28 %endif
29 29 </%def>
30 30
31 31 <%def name="summary_detail(breadcrumbs_links, show_downloads=True)">
32 32 <% summary = lambda n:{False:'summary-short'}.get(n) %>
33 33
34 34 <div id="summary-menu-stats" class="summary-detail">
35 35 <div class="summary-detail-header">
36 36 <div class="breadcrumbs files_location">
37 37 <h4>
38 38 ${breadcrumbs_links}
39 39 </h4>
40 40 </div>
41 41 <div id="summary_details_expand" class="btn-collapse" data-toggle="summary-details">
42 42 ${_('Show More')}
43 43 </div>
44 44 </div>
45 45
46 46 <div class="fieldset">
47 47 %if h.is_svn_without_proxy(c.rhodecode_db_repo):
48 48 <div class="left-label disabled">
49 49 ${_('Read-only url')}:
50 50 </div>
51 51 <div class="right-content disabled">
52 52 <input type="text" id="clone_url" disabled value="${c.clone_repo_url}"/>
53 53 <input type="text" id="clone_url_id" disabled value="${c.clone_repo_url_id}" style="display: none;"/>
54 54 <a id="clone_by_name" class="clone" style="display: none;">${_('Show by Name')}</a>
55 55 <a id="clone_by_id" class="clone">${_('Show by ID')}</a>
56 56 <p class="help-block">${_('SVN Protocol is disabled. To enable it, see the')} <a href="${h.url('enterprise_svn_setup')}" target="_blank">${_('documentation here')}</a>.</p>
57 57 </div>
58 58 %else:
59 59 <div class="left-label">
60 60 ${_('Clone url')}:
61 61 </div>
62 62 <div class="right-content">
63 63 <input type="text" id="clone_url" readonly="readonly" value="${c.clone_repo_url}"/>
64 64 <input type="text" id="clone_url_id" readonly="readonly" value="${c.clone_repo_url_id}" style="display: none;"/>
65 65 <a id="clone_by_name" class="clone" style="display: none;">${_('Show by Name')}</a>
66 66 <a id="clone_by_id" class="clone">${_('Show by ID')}</a>
67 67 </div>
68 68 %endif
69 69 </div>
70 70
71 71 <div class="fieldset collapsable-content" data-toggle="summary-details" style="display: none;">
72 72 <div class="left-label">
73 73 ${_('Description')}:
74 74 </div>
75 75 <div class="right-content">
76 76 %if c.visual.stylify_metatags:
77 77 <div class="input ${summary(c.show_stats)} desc">${h.urlify_text(h.escaped_stylize(c.rhodecode_db_repo.description))}</div>
78 78 %else:
79 79 <div class="input ${summary(c.show_stats)} desc">${h.urlify_text(h.html_escape(c.rhodecode_db_repo.description))}</div>
80 80 %endif
81 81 </div>
82 82 </div>
83 83
84 84 <div class="fieldset collapsable-content" data-toggle="summary-details" style="display: none;">
85 85 <div class="left-label">
86 86 ${_('Information')}:
87 87 </div>
88 88 <div class="right-content">
89 89
90 90 <div class="repo-size">
91 <%commit_rev = c.rhodecode_db_repo.changeset_cache.get('revision')%>
91 <% commit_rev = c.rhodecode_db_repo.changeset_cache.get('revision') %>
92 92
93 93 ## commits
94 94 % if commit_rev == -1:
95 95 ${ungettext('%(num)s Commit', '%(num)s Commits', 0) % {'num': 0}},
96 96 % else:
97 97 <a href="${h.url('changelog_home', repo_name=c.repo_name)}">
98 98 ${ungettext('%(num)s Commit', '%(num)s Commits', commit_rev) % {'num': commit_rev}}</a>,
99 99 % endif
100 100
101 101 ## forks
102 102 <a title="${_('Number of Repository Forks')}" href="${h.url('repo_forks_home', repo_name=c.repo_name)}">
103 103 ${c.repository_forks} ${ungettext('Fork', 'Forks', c.repository_forks)}</a>,
104 104
105 105 ## repo size
106 106 % if commit_rev == -1:
107 107 <span class="stats-bullet">0 B</span>
108 108 % else:
109 109 <span class="stats-bullet" id="repo_size_container">
110 110 ${_('Calculating Repository Size...')}
111 111 </span>
112 112 % endif
113 113 </div>
114 114
115 115 <div class="commit-info">
116 116 <div class="tags">
117 117 % if c.rhodecode_repo:
118 118 ${refs_counters(
119 119 c.rhodecode_repo.branches,
120 120 c.rhodecode_repo.branches_closed,
121 121 c.rhodecode_repo.tags,
122 122 c.rhodecode_repo.bookmarks)}
123 123 % else:
124 124 ## missing requirements can make c.rhodecode_repo None
125 125 ${refs_counters([], [], [], [])}
126 126 % endif
127 127 </div>
128 128 </div>
129 129
130 130 </div>
131 131 </div>
132 132
133 133 <div class="fieldset collapsable-content" data-toggle="summary-details" style="display: none;">
134 134 <div class="left-label">
135 135 ${_('Statistics')}:
136 136 </div>
137 137 <div class="right-content">
138 138 <div class="input ${summary(c.show_stats)} statistics">
139 139 % if c.show_stats:
140 140 <div id="lang_stats" class="enabled">
141 141 ${_('Calculating Code Statistics...')}
142 142 </div>
143 143 % else:
144 144 <span class="disabled">
145 145 ${_('Statistics are disabled for this repository')}
146 146 </span>
147 147 % if h.HasPermissionAll('hg.admin')('enable stats on from summary'):
148 148 , ${h.link_to(_('enable statistics'),h.url('edit_repo',repo_name=c.repo_name, anchor='repo_enable_statistics'))}
149 149 % endif
150 150 % endif
151 151 </div>
152 152
153 153 </div>
154 154 </div>
155 155
156 156 % if show_downloads:
157 157 <div class="fieldset collapsable-content" data-toggle="summary-details" style="display: none;">
158 158 <div class="left-label">
159 159 ${_('Downloads')}:
160 160 </div>
161 161 <div class="right-content">
162 162 <div class="input ${summary(c.show_stats)} downloads">
163 163 % if c.rhodecode_repo and len(c.rhodecode_repo.revisions) == 0:
164 164 <span class="disabled">
165 165 ${_('There are no downloads yet')}
166 166 </span>
167 167 % elif not c.enable_downloads:
168 168 <span class="disabled">
169 169 ${_('Downloads are disabled for this repository')}
170 170 </span>
171 171 % if h.HasPermissionAll('hg.admin')('enable downloads on from summary'):
172 172 , ${h.link_to(_('enable downloads'),h.url('edit_repo',repo_name=c.repo_name, anchor='repo_enable_downloads'))}
173 173 % endif
174 174 % else:
175 175 <span class="enabled">
176 176 <a id="archive_link" class="btn btn-small" href="${h.url('files_archive_home',repo_name=c.rhodecode_db_repo.repo_name,fname='tip.zip')}">
177 177 <i class="icon-archive"></i> tip.zip
178 178 ## replaced by some JS on select
179 179 </a>
180 180 </span>
181 181 ${h.hidden('download_options')}
182 182 % endif
183 183 </div>
184 184 </div>
185 185 </div>
186 186 % endif
187 187
188 188 </div><!--end summary-detail-->
189 189 </%def>
190 190
191 191 <%def name="summary_stats(gravatar_function)">
192 192 <div class="sidebar-right">
193 193 <div class="summary-detail-header">
194 194 <h4 class="item">
195 195 ${_('Owner')}
196 196 </h4>
197 197 </div>
198 198 <div class="sidebar-right-content">
199 199 ${gravatar_function(c.rhodecode_db_repo.user.email, 16)}
200 200 </div>
201 201 </div><!--end sidebar-right-->
202 202 </%def>
@@ -1,130 +1,129 b''
1 1 <%inherit file="/summary/base.mako"/>
2 2
3 3 <%namespace name="components" file="/summary/components.mako"/>
4 4
5 5
6 6 <%def name="menu_bar_subnav()">
7 7 ${self.repo_menu(active='summary')}
8 8 </%def>
9 9
10 10 <%def name="main()">
11 11
12 12 <div class="title">
13 13 ${self.repo_page_title(c.rhodecode_db_repo)}
14 14 <ul class="links icon-only-links block-right">
15 15 <li>
16 16 %if c.rhodecode_user.username != h.DEFAULT_USER:
17 <a href="${h.url('atom_feed_home',repo_name=c.rhodecode_db_repo.repo_name,auth_token=c.rhodecode_user.feed_token)}" title="${_('RSS Feed')}">
17 <a href="${h.url('atom_feed_home',repo_name=c.rhodecode_db_repo.repo_name,auth_token=c.rhodecode_user.feed_token)}" title="${_('RSS Feed')}"><i class="icon-rss-sign"></i></a>
18 18 %else:
19 <a href="${h.url('atom_feed_home',repo_name=c.rhodecode_db_repo.repo_name)}" title="${_('RSS Feed')}">
19 <a href="${h.url('atom_feed_home',repo_name=c.rhodecode_db_repo.repo_name)}" title="${_('RSS Feed')}"><i class="icon-rss-sign"></i></a>
20 20 %endif
21 <i class="icon-rss-sign"></i></a>
22 21 </li>
23 22 </ul>
24 23 </div>
25 24
26 25 <div id="repo-summary" class="summary">
27 26 ${components.summary_detail(breadcrumbs_links=self.breadcrumbs_links(), show_downloads=True)}
28 27 ${components.summary_stats(gravatar_function=self.gravatar_with_user)}
29 28 </div><!--end repo-summary-->
30 29
31 30
32 31 <div class="box" >
33 32 %if not c.repo_commits:
34 33 <div class="title">
35 34 <h3>${_('Quick start')}</h3>
36 35 </div>
37 36 %endif
38 37 <div class="table">
39 38 <div id="shortlog_data">
40 39 <%include file='../changelog/changelog_summary_data.mako'/>
41 40 </div>
42 41 </div>
43 42 </div>
44 43
45 44 %if c.readme_data:
46 45 <div id="readme" class="anchor">
47 46 <div class="box" >
48 47 <div class="title" title="${_('Readme file from commit %s:%s') % (c.rhodecode_db_repo.landing_rev[0], c.rhodecode_db_repo.landing_rev[1])}">
49 48 <h3 class="breadcrumbs">
50 49 <a href="${h.url('files_home',repo_name=c.repo_name,revision='tip',f_path=c.readme_file)}">${c.readme_file}</a>
51 50 </h3>
52 51 </div>
53 52 <div class="readme codeblock">
54 53 <div class="readme_box markdown-block">
55 54 ${c.readme_data|n}
56 55 </div>
57 56 </div>
58 57 </div>
59 58 </div>
60 59 %endif
61 60
62 61 <script type="text/javascript">
63 62 $(document).ready(function(){
64 63 $('#clone_by_name').on('click',function(e){
65 64 // show url by name and hide name button
66 65 $('#clone_url').show();
67 66 $('#clone_by_name').hide();
68 67
69 68 // hide url by id and show name button
70 69 $('#clone_by_id').show();
71 70 $('#clone_url_id').hide();
72 71
73 72 });
74 73 $('#clone_by_id').on('click',function(e){
75 74
76 75 // show url by id and hide id button
77 76 $('#clone_by_id').hide();
78 77 $('#clone_url_id').show();
79 78
80 79 // hide url by name and show id button
81 80 $('#clone_by_name').show();
82 81 $('#clone_url').hide();
83 82 });
84 83
85 84 var initialCommitData = {
86 85 id: null,
87 86 text: 'tip',
88 87 type: 'tag',
89 88 raw_id: null,
90 89 files_url: null
91 90 };
92 91
93 92 select2RefSwitcher('#download_options', initialCommitData);
94 93
95 94 // on change of download options
96 95 $('#download_options').on('change', function(e) {
97 96 // format of Object {text: "v0.0.3", type: "tag", id: "rev"}
98 97 var selected_cs = e.added;
99 98 var fname= e.added.raw_id + ".zip";
100 var href = pyroutes.url('files_archive_home', {'repo_name': templateContext.repo_name, 'fname':fname})
99 var href = pyroutes.url('files_archive_home', {'repo_name': templateContext.repo_name, 'fname':fname});
101 100 // set new label
102 $('#archive_link').html('<i class="icon-archive"></i> '+ e.added.text+".zip")
101 $('#archive_link').html('<i class="icon-archive"></i> '+ e.added.text+".zip");
103 102
104 103 // set new url to button,
105 104 $('#archive_link').attr('href', href)
106 105 });
107 106
108 107
109 108 // load details on summary page expand
110 109 $('#summary_details_expand').on('click', function() {
111 110
112 111 var callback = function (data) {
113 112 % if c.show_stats:
114 113 showRepoStats(
115 114 'lang_stats', data);
116 115 % endif
117 116 };
118 117
119 118 showRepoSize(
120 119 'repo_size_container',
121 120 templateContext.repo_name,
122 121 templateContext.repo_landing_commit,
123 122 callback);
124 123
125 124 })
126 125
127 126 })
128 127 </script>
129 128
130 129 </%def>
General Comments 0
You need to be logged in to leave comments. Login now