3fc6ca3130fbfa86adba491c86e397750ecdd3e0
[web.mtrack] / MTrackWeb / templates / images / MTrackWeb / MTrackWeb.Layout.bjs
1 {
2     "id": "roo-file-200",
3     "name": "MTrackWeb.Layout",
4     "parent": "",
5     "title": "",
6     "path": "/home/alan/gitlive/web.mtrack/MTrackWeb/templates/images/MTrackWeb/MTrackWeb.Layout.bjs",
7     "items": [
8         {
9             "listeners": {
10                 "activate": "function (_self)\n{\n      \n}"
11             },
12             "xtype": "NestedLayoutPanel",
13             "|xns": "Roo",
14             "items": [
15                 {
16                     "|xns": "Roo",
17                     "xtype": "BorderLayout",
18                     "*prop": "layout",
19                     "items": [
20                         {
21                             "*prop": "north",
22                             "height": 52,
23                             "titlebar": false,
24                             "xtype": "LayoutRegion",
25                             "|xns": "Roo"
26                         },
27                         {
28                             "*prop": "center",
29                             "alwaysShowTabs": true,
30                             "tabPosition": "top",
31                             "xtype": "LayoutRegion",
32                             "|xns": "Roo",
33                             "items": [
34                                 {
35                                     "|xns": "Roo",
36                                     "xtype": "Toolbar",
37                                     "*prop": "toolbar",
38                                     "items": [
39                                         {
40                                             "|xns": "Roo.Toolbar",
41                                             "xtype": "Fill"
42                                         },
43                                         {
44                                             "text": "Project:",
45                                             "xtype": "TextItem",
46                                             "|xns": "Roo.Toolbar"
47                                         },
48                                         {
49                                             "listeners": {
50                                                 "beforeselect": "function (combo, rec, index)\n{\n  // this should post to the system, - to register active Project..\n                        // it's not really needed in new version... but done for compat.\n                        // at present..\n        Roo.Ajax.request( {\n            method: 'POST',\n            url : baseURL + '/Projects/' + rec.data.id,\n            success : function (data) {\n                // then, it should refresh the current active tab..\n                MTrack.ajaxLoad( MTrack.currentURL);\n            }\n        }); \n    \n}",
51                                                 "render": "function (_self)\n{\n    \n    _this.projectCombo = _self;\n    // BC..\n   MTrack.projectCombo = _self;\n    \n    // set the default value to our current project..\n    this.setFromData({\n        id : project_id,\n        name : project_name\n    });\n}"
52                                             },
53                                             "allowBlank": false,
54                                             "alwaysQuery": true,
55                                             "displayField": "name",
56                                             "editable": false,
57                                             "emptyText": "Select Project",
58                                             "forceSelection": true,
59                                             "listWidth": 400,
60                                             "loadingText": "Searching...",
61                                             "pageSize": 40,
62                                             "qtip": "Select Project",
63                                             "selectOnFocus": true,
64                                             "tpl": "<div class=\"x-grid-cell-text x-btn\">{name} -  <b>{code}</b> </div>",
65                                             "triggerAction": "all",
66                                             "typeAhead": true,
67                                             "valueField": "id",
68                                             "width": 150,
69                                             "xtype": "ComboBox",
70                                             "|xns": "Roo.form",
71                                             "items": [
72                                                 {
73                                                     "listeners": {
74                                                         "|beforeload": "function (_self, o){\n    o.params = o.params || {};\n    // set more here\n}\n"
75                                                     },
76                                                     "*prop": "store",
77                                                     "remoteSort": true,
78                                                     "xtype": "Store",
79                                                     "|sortInfo": "{ direction : 'ASC', field: 'name' }",
80                                                     "|xns": "Roo.data",
81                                                     "items": [
82                                                         {
83                                                             "*prop": "proxy",
84                                                             "method": "GET",
85                                                             "xtype": "HttpProxy",
86                                                             "|url": "baseURL + '/Roo/Projects.php'",
87                                                             "|xns": "Roo.data"
88                                                         },
89                                                         {
90                                                             "*prop": "reader",
91                                                             "id": "id",
92                                                             "root": "data",
93                                                             "totalProperty": "total",
94                                                             "xtype": "JsonReader",
95                                                             "|fields": "[{\"name\":\"id\",\"type\":\"int\"},\"name\",\"code\"]",
96                                                             "|xns": "Roo.data"
97                                                         }
98                                                     ]
99                                                 }
100                                             ]
101                                         },
102                                         {
103                                             "|xns": "Roo.Toolbar",
104                                             "xtype": "Separator"
105                                         },
106                                         {
107                                             "listeners": {
108                                                 "specialkey": "function (_self, e)\n{\n   if (e.getKey() == 13) {\n        // search!\n   }\n}"
109                                             },
110                                             "emptyText": "Search (to be done..)",
111                                             "width": 100,
112                                             "xtype": "TextField",
113                                             "|xns": "Roo.form"
114                                         },
115                                         {
116                                             "cls": "x-btn-icon",
117                                             "xtype": "Button",
118                                             "|icon": "rootURL + '/Pman/templates/images/search.gif'",
119                                             "|xns": "Roo.Toolbar"
120                                         },
121                                         {
122                                             "|xns": "Roo.Toolbar",
123                                             "xtype": "Separator"
124                                         },
125                                         {
126                                             "listeners": {
127                                                 "click": "function (_self, e)\n{\n    var bt = this;\n    if (!Pman.Login.authUser.id) { \n        Pman.Login.show(false, function() {\n            bt.setText('Logout');\n            Roo.select('.banner-username').first().update(\n                String.format('You are logged in as {0} &lt;{1}&gt;',\n                    Pman.Login.authUser.name,\n                    Pman.Login.authUser.email));\n            \n             \n            // set the default value to our current project..\n            MTrack.projectCombo.setFromData({\n                id : Pman.Login.authUser.project.id,\n                name : Pman.Login.authUser.project.name\n            });\n            \n            MTrack.ajaxLoad( MTrack.currentURL);\n            //document.location = baseURL + '/Report/1?ts=' + Math.random();\n            // reload the project list!??\n            // reload the active page\n        });\n    } else {\n        Roo.MessageBox.confirm(\"Logout\", \n            \"Are you sure you want to Log out?\",\n            function(r) {\n                if (r!='yes') {\n                    return;\n                }\n        \n                Pman.Login.logout();\n            }\n        );\n        // should for a reload..\n    }\n}",
128                                                 "render": "function (_self)\n{\n    if (typeof(Pman) == 'undefined') {\n        return;\n    }\n    \n    // if we are logged in.. change stuff..\n    if (!Pman.Login.authUser.id) {\n        // not logged in..\n        return;\n    }\n    // logged in..\n    this.el.child(\"button:first\").setStyle(\n            'background-image', 'url(' + rootURL + '/Pman/templates/images/logout.gif)');\n    this.setText('Logout');\n    Roo.select('.banner-username').first().update(\n         String.format('You are logged in as {0} &lt;{1}&gt;',\n            Pman.Login.authUser.name,\n            Pman.Login.authUser.email));\n    // change the icon..\n     \n}"
129                                             },
130                                             "cls": "x-btn-text-icon",
131                                             "text": "Login",
132                                             "xtype": "SplitButton",
133                                             "|icon": "rootURL + '/Pman/templates/images/lock.gif'",
134                                             "|xns": "Roo.Toolbar",
135                                             "items": [
136                                                 {
137                                                     "|xns": "Roo.menu",
138                                                     "xtype": "Menu",
139                                                     "*prop": "menu",
140                                                     "items": [
141                                                         {
142                                                             "text": "Request Account",
143                                                             "xtype": "Item",
144                                                             "|xns": "Roo.menu"
145                                                         },
146                                                         {
147                                                             "text": "Send Invite to a Friend",
148                                                             "xtype": "Item",
149                                                             "|xns": "Roo.menu"
150                                                         },
151                                                         {
152                                                             "|xns": "Roo.menu",
153                                                             "xtype": "Separator"
154                                                         },
155                                                         {
156                                                             "listeners": {
157                                                                 "render": "function (_self)\n{\n    _this.changePassword = _self;\n}"
158                                                             },
159                                                             "text": "Change Password",
160                                                             "xtype": "Item",
161                                                             "|xns": "Roo.menu"
162                                                         }
163                                                     ]
164                                                 }
165                                             ]
166                                         }
167                                     ]
168                                 }
169                             ]
170                         },
171                         {
172                             "*prop": "south",
173                             "height": 30,
174                             "titlebar": false,
175                             "xtype": "LayoutRegion",
176                             "|xns": "Roo"
177                         },
178                         {
179                             "region": "north",
180                             "xtype": "ContentPanel",
181                             "|content": "        '<div class=\"banner-username\"></div>' + \n        '<div id=\"banner\">' +\n            '<a href=\"' + baseURL + '\"><img style=\"float: left;margin-right: 10px;\" src=\"' +\n                 '/Roojscom/templates/images/roojsorg_logo-55.png\" width=\"150\" height=\"55\"></a>' +\n            '<div class=\"banner-title\">Project Tracker</div>'+\n        '</div>'\n         \n    \n    ",
182                             "|xns": "Roo"
183                         },
184                         {
185                             "region": "south",
186                             "xtype": "ContentPanel",
187                             "|content": "' <div id=\"footer\">' +\n        '<div class=\"navfoot\">' +\n           'Powered by <a href=\"http://www.roojs.com/mtrack/index.php/Browse/default/web.mtrack\">web.mtrack</a>' +\n           ' based on Wez\\'s ' +\n            '<a href=\"http://bitbucket.org/wez/mtrack/\">mtrack</a>' +\n        '</div>' +\n    '</div>' ",
188                             "|xns": "Roo"
189                         }
190                     ]
191                 }
192             ]
193         }
194     ],
195     "permname": "",
196     "modOrder": "001"
197 }