]> git.proxmox.com Git - extjs.git/blame - extjs/templates/admin-dashboard/classic/src/view/search/Results.js
add extjs 6.0.1 sources
[extjs.git] / extjs / templates / admin-dashboard / classic / src / view / search / Results.js
CommitLineData
6527f429
DM
1Ext.define('Admin.view.search.Results', {\r
2 extend: 'Ext.tab.Panel',\r
3 xtype: 'searchresults',\r
4\r
5 requires: [\r
6 'Ext.grid.Panel',\r
7 'Ext.toolbar.Paging',\r
8 'Ext.grid.column.Date'\r
9 ],\r
10\r
11 controller: 'searchresults',\r
12 viewModel: {\r
13 type: 'searchresults'\r
14 },\r
15\r
16 cls: 'shadow',\r
17 activeTab: 0,\r
18 margin: 20,\r
19\r
20 items: [\r
21 {\r
22 xtype: 'gridpanel',\r
23 cls: 'allRecordsCls',\r
24 scrollable: false,\r
25 hideHeaders: true,\r
26 border: false,\r
27 title: 'All',\r
28 routeId: 'all',\r
29 bind: '{allResults}',\r
30 viewConfig: {\r
31 preserveScrollOnRefresh: true,\r
32 stripeRows: false\r
33 },\r
34 columns: [\r
35 {\r
36 xtype: 'gridcolumn',\r
37 renderer: function(value, metaData, record, rowIndex) {\r
38 var page = "<div class='resultsItemCls'><div class='resultsTitleCls'>"+record.data.title+"</div><div class='resultsUrlCls'><a href='#'>"+record.data.url+"</a></div><div class='resultsContentCls'>"+record.data.content+"</div></div>";\r
39 if (rowIndex === 3) {\r
40 page = "<div class='imageRowCls'>" +\r
41 "<img src='resources/images/img1.jpg' alt='Dandelion' " +\r
42 "class='search-result-attachment'>" +\r
43 "<img src='resources/images/img2.jpg' alt='Landscape' " +\r
44 "class='search-result-attachment'>" +\r
45 "</div>";\r
46 }\r
47 return page;\r
48 },\r
49 dataIndex: 'content',\r
50 flex: 1\r
51 }\r
52 ],\r
53 dockedItems: [\r
54 {\r
55 xtype: 'pagingtoolbar',\r
56 dock: 'bottom',\r
57 displayInfo: true,\r
58 bind: '{allResults}'\r
59 }\r
60 ]\r
61 },\r
62\r
63 {\r
64 xtype: 'gridpanel',\r
65 cls: 'user-grid',\r
66 title: 'User Results',\r
67 routeId: 'user',\r
68 bind: '{usersResults}',\r
69 columns: [\r
70 {\r
71 xtype: 'gridcolumn',\r
72 width: 40,\r
73 dataIndex: 'identifier',\r
74 text: '#'\r
75 },\r
76 {\r
77 xtype: 'gridcolumn',\r
78 renderer: function(value) {\r
79 return "<img src='resources/images/user-profile/" + value + "' alt='Profile Pic' height='40px' width='40px'>";\r
80 },\r
81 width: 75,\r
82 dataIndex: 'profile_pic',\r
83 text: 'User'\r
84 },\r
85 {\r
86 xtype: 'gridcolumn',\r
87 cls: 'content-column',\r
88 dataIndex: 'fullname',\r
89 text: 'Name',\r
90 flex: 1\r
91 },\r
92 {\r
93 xtype: 'gridcolumn',\r
94 cls: 'content-column',\r
95 dataIndex: 'email',\r
96 text: 'Email',\r
97 flex: 1\r
98 },\r
99 {\r
100 xtype: 'datecolumn',\r
101 cls: 'content-column',\r
102 width: 120,\r
103 dataIndex: 'joinDate',\r
104 text: 'Date'\r
105 },\r
106 {\r
107 xtype: 'gridcolumn',\r
108 cls: 'content-column',\r
109 dataIndex: 'subscription',\r
110 text: 'Subscription',\r
111 flex: 1\r
112 },\r
113 {\r
114 xtype: 'actioncolumn',\r
115 items: [\r
116 {\r
117 xtype: 'button',\r
118 iconCls: 'x-fa fa-pencil'\r
119 },\r
120 {\r
121 xtype: 'button',\r
122 iconCls: 'x-fa fa-close'\r
123 },\r
124 {\r
125 xtype: 'button',\r
126 iconCls: 'x-fa fa-ban'\r
127 }\r
128 ],\r
129\r
130 cls: 'content-column',\r
131 width: 120,\r
132 dataIndex: 'bool',\r
133 text: 'Actions',\r
134 tooltip: 'edit '\r
135 }\r
136 ],\r
137 dockedItems: [\r
138 {\r
139 xtype: 'pagingtoolbar',\r
140 dock: 'bottom',\r
141 itemId: 'userPaginationToolbar',\r
142 displayInfo: true,\r
143 bind: '{usersResults}'\r
144 }\r
145 ]\r
146 },\r
147 {\r
148 xtype: 'gridpanel',\r
149 cls: 'email-inbox-panel',\r
150 itemId: 'messagesGrid',\r
151 hideHeaders: true,\r
152 title: 'Messages',\r
153 routeId: 'messages',\r
154 bind: '{inboxResults}',\r
155 columns: [\r
156 {\r
157 xtype: 'gridcolumn',\r
158 renderer: function(value) {\r
159 if(value) {\r
160 return '<span class="x-fa fa-heart"></span>';\r
161 }\r
162 return '<span class="x-fa fa-heart-o"></span>';\r
163\r
164 },\r
165 width: 45,\r
166 dataIndex: 'favorite'\r
167 },\r
168 {\r
169 xtype: 'gridcolumn',\r
170 dataIndex: 'from',\r
171 flex: 1\r
172 },\r
173 {\r
174 xtype: 'gridcolumn',\r
175 dataIndex: 'title',\r
176 flex: 2\r
177 },\r
178 {\r
179 xtype: 'gridcolumn',\r
180 renderer: function(value) {\r
181 return value ? '<span class="x-fa fa-paperclip"></span>' : '';\r
182 },\r
183 dataIndex: 'has_attachments'\r
184 },\r
185 {\r
186 xtype: 'datecolumn',\r
187 dataIndex: 'received_on'\r
188 }\r
189 ],\r
190 dockedItems: [\r
191 {\r
192 xtype: 'pagingtoolbar',\r
193 dock: 'bottom',\r
194 itemId: 'pagingToolbar',\r
195 prependButtons: true,\r
196 bind: '{inboxResults}'\r
197 }\r
198 ]\r
199 }\r
200 ]\r
201});\r