Show More
@@ -35,7 +35,7 b' def make_map(config):' | |||
|
35 | 35 | #========================================================================== |
|
36 | 36 | |
|
37 | 37 | #MAIN PAGE |
|
38 |
map.connect(' |
|
|
38 | map.connect('home', '/', controller='home', action='index') | |
|
39 | 39 | map.connect('bugtracker', "http://bitbucket.org/marcinkuzminski/rhodecode/issues", _static=True) |
|
40 | 40 | map.connect('gpl_license', "http://www.gnu.org/licenses/gpl.html", _static=True) |
|
41 | 41 | #ADMIN REPOSITORY REST ROUTES |
@@ -48,22 +48,22 b' class ReposController(BaseController):' | |||
|
48 | 48 | # To properly map this controller, ensure your config/routing.py |
|
49 | 49 | # file has a resource setup: |
|
50 | 50 | # map.resource('repo', 'repos') |
|
51 | ||
|
51 | ||
|
52 | 52 | @LoginRequired() |
|
53 | 53 | @HasPermissionAnyDecorator('hg.admin', 'hg.create.repository') |
|
54 | 54 | def __before__(self): |
|
55 | 55 | c.admin_user = session.get('admin_user') |
|
56 | 56 | c.admin_username = session.get('admin_username') |
|
57 | 57 | super(ReposController, self).__before__() |
|
58 | ||
|
59 |
@HasPermissionAllDecorator('hg.admin') |
|
|
58 | ||
|
59 | @HasPermissionAllDecorator('hg.admin') | |
|
60 | 60 | def index(self, format='html'): |
|
61 | 61 | """GET /repos: All items in the collection""" |
|
62 | 62 | # url('repos') |
|
63 | 63 | cached_repo_list = HgModel().get_repos() |
|
64 | 64 | c.repos_list = sorted(cached_repo_list, key=itemgetter('name_sort')) |
|
65 | 65 | return render('admin/repos/repos.html') |
|
66 | ||
|
66 | ||
|
67 | 67 | @HasPermissionAnyDecorator('hg.admin', 'hg.create.repository') |
|
68 | 68 | def create(self): |
|
69 | 69 | """POST /repos: Create a new item""" |
@@ -83,22 +83,22 b' class ReposController(BaseController):' | |||
|
83 | 83 | form_result['repo_name'], '', self.sa) |
|
84 | 84 | else: |
|
85 | 85 | action_logger(self.rhodecode_user, 'admin_created_repo', |
|
86 |
form_result['repo_name'], '', self.sa) |
|
|
87 | ||
|
86 | form_result['repo_name'], '', self.sa) | |
|
87 | ||
|
88 | 88 | except formencode.Invalid, errors: |
|
89 | 89 | c.new_repo = errors.value['repo_name'] |
|
90 | ||
|
90 | ||
|
91 | 91 | if request.POST.get('user_created'): |
|
92 | 92 | r = render('admin/repos/repo_add_create_repository.html') |
|
93 |
else: |
|
|
93 | else: | |
|
94 | 94 | r = render('admin/repos/repo_add.html') |
|
95 | ||
|
95 | ||
|
96 | 96 | return htmlfill.render( |
|
97 | 97 | r, |
|
98 | 98 | defaults=errors.value, |
|
99 | 99 | errors=errors.error_dict or {}, |
|
100 | 100 | prefix_error=False, |
|
101 |
encoding="UTF-8") |
|
|
101 | encoding="UTF-8") | |
|
102 | 102 | |
|
103 | 103 | except Exception: |
|
104 | 104 | log.error(traceback.format_exc()) |
@@ -106,9 +106,9 b' class ReposController(BaseController):' | |||
|
106 | 106 | % form_result.get('repo_name') |
|
107 | 107 | h.flash(msg, category='error') |
|
108 | 108 | if request.POST.get('user_created'): |
|
109 |
return redirect(url(' |
|
|
109 | return redirect(url('home')) | |
|
110 | 110 | return redirect(url('repos')) |
|
111 | ||
|
111 | ||
|
112 | 112 | @HasPermissionAllDecorator('hg.admin') |
|
113 | 113 | def new(self, format='html'): |
|
114 | 114 | """GET /repos/new: Form to create a new item""" |
@@ -116,7 +116,7 b' class ReposController(BaseController):' | |||
|
116 | 116 | c.new_repo = h.repo_name_slug(new_repo) |
|
117 | 117 | |
|
118 | 118 | return render('admin/repos/repo_add.html') |
|
119 | ||
|
119 | ||
|
120 | 120 | @HasPermissionAllDecorator('hg.admin') |
|
121 | 121 | def update(self, repo_name): |
|
122 | 122 | """PUT /repos/repo_name: Update an existing item""" |
@@ -129,7 +129,7 b' class ReposController(BaseController):' | |||
|
129 | 129 | repo_model = RepoModel() |
|
130 | 130 | changed_name = repo_name |
|
131 | 131 | _form = RepoForm(edit=True, old_data={'repo_name':repo_name})() |
|
132 | ||
|
132 | ||
|
133 | 133 | try: |
|
134 | 134 | form_result = _form.to_python(dict(request.POST)) |
|
135 | 135 | repo_model.update(repo_name, form_result) |
@@ -147,14 +147,14 b' class ReposController(BaseController):' | |||
|
147 | 147 | errors=errors.error_dict or {}, |
|
148 | 148 | prefix_error=False, |
|
149 | 149 | encoding="UTF-8") |
|
150 | ||
|
150 | ||
|
151 | 151 | except Exception: |
|
152 | 152 | log.error(traceback.format_exc()) |
|
153 | 153 | h.flash(_('error occured during update of repository %s') \ |
|
154 | 154 | % repo_name, category='error') |
|
155 | ||
|
155 | ||
|
156 | 156 | return redirect(url('edit_repo', repo_name=changed_name)) |
|
157 | ||
|
157 | ||
|
158 | 158 | @HasPermissionAllDecorator('hg.admin') |
|
159 | 159 | def delete(self, repo_name): |
|
160 | 160 | """DELETE /repos/repo_name: Delete an existing item""" |
@@ -164,65 +164,65 b' class ReposController(BaseController):' | |||
|
164 | 164 | # h.form(url('repo', repo_name=ID), |
|
165 | 165 | # method='delete') |
|
166 | 166 | # url('repo', repo_name=ID) |
|
167 | ||
|
167 | ||
|
168 | 168 | repo_model = RepoModel() |
|
169 | 169 | repo = repo_model.get(repo_name) |
|
170 | 170 | if not repo: |
|
171 |
h.flash(_('%s repository is not mapped to db perhaps' |
|
|
171 | h.flash(_('%s repository is not mapped to db perhaps' | |
|
172 | 172 | ' it was moved or renamed from the filesystem' |
|
173 | 173 | ' please run the application again' |
|
174 | 174 | ' in order to rescan repositories') % repo_name, |
|
175 | 175 | category='error') |
|
176 | ||
|
176 | ||
|
177 | 177 | return redirect(url('repos')) |
|
178 | 178 | try: |
|
179 | 179 | action_logger(self.rhodecode_user, 'admin_deleted_repo', |
|
180 | 180 | repo_name, '', self.sa) |
|
181 |
repo_model.delete(repo) |
|
|
181 | repo_model.delete(repo) | |
|
182 | 182 | invalidate_cache('cached_repo_list') |
|
183 | 183 | h.flash(_('deleted repository %s') % repo_name, category='success') |
|
184 | ||
|
184 | ||
|
185 | 185 | except Exception, e: |
|
186 | 186 | log.error(traceback.format_exc()) |
|
187 | 187 | h.flash(_('An error occured during deletion of %s') % repo_name, |
|
188 | 188 | category='error') |
|
189 | ||
|
189 | ||
|
190 | 190 | return redirect(url('repos')) |
|
191 | ||
|
192 |
@HasPermissionAllDecorator('hg.admin') |
|
|
191 | ||
|
192 | @HasPermissionAllDecorator('hg.admin') | |
|
193 | 193 | def delete_perm_user(self, repo_name): |
|
194 | 194 | """ |
|
195 | 195 | DELETE an existing repository permission user |
|
196 | 196 | :param repo_name: |
|
197 | 197 | """ |
|
198 | ||
|
198 | ||
|
199 | 199 | try: |
|
200 | 200 | repo_model = RepoModel() |
|
201 |
repo_model.delete_perm_user(request.POST, repo_name) |
|
|
201 | repo_model.delete_perm_user(request.POST, repo_name) | |
|
202 | 202 | except Exception, e: |
|
203 | 203 | h.flash(_('An error occured during deletion of repository user'), |
|
204 | 204 | category='error') |
|
205 | 205 | raise HTTPInternalServerError() |
|
206 | ||
|
207 |
@HasPermissionAllDecorator('hg.admin') |
|
|
206 | ||
|
207 | @HasPermissionAllDecorator('hg.admin') | |
|
208 | 208 | def show(self, repo_name, format='html'): |
|
209 | 209 | """GET /repos/repo_name: Show a specific item""" |
|
210 | 210 | # url('repo', repo_name=ID) |
|
211 | ||
|
212 |
@HasPermissionAllDecorator('hg.admin') |
|
|
211 | ||
|
212 | @HasPermissionAllDecorator('hg.admin') | |
|
213 | 213 | def edit(self, repo_name, format='html'): |
|
214 | 214 | """GET /repos/repo_name/edit: Form to edit an existing item""" |
|
215 | 215 | # url('edit_repo', repo_name=ID) |
|
216 | 216 | repo_model = RepoModel() |
|
217 | 217 | c.repo_info = repo = repo_model.get(repo_name) |
|
218 | 218 | if not repo: |
|
219 |
h.flash(_('%s repository is not mapped to db perhaps' |
|
|
219 | h.flash(_('%s repository is not mapped to db perhaps' | |
|
220 | 220 | ' it was created or renamed from the filesystem' |
|
221 | 221 | ' please run the application again' |
|
222 | 222 | ' in order to rescan repositories') % repo_name, |
|
223 | 223 | category='error') |
|
224 | ||
|
225 |
return redirect(url('repos')) |
|
|
224 | ||
|
225 | return redirect(url('repos')) | |
|
226 | 226 | defaults = c.repo_info.__dict__ |
|
227 | 227 | if c.repo_info.user: |
|
228 | 228 | defaults.update({'user':c.repo_info.user.username}) |
@@ -230,16 +230,16 b' class ReposController(BaseController):' | |||
|
230 | 230 | replacement_user = self.sa.query(User)\ |
|
231 | 231 | .filter(User.admin == True).first().username |
|
232 | 232 | defaults.update({'user':replacement_user}) |
|
233 | ||
|
233 | ||
|
234 | 234 | c.users_array = repo_model.get_users_js() |
|
235 | ||
|
235 | ||
|
236 | 236 | for p in c.repo_info.repo_to_perm: |
|
237 |
defaults.update({'perm_%s' % p.user.username: |
|
|
237 | defaults.update({'perm_%s' % p.user.username: | |
|
238 | 238 | p.permission.permission_name}) |
|
239 | ||
|
239 | ||
|
240 | 240 | return htmlfill.render( |
|
241 | 241 | render('admin/repos/repo_edit.html'), |
|
242 | 242 | defaults=defaults, |
|
243 | 243 | encoding="UTF-8", |
|
244 | 244 | force_defaults=False |
|
245 |
) |
|
|
245 | ) |
@@ -38,13 +38,13 b' import logging' | |||
|
38 | 38 | log = logging.getLogger(__name__) |
|
39 | 39 | |
|
40 | 40 | class ChangelogController(BaseController): |
|
41 | ||
|
41 | ||
|
42 | 42 | @LoginRequired() |
|
43 | 43 | @HasRepoPermissionAnyDecorator('repository.read', 'repository.write', |
|
44 |
'repository.admin') |
|
|
44 | 'repository.admin') | |
|
45 | 45 | def __before__(self): |
|
46 | 46 | super(ChangelogController, self).__before__() |
|
47 | ||
|
47 | ||
|
48 | 48 | def index(self): |
|
49 | 49 | limit = 100 |
|
50 | 50 | default = 20 |
@@ -53,7 +53,7 b' class ChangelogController(BaseController' | |||
|
53 | 53 | int_size = int(request.params.get('size')) |
|
54 | 54 | except ValueError: |
|
55 | 55 | int_size = default |
|
56 |
int_size = int_size if int_size <= limit else limit |
|
|
56 | int_size = int_size if int_size <= limit else limit | |
|
57 | 57 | c.size = int_size |
|
58 | 58 | session['changelog_size'] = c.size |
|
59 | 59 | session.save() |
@@ -61,35 +61,37 b' class ChangelogController(BaseController' | |||
|
61 | 61 | c.size = int(session.get('changelog_size', default)) |
|
62 | 62 | |
|
63 | 63 | changesets = HgModel().get_repo(c.repo_name) |
|
64 | ||
|
64 | ||
|
65 | 65 | p = int(request.params.get('page', 1)) |
|
66 | 66 | c.total_cs = len(changesets) |
|
67 | 67 | c.pagination = Page(changesets, page=p, item_count=c.total_cs, |
|
68 | 68 | items_per_page=c.size) |
|
69 | ||
|
69 | ||
|
70 | 70 | self._graph(changesets, c.size, p) |
|
71 | ||
|
71 | ||
|
72 | 72 | return render('changelog/changelog.html') |
|
73 | 73 | |
|
74 | 74 | |
|
75 | 75 | def _graph(self, repo, size, p): |
|
76 | 76 | revcount = size |
|
77 | 77 | if not repo.revisions:return json.dumps([]), 0 |
|
78 | ||
|
78 | ||
|
79 | 79 | max_rev = repo.revisions[-1] |
|
80 | ||
|
80 | 81 | offset = 1 if p == 1 else ((p - 1) * revcount + 1) |
|
82 | ||
|
81 | 83 | rev_start = repo.revisions[(-1 * offset)] |
|
82 | ||
|
84 | ||
|
83 | 85 | revcount = min(max_rev, revcount) |
|
84 | 86 | rev_end = max(0, rev_start - revcount) |
|
85 | 87 | dag = graph_rev(repo.repo, rev_start, rev_end) |
|
86 | ||
|
88 | ||
|
87 | 89 | c.dag = tree = list(colored(dag)) |
|
88 | 90 | data = [] |
|
89 | 91 | for (id, type, ctx, vtx, edges) in tree: |
|
90 | 92 | if type != CHANGESET: |
|
91 | 93 | continue |
|
92 | 94 | data.append(('', vtx, edges)) |
|
93 | ||
|
94 | c.jsdata = json.dumps(data) | |
|
95 | 95 | |
|
96 | c.jsdata = json.dumps(data) | |
|
97 |
@@ -37,44 +37,44 b' import traceback' | |||
|
37 | 37 | log = logging.getLogger(__name__) |
|
38 | 38 | |
|
39 | 39 | class ChangesetController(BaseController): |
|
40 | ||
|
40 | ||
|
41 | 41 | @LoginRequired() |
|
42 | 42 | @HasRepoPermissionAnyDecorator('repository.read', 'repository.write', |
|
43 |
'repository.admin') |
|
|
43 | 'repository.admin') | |
|
44 | 44 | def __before__(self): |
|
45 | 45 | super(ChangesetController, self).__before__() |
|
46 | ||
|
46 | ||
|
47 | 47 | def index(self, revision): |
|
48 | 48 | hg_model = HgModel() |
|
49 | 49 | cut_off_limit = 1024 * 250 |
|
50 | ||
|
50 | ||
|
51 | 51 | def wrap_to_table(str): |
|
52 | ||
|
52 | ||
|
53 | 53 | return '''<table class="code-difftable"> |
|
54 | 54 | <tr class="line"> |
|
55 | 55 | <td class="lineno new"></td> |
|
56 | 56 | <td class="code"><pre>%s</pre></td> |
|
57 | 57 | </tr> |
|
58 | 58 | </table>''' % str |
|
59 | ||
|
59 | ||
|
60 | 60 | try: |
|
61 | 61 | c.changeset = hg_model.get_repo(c.repo_name).get_changeset(revision) |
|
62 | 62 | except RepositoryError: |
|
63 | 63 | log.error(traceback.format_exc()) |
|
64 |
return redirect(url(' |
|
|
64 | return redirect(url('home')) | |
|
65 | 65 | else: |
|
66 | 66 | try: |
|
67 | 67 | c.changeset_old = c.changeset.parents[0] |
|
68 | 68 | except IndexError: |
|
69 | 69 | c.changeset_old = None |
|
70 | 70 | c.changes = [] |
|
71 | ||
|
71 | ||
|
72 | 72 | #=================================================================== |
|
73 | 73 | # ADDED FILES |
|
74 | 74 | #=================================================================== |
|
75 | 75 | c.sum_added = 0 |
|
76 | 76 | for node in c.changeset.added: |
|
77 | ||
|
77 | ||
|
78 | 78 | filenode_old = FileNode(node.path, '', EmptyChangeset()) |
|
79 | 79 | if filenode_old.is_binary or node.is_binary: |
|
80 | 80 | diff = wrap_to_table(_('binary file')) |
@@ -83,29 +83,29 b' class ChangesetController(BaseController' | |||
|
83 | 83 | if c.sum_added < cut_off_limit: |
|
84 | 84 | f_udiff = differ.get_udiff(filenode_old, node) |
|
85 | 85 | diff = differ.DiffProcessor(f_udiff).as_html() |
|
86 | ||
|
86 | ||
|
87 | 87 | else: |
|
88 | 88 | diff = wrap_to_table(_('Changeset is to big and was cut' |
|
89 | 89 | ' off, see raw changeset instead')) |
|
90 | ||
|
90 | ||
|
91 | 91 | cs1 = None |
|
92 |
cs2 = node.last_changeset. |
|
|
92 | cs2 = node.last_changeset.raw_id | |
|
93 | 93 | c.changes.append(('added', node, diff, cs1, cs2)) |
|
94 | ||
|
94 | ||
|
95 | 95 | #=================================================================== |
|
96 | 96 | # CHANGED FILES |
|
97 | 97 | #=================================================================== |
|
98 |
c.sum_removed = 0 |
|
|
98 | c.sum_removed = 0 | |
|
99 | 99 | for node in c.changeset.changed: |
|
100 | 100 | try: |
|
101 | 101 | filenode_old = c.changeset_old.get_node(node.path) |
|
102 | 102 | except ChangesetError: |
|
103 | 103 | filenode_old = FileNode(node.path, '', EmptyChangeset()) |
|
104 | ||
|
104 | ||
|
105 | 105 | if filenode_old.is_binary or node.is_binary: |
|
106 | 106 | diff = wrap_to_table(_('binary file')) |
|
107 | 107 | else: |
|
108 | ||
|
108 | ||
|
109 | 109 | if c.sum_removed < cut_off_limit: |
|
110 | 110 | f_udiff = differ.get_udiff(filenode_old, node) |
|
111 | 111 | diff = differ.DiffProcessor(f_udiff).as_html() |
@@ -114,68 +114,68 b' class ChangesetController(BaseController' | |||
|
114 | 114 | else: |
|
115 | 115 | diff = wrap_to_table(_('Changeset is to big and was cut' |
|
116 | 116 | ' off, see raw changeset instead')) |
|
117 | ||
|
118 | ||
|
119 |
cs1 = filenode_old.last_changeset. |
|
|
120 |
cs2 = node.last_changeset. |
|
|
117 | ||
|
118 | ||
|
119 | cs1 = filenode_old.last_changeset.raw_id | |
|
120 | cs2 = node.last_changeset.raw_id | |
|
121 | 121 | c.changes.append(('changed', node, diff, cs1, cs2)) |
|
122 | ||
|
122 | ||
|
123 | 123 | #=================================================================== |
|
124 | 124 | # REMOVED FILES |
|
125 | 125 | #=================================================================== |
|
126 | 126 | for node in c.changeset.removed: |
|
127 |
c.changes.append(('removed', node, None, None, None)) |
|
|
128 | ||
|
127 | c.changes.append(('removed', node, None, None, None)) | |
|
128 | ||
|
129 | 129 | return render('changeset/changeset.html') |
|
130 | 130 | |
|
131 | 131 | def raw_changeset(self, revision): |
|
132 | ||
|
132 | ||
|
133 | 133 | hg_model = HgModel() |
|
134 | 134 | method = request.GET.get('diff', 'show') |
|
135 | 135 | try: |
|
136 | 136 | c.changeset = hg_model.get_repo(c.repo_name).get_changeset(revision) |
|
137 | 137 | except RepositoryError: |
|
138 | 138 | log.error(traceback.format_exc()) |
|
139 |
return redirect(url(' |
|
|
139 | return redirect(url('home')) | |
|
140 | 140 | else: |
|
141 | 141 | try: |
|
142 | 142 | c.changeset_old = c.changeset.parents[0] |
|
143 | 143 | except IndexError: |
|
144 | 144 | c.changeset_old = None |
|
145 | 145 | c.changes = [] |
|
146 | ||
|
146 | ||
|
147 | 147 | for node in c.changeset.added: |
|
148 | 148 | filenode_old = FileNode(node.path, '') |
|
149 | 149 | if filenode_old.is_binary or node.is_binary: |
|
150 | 150 | diff = _('binary file') |
|
151 |
else: |
|
|
151 | else: | |
|
152 | 152 | f_udiff = differ.get_udiff(filenode_old, node) |
|
153 | 153 | diff = differ.DiffProcessor(f_udiff).raw_diff() |
|
154 | 154 | |
|
155 | 155 | cs1 = None |
|
156 |
cs2 = node.last_changeset. |
|
|
156 | cs2 = node.last_changeset.raw_id | |
|
157 | 157 | c.changes.append(('added', node, diff, cs1, cs2)) |
|
158 | ||
|
158 | ||
|
159 | 159 | for node in c.changeset.changed: |
|
160 | 160 | filenode_old = c.changeset_old.get_node(node.path) |
|
161 | 161 | if filenode_old.is_binary or node.is_binary: |
|
162 | 162 | diff = _('binary file') |
|
163 |
else: |
|
|
163 | else: | |
|
164 | 164 | f_udiff = differ.get_udiff(filenode_old, node) |
|
165 | 165 | diff = differ.DiffProcessor(f_udiff).raw_diff() |
|
166 | 166 | |
|
167 |
cs1 = filenode_old.last_changeset. |
|
|
168 |
cs2 = node.last_changeset. |
|
|
169 |
c.changes.append(('changed', node, diff, cs1, cs2)) |
|
|
170 | ||
|
167 | cs1 = filenode_old.last_changeset.raw_id | |
|
168 | cs2 = node.last_changeset.raw_id | |
|
169 | c.changes.append(('changed', node, diff, cs1, cs2)) | |
|
170 | ||
|
171 | 171 | response.content_type = 'text/plain' |
|
172 | 172 | if method == 'download': |
|
173 |
response.content_disposition = 'attachment; filename=%s.patch' % revision |
|
|
173 | response.content_disposition = 'attachment; filename=%s.patch' % revision | |
|
174 | 174 | parent = True if len(c.changeset.parents) > 0 else False |
|
175 | 175 | c.parent_tmpl = 'Parent %s' % c.changeset.parents[0].raw_id if parent else '' |
|
176 | ||
|
176 | ||
|
177 | 177 | c.diffs = '' |
|
178 | 178 | for x in c.changes: |
|
179 | 179 | c.diffs += x[2] |
|
180 | ||
|
180 | ||
|
181 | 181 | return render('changeset/raw_changeset.html') |
@@ -54,7 +54,7 b' class FeedController(BaseController):' | |||
|
54 | 54 | for cs in changesets[:self.feed_nr]: |
|
55 | 55 | feed.add_item(title=cs.message, |
|
56 | 56 | link=url('changeset_home', repo_name=repo_name, |
|
57 |
revision=cs. |
|
|
57 | revision=cs.raw_id, qualified=True), | |
|
58 | 58 | description=str(cs.date)) |
|
59 | 59 | |
|
60 | 60 | response.content_type = feed.mime_type |
@@ -73,7 +73,7 b' class FeedController(BaseController):' | |||
|
73 | 73 | for cs in changesets[:self.feed_nr]: |
|
74 | 74 | feed.add_item(title=cs.message, |
|
75 | 75 | link=url('changeset_home', repo_name=repo_name, |
|
76 |
revision=cs. |
|
|
76 | revision=cs.raw_id, qualified=True), | |
|
77 | 77 | description=str(cs.date)) |
|
78 | 78 | |
|
79 | 79 | response.content_type = feed.mime_type |
@@ -36,14 +36,14 b' from vcs.utils import diffs as differ' | |||
|
36 | 36 | import logging |
|
37 | 37 | import rhodecode.lib.helpers as h |
|
38 | 38 | import tempfile |
|
39 | ||
|
39 | ||
|
40 | 40 | log = logging.getLogger(__name__) |
|
41 | 41 | |
|
42 | 42 | class FilesController(BaseController): |
|
43 | ||
|
43 | ||
|
44 | 44 | @LoginRequired() |
|
45 | 45 | @HasRepoPermissionAnyDecorator('repository.read', 'repository.write', |
|
46 |
'repository.admin') |
|
|
46 | 'repository.admin') | |
|
47 | 47 | def __before__(self): |
|
48 | 48 | super(FilesController, self).__before__() |
|
49 | 49 | c.file_size_limit = 250 * 1024 #limit of file size to display |
@@ -52,41 +52,41 b' class FilesController(BaseController):' | |||
|
52 | 52 | hg_model = HgModel() |
|
53 | 53 | c.repo = repo = hg_model.get_repo(c.repo_name) |
|
54 | 54 | revision = request.POST.get('at_rev', None) or revision |
|
55 | ||
|
55 | ||
|
56 | 56 | def get_next_rev(cur): |
|
57 | 57 | max_rev = len(c.repo.revisions) - 1 |
|
58 | 58 | r = cur + 1 |
|
59 | 59 | if r > max_rev: |
|
60 | 60 | r = max_rev |
|
61 | 61 | return r |
|
62 | ||
|
62 | ||
|
63 | 63 | def get_prev_rev(cur): |
|
64 | 64 | r = cur - 1 |
|
65 | 65 | return r |
|
66 | 66 | |
|
67 | 67 | c.f_path = f_path |
|
68 | ||
|
69 | ||
|
68 | ||
|
69 | ||
|
70 | 70 | try: |
|
71 | 71 | cur_rev = repo.get_changeset(revision).revision |
|
72 |
prev_rev = repo.get_changeset(get_prev_rev(cur_rev)). |
|
|
73 |
next_rev = repo.get_changeset(get_next_rev(cur_rev)). |
|
|
74 | ||
|
72 | prev_rev = repo.get_changeset(get_prev_rev(cur_rev)).raw_id | |
|
73 | next_rev = repo.get_changeset(get_next_rev(cur_rev)).raw_id | |
|
74 | ||
|
75 | 75 | c.url_prev = url('files_home', repo_name=c.repo_name, |
|
76 |
revision=prev_rev, f_path=f_path) |
|
|
76 | revision=prev_rev, f_path=f_path) | |
|
77 | 77 | c.url_next = url('files_home', repo_name=c.repo_name, |
|
78 |
revision=next_rev, f_path=f_path) |
|
|
79 | ||
|
78 | revision=next_rev, f_path=f_path) | |
|
79 | ||
|
80 | 80 | c.changeset = repo.get_changeset(revision) |
|
81 | ||
|
82 |
c.cur_rev = c.changeset. |
|
|
81 | ||
|
82 | c.cur_rev = c.changeset.raw_id | |
|
83 | 83 | c.rev_nr = c.changeset.revision |
|
84 | 84 | c.files_list = c.changeset.get_node(f_path) |
|
85 | 85 | c.file_history = self._get_history(repo, c.files_list, f_path) |
|
86 | ||
|
86 | ||
|
87 | 87 | except (RepositoryError, ChangesetError): |
|
88 | 88 | c.files_list = None |
|
89 | ||
|
89 | ||
|
90 | 90 | return render('files/files.html') |
|
91 | 91 | |
|
92 | 92 | def rawfile(self, repo_name, revision, f_path): |
@@ -95,7 +95,7 b' class FilesController(BaseController):' | |||
|
95 | 95 | file_node = c.repo.get_changeset(revision).get_node(f_path) |
|
96 | 96 | response.content_type = file_node.mimetype |
|
97 | 97 | response.content_disposition = 'attachment; filename=%s' \ |
|
98 |
% f_path.split('/')[-1] |
|
|
98 | % f_path.split('/')[-1] | |
|
99 | 99 | return file_node.content |
|
100 | 100 | |
|
101 | 101 | def raw(self, repo_name, revision, f_path): |
@@ -103,21 +103,21 b' class FilesController(BaseController):' | |||
|
103 | 103 | c.repo = hg_model.get_repo(c.repo_name) |
|
104 | 104 | file_node = c.repo.get_changeset(revision).get_node(f_path) |
|
105 | 105 | response.content_type = 'text/plain' |
|
106 | ||
|
106 | ||
|
107 | 107 | return file_node.content |
|
108 | ||
|
108 | ||
|
109 | 109 | def annotate(self, repo_name, revision, f_path): |
|
110 | 110 | hg_model = HgModel() |
|
111 | 111 | c.repo = hg_model.get_repo(c.repo_name) |
|
112 | 112 | cs = c.repo.get_changeset(revision) |
|
113 | 113 | c.file = cs.get_node(f_path) |
|
114 | 114 | c.file_msg = cs.get_file_message(f_path) |
|
115 |
c.cur_rev = cs. |
|
|
116 |
c.rev_nr = cs.revision |
|
|
115 | c.cur_rev = cs.raw_id | |
|
116 | c.rev_nr = cs.revision | |
|
117 | 117 | c.f_path = f_path |
|
118 | 118 | |
|
119 | 119 | return render('files/files_annotate.html') |
|
120 | ||
|
120 | ||
|
121 | 121 | def archivefile(self, repo_name, revision, fileformat): |
|
122 | 122 | archive_specs = { |
|
123 | 123 | '.tar.bz2': ('application/x-tar', 'tbz2'), |
@@ -126,7 +126,7 b' class FilesController(BaseController):' | |||
|
126 | 126 | } |
|
127 | 127 | if not archive_specs.has_key(fileformat): |
|
128 | 128 | return 'Unknown archive type %s' % fileformat |
|
129 | ||
|
129 | ||
|
130 | 130 | def read_in_chunks(file_object, chunk_size=1024 * 40): |
|
131 | 131 | """Lazy function (generator) to read a file piece by piece. |
|
132 | 132 | Default chunk size: 40k.""" |
@@ -134,8 +134,8 b' class FilesController(BaseController):' | |||
|
134 | 134 | data = file_object.read(chunk_size) |
|
135 | 135 | if not data: |
|
136 | 136 | break |
|
137 |
yield data |
|
|
138 | ||
|
137 | yield data | |
|
138 | ||
|
139 | 139 | archive = tempfile.TemporaryFile() |
|
140 | 140 | repo = HgModel().get_repo(repo_name).repo |
|
141 | 141 | fname = '%s-%s%s' % (repo_name, revision, fileformat) |
@@ -145,7 +145,7 b' class FilesController(BaseController):' | |||
|
145 | 145 | response.content_disposition = 'attachment; filename=%s' % fname |
|
146 | 146 | archive.seek(0) |
|
147 | 147 | return read_in_chunks(archive) |
|
148 | ||
|
148 | ||
|
149 | 149 | def diff(self, repo_name, f_path): |
|
150 | 150 | hg_model = HgModel() |
|
151 | 151 | diff1 = request.GET.get('diff1') |
@@ -162,7 +162,7 b' class FilesController(BaseController):' | |||
|
162 | 162 | else: |
|
163 | 163 | c.changeset_1 = EmptyChangeset() |
|
164 | 164 | node1 = FileNode('.', '', changeset=c.changeset_1) |
|
165 | ||
|
165 | ||
|
166 | 166 | if diff2 not in ['', None, 'None', '0' * 12, '0' * 40]: |
|
167 | 167 | c.changeset_2 = c.repo.get_changeset(diff2) |
|
168 | 168 | node2 = c.changeset_2.get_node(f_path) |
@@ -173,19 +173,16 b' class FilesController(BaseController):' | |||
|
173 | 173 | return redirect(url('files_home', |
|
174 | 174 | repo_name=c.repo_name, f_path=f_path)) |
|
175 | 175 | |
|
176 | c.diff1 = 'r%s:%s' % (c.changeset_1.revision, c.changeset_1.short_id) | |
|
177 | c.diff2 = 'r%s:%s' % (c.changeset_2.revision, c.changeset_2.short_id) | |
|
178 | ||
|
179 | 176 | f_udiff = differ.get_udiff(node1, node2) |
|
180 | 177 | diff = differ.DiffProcessor(f_udiff) |
|
181 | ||
|
178 | ||
|
182 | 179 | if c.action == 'download': |
|
183 | 180 | diff_name = '%s_vs_%s.diff' % (diff1, diff2) |
|
184 | 181 | response.content_type = 'text/plain' |
|
185 | 182 | response.content_disposition = 'attachment; filename=%s' \ |
|
186 |
% diff_name |
|
|
183 | % diff_name | |
|
187 | 184 | return diff.raw_diff() |
|
188 | ||
|
185 | ||
|
189 | 186 | elif c.action == 'raw': |
|
190 | 187 | c.cur_diff = '<pre class="raw">%s</pre>' % h.escape(diff.raw_diff()) |
|
191 | 188 | elif c.action == 'diff': |
@@ -199,10 +196,10 b' class FilesController(BaseController):' | |||
|
199 | 196 | c.cur_diff = _('Diff is to big to display') |
|
200 | 197 | else: |
|
201 | 198 | c.cur_diff = diff.as_html() |
|
202 | ||
|
203 |
if not c.cur_diff: c.no_changes = True |
|
|
199 | ||
|
200 | if not c.cur_diff: c.no_changes = True | |
|
204 | 201 | return render('files/file_diff.html') |
|
205 | ||
|
202 | ||
|
206 | 203 | def _get_history(self, repo, node, f_path): |
|
207 | 204 | from vcs.nodes import NodeKind |
|
208 | 205 | if not node.kind is NodeKind.FILE: |
@@ -211,5 +208,5 b' class FilesController(BaseController):' | |||
|
211 | 208 | hist_l = [] |
|
212 | 209 | for chs in changesets: |
|
213 | 210 | n_desc = 'r%s:%s' % (chs.revision, chs.short_id) |
|
214 |
hist_l.append((chs. |
|
|
211 | hist_l.append((chs.raw_id, n_desc,)) | |
|
215 | 212 | return hist_l |
@@ -30,17 +30,17 b' from rhodecode.model.hg import HgModel' | |||
|
30 | 30 | import logging |
|
31 | 31 | log = logging.getLogger(__name__) |
|
32 | 32 | |
|
33 |
class H |
|
|
33 | class HomeController(BaseController): | |
|
34 | 34 | |
|
35 | 35 | @LoginRequired() |
|
36 | 36 | def __before__(self): |
|
37 |
super(H |
|
|
38 | ||
|
37 | super(HomeController, self).__before__() | |
|
38 | ||
|
39 | 39 | def index(self): |
|
40 | 40 | sortables = ['name', 'description', 'last_change', 'tip', 'contact'] |
|
41 | 41 | current_sort = request.GET.get('sort', 'name') |
|
42 | 42 | current_sort_slug = current_sort.replace('-', '') |
|
43 | ||
|
43 | ||
|
44 | 44 | if current_sort_slug not in sortables: |
|
45 | 45 | c.sort_by = 'name' |
|
46 | 46 | current_sort_slug = c.sort_by |
@@ -48,11 +48,11 b' class HgController(BaseController):' | |||
|
48 | 48 | c.sort_by = current_sort |
|
49 | 49 | c.sort_slug = current_sort_slug |
|
50 | 50 | cached_repo_list = HgModel().get_repos() |
|
51 | ||
|
51 | ||
|
52 | 52 | sort_key = current_sort_slug + '_sort' |
|
53 | 53 | if c.sort_by.startswith('-'): |
|
54 | 54 | c.repos_list = sorted(cached_repo_list, key=itemgetter(sort_key), reverse=True) |
|
55 | 55 | else: |
|
56 | 56 | c.repos_list = sorted(cached_repo_list, key=itemgetter(sort_key), reverse=False) |
|
57 | ||
|
57 | ||
|
58 | 58 | return render('/index.html') |
@@ -28,7 +28,7 b' from pylons import request, response, se' | |||
|
28 | 28 | from pylons.controllers.util import abort, redirect |
|
29 | 29 | from rhodecode.lib.auth import AuthUser, HasPermissionAnyDecorator |
|
30 | 30 | from rhodecode.lib.base import BaseController, render |
|
31 |
import rhodecode.lib.helpers as h |
|
|
31 | import rhodecode.lib.helpers as h | |
|
32 | 32 | from pylons.i18n.translation import _ |
|
33 | 33 | from rhodecode.model.forms import LoginForm, RegisterForm, PasswordResetForm |
|
34 | 34 | from rhodecode.model.user import UserModel |
@@ -45,10 +45,10 b' class LoginController(BaseController):' | |||
|
45 | 45 | def index(self): |
|
46 | 46 | #redirect if already logged in |
|
47 | 47 | c.came_from = request.GET.get('came_from', None) |
|
48 | ||
|
48 | ||
|
49 | 49 | if c.rhodecode_user.is_authenticated: |
|
50 |
return redirect(url(' |
|
|
51 | ||
|
50 | return redirect(url('home')) | |
|
51 | ||
|
52 | 52 | if request.POST: |
|
53 | 53 | #import Login Form validator class |
|
54 | 54 | login_form = LoginForm() |
@@ -66,14 +66,14 b' class LoginController(BaseController):' | |||
|
66 | 66 | session['rhodecode_user'] = auth_user |
|
67 | 67 | session.save() |
|
68 | 68 | log.info('user %s is now authenticated', username) |
|
69 | ||
|
69 | ||
|
70 | 70 | user.update_lastlogin() |
|
71 | ||
|
71 | ||
|
72 | 72 | if c.came_from: |
|
73 | 73 | return redirect(c.came_from) |
|
74 | 74 | else: |
|
75 |
return redirect(url(' |
|
|
76 | ||
|
75 | return redirect(url('home')) | |
|
76 | ||
|
77 | 77 | except formencode.Invalid, errors: |
|
78 | 78 | return htmlfill.render( |
|
79 | 79 | render('/login.html'), |
@@ -81,9 +81,9 b' class LoginController(BaseController):' | |||
|
81 | 81 | errors=errors.error_dict or {}, |
|
82 | 82 | prefix_error=False, |
|
83 | 83 | encoding="UTF-8") |
|
84 | ||
|
84 | ||
|
85 | 85 | return render('/login.html') |
|
86 | ||
|
86 | ||
|
87 | 87 | @HasPermissionAnyDecorator('hg.admin', 'hg.register.auto_activate', |
|
88 | 88 | 'hg.register.manual_activate') |
|
89 | 89 | def register(self): |
@@ -93,18 +93,18 b' class LoginController(BaseController):' | |||
|
93 | 93 | if perm.permission.permission_name == 'hg.register.auto_activate': |
|
94 | 94 | c.auto_active = True |
|
95 | 95 | break |
|
96 | ||
|
96 | ||
|
97 | 97 | if request.POST: |
|
98 | ||
|
98 | ||
|
99 | 99 | register_form = RegisterForm()() |
|
100 | 100 | try: |
|
101 | 101 | form_result = register_form.to_python(dict(request.POST)) |
|
102 | 102 | form_result['active'] = c.auto_active |
|
103 | 103 | user_model.create_registration(form_result) |
|
104 | 104 | h.flash(_('You have successfully registered into rhodecode'), |
|
105 |
category='success') |
|
|
105 | category='success') | |
|
106 | 106 | return redirect(url('login_home')) |
|
107 | ||
|
107 | ||
|
108 | 108 | except formencode.Invalid, errors: |
|
109 | 109 | return htmlfill.render( |
|
110 | 110 | render('/register.html'), |
@@ -112,21 +112,21 b' class LoginController(BaseController):' | |||
|
112 | 112 | errors=errors.error_dict or {}, |
|
113 | 113 | prefix_error=False, |
|
114 | 114 | encoding="UTF-8") |
|
115 | ||
|
115 | ||
|
116 | 116 | return render('/register.html') |
|
117 | 117 | |
|
118 | 118 | def password_reset(self): |
|
119 | 119 | user_model = UserModel() |
|
120 | 120 | if request.POST: |
|
121 | ||
|
121 | ||
|
122 | 122 | password_reset_form = PasswordResetForm()() |
|
123 | 123 | try: |
|
124 | 124 | form_result = password_reset_form.to_python(dict(request.POST)) |
|
125 | 125 | user_model.reset_password(form_result) |
|
126 | 126 | h.flash(_('Your new password was sent'), |
|
127 |
category='success') |
|
|
127 | category='success') | |
|
128 | 128 | return redirect(url('login_home')) |
|
129 | ||
|
129 | ||
|
130 | 130 | except formencode.Invalid, errors: |
|
131 | 131 | return htmlfill.render( |
|
132 | 132 | render('/password_reset.html'), |
@@ -134,11 +134,11 b' class LoginController(BaseController):' | |||
|
134 | 134 | errors=errors.error_dict or {}, |
|
135 | 135 | prefix_error=False, |
|
136 | 136 | encoding="UTF-8") |
|
137 | ||
|
137 | ||
|
138 | 138 | return render('/password_reset.html') |
|
139 | ||
|
139 | ||
|
140 | 140 | def logout(self): |
|
141 | 141 | session['rhodecode_user'] = AuthUser() |
|
142 | 142 | session.save() |
|
143 | 143 | log.info('Logging out and setting user as Empty') |
|
144 |
redirect(url(' |
|
|
144 | redirect(url('home')) |
@@ -41,35 +41,35 b' log = logging.getLogger(__name__)' | |||
|
41 | 41 | class SettingsController(BaseController): |
|
42 | 42 | |
|
43 | 43 | @LoginRequired() |
|
44 |
@HasRepoPermissionAllDecorator('repository.admin') |
|
|
44 | @HasRepoPermissionAllDecorator('repository.admin') | |
|
45 | 45 | def __before__(self): |
|
46 | 46 | super(SettingsController, self).__before__() |
|
47 | ||
|
47 | ||
|
48 | 48 | def index(self, repo_name): |
|
49 | 49 | repo_model = RepoModel() |
|
50 | 50 | c.repo_info = repo = repo_model.get(repo_name) |
|
51 | 51 | if not repo: |
|
52 |
h.flash(_('%s repository is not mapped to db perhaps' |
|
|
52 | h.flash(_('%s repository is not mapped to db perhaps' | |
|
53 | 53 | ' it was created or renamed from the filesystem' |
|
54 | 54 | ' please run the application again' |
|
55 | 55 | ' in order to rescan repositories') % repo_name, |
|
56 | 56 | category='error') |
|
57 | ||
|
58 |
return redirect(url(' |
|
|
57 | ||
|
58 | return redirect(url('home')) | |
|
59 | 59 | defaults = c.repo_info.__dict__ |
|
60 | 60 | defaults.update({'user':c.repo_info.user.username}) |
|
61 | 61 | c.users_array = repo_model.get_users_js() |
|
62 | ||
|
62 | ||
|
63 | 63 | for p in c.repo_info.repo_to_perm: |
|
64 |
defaults.update({'perm_%s' % p.user.username: |
|
|
64 | defaults.update({'perm_%s' % p.user.username: | |
|
65 | 65 | p.permission.permission_name}) |
|
66 | ||
|
66 | ||
|
67 | 67 | return htmlfill.render( |
|
68 | 68 | render('settings/repo_settings.html'), |
|
69 | 69 | defaults=defaults, |
|
70 | 70 | encoding="UTF-8", |
|
71 | 71 | force_defaults=False |
|
72 |
) |
|
|
72 | ) | |
|
73 | 73 | |
|
74 | 74 | def update(self, repo_name): |
|
75 | 75 | repo_model = RepoModel() |
@@ -81,7 +81,7 b' class SettingsController(BaseController)' | |||
|
81 | 81 | invalidate_cache('cached_repo_list') |
|
82 | 82 | h.flash(_('Repository %s updated successfully' % repo_name), |
|
83 | 83 | category='success') |
|
84 |
changed_name = form_result['repo_name'] |
|
|
84 | changed_name = form_result['repo_name'] | |
|
85 | 85 | except formencode.Invalid, errors: |
|
86 | 86 | c.repo_info = repo_model.get(repo_name) |
|
87 | 87 | c.users_array = repo_model.get_users_js() |
@@ -91,17 +91,17 b' class SettingsController(BaseController)' | |||
|
91 | 91 | defaults=errors.value, |
|
92 | 92 | errors=errors.error_dict or {}, |
|
93 | 93 | prefix_error=False, |
|
94 |
encoding="UTF-8") |
|
|
94 | encoding="UTF-8") | |
|
95 | 95 | except Exception: |
|
96 | 96 | log.error(traceback.format_exc()) |
|
97 | 97 | h.flash(_('error occured during update of repository %s') \ |
|
98 | 98 | % repo_name, category='error') |
|
99 | ||
|
99 | ||
|
100 | 100 | return redirect(url('repo_settings_home', repo_name=changed_name)) |
|
101 | 101 | |
|
102 | 102 | |
|
103 | 103 | |
|
104 |
def delete(self, repo_name): |
|
|
104 | def delete(self, repo_name): | |
|
105 | 105 | """DELETE /repos/repo_name: Delete an existing item""" |
|
106 | 106 | # Forms posted to this method should contain a hidden field: |
|
107 | 107 | # <input type="hidden" name="_method" value="DELETE" /> |
@@ -109,45 +109,45 b' class SettingsController(BaseController)' | |||
|
109 | 109 | # h.form(url('repo_settings_delete', repo_name=ID), |
|
110 | 110 | # method='delete') |
|
111 | 111 | # url('repo_settings_delete', repo_name=ID) |
|
112 | ||
|
112 | ||
|
113 | 113 | repo_model = RepoModel() |
|
114 | 114 | repo = repo_model.get(repo_name) |
|
115 | 115 | if not repo: |
|
116 |
h.flash(_('%s repository is not mapped to db perhaps' |
|
|
116 | h.flash(_('%s repository is not mapped to db perhaps' | |
|
117 | 117 | ' it was moved or renamed from the filesystem' |
|
118 | 118 | ' please run the application again' |
|
119 | 119 | ' in order to rescan repositories') % repo_name, |
|
120 | 120 | category='error') |
|
121 | ||
|
122 |
return redirect(url(' |
|
|
121 | ||
|
122 | return redirect(url('home')) | |
|
123 | 123 | try: |
|
124 | 124 | action_logger(self.rhodecode_user, 'user_deleted_repo', |
|
125 |
repo_name, '', self.sa) |
|
|
126 |
repo_model.delete(repo) |
|
|
125 | repo_name, '', self.sa) | |
|
126 | repo_model.delete(repo) | |
|
127 | 127 | invalidate_cache('cached_repo_list') |
|
128 | 128 | h.flash(_('deleted repository %s') % repo_name, category='success') |
|
129 | 129 | except Exception: |
|
130 | 130 | h.flash(_('An error occurred during deletion of %s') % repo_name, |
|
131 | 131 | category='error') |
|
132 | ||
|
133 |
return redirect(url(' |
|
|
134 | ||
|
132 | ||
|
133 | return redirect(url('home')) | |
|
134 | ||
|
135 | 135 | def fork(self, repo_name): |
|
136 | 136 | repo_model = RepoModel() |
|
137 | 137 | c.repo_info = repo = repo_model.get(repo_name) |
|
138 | 138 | if not repo: |
|
139 |
h.flash(_('%s repository is not mapped to db perhaps' |
|
|
139 | h.flash(_('%s repository is not mapped to db perhaps' | |
|
140 | 140 | ' it was created or renamed from the filesystem' |
|
141 | 141 | ' please run the application again' |
|
142 | 142 | ' in order to rescan repositories') % repo_name, |
|
143 | 143 | category='error') |
|
144 | ||
|
145 |
return redirect(url(' |
|
|
146 | ||
|
144 | ||
|
145 | return redirect(url('home')) | |
|
146 | ||
|
147 | 147 | return render('settings/repo_fork.html') |
|
148 | ||
|
149 | ||
|
150 | ||
|
148 | ||
|
149 | ||
|
150 | ||
|
151 | 151 | def fork_create(self, repo_name): |
|
152 | 152 | repo_model = RepoModel() |
|
153 | 153 | c.repo_info = repo_model.get(repo_name) |
@@ -161,15 +161,15 b' class SettingsController(BaseController)' | |||
|
161 | 161 | % (repo_name, form_result['fork_name']), |
|
162 | 162 | category='success') |
|
163 | 163 | action_logger(self.rhodecode_user, 'user_forked_repo', |
|
164 |
repo_name, '', self.sa) |
|
|
164 | repo_name, '', self.sa) | |
|
165 | 165 | except formencode.Invalid, errors: |
|
166 | 166 | c.new_repo = errors.value['fork_name'] |
|
167 | 167 | r = render('settings/repo_fork.html') |
|
168 | ||
|
168 | ||
|
169 | 169 | return htmlfill.render( |
|
170 | 170 | r, |
|
171 | 171 | defaults=errors.value, |
|
172 | 172 | errors=errors.error_dict or {}, |
|
173 | 173 | prefix_error=False, |
|
174 |
encoding="UTF-8") |
|
|
175 |
return redirect(url(' |
|
|
174 | encoding="UTF-8") | |
|
175 | return redirect(url('home')) |
@@ -272,12 +272,12 b' def pygmentize_annotation(filenode, **kw' | |||
|
272 | 272 | changeset.date, |
|
273 | 273 | tooltip(changeset.message)) |
|
274 | 274 | lnk_format = 'r%-5s:%s' % (changeset.revision, |
|
275 |
changeset. |
|
|
275 | changeset.raw_id) | |
|
276 | 276 | uri = link_to( |
|
277 | 277 | lnk_format, |
|
278 | 278 | url('changeset_home', repo_name=changeset.repository.name, |
|
279 |
revision=changeset. |
|
|
280 |
style=get_color_string(changeset. |
|
|
279 | revision=changeset.raw_id), | |
|
280 | style=get_color_string(changeset.raw_id), | |
|
281 | 281 | class_='tooltip', |
|
282 | 282 | tooltip_title=tooltip_html |
|
283 | 283 | ) |
@@ -352,6 +352,7 b' capitalize = lambda x: x.capitalize()' | |||
|
352 | 352 | email = util.email |
|
353 | 353 | email_or_none = lambda x: util.email(x) if util.email(x) != x else None |
|
354 | 354 | person = lambda x: _person(x) |
|
355 | short_id = lambda x: x[:12] | |
|
355 | 356 | |
|
356 | 357 | #============================================================================== |
|
357 | 358 | # PERMS |
@@ -303,6 +303,7 b' class EmptyChangeset(BaseChangeset):' | |||
|
303 | 303 | message = '' |
|
304 | 304 | author = '' |
|
305 | 305 | date = '' |
|
306 | ||
|
306 | 307 | @LazyProperty |
|
307 | 308 | def raw_id(self): |
|
308 | 309 | """ |
@@ -158,7 +158,7 b' class HgModel(object):' | |||
|
158 | 158 | tmp_d['description_sort'] = tmp_d['description'] |
|
159 | 159 | tmp_d['last_change'] = last_change |
|
160 | 160 | tmp_d['last_change_sort'] = time.mktime(last_change.timetuple()) |
|
161 |
tmp_d['tip'] = tip. |
|
|
161 | tmp_d['tip'] = tip.raw_id | |
|
162 | 162 | tmp_d['tip_sort'] = tip.revision |
|
163 | 163 | tmp_d['rev'] = tip.revision |
|
164 | 164 | tmp_d['contact'] = repo.contact |
@@ -1701,6 +1701,7 b' font:100% sans-serif;' | |||
|
1701 | 1701 | width:auto; |
|
1702 | 1702 | opacity:1px; |
|
1703 | 1703 | padding:8px; |
|
1704 | white-space: pre; | |
|
1704 | 1705 | } |
|
1705 | 1706 | |
|
1706 | 1707 | .ac { |
@@ -31,7 +31,7 b'' | |||
|
31 | 31 | <div id="header-inner" class="title top-left-rounded-corner top-right-rounded-corner"> |
|
32 | 32 | <!-- logo --> |
|
33 | 33 | <div id="logo"> |
|
34 |
<h1><a href="${h.url('h |
|
|
34 | <h1><a href="${h.url('home')}">${c.rhodecode_name}</a></h1> | |
|
35 | 35 | </div> |
|
36 | 36 | <!-- end logo --> |
|
37 | 37 | <!-- menu --> |
@@ -146,7 +146,7 b'' | |||
|
146 | 146 | <ul> |
|
147 | 147 | %if c.repository_branches.values(): |
|
148 | 148 | %for cnt,branch in enumerate(c.repository_branches.items()): |
|
149 | <li>${h.link_to('%s - %s' % (branch[0],branch[1]),h.url('files_home',repo_name=c.repo_name,revision=branch[1]))}</li> | |
|
149 | <li>${h.link_to('%s - %s' % (branch[0],h.short_id(branch[1])),h.url('files_home',repo_name=c.repo_name,revision=branch[1]))}</li> | |
|
150 | 150 | %endfor |
|
151 | 151 | %else: |
|
152 | 152 | <li>${h.link_to(_('There are no branches yet'),'#')}</li> |
@@ -158,7 +158,7 b'' | |||
|
158 | 158 | <ul> |
|
159 | 159 | %if c.repository_tags.values(): |
|
160 | 160 | %for cnt,tag in enumerate(c.repository_tags.items()): |
|
161 | <li>${h.link_to('%s - %s' % (tag[0],tag[1]),h.url('files_home',repo_name=c.repo_name,revision=tag[1]))}</li> | |
|
161 | <li>${h.link_to('%s - %s' % (tag[0],h.short_id(tag[1])),h.url('files_home',repo_name=c.repo_name,revision=tag[1]))}</li> | |
|
162 | 162 | %endfor |
|
163 | 163 | %else: |
|
164 | 164 | <li>${h.link_to(_('There are no tags yet'),'#')}</li> |
@@ -219,7 +219,7 b'' | |||
|
219 | 219 | ##ROOT MENU |
|
220 | 220 | <ul id="quick"> |
|
221 | 221 | <li> |
|
222 |
<a title="${_('Home')}" href="${h.url('h |
|
|
222 | <a title="${_('Home')}" href="${h.url('home')}"> | |
|
223 | 223 | <span class="icon"> |
|
224 | 224 | <img src="/images/icons/home_16.png" alt="${_('Home')}" /> |
|
225 | 225 | </span> |
@@ -2,24 +2,26 b'' | |||
|
2 | 2 | <table class="table_disp"> |
|
3 | 3 | <tr> |
|
4 | 4 | <th class="left">${_('date')}</th> |
|
5 | <th class="left">${_('name')}</th> | |
|
6 | <th class="left">${_('author')}</th> | |
|
5 | 7 | <th class="left">${_('revision')}</th> |
|
6 | <th class="left">${_('name')}</th> | |
|
7 | 8 | <th class="left">${_('links')}</th> |
|
8 | 9 | </tr> |
|
9 | 10 | %for cnt,branch in enumerate(c.repo_branches.items()): |
|
10 | 11 | <tr class="parity${cnt%2}"> |
|
11 |
|
|
|
12 | <td>r${branch[1].revision}:${branch[1].short_id}</td> | |
|
13 | <td> | |
|
14 | <span class="logtags"> | |
|
15 | <span class="branchtag">${h.link_to(branch[0], | |
|
16 | h.url('changeset_home',repo_name=c.repo_name,revision=branch[1].short_id))}</span> | |
|
17 | </span> | |
|
18 | </td> | |
|
12 | <td>${branch[1].date} - ${h.age(branch[1].date)}</td> | |
|
13 | <td> | |
|
14 | <span class="logtags"> | |
|
15 | <span class="branchtag">${h.link_to(branch[0], | |
|
16 | h.url('changeset_home',repo_name=c.repo_name,revision=branch[1].raw_id))}</span> | |
|
17 | </span> | |
|
18 | </td> | |
|
19 | <td title="${branch[1].author}">${h.person(branch[1].author)}</td> | |
|
20 | <td>r${branch[1].revision}:${h.short_id(branch[1].raw_id)}</td> | |
|
19 | 21 | <td class="nowrap"> |
|
20 |
${h.link_to(_('changeset'),h.url('changeset_home',repo_name=c.repo_name,revision=branch[1]. |
|
|
22 | ${h.link_to(_('changeset'),h.url('changeset_home',repo_name=c.repo_name,revision=branch[1].raw_id))} | |
|
21 | 23 | | |
|
22 |
${h.link_to(_('files'),h.url('files_home',repo_name=c.repo_name,revision=branch[1]. |
|
|
24 | ${h.link_to(_('files'),h.url('files_home',repo_name=c.repo_name,revision=branch[1].raw_id))} | |
|
23 | 25 | </td> |
|
24 | 26 | </tr> |
|
25 | 27 | %endfor |
@@ -46,7 +46,7 b'' | |||
|
46 | 46 | %for cnt,cs in enumerate(c.pagination): |
|
47 | 47 | <div id="chg_${cnt+1}" class="container"> |
|
48 | 48 | <div class="left"> |
|
49 |
<div class="date">${_('commit')} ${cs.revision}: ${cs. |
|
|
49 | <div class="date">${_('commit')} ${cs.revision}: ${cs.raw_id}@${cs.date}</div> | |
|
50 | 50 | <div class="author"> |
|
51 | 51 | <div class="gravatar"> |
|
52 | 52 | <img alt="gravatar" src="${h.gravatar_url(h.email(cs.author),20)}"/> |
@@ -54,7 +54,7 b'' | |||
|
54 | 54 | <span>${h.person(cs.author)}</span><br/> |
|
55 | 55 | <span><a href="mailto:${h.email_or_none(cs.author)}">${h.email_or_none(cs.author)}</a></span><br/> |
|
56 | 56 | </div> |
|
57 |
<div class="message">${h.link_to(h.wrap_paragraphs(cs.message),h.url('changeset_home',repo_name=c.repo_name,revision=cs. |
|
|
57 | <div class="message">${h.link_to(h.wrap_paragraphs(cs.message),h.url('changeset_home',repo_name=c.repo_name,revision=cs.raw_id))}</div> | |
|
58 | 58 | </div> |
|
59 | 59 | <div class="right"> |
|
60 | 60 | <div class="changes"> |
@@ -69,8 +69,8 b'' | |||
|
69 | 69 | %endif |
|
70 | 70 | %if cs.parents: |
|
71 | 71 | %for p_cs in reversed(cs.parents): |
|
72 |
<div class="parent">${_('Parent')} ${p_cs.revision}: ${h.link_to(p_cs. |
|
|
73 |
h.url('changeset_home',repo_name=c.repo_name,revision=p_cs. |
|
|
72 | <div class="parent">${_('Parent')} ${p_cs.revision}: ${h.link_to(p_cs.raw_id, | |
|
73 | h.url('changeset_home',repo_name=c.repo_name,revision=p_cs.raw_id),title=p_cs.message)} | |
|
74 | 74 | </div> |
|
75 | 75 | %endfor |
|
76 | 76 | %else: |
@@ -79,10 +79,10 b'' | |||
|
79 | 79 | |
|
80 | 80 | <span class="logtags"> |
|
81 | 81 | <span class="branchtag" title="${'%s %s' % (_('branch'),cs.branch)}"> |
|
82 |
${h.link_to(cs.branch,h.url('files_home',repo_name=c.repo_name,revision=cs. |
|
|
82 | ${h.link_to(cs.branch,h.url('files_home',repo_name=c.repo_name,revision=cs.raw_id))}</span> | |
|
83 | 83 | %for tag in cs.tags: |
|
84 | 84 | <span class="tagtag" title="${'%s %s' % (_('tag'),tag)}"> |
|
85 |
${h.link_to(tag,h.url('files_home',repo_name=c.repo_name,revision=cs. |
|
|
85 | ${h.link_to(tag,h.url('files_home',repo_name=c.repo_name,revision=cs.raw_id))}</span> | |
|
86 | 86 | %endfor |
|
87 | 87 | </span> |
|
88 | 88 | </div> |
@@ -1,7 +1,7 b'' | |||
|
1 | 1 | <%inherit file="/base/base.html"/> |
|
2 | 2 | |
|
3 | 3 | <%def name="title()"> |
|
4 |
${c.repo_name} ${_('Changeset')} - r${c.changeset.revision}:${c.changeset. |
|
|
4 | ${c.repo_name} ${_('Changeset')} - r${c.changeset.revision}:${h.short_id(c.changeset.raw_id)} - ${c.rhodecode_name} | |
|
5 | 5 | </%def> |
|
6 | 6 | |
|
7 | 7 | <%def name="breadcrumbs_links()"> |
@@ -9,7 +9,7 b'' | |||
|
9 | 9 | » |
|
10 | 10 | ${h.link_to(c.repo_name,h.url('summary_home',repo_name=c.repo_name))} |
|
11 | 11 | » |
|
12 |
${_('Changeset')} - r${c.changeset.revision}:${c.changeset. |
|
|
12 | ${_('Changeset')} - r${c.changeset.revision}:${h.short_id(c.changeset.raw_id)} | |
|
13 | 13 | </%def> |
|
14 | 14 | |
|
15 | 15 | <%def name="page_nav()"> |
@@ -26,18 +26,18 b'' | |||
|
26 | 26 | <div id="body" class="diffblock"> |
|
27 | 27 | <div class="code-header"> |
|
28 | 28 | <div> |
|
29 |
${_('Changeset')} - r${c.changeset.revision}:${c.changeset. |
|
|
29 | ${_('Changeset')} - r${c.changeset.revision}:${h.short_id(c.changeset.raw_id)} | |
|
30 | 30 | » <span>${h.link_to(_('raw diff'), |
|
31 |
h.url('raw_changeset_home',repo_name=c.repo_name,revision=c.changeset. |
|
|
31 | h.url('raw_changeset_home',repo_name=c.repo_name,revision=c.changeset.raw_id,diff='show'))}</span> | |
|
32 | 32 | » <span>${h.link_to(_('download diff'), |
|
33 |
h.url('raw_changeset_home',repo_name=c.repo_name,revision=c.changeset. |
|
|
33 | h.url('raw_changeset_home',repo_name=c.repo_name,revision=c.changeset.raw_id,diff='download'))}</span> | |
|
34 | 34 | </div> |
|
35 | 35 | </div> |
|
36 | 36 | </div> |
|
37 | 37 | <div id="changeset_content"> |
|
38 | 38 | <div class="container"> |
|
39 | 39 | <div class="left"> |
|
40 |
<div class="date">${_('commit')} ${c.changeset.revision}: ${c.changeset. |
|
|
40 | <div class="date">${_('commit')} ${c.changeset.revision}: ${h.short_id(c.changeset.raw_id)}@${c.changeset.date}</div> | |
|
41 | 41 | <div class="author"> |
|
42 | 42 | <div class="gravatar"> |
|
43 | 43 | <img alt="gravatar" src="${h.gravatar_url(h.email(c.changeset.author),20)}"/> |
@@ -45,7 +45,7 b'' | |||
|
45 | 45 | <span>${h.person(c.changeset.author)}</span><br/> |
|
46 | 46 | <span><a href="mailto:${h.email_or_none(c.changeset.author)}">${h.email_or_none(c.changeset.author)}</a></span><br/> |
|
47 | 47 | </div> |
|
48 |
<div class="message">${h.link_to(h.wrap_paragraphs(c.changeset.message),h.url('changeset_home',repo_name=c.repo_name,revision=c.changeset. |
|
|
48 | <div class="message">${h.link_to(h.wrap_paragraphs(c.changeset.message),h.url('changeset_home',repo_name=c.repo_name,revision=c.changeset.raw_id))}</div> | |
|
49 | 49 | </div> |
|
50 | 50 | <div class="right"> |
|
51 | 51 | <div class="changes"> |
@@ -61,8 +61,8 b'' | |||
|
61 | 61 | |
|
62 | 62 | %if c.changeset.parents: |
|
63 | 63 | %for p_cs in reversed(c.changeset.parents): |
|
64 |
<div class="parent">${_('Parent')} ${p_cs.revision}: ${h.link_to( |
|
|
65 |
h.url('changeset_home',repo_name=c.repo_name,revision=p_cs. |
|
|
64 | <div class="parent">${_('Parent')} ${p_cs.revision}: ${h.link_to(h.short_id(p_cs.raw_id), | |
|
65 | h.url('changeset_home',repo_name=c.repo_name,revision=p_cs.raw_id),title=p_cs.message)} | |
|
66 | 66 | </div> |
|
67 | 67 | %endfor |
|
68 | 68 | %else: |
@@ -70,10 +70,10 b'' | |||
|
70 | 70 | %endif |
|
71 | 71 | <span class="logtags"> |
|
72 | 72 | <span class="branchtag" title="${'%s %s' % (_('branch'),c.changeset.branch)}"> |
|
73 |
${h.link_to(c.changeset.branch,h.url('files_home',repo_name=c.repo_name,revision=c.changeset. |
|
|
73 | ${h.link_to(c.changeset.branch,h.url('files_home',repo_name=c.repo_name,revision=c.changeset.raw_id))}</span> | |
|
74 | 74 | %for tag in c.changeset.tags: |
|
75 | 75 | <span class="tagtag" title="${'%s %s' % (_('tag'),tag)}"> |
|
76 |
${h.link_to(tag,h.url('files_home',repo_name=c.repo_name,revision=c.changeset. |
|
|
76 | ${h.link_to(tag,h.url('files_home',repo_name=c.repo_name,revision=c.changeset.raw_id))}</span> | |
|
77 | 77 | %endfor |
|
78 | 78 | </span> |
|
79 | 79 | </div> |
@@ -96,7 +96,7 b'' | |||
|
96 | 96 | <div> |
|
97 | 97 | <span> |
|
98 | 98 | ${h.link_to_if(change!='removed',filenode.path,h.url('files_home',repo_name=c.repo_name, |
|
99 |
revision=filenode.changeset. |
|
|
99 | revision=filenode.changeset.raw_id,f_path=filenode.path))} | |
|
100 | 100 | </span> |
|
101 | 101 | %if 1: |
|
102 | 102 | » <span>${h.link_to(_('diff'), |
@@ -6,7 +6,7 b'' | |||
|
6 | 6 | </%def> |
|
7 | 7 | |
|
8 | 8 | <%def name="breadcrumbs()"> |
|
9 |
${h.link_to(u'Home',h.url('h |
|
|
9 | ${h.link_to(u'Home',h.url('home'))} | |
|
10 | 10 | / |
|
11 | 11 | ${h.link_to(u'Admin',h.url('admin_home'))} |
|
12 | 12 | </%def> |
@@ -26,7 +26,7 b'' | |||
|
26 | 26 | ${_('Create "%s" repository as %s' % (c.repo_name,c.repo_name_cleaned))}</a> |
|
27 | 27 | |
|
28 | 28 | </p> |
|
29 |
<p class="normal">${h.link_to(_('Go back to the main repository list page'),h.url('h |
|
|
29 | <p class="normal">${h.link_to(_('Go back to the main repository list page'),h.url('home'))}</p> | |
|
30 | 30 | <div class="page-footer"> |
|
31 | 31 | </div> |
|
32 | 32 | </%def> No newline at end of file |
@@ -9,7 +9,7 b'' | |||
|
9 | 9 | » |
|
10 | 10 | ${h.link_to(c.repo_name,h.url('summary_home',repo_name=c.repo_name))} |
|
11 | 11 | » |
|
12 | ${'%s: %s %s %s' % (_('File diff'),c.diff2,'→',c.diff1)|n} | |
|
12 | ${_('File diff')} r${c.changeset_1.revision}:${h.short_id(c.changeset_1.raw_id)} → r${c.changeset_2.revision}:${h.short_id(c.changeset_2.raw_id)} | |
|
13 | 13 | </%def> |
|
14 | 14 | |
|
15 | 15 | <%def name="page_nav()"> |
@@ -26,13 +26,13 b'' | |||
|
26 | 26 | <div class="code-header"> |
|
27 | 27 | <div> |
|
28 | 28 | <span>${h.link_to(c.f_path,h.url('files_home',repo_name=c.repo_name, |
|
29 |
revision=c. |
|
|
29 | revision=c.changeset_2.raw_id,f_path=c.f_path))}</span> | |
|
30 | 30 | » <span>${h.link_to(_('diff'), |
|
31 |
h.url.current(diff2=c. |
|
|
31 | h.url.current(diff2=c.changeset_2.raw_id,diff1=c.changeset_1.raw_id,diff='diff'))}</span> | |
|
32 | 32 | » <span>${h.link_to(_('raw diff'), |
|
33 |
h.url.current(diff2=c. |
|
|
33 | h.url.current(diff2=c.changeset_2.raw_id,diff1=c.changeset_1.raw_id,diff='raw'))}</span> | |
|
34 | 34 | » <span>${h.link_to(_('download diff'), |
|
35 |
h.url.current(diff2=c. |
|
|
35 | h.url.current(diff2=c.changeset_2.raw_id,diff1=c.changeset_1.raw_id,diff='download'))}</span> | |
|
36 | 36 | </div> |
|
37 | 37 | </div> |
|
38 | 38 | <div class="code-body"> |
@@ -11,7 +11,7 b'' | |||
|
11 | 11 | » |
|
12 | 12 | ${_('files')} |
|
13 | 13 | %if c.files_list: |
|
14 | @ R${c.rev_nr}:${c.cur_rev} | |
|
14 | @ R${c.rev_nr}:${h.short_id(c.cur_rev)} | |
|
15 | 15 | %endif |
|
16 | 16 | </%def> |
|
17 | 17 |
@@ -26,8 +26,8 b'' | |||
|
26 | 26 | <h3 class="files_location">${_('Location')}: ${h.files_breadcrumbs(c.repo_name,c.cur_rev,c.file.path)}</h3> |
|
27 | 27 | <dl class="overview"> |
|
28 | 28 | <dt>${_('Last revision')}</dt> |
|
29 |
<dd>${h.link_to("r%s:%s" % (c.file.last_changeset.revision,c.file.last_changeset. |
|
|
30 |
h.url('files_annotate_home',repo_name=c.repo_name,revision=c.file.last_changeset. |
|
|
29 | <dd>${h.link_to("r%s:%s" % (c.file.last_changeset.revision,c.file.last_changeset.raw_id), | |
|
30 | h.url('files_annotate_home',repo_name=c.repo_name,revision=c.file.last_changeset.raw_id,f_path=c.f_path))} </dd> | |
|
31 | 31 | <dt>${_('Size')}</dt> |
|
32 | 32 | <dd>${h.format_byte_size(c.file.size,binary=True)}</dd> |
|
33 | 33 | <dt>${_('Mimetype')}</dt> |
@@ -43,7 +43,7 b'' | |||
|
43 | 43 | </dl> |
|
44 | 44 | <div id="body" class="codeblock"> |
|
45 | 45 | <div class="code-header"> |
|
46 |
<div class="revision">${c.file.name}@r${c.file.last_changeset.revision}:${c.file.last_changeset. |
|
|
46 | <div class="revision">${c.file.name}@r${c.file.last_changeset.revision}:${c.file.last_changeset.raw_id}</div> | |
|
47 | 47 | <div class="commit">"${c.file_msg}"</div> |
|
48 | 48 | </div> |
|
49 | 49 | <div class="code-body"> |
@@ -1,8 +1,8 b'' | |||
|
1 | 1 | <dl> |
|
2 | 2 | <dt>${_('Last revision')}</dt> |
|
3 | 3 | <dd> |
|
4 |
${h.link_to("r%s:%s" % (c.files_list.last_changeset.revision,c.files_list.last_changeset. |
|
|
5 |
h.url('files_home',repo_name=c.repo_name,revision=c.files_list.last_changeset. |
|
|
4 | ${h.link_to("r%s:%s" % (c.files_list.last_changeset.revision,h.short_id(c.files_list.last_changeset.raw_id)), | |
|
5 | h.url('files_home',repo_name=c.repo_name,revision=c.files_list.last_changeset.raw_id,f_path=c.f_path))} | |
|
6 | 6 | </dd> |
|
7 | 7 | <dt>${_('Size')}</dt> |
|
8 | 8 | <dd>${h.format_byte_size(c.files_list.size,binary=True)}</dd> |
@@ -20,8 +20,8 b'' | |||
|
20 | 20 | <dd> |
|
21 | 21 | <div> |
|
22 | 22 | ${h.form(h.url('files_diff_home',repo_name=c.repo_name,f_path=c.f_path),method='get')} |
|
23 |
${h.hidden('diff2',c.files_list.last_changeset. |
|
|
24 |
${h.select('diff1',c.files_list.last_changeset. |
|
|
23 | ${h.hidden('diff2',c.files_list.last_changeset.raw_id)} | |
|
24 | ${h.select('diff1',c.files_list.last_changeset.raw_id,c.file_history)} | |
|
25 | 25 | ${h.submit('diff','diff to revision',class_="ui-button ui-widget ui-state-default ui-corner-all")} |
|
26 | 26 | ${h.submit('show_rev','show at revision',class_="ui-button ui-widget ui-state-default ui-corner-all")} |
|
27 | 27 | ${h.end_form()} |
@@ -32,7 +32,7 b'' | |||
|
32 | 32 | |
|
33 | 33 | <div id="body" class="codeblock"> |
|
34 | 34 | <div class="code-header"> |
|
35 |
<div class="revision">${c.files_list.name}@r${c.files_list.last_changeset.revision}:${c.files_list.last_changeset. |
|
|
35 | <div class="revision">${c.files_list.name}@r${c.files_list.last_changeset.revision}:${h.short_id(c.files_list.last_changeset.raw_id)}</div> | |
|
36 | 36 | <div class="commit">"${c.files_list.last_changeset.message}"</div> |
|
37 | 37 | </div> |
|
38 | 38 | <div class="code-body"> |
@@ -56,33 +56,36 b'' | |||
|
56 | 56 | <tr class="parity${cnt%2}"> |
|
57 | 57 | <td> |
|
58 | 58 | %if repo['repo'].dbrepo.repo_type =='hg': |
|
59 | <img class="icon" alt="${_('Mercurial repository')}" src="/images/icons/hgicon.png"/> | |
|
59 | <img class="icon" title="${_('Mercurial repository')}" alt="${_('Mercurial repository')}" src="/images/icons/hgicon.png"/> | |
|
60 | 60 | %elif repo['repo'].dbrepo.repo_type =='git': |
|
61 | <img class="icon" alt="${_('Git repository')}" src="/images/icons/giticon.png"/> | |
|
61 | <img class="icon" title="${_('Git repository')}" alt="${_('Git repository')}" src="/images/icons/giticon.png"/> | |
|
62 | 62 | %else: |
|
63 | 63 | |
|
64 | 64 | %endif |
|
65 | 65 | |
|
66 | 66 | %if repo['repo'].dbrepo.private: |
|
67 | <img class="icon" alt="${_('private')}" src="/images/icons/lock.png"/> | |
|
67 | <img class="icon" title="${_('private repository')}" alt="${_('private repository')}" src="/images/icons/lock.png"/> | |
|
68 | 68 | %else: |
|
69 | <img class="icon" alt="${_('public')}" src="/images/icons/lock_open.png"/> | |
|
69 | <img class="icon" title="${_('public repository')}" alt="${_('public repository')}" src="/images/icons/lock_open.png"/> | |
|
70 | 70 | %endif |
|
71 | 71 | ${h.link_to(repo['name'], |
|
72 | 72 | h.url('summary_home',repo_name=repo['name']))} |
|
73 | 73 | %if repo['repo'].dbrepo.fork: |
|
74 | 74 | <a href="${h.url('summary_home',repo_name=repo['repo'].dbrepo.fork.repo_name)}"> |
|
75 |
<img class="icon" alt="${_(' |
|
|
75 | <img class="icon" alt="${_('fork')}" | |
|
76 | 76 | title="${_('Fork of')} ${repo['repo'].dbrepo.fork.repo_name}" |
|
77 | 77 | src="/images/icons/arrow_divide.png"/></a> |
|
78 | 78 | %endif |
|
79 | 79 | </td> |
|
80 | <td title="${repo['description']}">${h.truncate(repo['description'],60)}</td> | |
|
80 | <td><span class="tooltip" tooltip_title="${repo['description']}"> | |
|
81 | ${h.truncate(repo['description'],60)}</span> | |
|
82 | </td> | |
|
81 | 83 | <td><span class="tooltip" tooltip_title="${repo['last_change']}"> |
|
82 |
${h.age(repo['last_change'])} </span> |
|
|
84 | ${h.age(repo['last_change'])} </span> | |
|
85 | </td> | |
|
83 | 86 | <td> |
|
84 | 87 | %if repo['rev']>=0: |
|
85 | ${h.link_to('r%s:%s' % (repo['rev'],repo['tip']), | |
|
88 | ${h.link_to('r%s:%s' % (repo['rev'],h.short_id(repo['tip'])), | |
|
86 | 89 | h.url('changeset_home',repo_name=repo['name'],revision=repo['tip']), |
|
87 | 90 | class_="tooltip", |
|
88 | 91 | tooltip_title=h.tooltip(repo['last_msg']))} |
@@ -3,9 +3,9 b'' | |||
|
3 | 3 | <table> |
|
4 | 4 | <tr> |
|
5 | 5 | <th class="left">${_('date')}</th> |
|
6 | <th class="left">${_('commit message')}</th> | |
|
6 | 7 | <th class="left">${_('author')}</th> |
|
7 | 8 | <th class="left">${_('revision')}</th> |
|
8 | <th class="left">${_('commit message')}</th> | |
|
9 | 9 | <th class="left">${_('branch')}</th> |
|
10 | 10 | <th class="left">${_('tags')}</th> |
|
11 | 11 | <th class="left">${_('links')}</th> |
@@ -13,14 +13,14 b'' | |||
|
13 | 13 | </tr> |
|
14 | 14 | %for cnt,cs in enumerate(c.repo_changesets): |
|
15 | 15 | <tr class="parity${cnt%2}"> |
|
16 |
<td>${h.age(cs.date)} |
|
|
16 | <td>${cs.date} - ${h.age(cs.date)}</td> | |
|
17 | <td> | |
|
18 | ${h.link_to(h.truncate(cs.message,60), | |
|
19 | h.url('changeset_home',repo_name=c.repo_name,revision=cs.raw_id), | |
|
20 | title=cs.message)} | |
|
21 | </td> | |
|
17 | 22 | <td title="${cs.author}">${h.person(cs.author)}</td> |
|
18 |
<td>r${cs.revision}:${ |
|
|
19 | <td> | |
|
20 | ${h.link_to(h.truncate(cs.message,60), | |
|
21 | h.url('changeset_home',repo_name=c.repo_name,revision=cs.short_id), | |
|
22 | title=cs.message)} | |
|
23 | </td> | |
|
23 | <td>r${cs.revision}:${h.short_id(cs.raw_id)}</td> | |
|
24 | 24 | <td> |
|
25 | 25 | <span class="logtags"> |
|
26 | 26 | <span class="branchtag">${cs.branch}</span> |
@@ -34,9 +34,9 b'' | |||
|
34 | 34 | </span> |
|
35 | 35 | </td> |
|
36 | 36 | <td class="nowrap"> |
|
37 |
${h.link_to(_('changeset'),h.url('changeset_home',repo_name=c.repo_name,revision=cs. |
|
|
37 | ${h.link_to(_('changeset'),h.url('changeset_home',repo_name=c.repo_name,revision=cs.raw_id))} | |
|
38 | 38 | | |
|
39 |
${h.link_to(_('files'),h.url('files_home',repo_name=c.repo_name,revision=cs. |
|
|
39 | ${h.link_to(_('files'),h.url('files_home',repo_name=c.repo_name,revision=cs.raw_id))} | |
|
40 | 40 | </td> |
|
41 | 41 | </tr> |
|
42 | 42 | %endfor |
@@ -42,10 +42,19 b' E.onDOMReady(function(e){' | |||
|
42 | 42 | <label>${_('Name')}:</label> |
|
43 | 43 | </div> |
|
44 | 44 | <div class="input-short"> |
|
45 | ||
|
46 | %if c.repo_info.dbrepo.repo_type =='hg': | |
|
47 | <img style="margin-bottom:2px" class="icon" title="${_('Mercurial repository')}" alt="${_('Mercurial repository')}" src="/images/icons/hgicon.png"/> | |
|
48 | %elif c.repo_info.dbrepo.repo_type =='git': | |
|
49 | <img style="margin-bottom:2px" class="icon" title="${_('Git repository')}" alt="${_('Git repository')}" src="/images/icons/giticon.png"/> | |
|
50 | %else: | |
|
51 | ||
|
52 | %endif | |
|
53 | ||
|
45 | 54 | %if c.repo_info.dbrepo.private: |
|
46 | <img style="margin-bottom:2px" class="icon" title="${_('private repository')}" alt="${_('private')}" src="/images/icons/lock.png"/> | |
|
55 | <img style="margin-bottom:2px" class="icon" title="${_('private repository')}" alt="${_('private repository')}" src="/images/icons/lock.png"/> | |
|
47 | 56 | %else: |
|
48 | <img style="margin-bottom:2px" class="icon" title="${_('public repository')}" alt="${_('public')}" src="/images/icons/lock_open.png"/> | |
|
57 | <img style="margin-bottom:2px" class="icon" title="${_('public repository')}" alt="${_('public repository')}" src="/images/icons/lock_open.png"/> | |
|
49 | 58 | %endif |
|
50 | 59 | <span style="font-size: 1.6em;font-weight: bold;vertical-align: baseline;">${c.repo_info.name}</span> |
|
51 | 60 | <br/> |
@@ -1,25 +1,27 b'' | |||
|
1 | 1 | %if c.repo_tags: |
|
2 | 2 | <table> |
|
3 | 3 | <tr> |
|
4 |
|
|
|
5 |
|
|
|
6 |
|
|
|
4 | <th class="left">${_('date')}</th> | |
|
5 | <th class="left">${_('name')}</th> | |
|
6 | <th class="left">${_('author')}</th> | |
|
7 | <th class="left">${_('revision')}</th> | |
|
7 | 8 | <th class="left">${_('links')}</th> |
|
8 | 9 | </tr> |
|
9 | 10 | %for cnt,tag in enumerate(c.repo_tags.items()): |
|
10 | <tr class="parity${cnt%2}"> | |
|
11 |
|
|
|
12 | <td>r${tag[1].revision}:${tag[1].short_id}</td> | |
|
13 | <td> | |
|
14 | <span class="logtags"> | |
|
15 | <span class="tagtag">${h.link_to(tag[0], | |
|
16 | h.url('changeset_home',repo_name=c.repo_name,revision=tag[1].short_id))}</span> | |
|
17 | </span> | |
|
18 | </td> | |
|
11 | <tr class="parity${cnt%2}"> | |
|
12 | <td>${tag[1].date} - ${h.age(tag[1].date)}</td> | |
|
13 | <td> | |
|
14 | <span class="logtags"> | |
|
15 | <span class="tagtag">${h.link_to(tag[0], | |
|
16 | h.url('changeset_home',repo_name=c.repo_name,revision=tag[1].raw_id))}</span> | |
|
17 | </span> | |
|
18 | </td> | |
|
19 | <td title="${tag[1].author}">${h.person(tag[1].author)}</td> | |
|
20 | <td>r${tag[1].revision}:${h.short_id(tag[1].raw_id)}</td> | |
|
19 | 21 | <td class="nowrap"> |
|
20 |
${h.link_to(_('changeset'),h.url('changeset_home',repo_name=c.repo_name,revision=tag[1]. |
|
|
22 | ${h.link_to(_('changeset'),h.url('changeset_home',repo_name=c.repo_name,revision=tag[1].raw_id))} | |
|
21 | 23 | | |
|
22 |
${h.link_to(_('files'),h.url('files_home',repo_name=c.repo_name,revision=tag[1]. |
|
|
24 | ${h.link_to(_('files'),h.url('files_home',repo_name=c.repo_name,revision=tag[1].raw_id))} | |
|
23 | 25 | </td> |
|
24 | 26 | </tr> |
|
25 | 27 | %endfor |
General Comments 0
You need to be logged in to leave comments.
Login now