# HG changeset patch # User Marcin Kuzminski # Date 2013-01-09 00:59:43 # Node ID 0226b6d6b2b56f2f75ac9aa6eea5b10b48f1e95e # Parent 8046d1979674d807c7cffcb36e0d468e5e04a41d Use common function for generation of grid data - admin grid now has dedicated edit button, and uses changeset_cache - some small improvements to grid - all other datatables use this diff --git a/rhodecode/config/routing.py b/rhodecode/config/routing.py --- a/rhodecode/config/routing.py +++ b/rhodecode/config/routing.py @@ -359,8 +359,6 @@ def make_map(config): m.connect('api', '/api') #USER JOURNAL - rmap.connect('journal_my_repos', '%s/journal_my_repos' % ADMIN_PREFIX, - controller='journal', action='index_my_repos') rmap.connect('journal', '%s/journal' % ADMIN_PREFIX, controller='journal', action='index') rmap.connect('journal_rss', '%s/journal/rss' % ADMIN_PREFIX, diff --git a/rhodecode/controllers/admin/repos.py b/rhodecode/controllers/admin/repos.py --- a/rhodecode/controllers/admin/repos.py +++ b/rhodecode/controllers/admin/repos.py @@ -135,40 +135,10 @@ class ReposController(BaseController): .order_by(func.lower(Repository.repo_name))\ .all() - repos_data = [] - total_records = len(c.repos_list) - - _tmpl_lookup = rhodecode.CONFIG['pylons.app_globals'].mako_lookup - template = _tmpl_lookup.get_template('data_table/_dt_elements.html') - - quick_menu = lambda repo_name: (template.get_def("quick_menu") - .render(repo_name, _=_, h=h, c=c)) - repo_lnk = lambda name, rtype, private, fork_of: ( - template.get_def("repo_name") - .render(name, rtype, private, fork_of, short_name=False, - admin=True, _=_, h=h, c=c)) - - repo_actions = lambda repo_name: (template.get_def("repo_actions") - .render(repo_name, _=_, h=h, c=c)) - - for repo in c.repos_list: - repos_data.append({ - "menu": quick_menu(repo.repo_name), - "raw_name": repo.repo_name.lower(), - "name": repo_lnk(repo.repo_name, repo.repo_type, - repo.private, repo.fork), - "desc": repo.description, - "owner": repo.user.username, - "action": repo_actions(repo.repo_name), - }) - - c.data = json.dumps({ - "totalRecords": total_records, - "startIndex": 0, - "sort": "name", - "dir": "asc", - "records": repos_data - }) + repos_data = RepoModel().get_repos_as_dict(repos_list=c.repos_list, + admin=True) + #json used to render the grid + c.data = json.dumps(repos_data) return render('admin/repos/repos.html') diff --git a/rhodecode/controllers/admin/repos_groups.py b/rhodecode/controllers/admin/repos_groups.py --- a/rhodecode/controllers/admin/repos_groups.py +++ b/rhodecode/controllers/admin/repos_groups.py @@ -295,54 +295,18 @@ class ReposGroupsController(BaseControll c.groups = self.scm_model.get_repos_groups(groups) if c.visual.lightweight_dashboard is False: - c.cached_repo_list = self.scm_model.get_repos(all_repos=gr_filter) - - c.repos_list = c.cached_repo_list + c.repo_list = self.scm_model.get_repos(all_repos=gr_filter) ## lightweight version of dashboard else: c.repos_list = Repository.query()\ .filter(Repository.group_id == id)\ .order_by(func.lower(Repository.repo_name))\ .all() - repos_data = [] - total_records = len(c.repos_list) - _tmpl_lookup = rhodecode.CONFIG['pylons.app_globals'].mako_lookup - template = _tmpl_lookup.get_template('data_table/_dt_elements.html') - - quick_menu = lambda repo_name: (template.get_def("quick_menu") - .render(repo_name, _=_, h=h, c=c)) - repo_lnk = lambda name, rtype, private, fork_of: ( - template.get_def("repo_name") - .render(name, rtype, private, fork_of, short_name=False, - admin=False, _=_, h=h, c=c)) - last_change = lambda last_change: (template.get_def("last_change") - .render(last_change, _=_, h=h, c=c)) - rss_lnk = lambda repo_name: (template.get_def("rss") - .render(repo_name, _=_, h=h, c=c)) - atom_lnk = lambda repo_name: (template.get_def("atom") - .render(repo_name, _=_, h=h, c=c)) - - for repo in c.repos_list: - repos_data.append({ - "menu": quick_menu(repo.repo_name), - "raw_name": repo.repo_name.lower(), - "name": repo_lnk(repo.repo_name, repo.repo_type, - repo.private, repo.fork), - "last_change": last_change(repo.last_db_change), - "desc": repo.description, - "owner": h.person(repo.user.username), - "rss": rss_lnk(repo.repo_name), - "atom": atom_lnk(repo.repo_name), - }) - - c.data = json.dumps({ - "totalRecords": total_records, - "startIndex": 0, - "sort": "name", - "dir": "asc", - "records": repos_data - }) + repos_data = RepoModel().get_repos_as_dict(repos_list=c.repos_list, + admin=False) + #json used to render the grid + c.data = json.dumps(repos_data) return render('admin/repos_groups/repos_groups.html') diff --git a/rhodecode/controllers/admin/settings.py b/rhodecode/controllers/admin/settings.py --- a/rhodecode/controllers/admin/settings.py +++ b/rhodecode/controllers/admin/settings.py @@ -48,11 +48,12 @@ from rhodecode.model.forms import UserFo ApplicationUiSettingsForm, ApplicationVisualisationForm from rhodecode.model.scm import ScmModel from rhodecode.model.user import UserModel +from rhodecode.model.repo import RepoModel from rhodecode.model.db import User from rhodecode.model.notification import EmailNotificationModel from rhodecode.model.meta import Session from rhodecode.lib.utils2 import str2bool, safe_unicode - +from rhodecode.lib.compat import json log = logging.getLogger(__name__) @@ -390,17 +391,22 @@ class SettingsController(BaseController) # url('admin_settings_my_account') c.user = User.get(self.rhodecode_user.user_id) - all_repos = Session().query(Repository)\ - .filter(Repository.user_id == c.user.user_id)\ - .order_by(func.lower(Repository.repo_name)).all() - - c.user_repos = ScmModel().get_repos(all_repos) if c.user.username == 'default': h.flash(_("You can't edit this user since it's" " crucial for entire application"), category='warning') return redirect(url('users')) + repos_list = Session().query(Repository)\ + .filter(Repository.user_id == + self.rhodecode_user.user_id)\ + .order_by(func.lower(Repository.repo_name)).all() + + repos_data = RepoModel().get_repos_as_dict(repos_list=repos_list, + admin=True) + #json used to render the grid + c.data = json.dumps(repos_data) + defaults = c.user.get_dict() c.form = htmlfill.render( @@ -449,23 +455,14 @@ class SettingsController(BaseController) return redirect(url('my_account')) @NotAnonymous() - def my_account_my_repos(self): - all_repos = Session().query(Repository)\ - .filter(Repository.user_id == self.rhodecode_user.user_id)\ - .order_by(func.lower(Repository.repo_name))\ - .all() - c.user_repos = ScmModel().get_repos(all_repos) - return render('admin/users/user_edit_my_account_repos.html') - - @NotAnonymous() def my_account_my_pullrequests(self): c.my_pull_requests = PullRequest.query()\ - .filter(PullRequest.user_id== + .filter(PullRequest.user_id == self.rhodecode_user.user_id)\ .all() c.participate_in_pull_requests = \ [x.pull_request for x in PullRequestReviewers.query()\ - .filter(PullRequestReviewers.user_id== + .filter(PullRequestReviewers.user_id == self.rhodecode_user.user_id)\ .all()] return render('admin/users/user_edit_my_account_pullrequests.html') diff --git a/rhodecode/controllers/home.py b/rhodecode/controllers/home.py --- a/rhodecode/controllers/home.py +++ b/rhodecode/controllers/home.py @@ -28,6 +28,7 @@ import logging from pylons import tmpl_context as c, request from pylons.i18n.translation import _ from webob.exc import HTTPBadRequest +from sqlalchemy.sql.expression import func import rhodecode from rhodecode.lib import helpers as h @@ -35,7 +36,8 @@ from rhodecode.lib.ext_json import json from rhodecode.lib.auth import LoginRequired from rhodecode.lib.base import BaseController, render from rhodecode.model.db import Repository -from sqlalchemy.sql.expression import func +from rhodecode.model.repo import RepoModel + log = logging.getLogger(__name__) @@ -58,59 +60,11 @@ class HomeController(BaseController): .filter(Repository.group_id == None)\ .order_by(func.lower(Repository.repo_name))\ .all() - repos_data = [] - total_records = len(c.repos_list) - _tmpl_lookup = rhodecode.CONFIG['pylons.app_globals'].mako_lookup - template = _tmpl_lookup.get_template('data_table/_dt_elements.html') - - quick_menu = lambda repo_name: (template.get_def("quick_menu") - .render(repo_name, _=_, h=h, c=c)) - repo_lnk = lambda name, rtype, private, fork_of: ( - template.get_def("repo_name") - .render(name, rtype, private, fork_of, short_name=False, - admin=False, _=_, h=h, c=c)) - last_change = lambda last_change: (template.get_def("last_change") - .render(last_change, _=_, h=h, c=c)) - rss_lnk = lambda repo_name: (template.get_def("rss") - .render(repo_name, _=_, h=h, c=c)) - atom_lnk = lambda repo_name: (template.get_def("atom") - .render(repo_name, _=_, h=h, c=c)) - tip = lambda repo_name, cs_cache: (template.get_def("revision") - .render(repo_name, - cs_cache.get('revision'), - cs_cache.get('raw_id'), - cs_cache.get('author'), - cs_cache.get('message'), _=_, h=h, - c=c)) - - def desc(desc): - if c.visual.stylify_metatags: - return h.urlify_text(h.desc_stylize(h.truncate(desc, 60))) - else: - return h.urlify_text(h.truncate(desc, 60)) - - for repo in c.repos_list: - repos_data.append({ - "menu": quick_menu(repo.repo_name), - "raw_name": repo.repo_name.lower(), - "name": repo_lnk(repo.repo_name, repo.repo_type, - repo.private, repo.fork), - "last_change": last_change(repo.last_db_change), - "tip": tip(repo.repo_name, repo.changeset_cache), - "desc": desc(repo.description), - "owner": h.person(repo.user.username), - "rss": rss_lnk(repo.repo_name), - "atom": atom_lnk(repo.repo_name), - }) - - c.data = json.dumps({ - "totalRecords": total_records, - "startIndex": 0, - "sort": "name", - "dir": "asc", - "records": repos_data - }) + repos_data = RepoModel().get_repos_as_dict(repos_list=c.repos_list, + admin=False) + #json used to render the grid + c.data = json.dumps(repos_data) return render('/index.html') diff --git a/rhodecode/controllers/journal.py b/rhodecode/controllers/journal.py --- a/rhodecode/controllers/journal.py +++ b/rhodecode/controllers/journal.py @@ -27,6 +27,8 @@ from itertools import groupby from sqlalchemy import or_ from sqlalchemy.orm import joinedload +from sqlalchemy.sql.expression import func + from webhelpers.paginate import Page from webhelpers.feedgenerator import Atom1Feed, Rss201rev2Feed @@ -39,10 +41,10 @@ from rhodecode.lib.auth import LoginRequ from rhodecode.lib.base import BaseController, render from rhodecode.model.db import UserLog, UserFollowing, Repository, User from rhodecode.model.meta import Session -from sqlalchemy.sql.expression import func -from rhodecode.model.scm import ScmModel from rhodecode.lib.utils2 import safe_int, AttributeDict from rhodecode.controllers.admin.admin import _journal_filter +from rhodecode.model.repo import RepoModel +from rhodecode.lib.compat import json log = logging.getLogger(__name__) @@ -78,18 +80,73 @@ class JournalController(BaseController): c.journal_data = render('journal/journal_data.html') if request.environ.get('HTTP_X_PARTIAL_XHR'): return c.journal_data - return render('journal/journal.html') + + repos_list = Session().query(Repository)\ + .filter(Repository.user_id == + self.rhodecode_user.user_id)\ + .order_by(func.lower(Repository.repo_name)).all() + + repos_data = RepoModel().get_repos_as_dict(repos_list=repos_list, + admin=True) + #json used to render the grid + c.data = json.dumps(repos_data) + + watched_repos_data = [] + + ## watched repos + _render = RepoModel._render_datatable + + def quick_menu(repo_name): + return _render('quick_menu', repo_name) + + def repo_lnk(name, rtype, private, fork_of): + return _render('repo_name', name, rtype, private, fork_of, + short_name=False, admin=False) + + def last_rev(repo_name, cs_cache): + return _render('revision', repo_name, cs_cache.get('revision'), + cs_cache.get('raw_id'), cs_cache.get('author'), + cs_cache.get('message')) - @LoginRequired() - @NotAnonymous() - def index_my_repos(self): - c.user = User.get(self.rhodecode_user.user_id) - if request.environ.get('HTTP_X_PARTIAL_XHR'): - all_repos = self.sa.query(Repository)\ - .filter(Repository.user_id == c.user.user_id)\ - .order_by(func.lower(Repository.repo_name)).all() - c.user_repos = ScmModel().get_repos(all_repos) - return render('journal/journal_page_repos.html') + def desc(desc): + from pylons import tmpl_context as c + if c.visual.stylify_metatags: + return h.urlify_text(h.desc_stylize(h.truncate(desc, 60))) + else: + return h.urlify_text(h.truncate(desc, 60)) + + def repo_actions(repo_name): + return _render('repo_actions', repo_name) + + def owner_actions(user_id, username): + return _render('user_name', user_id, username) + + def toogle_follow(repo_id): + return _render('toggle_follow', repo_id) + + for entry in c.following: + repo = entry.follows_repository + cs_cache = repo.changeset_cache + row = { + "menu": quick_menu(repo.repo_name), + "raw_name": repo.repo_name.lower(), + "name": repo_lnk(repo.repo_name, repo.repo_type, + repo.private, repo.fork), + "last_changeset": last_rev(repo.repo_name, cs_cache), + "raw_tip": cs_cache.get('revision'), + "action": toogle_follow(repo.repo_id) + } + + watched_repos_data.append(row) + + c.watched_data = json.dumps({ + "totalRecords": len(c.following), + "startIndex": 0, + "sort": "name", + "dir": "asc", + "records": watched_repos_data + }) + return render('journal/journal.html') @LoginRequired(api_access=True) @NotAnonymous() diff --git a/rhodecode/model/repo.py b/rhodecode/model/repo.py --- a/rhodecode/model/repo.py +++ b/rhodecode/model/repo.py @@ -41,6 +41,7 @@ from rhodecode.model.db import Repositor Statistics, UsersGroup, UsersGroupRepoToPerm, RhodeCodeUi, RepoGroup,\ RhodeCodeSetting from rhodecode.lib import helpers as h +from rhodecode.lib.auth import HasRepoPermissionAny log = logging.getLogger(__name__) @@ -113,6 +114,95 @@ class RepoModel(BaseModel): } for gr in users_groups] ) + @classmethod + def _render_datatable(cls, tmpl, *args, **kwargs): + import rhodecode + from pylons import tmpl_context as c + from pylons.i18n.translation import _ + + _tmpl_lookup = rhodecode.CONFIG['pylons.app_globals'].mako_lookup + template = _tmpl_lookup.get_template('data_table/_dt_elements.html') + + tmpl = template.get_def(tmpl) + kwargs.update(dict(_=_, h=h, c=c)) + return tmpl.render(*args, **kwargs) + + def get_repos_as_dict(self, repos_list=None, admin=False, perm_check=True): + _render = self._render_datatable + + def quick_menu(repo_name): + return _render('quick_menu', repo_name) + + def repo_lnk(name, rtype, private, fork_of): + return _render('repo_name', name, rtype, private, fork_of, + short_name=not admin, admin=False) + + def last_change(last_change): + return _render("last_change", last_change) + + def rss_lnk(repo_name): + return _render("rss", repo_name) + + def atom_lnk(repo_name): + return _render("atom", repo_name) + + def last_rev(repo_name, cs_cache): + return _render('revision', repo_name, cs_cache.get('revision'), + cs_cache.get('raw_id'), cs_cache.get('author'), + cs_cache.get('message')) + + def desc(desc): + from pylons import tmpl_context as c + if c.visual.stylify_metatags: + return h.urlify_text(h.desc_stylize(h.truncate(desc, 60))) + else: + return h.urlify_text(h.truncate(desc, 60)) + + def repo_actions(repo_name): + return _render('repo_actions', repo_name) + + def owner_actions(user_id, username): + return _render('user_name', user_id, username) + + repos_data = [] + for repo in repos_list: + if perm_check: + # check permission at this level + if not HasRepoPermissionAny( + 'repository.read', 'repository.write', 'repository.admin' + )(repo.repo_name, 'get_repos_as_dict check'): + continue + cs_cache = repo.changeset_cache + row = { + "menu": quick_menu(repo.repo_name), + "raw_name": repo.repo_name.lower(), + "name": repo_lnk(repo.repo_name, repo.repo_type, + repo.private, repo.fork), + "last_change": last_change(repo.last_db_change), + "last_changeset": last_rev(repo.repo_name, cs_cache), + "raw_tip": cs_cache.get('revision'), + "desc": desc(repo.description), + "owner": h.person(repo.user.username), + "rss": rss_lnk(repo.repo_name), + "atom": atom_lnk(repo.repo_name), + + } + if admin: + row.update({ + "action": repo_actions(repo.repo_name), + "owner": owner_actions(repo.user.user_id, + h.person(repo.user.username)) + }) + repos_data.append(row) + + return { + "totalRecords": len(repos_list), + "startIndex": 0, + "sort": "name", + "dir": "asc", + "records": repos_data + } + def _get_defaults(self, repo_name): """ Get's information about repository, and returns a dict for diff --git a/rhodecode/public/css/style.css b/rhodecode/public/css/style.css --- a/rhodecode/public/css/style.css +++ b/rhodecode/public/css/style.css @@ -3235,7 +3235,7 @@ table.code-browser .submodule-dir { } .edit_icon { - background: url("../images/icons/folder_edit.png") no-repeat scroll 3px; + background: url("../images/icons/application_form_edit.png") no-repeat scroll 3px; padding-left: 20px; padding-top: 0px; text-align: left; diff --git a/rhodecode/templates/admin/repos/repos.html b/rhodecode/templates/admin/repos/repos.html --- a/rhodecode/templates/admin/repos/repos.html +++ b/rhodecode/templates/admin/repos/repos.html @@ -40,6 +40,7 @@ {key:"raw_name"}, {key:"name"}, {key:"desc"}, + {key:"last_changeset"}, {key:"owner"}, {key:"action"}, ] @@ -70,6 +71,8 @@ {key:"name",label:"${_('Name')}",sortable:true, sortOptions: { sortFunction: nameSort }}, {key:"desc",label:"${_('Description')}",sortable:true}, + {key:"last_changeset",label:"${_('Tip')}",sortable:true, + sortOptions: { sortFunction: revisionSort }}, {key:"owner",label:"${_('Owner')}",sortable:true}, {key:"action",label:"${_('Action')}",sortable:false}, ]; @@ -77,7 +80,7 @@ var myDataTable = new YAHOO.widget.DataTable("repos_list_wrap", myColumnDefs, myDataSource,{ sortedBy:{key:"name",dir:"asc"}, paginator: new YAHOO.widget.Paginator({ - rowsPerPage: 15, + rowsPerPage: 25, alwaysVisible: false, template : "{PreviousPageLink} {FirstPageLink} {PageLinks} {LastPageLink} {NextPageLink}", pageLinks: 5, @@ -111,7 +114,7 @@ // Reset sort var state = myDataTable.getState(); - state.sortedBy = {key:'name', dir:YAHOO.widget.DataTable.CLASS_ASC}; + state.sortedBy = {key:'name', dir:YAHOO.widget.DataTable.CLASS_ASC}; // Get filtered data myDataSource.sendRequest(YUD.get('q_filter').value,{ @@ -123,7 +126,11 @@ }; YUE.on('q_filter','click',function(){ - YUD.get('q_filter').value = ''; + if(!YUD.hasClass('q_filter', 'loaded')){ + YUD.get('q_filter').value = ''; + //TODO: load here full list later to do search within groups + YUD.addClass('q_filter', 'loaded'); + } }); YUE.on('q_filter','keyup',function (e) { diff --git a/rhodecode/templates/admin/users/user_edit_my_account.html b/rhodecode/templates/admin/users/user_edit_my_account.html --- a/rhodecode/templates/admin/users/user_edit_my_account.html +++ b/rhodecode/templates/admin/users/user_edit_my_account.html @@ -48,7 +48,7 @@ -
+
%for section in sorted(c.rhodecode_user.permissions.keys()):
${section.replace("_"," ").capitalize()}
@@ -94,30 +94,26 @@
%endfor
- - - diff --git a/rhodecode/templates/admin/users/user_edit_my_account_repos.html b/rhodecode/templates/admin/users/user_edit_my_account_repos.html --- a/rhodecode/templates/admin/users/user_edit_my_account_repos.html +++ b/rhodecode/templates/admin/users/user_edit_my_account_repos.html @@ -1,46 +1,1 @@ -
- - - - - - - - - - - <%namespace name="dt" file="/data_table/_dt_elements.html"/> - %if c.user_repos: - %for repo in c.user_repos: - - ##QUICK MENU - - ##REPO NAME AND ICONS - - ##LAST REVISION - - - - - %endfor - %else: -
- ${_('No repositories yet')} - %if h.HasPermissionAny('hg.admin','hg.create.repository')(): - ${h.link_to(_('create one now'),h.url('admin_settings_create_repository'),class_="ui-btn")} - %endif -
- %endif - -
${_('Name')}${_('Revision')}${_('Action')}${_('Action')}
- ${dt.quick_menu(repo['name'])} - - ${dt.repo_name(repo['name'],repo['dbrepo']['repo_type'],repo['dbrepo']['private'],h.AttributeDict(repo['dbrepo_fork']))} - - ${dt.revision(repo['name'],repo['rev'],repo['tip'],repo['author'],repo['last_msg'])} - ${_('private')} - ${h.form(url('repo_settings_delete', repo_name=repo['name']),method='delete')} - ${h.submit('remove_%s' % repo['name'],'',class_="delete_icon action_button",onclick="return confirm('"+_('Confirm to delete this repository: %s') % repo['name']+"');")} - ${h.end_form()} -
-
+ diff --git a/rhodecode/templates/data_table/_dt_elements.html b/rhodecode/templates/data_table/_dt_elements.html --- a/rhodecode/templates/data_table/_dt_elements.html +++ b/rhodecode/templates/data_table/_dt_elements.html @@ -2,12 +2,6 @@ ## usage: ## <%namespace name="dt" file="/data_table/_dt_elements.html"/> -<%def name="repo_actions(repo_name)"> - ${h.form(h.url('repo', repo_name=repo_name),method='delete')} - ${h.submit('remove_%s' % repo_name,_('delete'),class_="delete_icon action_button",onclick="return confirm('"+_('Confirm to delete this repository: %s') % repo_name+"');")} - ${h.end_form()} - - <%def name="quick_menu(repo_name)"> -<%def name="repo_name(name,rtype,private,fork_of,short_name=False, admin=False)"> +<%def name="repo_name(name,rtype,private,fork_of,short_name=False,admin=False)"> <% def get_name(name,short_name=short_name): if short_name: @@ -116,6 +110,21 @@
gravatar
+<%def name="repo_actions(repo_name)"> +
+
+ + ${h.submit('edit_%s' % repo_name,_('edit'),class_="edit_icon action_button")} + +
+
+ ${h.form(h.url('repo', repo_name=repo_name),method='delete')} + ${h.submit('remove_%s' % repo_name,_('delete'),class_="delete_icon action_button",onclick="return confirm('"+_('Confirm to delete this repository: %s') % repo_name+"');")} + ${h.end_form()} +
+
+ + <%def name="user_actions(user_id, username)"> ${h.form(h.url('delete_user', id=user_id),method='delete')} ${h.submit('remove_',_('delete'),id="remove_user_%s" % user_id, @@ -126,3 +135,10 @@ <%def name="user_name(user_id, username)"> ${h.link_to(username,h.url('edit_user', id=user_id))} + +<%def name="toggle_follow(repo_id)"> + + + + diff --git a/rhodecode/templates/index_base.html b/rhodecode/templates/index_base.html --- a/rhodecode/templates/index_base.html +++ b/rhodecode/templates/index_base.html @@ -127,9 +127,6 @@ % if c.visual.lightweight_dashboard is False: % else: diff --git a/rhodecode/templates/journal/journal_page_repos.html b/rhodecode/templates/journal/journal_page_repos.html deleted file mode 100644 --- a/rhodecode/templates/journal/journal_page_repos.html +++ /dev/null @@ -1,47 +0,0 @@ -%if c.user_repos: -
- - - - - - - - - - - <%namespace name="dt" file="/data_table/_dt_elements.html"/> - %for repo in c.user_repos: - - ##QUICK MENU - - ##REPO NAME AND ICONS - - ##LAST REVISION - - ## - - - - %endfor - -
${_('Name')}${_('Revision')}${_('Action')}${_('Action')}
- ${dt.quick_menu(repo['name'])} - - ${dt.repo_name(repo['name'],repo['dbrepo']['repo_type'],repo['dbrepo']['private'],h.AttributeDict(repo['dbrepo_fork']))} - - ${dt.revision(repo['name'],repo['rev'],repo['tip'],repo['author'],repo['last_msg'])} - ${_('private')} - ${h.form(url('repo_settings_delete', repo_name=repo['name']),method='delete')} - ${h.submit('remove_%s' % repo['name'],'',class_="delete_icon action_button",onclick="return confirm('"+_('Confirm to delete this repository: %s') % repo['name']+"');")} - ${h.end_form()} -
-
- %else: -
- ${_('No repositories yet')} - %if h.HasPermissionAny('hg.admin','hg.create.repository')(): - ${h.link_to(_('create one now'),h.url('admin_settings_create_repository'),class_="ui-btn")} - %endif -
- %endif