Ignore:
Timestamp:
06/24/12 16:25:01 (13 years ago)
Author:
hendrikvanantwerpen
Message:

[Client] Merged mockup into pages/ folder.
[Client] Make client more robust when pages have empty lines or multiple root nodes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • Dev/branches/rest-dojo-ui/client/rft/pages/sessions.html

    r303 r347  
    11<div>
    2     <script type="rft/method" data-rft-method="onVisit">
    3         var that = this;
    4         require(['dojo/_base/lang','dojo/_base/event','dojo/store/JsonRest','dojox/grid/DataGrid',
    5             'dojo/data/ObjectStore','rft/content','dojo/domReady!'],
    6         function(lang,event,JsonRest,DataGrid,ObjectStore,content){
    7             var store = new JsonRest({
    8                 target:"../server/api.php/data/Session/",
    9                 idProperty: 'uid'
     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                }
    1013            });
     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");
    1134
    12             that.grid.setStore(ObjectStore({objectStore: store}));
    13        
    14             that.grid.on('rowclick',lang.hitch(that,function(evt){
    15                 var obj = evt.grid.getItem(evt.rowIndex);
    16                 this.form.set('value', obj);
    17             }));
     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'">
    1860
    19             that.grid.on('rowdblclick',lang.hitch(that,function(evt){
    20                 var obj = evt.grid.getItem(evt.rowIndex);
    21                 content.goTo('/session',{uid:obj.uid});
    22             }));
    23 
    24             var submitHandler = lang.hitch(that,function(evt){
    25                 var newObj = this.form.get('value');
    26                 // mixin newObj in obj.
    27                 // store.put(newObj);
    28                 event.stop(evt);
    29                 return false;
    30             });
    31             that.btnSave.on('click',submitHandler);
    32             that.form.on('submit',submitHandler);
    33        
    34         });
    35     </script>
    36     <div class="largeFrame" style="width: 400px;">
    37         <div class="largeTitle">Sessions</div>
    38         <div class="content">
    39             <div data-dojo-type="dojox.grid.DataGrid" data-dojo-props="autoWidth:true,autoHeight:true,structure:[{name:'Title',field:'title'}]" data-dojo-attach-point="grid"></div>
    40         </div>
    41 
    42     </div>
    43 
    44     <div class="largeFrame" style="width: 400px;">
    45         <div class="largeTitle">Details</div>
    46         <div>
    47             <form data-dojo-type="dijit.form.Form" data-dojo-attach-point="form">
    48                 <fieldset>
    49                     <label for="title" class="loginLabel">Title</label>
    50                     <input data-dojo-type="dijit.form.TextBox" name="title" type="text" class="loginInput" />
    51                 </fieldset>
    52                 <button type="submit" data-dojo-type="dijit.form.Button" data-dojo-attach-point="btnSave">Save</button>
    53             </form>
     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>
    5467        </div>
    5568    </div>
    56 
    5769</div>
Note: See TracChangeset for help on using the changeset viewer.