Beispiel #1
0
def admin():
    response.view = 'classes.html'
    jslib.use_ui()
    jslib.use_grid()
    jslib.use_app('js/course.js')
    grid = jquery.Grid("class", {
            'grid': {
                'data': {
                    'url':	URL("classinfo.json"),
                    'editurl':	URL("classinfo_edit"),
                    'colNames': [ t("ID"), t("Class"), t("Teacher"), t("Schedule"), t("Summary"),
                                  t("Room"), t("Capacity"), t("Enrollment")],
                    'colModel': [
                        {'name': "id", 'index': "id", 'width': 60, 'editable': False },
                        {'name': "name", 'index': "name", 'width': 100,
                         'editable': True, 'editoptions': {'size': 10} },
                        {'name': "teacher", 'index': "teacher", 'width': 160, 'sortable': True,
                         'editable': True },
                        {'name': "sched", 'index': "sched", 'width': 200, 'sortable': True,
                         'editable': True, 'editoptions': {'size': 10} },
                        {'name': "summary", 'index': "summary", 'width': 400, 'align': "center",
                         'editable': True, 'edittype': "textarea", 'editoptions': { 'rows': 4, 'cols': 80 }},
                        {'name': "room", 'index': "room", 'width': 80, 'align': "center",
                         'editable': True, 'editoptions': {'size': 10} },
                        {'name': "capacity", 'index': "capacity", 'width': 100, 'align': "center",
                         'editable': False, 'sortable': True },
                        {'name': "enroll", 'index': "enroll", 'width': 100, 'align': "center",
                         'editable': False, 'sortable': True },
                        ],
                    'sortname': "name",
                    'sortorder': "asc",
                    'viewrecords': True,
                    'caption': t("Class Information"),
                    },
                },
            'pager': {
                'data': { 'edit': True, 'add': True, 'del': True, 'search': False, 'view': True },
                'add': { 'width': '60em', 'height': "100%", 'closeOnEscape': True, 'closeAfterAdd': True, 'closeAfterEdit': True, },
                'edit': { 'width': '60em', 'height': "400", 'closeOnEscape': True },
                'view': { 'width': '40em', 'height': "100%", 'closeOnEscape': True },
                }
            })
    return dict(title=T("Ann-Hua Chinese School"),
                main_header=T("Ann-Hua Classes"),
                main_content=DIV(jquery.Help(), grid),
                rsidebar=T('Browse'),
                pagedata=jslib.Session(),
               )
Beispiel #2
0
def student():
    """
    /c9rocs/parent/student: Page for parent(s) to manage their students.
    """
    response.view = 'classes.html'
    jslib.use_ui()
    jslib.use_grid()
    jslib.use(['js/course.js'], request.application)
    grid = jquery.Grid("class", {
            'grid': {
                'data': {
                    'url':	URL("childlist.json"),
                    'editurl':	URL("childlist_edit"),
                    'colNames': [ t("ID"), t("Name"), t("Phone"), t("Email"), t("Address"), t("Role")],
                    'colModel': [
                        {'name': "id", 'index': "id", 'width': 60, 'editable': False },
                        {'name': "name", 'index': "name", 'width': 100, 'editable': True },
                        {'name': "phone", 'index': "phone", 'width': 160, 'sortable': True, 'editable': True },
                        {'name': "email", 'index': "email", 'width': 200, 'sortable': True, 'editable': True,
                         'editoptions': {'size': 80} },
                        {'name': "address", 'index': "address", 'width': 400, 'align': "center",
                         'editable': True, 'edittype': "textarea", 'editoptions': { 'rows': 4, 'cols': 80 }},
                        {'name': "role", 'index': "role", 'width': 80, 'align': "center", 'editable': True,
                         'editoptions': {'size': 60} },
                        ],
                    'sortname': "name",
                    'sortorder': "asc",
                    'viewrecords': True,
                    'caption': t("Class Information"),
                    },
                },
            'pager': {
                'data': { 'edit': True, 'add': True, 'del': True, 'search': False, 'view': True },
                # View options
                #'add': { 'width': '60em', 'height': "100%", 'closeOnEscape': True },
                'add': { 'closeOnEscape': True, 'closeAfterAdd': True, 'closeAfterEdit': True, },
                #'edit': { 'width': '60em', 'height': "400", 'closeOnEscape': True },
                #'view': { 'width': '40em', 'height': "100%", 'closeOnEscape': True },
                }
            })
    return dict(title=T("Ann-Hua Chinese School"),
                main_header=T("Ann-Hua Users"),
                main_content=grid,
                rsidebar=T('Browse'),
                pagedata=jslib.Session(),
               )
Beispiel #3
0
def users():
    """
    /c9rocs/admin/users
    """
    response.view = "classes.html"
    jslib.use_ui()
    jslib.use_grid()
    jslib.use(["js/course.js"], request.application)
    grid = jquery.Grid(
        "class",
        {
            "grid": {
                "data": {
                    "url": URL("userlist.json"),
                    "editurl": URL("userinfo_edit"),
                    "colNames": [t("ID"), t("Name"), t("Phone"), t("Email"), t("Address"), t("Role")],
                    "colModel": [
                        {"name": "id", "index": "id", "width": 60, "editable": False},
                        {"name": "name", "index": "name", "width": 100, "editable": True},
                        {"name": "phone", "index": "phone", "width": 160, "sortable": True, "editable": True},
                        {
                            "name": "email",
                            "index": "email",
                            "width": 200,
                            "sortable": True,
                            "editable": True,
                            "editoptions": {"size": 80},
                        },
                        {
                            "name": "address",
                            "index": "address",
                            "width": 400,
                            "align": "center",
                            "editable": True,
                            "edittype": "textarea",
                            "editoptions": {"rows": 4, "cols": 80},
                        },
                        {
                            "name": "role",
                            "index": "role",
                            "width": 80,
                            "align": "center",
                            "editable": True,
                            "editoptions": {"size": 60},
                        },
                    ],
                    "sortname": "name",
                    "sortorder": "asc",
                    "viewrecords": True,
                    "caption": t("User Information"),
                }
            },
            "pager": {
                "data": {"edit": True, "add": True, "del": True, "search": True, "view": True},
                # View options
                #'add': { 'width': '60em', 'height': "100%", 'closeOnEscape': True },
                "add": {"closeOnEscape": True, "closeAfterAdd": True, "closeAfterEdit": True},
                #'edit': { 'width': '60em', 'height': "400", 'closeOnEscape': True },
                #'view': { 'width': '40em', 'height': "100%", 'closeOnEscape': True },
            },
        },
    )
    return dict(
        title=T("Ann-Hua Chinese School"),
        main_header=T("Ann-Hua Users"),
        main_content=grid,
        rsidebar=T("Browse"),
        pagedata=jslib.Session(),
    )