##// END OF EJS Templates
added info about forked repository in few places...
marcink -
r531:6fc59ac3 default
parent child Browse files
Show More
@@ -31,6 +31,7 b' from pylons_app.model import meta'
31 from pylons_app.model.db import Repository, User
31 from pylons_app.model.db import Repository, User
32 from pylons_app.lib import helpers as h
32 from pylons_app.lib import helpers as h
33 from vcs.exceptions import RepositoryError, VCSError
33 from vcs.exceptions import RepositoryError, VCSError
34 from sqlalchemy.orm import joinedload
34 import logging
35 import logging
35 import os
36 import os
36 import sys
37 import sys
@@ -123,7 +124,9 b' class HgModel(object):'
123 dbrepo = None
124 dbrepo = None
124 if not initial:
125 if not initial:
125 dbrepo = sa.query(Repository)\
126 dbrepo = sa.query(Repository)\
126 .filter(Repository.repo_name == name).scalar()
127 .options(joinedload(Repository.fork))\
128 .filter(Repository.repo_name == name)\
129 .scalar()
127
130
128 if dbrepo:
131 if dbrepo:
129 log.info('Adding db instance to cached list')
132 log.info('Adding db instance to cached list')
@@ -27,9 +27,11 b''
27 <div class="table">
27 <div class="table">
28 <table class="table_disp">
28 <table class="table_disp">
29 <tr class="header">
29 <tr class="header">
30 <th class="left">${_('name')}</th>
30 <th class="left">${_('Name')}</th>
31 <th class="left">${_('owner')}</th>
31 <th class="left">${_('Description')}</th>
32 <th class="left">${_('last revision')}</th>
32 <th class="left">${_('Last change')}</th>
33 <th class="left">${_('Tip')}</th>
34 <th class="left">${_('Contact')}</th>
33 <th class="left">${_('action')}</th>
35 <th class="left">${_('action')}</th>
34 </tr>
36 </tr>
35 %for cnt,repo in enumerate(c.repos_list):
37 %for cnt,repo in enumerate(c.repos_list):
@@ -40,9 +42,28 b''
40 %else:
42 %else:
41 <img alt="${_('public')}" src="/images/icons/lock_open.png"/>
43 <img alt="${_('public')}" src="/images/icons/lock_open.png"/>
42 %endif
44 %endif
43 ${h.link_to(repo['name'],h.url('edit_repo',repo_name=repo['name']))}</td>
45 ${h.link_to(repo['name'],h.url('edit_repo',repo_name=repo['name']))}
44 <td>${repo['contact']}</td>
46
45 <td>r${repo['rev']}:${repo['tip']}</td>
47 %if repo['repo'].dbrepo.fork:
48 <a href="${h.url('summary_home',repo_name=repo['repo'].dbrepo.fork.repo_name)}">
49 <img class="icon" alt="${_('public')}"
50 title="${_('Fork of')} ${repo['repo'].dbrepo.fork.repo_name}"
51 src="/images/icons/arrow_divide.png"/></a>
52 %endif
53 </td>
54 <td title="${repo['description']}">${h.truncate(repo['description'],60)}</td>
55 <td>${h.age(repo['last_change'])}</td>
56 <td>
57 %if repo['rev']>=0:
58 ${h.link_to('r%s:%s' % (repo['rev'],repo['tip']),
59 h.url('changeset_home',repo_name=repo['name'],revision=repo['tip']),
60 class_="tooltip",
61 tooltip_title=h.tooltip(repo['last_msg']))}
62 %else:
63 ${_('No changesets yet')}
64 %endif
65 </td>
66 <td title="${repo['contact']}">${h.person(repo['contact'])}</td>
46 <td>
67 <td>
47 ${h.form(url('repo', repo_name=repo['name']),method='delete')}
68 ${h.form(url('repo', repo_name=repo['name']),method='delete')}
48 ${h.submit('remove_%s' % repo['name'],'delete',class_="delete_icon action_button",onclick="return confirm('Confirm to delete this repository');")}
69 ${h.submit('remove_%s' % repo['name'],'delete',class_="delete_icon action_button",onclick="return confirm('Confirm to delete this repository');")}
@@ -98,7 +98,14 b''
98 <img class="icon" alt="${_('public')}" src="/images/icons/lock_open.png"/>
98 <img class="icon" alt="${_('public')}" src="/images/icons/lock_open.png"/>
99 %endif
99 %endif
100
100
101 ${h.link_to(repo.name, h.url('summary_home',repo_name=repo.name))}</td>
101 ${h.link_to(repo.name, h.url('summary_home',repo_name=repo.name))}
102 %if repo.dbrepo.fork:
103 <a href="${h.url('summary_home',repo_name=repo.dbrepo.fork.repo_name)}">
104 <img class="icon" alt="${_('public')}"
105 title="${_('Fork of')} ${repo.dbrepo.fork.repo_name}"
106 src="/images/icons/arrow_divide.png"/></a>
107 %endif
108 </td>
102 <td>${_('revision')}: ${h.get_changeset_safe(repo,'tip').revision}</td>
109 <td>${_('revision')}: ${h.get_changeset_safe(repo,'tip').revision}</td>
103 <td>${_('last changed')}: ${h.age(repo.last_change)}</td>
110 <td>${_('last changed')}: ${h.age(repo.last_change)}</td>
104 <td><img class="icon" alt="${_('private')}" src="/images/icons/application_form_edit.png"/> ${h.link_to(_('edit'),h.url('repo_settings_home',repo_name=repo.name))}</td>
111 <td><img class="icon" alt="${_('private')}" src="/images/icons/application_form_edit.png"/> ${h.link_to(_('edit'),h.url('repo_settings_home',repo_name=repo.name))}</td>
@@ -61,7 +61,14 b''
61 <img class="icon" alt="${_('public')}" src="/images/icons/lock_open.png"/>
61 <img class="icon" alt="${_('public')}" src="/images/icons/lock_open.png"/>
62 %endif
62 %endif
63 ${h.link_to(repo['name'],
63 ${h.link_to(repo['name'],
64 h.url('summary_home',repo_name=repo['name']))}</td>
64 h.url('summary_home',repo_name=repo['name']))}
65 %if repo['repo'].dbrepo.fork:
66 <a href="${h.url('summary_home',repo_name=repo['repo'].dbrepo.fork.repo_name)}">
67 <img class="icon" alt="${_('public')}"
68 title="${_('Fork of')} ${repo['repo'].dbrepo.fork.repo_name}"
69 src="/images/icons/arrow_divide.png"/></a>
70 %endif
71 </td>
65 <td title="${repo['description']}">${h.truncate(repo['description'],60)}</td>
72 <td title="${repo['description']}">${h.truncate(repo['description'],60)}</td>
66 <td>${h.age(repo['last_change'])}</td>
73 <td>${h.age(repo['last_change'])}</td>
67 <td>
74 <td>
@@ -42,7 +42,17 b' E.onDOMReady(function(e){'
42 <label>${_('Name')}:</label>
42 <label>${_('Name')}:</label>
43 </div>
43 </div>
44 <div class="input-short">
44 <div class="input-short">
45 <span style="font-size: 1.6em;font-weight: bold">${c.repo_info.name}</span>
45 <span style="font-size: 1.6em;font-weight: bold;">${c.repo_info.name}</span><br/>
46 %if c.repo_info.dbrepo.fork:
47 <span style="margin-top:5px">
48 <a href="${h.url('summary_home',repo_name=c.repo_info.dbrepo.fork.repo_name)}">
49 <img class="icon" alt="${_('public')}"
50 title="${_('Fork of')} ${c.repo_info.dbrepo.fork.repo_name}"
51 src="/images/icons/arrow_divide.png"/>
52 ${_('Fork of')} ${c.repo_info.dbrepo.fork.repo_name}
53 </a>
54 </span>
55 %endif
46 </div>
56 </div>
47 </div>
57 </div>
48
58
General Comments 0
You need to be logged in to leave comments. Login now