# HG changeset patch # User Marcin Kuzminski # Date 2010-09-03 05:34:38 # Node ID 70c2750531d3e6f6543f02aa9698c24736396b3a # Parent a0a93357f954f15c853c31758be81787a3e38527 rewrote sorting on main page, to clickable headers. Update my account with better repo list some css fixes diff --git a/pylons_app/controllers/hg.py b/pylons_app/controllers/hg.py --- a/pylons_app/controllers/hg.py +++ b/pylons_app/controllers/hg.py @@ -37,19 +37,20 @@ class HgController(BaseController): super(HgController, self).__before__() def index(self): - c.current_sort = request.GET.get('sort', 'name') - sort_by = c.current_sort sortables = ['name', 'description', 'last_change', 'tip', 'contact'] + current_sort = request.GET.get('sort', 'name') + current_sort_slug = current_sort.replace('-', '') - c.cs_slug = sort_by.replace('-', '') - - if c.cs_slug not in sortables: - sort_by = 'name' - + if current_sort_slug not in sortables: + c.sort_by = 'name' + current_sort_slug = c.sort_by + else: + c.sort_by = current_sort + c.sort_slug = current_sort_slug cached_repo_list = HgModel().get_repos() - sort_key = c.cs_slug + '_sort' - if sort_by.startswith('-'): + sort_key = current_sort_slug + '_sort' + if c.sort_by.startswith('-'): c.repos_list = sorted(cached_repo_list, key=itemgetter(sort_key), reverse=True) else: c.repos_list = sorted(cached_repo_list, key=itemgetter(sort_key), reverse=False) diff --git a/pylons_app/public/css/style.css b/pylons_app/public/css/style.css --- a/pylons_app/public/css/style.css +++ b/pylons_app/public/css/style.css @@ -26,6 +26,10 @@ img border: none; } +img.icon{ + vertical-align: bottom; + +} /* ----------------------------------------------------------- anchors ----------------------------------------------------------- */ diff --git a/pylons_app/templates/admin/users/user_edit_my_account.html b/pylons_app/templates/admin/users/user_edit_my_account.html --- a/pylons_app/templates/admin/users/user_edit_my_account.html +++ b/pylons_app/templates/admin/users/user_edit_my_account.html @@ -14,67 +14,69 @@ <%def name="main()"> +
${self.breadcrumbs()}
+
${h.form(url('admin_settings_my_account_update'),method='put')} -
- -
-
-
- -
-
- ${h.text('username')} -
-
- -
-
- -
-
- ${h.password('new_password')} -
-
- -
-
- -
-
- ${h.text('name')} -
-
- -
-
- -
-
- ${h.text('lastname')} -
-
- -
-
- -
-
- ${h.text('email')} -
-
- -
- ${h.submit('save','save',class_="ui-button ui-widget ui-state-default ui-corner-all")} -
-
+
+
+
+
+ +
+
+ ${h.text('username')} +
+
+ +
+
+ +
+
+ ${h.password('new_password')} +
+
+ +
+
+ +
+
+ ${h.text('name')} +
+
+ +
+
+ +
+
+ ${h.text('lastname')} +
+
+ +
+
+ +
+
+ ${h.text('email')} +
+
+ +
+ ${h.submit('save','save',class_="ui-button ui-widget ui-state-default ui-corner-all")} +
+
+
+ ${h.end_form()}
- ${h.end_form()}
@@ -84,25 +86,25 @@
- - - %for repo in c.user_repos: - - - ## - - - - %endfor - -
- %if repo.dbrepo.private: - ${_('private')} - %else: - ${_('public')} - %endif - - ${h.link_to(repo.name, h.url('summary_home',repo_name=repo.name))}${_('created')} ${repo.dbrepo.}${_('last changed')} ${h.age(repo.last_change)}${h.link_to(_('[edit]'),h.url('edit_repo',repo_name=repo.name))}
+ + + %for repo in c.user_repos: + + + + + + + %endfor + +
+ %if repo.dbrepo.private: + ${_('private')} + %else: + ${_('public')} + %endif + + ${h.link_to(repo.name, h.url('summary_home',repo_name=repo.name))}${_('revision')}: ${repo.revisions[-1]}${_('last changed')}: ${h.age(repo.last_change)}${_('private')} ${h.link_to(_('edit'),h.url('edit_repo',repo_name=repo.name))}
diff --git a/pylons_app/templates/index.html b/pylons_app/templates/index.html --- a/pylons_app/templates/index.html +++ b/pylons_app/templates/index.html @@ -12,17 +12,18 @@ <%def name="main()"> <%def name="get_sort(name)"> <%name_slug = name.lower().replace(' ','_') %> - %if name_slug == c.cs_slug: - ${name} + + %if name_slug == c.sort_slug: + %if c.sort_by.startswith('-'): + ${name}↑ + %else: + ${name}↓ + %endif: %else: - ${name} + ${name} %endif - - - -
@@ -55,9 +56,9 @@ %if repo['repo'].dbrepo.private: - ${_('private')} + ${_('private')} %else: - ${_('public')} + ${_('public')} %endif ${h.link_to(repo['name'], h.url('summary_home',repo_name=repo['name']))} diff --git a/pylons_app/templates/summary/summary.html b/pylons_app/templates/summary/summary.html --- a/pylons_app/templates/summary/summary.html +++ b/pylons_app/templates/summary/summary.html @@ -42,7 +42,7 @@ E.onDOMReady(function(e){
- ${c.repo_info.name} + ${c.repo_info.name}