##// END OF EJS Templates
datagrids: save permanently the state if sorting for pull-request grids.
milka -
r4558:c3119a6d default
parent child Browse files
Show More
@@ -702,7 +702,9 b' class MyAccountView(BaseAppView, DataGri'
702 702 **valid_data)
703 703 if old_email != valid_data['email']:
704 704 old = UserEmailMap.query() \
705 .filter(UserEmailMap.user == c.user).filter(UserEmailMap.email == valid_data['email']).first()
705 .filter(UserEmailMap.user == c.user)\
706 .filter(UserEmailMap.email == valid_data['email'])\
707 .first()
706 708 old.email = old_email
707 709 h.flash(_('Your account was updated successfully'), category='success')
708 710 Session().commit()
@@ -718,6 +720,7 b' class MyAccountView(BaseAppView, DataGri'
718 720 def _get_pull_requests_list(self, statuses):
719 721 draw, start, limit = self._extract_chunk(self.request)
720 722 search_q, order_by, order_dir = self._extract_ordering(self.request)
723
721 724 _render = self.request.get_partial_renderer(
722 725 'rhodecode:templates/data_table/_dt_elements.mako')
723 726
@@ -704,3 +704,13 b' var storeUserSessionAttr = function (key'
704 704 ajaxPOST(pyroutes.url('store_user_session_value'), postData, success);
705 705 return false;
706 706 };
707
708
709 var getUserSessionAttr = function(key) {
710 var storeKey = templateContext.session_attrs;
711 var val = storeKey[key]
712 if (val !== undefined) {
713 return JSON.parse(val)
714 }
715 return null
716 }
@@ -46,6 +46,8 b''
46 46 $pullRequestListTable.DataTable({
47 47 processing: true,
48 48 serverSide: true,
49 stateSave: true,
50 stateDuration: -1,
49 51 ajax: {
50 52 "url": "${h.route_path('my_account_pullrequests_data')}",
51 53 "data": function (d) {
@@ -119,6 +121,10 b''
119 121 if (data['owned']) {
120 122 $(row).addClass('owned');
121 123 }
124 },
125 "stateSaveParams": function (settings, data) {
126 data.search.search = ""; // Don't save search
127 data.start = 0; // don't save pagination
122 128 }
123 129 });
124 130 $pullRequestListTable.on('xhr.dt', function (e, settings, json, xhr) {
@@ -129,6 +135,7 b''
129 135 $pullRequestListTable.css('opacity', 0.3);
130 136 });
131 137
138
132 139 // filter
133 140 $('#q_filter').on('keyup',
134 141 $.debounce(250, function () {
@@ -74,6 +74,8 b''
74 74 $pullRequestListTable.DataTable({
75 75 processing: true,
76 76 serverSide: true,
77 stateSave: true,
78 stateDuration: -1,
77 79 ajax: {
78 80 "url": "${h.route_path('pullrequest_show_all_data', repo_name=c.repo_name)}",
79 81 "data": function (d) {
@@ -114,6 +116,10 b''
114 116 if (data['closed']) {
115 117 $(row).addClass('closed');
116 118 }
119 },
120 "stateSaveParams": function (settings, data) {
121 data.search.search = ""; // Don't save search
122 data.start = 0; // don't save pagination
117 123 }
118 124 });
119 125
General Comments 0
You need to be logged in to leave comments. Login now