MTrackWeb/templates/images/MTrackWeb/MTrackWeb.Layout.bjs
[web.mtrack] / MTrackWeb / templates / images / MTrackWeb / MTrackWeb.Layout.bjs
1 {
2     "id": "roo-file-263",
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             "|getProjectId": "function() {\n    return  MTrack.projectCombo.getValue();\n}\n",
14             "|xns": "Roo",
15             "items": [
16                 {
17                     "|xns": "Roo",
18                     "xtype": "BorderLayout",
19                     "*prop": "layout",
20                     "items": [
21                         {
22                             "*prop": "north",
23                             "height": 52,
24                             "titlebar": false,
25                             "xtype": "LayoutRegion",
26                             "|xns": "Roo"
27                         },
28                         {
29                             "*prop": "center",
30                             "alwaysShowTabs": true,
31                             "tabPosition": "top",
32                             "xtype": "LayoutRegion",
33                             "|xns": "Roo",
34                             "items": [
35                                 {
36                                     "|xns": "Roo",
37                                     "xtype": "Toolbar",
38                                     "*prop": "toolbar",
39                                     "items": [
40                                         {
41                                             "|xns": "Roo.Toolbar",
42                                             "xtype": "Fill"
43                                         },
44                                         {
45                                             "text": "Project:",
46                                             "xtype": "TextItem",
47                                             "|xns": "Roo.Toolbar"
48                                         },
49                                         {
50                                             "listeners": {
51                                                 "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}",
52                                                 "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}"
53                                             },
54                                             "allowBlank": false,
55                                             "alwaysQuery": true,
56                                             "displayField": "name",
57                                             "editable": false,
58                                             "emptyText": "Select Project",
59                                             "forceSelection": true,
60                                             "listWidth": 400,
61                                             "loadingText": "Searching...",
62                                             "pageSize": 40,
63                                             "qtip": "Select Project",
64                                             "selectOnFocus": true,
65                                             "tpl": "<div class=\"x-grid-cell-text x-btn\">{name} -  <b>{code}</b> </div>",
66                                             "triggerAction": "all",
67                                             "typeAhead": true,
68                                             "valueField": "id",
69                                             "width": 150,
70                                             "xtype": "ComboBox",
71                                             "|xns": "Roo.form",
72                                             "items": [
73                                                 {
74                                                     "listeners": {
75                                                         "|beforeload": "function (_self, o){\n    o.params = o.params || {};\n    // set more here\n}\n"
76                                                     },
77                                                     "*prop": "store",
78                                                     "remoteSort": true,
79                                                     "xtype": "Store",
80                                                     "|sortInfo": "{ direction : 'ASC', field: 'name' }",
81                                                     "|xns": "Roo.data",
82                                                     "items": [
83                                                         {
84                                                             "*prop": "proxy",
85                                                             "method": "GET",
86                                                             "xtype": "HttpProxy",
87                                                             "|url": "baseURL + '/Roo/Projects.php'",
88                                                             "|xns": "Roo.data"
89                                                         },
90                                                         {
91                                                             "*prop": "reader",
92                                                             "id": "id",
93                                                             "root": "data",
94                                                             "totalProperty": "total",
95                                                             "xtype": "JsonReader",
96                                                             "|fields": "[{\"name\":\"id\",\"type\":\"int\"},\"name\",\"code\"]",
97                                                             "|xns": "Roo.data"
98                                                         }
99                                                     ]
100                                                 }
101                                             ]
102                                         },
103                                         {
104                                             "|xns": "Roo.Toolbar",
105                                             "xtype": "Separator"
106                                         },
107                                         {
108                                             "listeners": {
109                                                 "specialkey": "function (_self, e)\n{\n   if (e.getKey() == 13) {\n        // search!\n   }\n}"
110                                             },
111                                             "emptyText": "Search (to be done..)",
112                                             "width": 100,
113                                             "xtype": "TextField",
114                                             "|xns": "Roo.form"
115                                         },
116                                         {
117                                             "cls": "x-btn-icon",
118                                             "xtype": "Button",
119                                             "|icon": "rootURL + '/Pman/templates/images/search.gif'",
120                                             "|xns": "Roo.Toolbar"
121                                         },
122                                         {
123                                             "|xns": "Roo.Toolbar",
124                                             "xtype": "Separator"
125                                         },
126                                         {
127                                             "listeners": {
128                                                 "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}",
129                                                 "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}"
130                                             },
131                                             "cls": "x-btn-text-icon",
132                                             "text": "Login",
133                                             "xtype": "SplitButton",
134                                             "|icon": "rootURL + '/Pman/templates/images/lock.gif'",
135                                             "|xns": "Roo.Toolbar",
136                                             "items": [
137                                                 {
138                                                     "|xns": "Roo.menu",
139                                                     "xtype": "Menu",
140                                                     "*prop": "menu",
141                                                     "items": [
142                                                         {
143                                                             "text": "Request Account",
144                                                             "xtype": "Item",
145                                                             "|xns": "Roo.menu"
146                                                         },
147                                                         {
148                                                             "text": "Send Invite to a Friend",
149                                                             "xtype": "Item",
150                                                             "|xns": "Roo.menu"
151                                                         },
152                                                         {
153                                                             "|xns": "Roo.menu",
154                                                             "xtype": "Separator"
155                                                         },
156                                                         {
157                                                             "listeners": {
158                                                                 "render": "function (_self)\n{\n    _this.changePassword = _self;\n}"
159                                                             },
160                                                             "text": "Change Password",
161                                                             "xtype": "Item",
162                                                             "|xns": "Roo.menu"
163                                                         }
164                                                     ]
165                                                 }
166                                             ]
167                                         }
168                                     ]
169                                 }
170                             ]
171                         },
172                         {
173                             "*prop": "south",
174                             "height": 30,
175                             "titlebar": false,
176                             "xtype": "LayoutRegion",
177                             "|xns": "Roo"
178                         },
179                         {
180                             "region": "north",
181                             "xtype": "ContentPanel",
182                             "|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    ",
183                             "|xns": "Roo"
184                         },
185                         {
186                             "region": "south",
187                             "xtype": "ContentPanel",
188                             "|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>' ",
189                             "|xns": "Roo"
190                         }
191                     ]
192                 }
193             ]
194         }
195     ],
196     "permname": "",
197     "modOrder": "001"
198 }