grids: columns and sorting fixes
marcink -
r4150:554d4203 default
Not Reviewed
Show More
Add another comment
TODOs: 0 unresolved 0 Resolved
COMMENTS: 0 General 0 Inline
@@ -111,9 +111,9
111 def repo_group_list_data(self):
111 def repo_group_list_data(self):
112 self.load_default_context()
112 self.load_default_context()
113 column_map = {
113 column_map = {
114 'name_raw': 'group_name_hash',
114 'name': 'group_name_hash',
115 'desc': 'group_description',
115 'desc': 'group_description',
116 'last_change_raw': 'updated_on',
116 'last_change': 'updated_on',
117 'top_level_repos': 'repos_total',
117 'top_level_repos': 'repos_total',
118 'owner': 'user_username',
118 'owner': 'user_username',
119 }
119 }
@@ -223,9 +223,8
223 row = {
223 row = {
224 "menu": quick_menu(repo_gr.group_name),
224 "menu": quick_menu(repo_gr.group_name),
225 "name": repo_group_lnk(repo_gr.group_name),
225 "name": repo_group_lnk(repo_gr.group_name),
226 "name_raw": repo_gr.group_name,
226
227 "last_change": last_change(repo_gr.updated_on),
227 "last_change": last_change(repo_gr.updated_on),
228 "last_change_raw": datetime_to_time(repo_gr.updated_on),
229
228
230 "last_changeset": "",
229 "last_changeset": "",
231 "last_changeset_raw": "",
230 "last_changeset_raw": "",
@@ -81,9 +81,9
81 def repository_list_data(self):
81 def repository_list_data(self):
82 self.load_default_context()
82 self.load_default_context()
83 column_map = {
83 column_map = {
84 'name_raw': 'repo_name',
84 'name': 'repo_name',
85 'desc': 'description',
85 'desc': 'description',
86 'last_change_raw': 'updated_on',
86 'last_change': 'updated_on',
87 'owner': 'user_username',
87 'owner': 'user_username',
88 }
88 }
89 draw, start, limit = self._extract_chunk(self.request)
89 draw, start, limit = self._extract_chunk(self.request)
@@ -171,7 +171,6
171 for user_gr in auth_user_group_list:
171 for user_gr in auth_user_group_list:
172 row = {
172 row = {
173 "users_group_name": user_group_name(user_gr.users_group_name),
173 "users_group_name": user_group_name(user_gr.users_group_name),
174 "name_raw": h.escape(user_gr.users_group_name),
175 "description": h.escape(user_gr.user_group_description),
174 "description": h.escape(user_gr.user_group_description),
176 "members": user_gr.member_count,
175 "members": user_gr.member_count,
177 # NOTE(marcink): because of advanced query we
176 # NOTE(marcink): because of advanced query we
@@ -685,9 +685,9
685
685
686 def _main_page_repo_groups_data(self, repo_group_id):
686 def _main_page_repo_groups_data(self, repo_group_id):
687 column_map = {
687 column_map = {
688 'name_raw': 'group_name_hash',
688 'name': 'group_name_hash',
689 'desc': 'group_description',
689 'desc': 'group_description',
690 'last_change_raw': 'updated_on',
690 'last_change': 'updated_on',
691 'owner': 'user_username',
691 'owner': 'user_username',
692 }
692 }
693 draw, start, limit = self._extract_chunk(self.request)
693 draw, start, limit = self._extract_chunk(self.request)
@@ -700,9 +700,9
700
700
701 def _main_page_repos_data(self, repo_group_id):
701 def _main_page_repos_data(self, repo_group_id):
702 column_map = {
702 column_map = {
703 'name_raw': 'repo_name',
703 'name': 'repo_name',
704 'desc': 'description',
704 'desc': 'description',
705 'last_change_raw': 'updated_on',
705 'last_change': 'updated_on',
706 'owner': 'user_username',
706 'owner': 'user_username',
707 }
707 }
708 draw, start, limit = self._extract_chunk(self.request)
708 draw, start, limit = self._extract_chunk(self.request)
@@ -251,18 +251,16
251 # NOTE(marcink): because we use only raw column we need to load it like that
251 # NOTE(marcink): because we use only raw column we need to load it like that
252 changeset_cache = Repository._load_changeset_cache(
252 changeset_cache = Repository._load_changeset_cache(
253 repo.repo_id, repo._changeset_cache)
253 repo.repo_id, repo._changeset_cache)
254 last_commit_change = Repository._load_commit_change(changeset_cache)
255
254
256 row = {
255 row = {
257 "menu": quick_menu(repo.repo_name),
256 "menu": quick_menu(repo.repo_name),
258
257
259 "name": repo_lnk(repo.repo_name, repo.repo_type, repo.repo_state,
258 "name": repo_lnk(repo.repo_name, repo.repo_type, repo.repo_state,
260 repo.private, repo.archived, repo.fork),
259 repo.private, repo.archived, repo.fork),
261 "name_raw": repo.repo_name.lower(),
260
262 "desc": desc(repo.description),
261 "desc": desc(repo.description),
263
262
264 "last_change": last_change(last_commit_change),
263 "last_change": last_change(repo.updated_on),
265 "last_change_raw": datetime_to_time(last_commit_change),
266
264
267 "last_changeset": last_rev(repo.repo_name, changeset_cache),
265 "last_changeset": last_rev(repo.repo_name, changeset_cache),
268 "last_changeset_raw": changeset_cache.get('revision'),
266 "last_changeset_raw": changeset_cache.get('revision'),
@@ -749,7 +749,6
749 "name_raw": group.group_name,
749 "name_raw": group.group_name,
750
750
751 "last_change": last_change(last_commit_change),
751 "last_change": last_change(last_commit_change),
752 "last_change_raw": datetime_to_time(last_commit_change),
753
752
754 "last_changeset": "",
753 "last_changeset": "",
755 "last_changeset_raw": "",
754 "last_changeset_raw": "",
@@ -71,12 +71,12
71 order: [[ 0, "asc" ]],
71 order: [[ 0, "asc" ]],
72 columns: [
72 columns: [
73 { data: {"_": "name",
73 { data: {"_": "name",
74 "sort": "name_raw"}, title: "${_('Name')}", className: "td-componentname" },
74 "sort": "name"}, title: "${_('Name')}", className: "td-componentname" },
75 { data: 'menu', "bSortable": false, className: "quick_repo_menu" },
75 { data: 'menu', "bSortable": false, className: "quick_repo_menu" },
76 { data: {"_": "desc",
76 { data: {"_": "desc",
77 "sort": "desc"}, title: "${_('Description')}", className: "td-description" },
77 "sort": "desc"}, title: "${_('Description')}", className: "td-description" },
78 { data: {"_": "last_change",
78 { data: {"_": "last_change",
79 "sort": "last_change_raw",
79 "sort": "last_change",
80 "type": Number}, title: "${_('Last Change')}", className: "td-time" },
80 "type": Number}, title: "${_('Last Change')}", className: "td-time" },
81 { data: {"_": "top_level_repos",
81 { data: {"_": "top_level_repos",
82 "sort": "top_level_repos"}, title: "${_('Number of top level repositories')}" },
82 "sort": "top_level_repos"}, title: "${_('Number of top level repositories')}" },
@@ -72,7 +72,7
72 {
72 {
73 data: {
73 data: {
74 "_": "name",
74 "_": "name",
75 "sort": "name_raw"
75 "sort": "name"
76 }, title: "${_('Name')}", className: "td-componentname"
76 }, title: "${_('Name')}", className: "td-componentname"
77 },
77 },
78 {
78 {
@@ -86,7 +86,7
86 {
86 {
87 data: {
87 data: {
88 "_": "last_change",
88 "_": "last_change",
89 "sort": "last_change_raw",
89 "sort": "last_change",
90 "type": Number
90 "type": Number
91 }, title: "${_('Last Change')}", className: "td-time"
91 }, title: "${_('Last Change')}", className: "td-time"
92 },
92 },
@@ -58,10 +58,12
58 {
58 {
59 data: {
59 data: {
60 "_": "name",
60 "_": "name",
61 "sort": "name_raw"
61 "sort": "name"
62 }, title: "${_('Name')}", className: "truncate-wrap td-grid-name"
62 }, title: "${_('Name')}", className: "truncate-wrap td-grid-name"
63 },
63 },
64 {data: 'menu', "bSortable": false, className: "quick_repo_menu"},
64 {
65 data: 'menu', "bSortable": false, className: "quick_repo_menu"
66 },
65 {
67 {
66 data: {
68 data: {
67 "_": "desc",
69 "_": "desc",
@@ -71,7 +73,7
71 {
73 {
72 data: {
74 data: {
73 "_": "last_change",
75 "_": "last_change",
74 "sort": "last_change_raw",
76 "sort": "last_change",
75 "type": Number
77 "type": Number
76 }, title: "${_('Last Change')}", className: "td-time"
78 }, title: "${_('Last Change')}", className: "td-time"
77 },
79 },
@@ -80,7 +82,7
80 "_": "last_changeset",
82 "_": "last_changeset",
81 "sort": "last_changeset_raw",
83 "sort": "last_changeset_raw",
82 "type": Number
84 "type": Number
83 }, title: "", className: "td-hash"
85 }, title: "", className: "td-hash", orderable: false
84 },
86 },
85 {
87 {
86 data: {
88 data: {
@@ -147,7 +149,7
147 {
149 {
148 data: {
150 data: {
149 "_": "name",
151 "_": "name",
150 "sort": "name_raw"
152 "sort": "name"
151 }, title: "${_('Name')}", className: "truncate-wrap td-grid-name"
153 }, title: "${_('Name')}", className: "truncate-wrap td-grid-name"
152 },
154 },
153 {
155 {
@@ -162,16 +164,16
162 {
164 {
163 data: {
165 data: {
164 "_": "last_change",
166 "_": "last_change",
165 "sort": "last_change_raw",
167 "sort": "last_change",
166 "type": Number
168 "type": Number
167 }, title: "${_('Last Change')}", className: "td-time", orderable: false
169 }, title: "${_('Last Change')}", className: "td-time"
168 },
170 },
169 {
171 {
170 data: {
172 data: {
171 "_": "last_changeset",
173 "_": "last_changeset",
172 "sort": "last_changeset_raw",
174 "sort": "last_changeset_raw",
173 "type": Number
175 "type": Number
174 }, title: "${_('Commit')}", className: "td-hash"
176 }, title: "${_('Commit')}", className: "td-hash", orderable: false
175 },
177 },
176 {
178 {
177 data: {
179 data: {
Comments 0
You need to be logged in to leave comments. Login now