1 | <div> |
---|
2 | <script> |
---|
3 | function createNew(){ |
---|
4 | var newBox = new rft.ui.ObjectBox({ |
---|
5 | title: 'TeamUp Basic Template', |
---|
6 | subTitle: '', |
---|
7 | lowerTitle: '', |
---|
8 | objectType: 'SessionTemplate', |
---|
9 | actions: { |
---|
10 | "edit": function() {}, |
---|
11 | "delete": function() {} |
---|
12 | } |
---|
13 | }); |
---|
14 | newBox.startup(); |
---|
15 | newBox.placeAt("containerTemplates", "last"); |
---|
16 | } |
---|
17 | |
---|
18 | function createInstance(args) { |
---|
19 | // Create a template instance in the "Sessions" tab |
---|
20 | var args; |
---|
21 | args.objectType = "Session"; |
---|
22 | var d = new Date(); |
---|
23 | var dateString = d.getDate()+"-"+d.getMonth()+"-"+d.getFullYear(); |
---|
24 | var creator = "Igor Mayer"; // Use currently logged in profile instead! |
---|
25 | args.subTitle = "Created on "+dateString+" by "+creator; |
---|
26 | |
---|
27 | args.actions = { |
---|
28 | "edit": function() {}, |
---|
29 | "delete": function() {} |
---|
30 | } |
---|
31 | var newBox = new rft.ui.ObjectBox(args); |
---|
32 | newBox.startup(); |
---|
33 | newBox.placeAt("containerSessions", "last"); |
---|
34 | |
---|
35 | // TODO: Then switch tabs to the Sessions tab! |
---|
36 | var sess = dijit.byId("dijit_layout_ContentPane_5"); |
---|
37 | dijit.byId("tabs").selectChild(sess); |
---|
38 | } |
---|
39 | </script> |
---|
40 | <div data-dojo-type="dijit.layout.BorderContainer" data-dojo-props="region:'center'" style="height: 500px;"> |
---|
41 | <div data-dojo-type="dijit.layout.ContentPane" data-dojo-props="region:'top'"> |
---|
42 | <h2> |
---|
43 | <span class="rftIcon rftIconSession"></span> |
---|
44 | <span class="headerText">Sessions</span> |
---|
45 | </h2> |
---|
46 | </div> |
---|
47 | <div data-dojo-type="dijit.layout.BorderContainer" data-dojo-props="region:'center'"> |
---|
48 | <div data-dojo-type="dijit.layout.TabContainer" class="green" data-dojo-props="tabPosition:'left-h',region:'center'" id="tabs"> |
---|
49 | <div data-dojo-type="dijit.layout.BorderContainer" title="Templates"> |
---|
50 | <div id="containerTemplates" data-dojo-type="dijit.layout.ContentPane" data-dojo-props="region: 'center'"> |
---|
51 | <!--TODO: These don't allow for custom icon settings yet! --> |
---|
52 | <div data-dojo-type="rft.ui.ObjectBox" data-dojo-props="actions: {'edit': function(){alert('Custom edit code');}, 'delete':function(){}, 'Custom function': function(){alert('newCommand');}, 'publish': createInstance}"></div> |
---|
53 | </div> |
---|
54 | <div data-dojo-type="dijit.layout.ContentPane" data-dojo-props="region: 'bottom'" style="height: 40px;"> |
---|
55 | <div data-dojo-type="dijit.form.Button" data-dojo-props="region: 'bottom', baseClass: 'rftLargeButton', iconClass: 'rftIcon rftIconSessionTemplate', onClick: createNew">Create new template</div> |
---|
56 | </div> |
---|
57 | </div> |
---|
58 | <div data-dojo-type="dijit.layout.ContentPane" title="Sessions"> |
---|
59 | <div id="containerSessions" data-dojo-type="dijit.layout.ContentPane" data-dojo-props="region: 'center'"> |
---|
60 | |
---|
61 | </div> |
---|
62 | <div data-dojo-type="dijit.layout.ContentPane" data-dojo-props="region: 'bottom'" style="height: 40px;"> |
---|
63 | <!-- Buttons? --> |
---|
64 | </div> |
---|
65 | </div> |
---|
66 | </div> |
---|
67 | </div> |
---|
68 | </div> |
---|
69 | </div> |
---|