forked from devilry/devilry-django
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of https://github.com/devilry/devilry-django
- Loading branch information
Showing
77 changed files
with
2,681 additions
and
736 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
144 changes: 144 additions & 0 deletions
144
devilry/apps/administrator/static/extjs_classes/administrator/AdministratorSearchWidget.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,144 @@ | ||
/** SearchWidget used in every page in the entire administrator interface. | ||
* | ||
* Enables users to search for everything (like the dashboard) or just within | ||
* the current item. | ||
* */ | ||
Ext.define('devilry.administrator.AdministratorSearchWidget', { | ||
extend: 'devilry.extjshelpers.searchwidget.SearchWidget', | ||
requires: [ | ||
'devilry.extjshelpers.searchwidget.FilterConfigDefaults', | ||
], | ||
|
||
config: { | ||
/** | ||
* @cfg | ||
* Url prefix. Should be the absolute URL path to /administrator/. | ||
*/ | ||
urlPrefix: '', | ||
|
||
/** | ||
* @cfg | ||
* ``Ext.XTemplate`` for Node rows. | ||
*/ | ||
nodeRowTpl: '', | ||
|
||
/** | ||
* @cfg | ||
* ``Ext.XTemplate`` for Subject rows. | ||
*/ | ||
subjectRowTpl: '', | ||
|
||
/** | ||
* @cfg | ||
* ``Ext.XTemplate`` for Period rows. | ||
*/ | ||
periodRowTpl: '', | ||
|
||
/** | ||
* @cfg | ||
* ``Ext.XTemplate`` for Assignment rows. | ||
*/ | ||
assignmentRowTpl: '', | ||
|
||
/** | ||
* @cfg | ||
* ``Ext.XTemplate`` for AssignmentGroup rows. | ||
*/ | ||
assignmentgroupRowTpl: '', | ||
|
||
/** | ||
* @cfg | ||
* ``Ext.XTemplate`` for Delivery rows. | ||
*/ | ||
deliveryRowTpl: '' | ||
}, | ||
|
||
initComponent: function() { | ||
Ext.apply(this, { | ||
searchResultItems: [{ | ||
xtype: 'searchresults', | ||
title: 'Nodes', | ||
store: Ext.data.StoreManager.lookup('devilry.apps.administrator.simplified.SimplifiedNodeStoreSearch'), | ||
filterconfig: { | ||
type: 'node' | ||
}, | ||
resultitemConfig: { | ||
tpl: this.nodeRowTpl, | ||
defaultbutton: { | ||
text: 'View', | ||
clickLinkTpl: this.urlPrefix + 'node/view/{id}' | ||
} | ||
} | ||
}, { | ||
xtype: 'searchresults', | ||
title: 'Subjects', | ||
store: Ext.data.StoreManager.lookup('devilry.apps.administrator.simplified.SimplifiedSubjectStoreSearch'), | ||
filterconfig: { | ||
type: 'subject' | ||
}, | ||
resultitemConfig: { | ||
tpl: this.subjectRowTpl, | ||
defaultbutton: { | ||
text: 'View', | ||
clickLinkTpl: this.urlPrefix + 'subject/view/{id}' | ||
} | ||
} | ||
}, { | ||
xtype: 'searchresults', | ||
title: 'Periods', | ||
store: Ext.data.StoreManager.lookup('devilry.apps.administrator.simplified.SimplifiedPeriodStoreSearch'), | ||
filterconfig: { | ||
type: 'period' | ||
}, | ||
resultitemConfig: { | ||
tpl: this.periodRowTpl, | ||
defaultbutton: { | ||
text: 'View', | ||
clickLinkTpl: this.urlPrefix + 'period/view/{id}' | ||
} | ||
} | ||
}, { | ||
xtype: 'searchresults', | ||
title: 'Assignments', | ||
store: Ext.data.StoreManager.lookup('devilry.apps.administrator.simplified.SimplifiedAssignmentStoreSearch'), | ||
filterconfig: devilry.extjshelpers.searchwidget.FilterConfigDefaults.assignment, | ||
resultitemConfig: { | ||
tpl: this.assignmentRowTpl, | ||
defaultbutton: { | ||
text: 'View', | ||
clickLinkTpl: this.urlPrefix + 'assignment/view/{id}' | ||
}, | ||
menuitems: [{ | ||
text: 'Show deliveries', | ||
clickFilter: 'type:delivery assignment:{id}' | ||
}] | ||
} | ||
}, { | ||
xtype: 'searchresults', | ||
title: 'Assignment groups', | ||
store: Ext.data.StoreManager.lookup('devilry.apps.administrator.simplified.SimplifiedAssignmentGroupStoreSearch'), | ||
filterconfig: devilry.extjshelpers.searchwidget.FilterConfigDefaults.assignmentgroup, | ||
resultitemConfig: { | ||
tpl: this.assignmentgroupRowTpl, | ||
defaultbutton: { | ||
text: 'View', | ||
clickLinkTpl: this.urlPrefix + 'assignmentgroup/view/{id}' | ||
} | ||
} | ||
}, { | ||
xtype: 'searchresults', | ||
title: 'Delivery', | ||
store: Ext.data.StoreManager.lookup('devilry.apps.administrator.simplified.SimplifiedDeliveryStoreSearch'), | ||
filterconfig: devilry.extjshelpers.searchwidget.FilterConfigDefaults.delivery, | ||
resultitemConfig: { | ||
tpl: this.deliveryRowTpl, | ||
defaultbutton: { | ||
text: 'View', | ||
clickLinkTpl: this.urlPrefix + 'assignmentgroup/view/{deadline__assignment_group}?deliveryid={id}' | ||
} | ||
} | ||
}] | ||
}); | ||
this.callParent(arguments); | ||
} | ||
}); |
19 changes: 19 additions & 0 deletions
19
devilry/apps/administrator/static/extjs_classes/administrator/DefaultCreateWindow.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
/** Default config for the Create New window, which is opened to create an item | ||
* in the admin interface. */ | ||
Ext.define('devilry.administrator.DefaultCreateWindow', { | ||
extend: 'devilry.administrator.DefaultEditWindow', | ||
title: 'Create new', | ||
|
||
config: { | ||
/** | ||
* @cfg | ||
* ``Ext.XTemplate`` for the url to visit on successful save. The | ||
* template gets the record data as input. | ||
*/ | ||
successUrlTpl: undefined | ||
}, | ||
|
||
onSaveSuccess: function(record) { | ||
window.location.href = this.successUrlTpl.apply(record.data); | ||
} | ||
}); |
19 changes: 19 additions & 0 deletions
19
devilry/apps/administrator/static/extjs_classes/administrator/DefaultEditWindow.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
/** Default config for the Edit window, which is opened to edit an item in the | ||
* admin interface. */ | ||
Ext.define('devilry.administrator.DefaultEditWindow', { | ||
extend: 'devilry.administrator.DefaultEditWindowBase', | ||
title: 'Edit', | ||
|
||
config: { | ||
/** | ||
* @cfg | ||
* The {@link devilry.administrator.PrettyView} to refresh when a save succeeds. | ||
*/ | ||
prettyview: undefined | ||
}, | ||
|
||
onSaveSuccess: function(record) { | ||
this.prettyview.setRecord(record); | ||
this.close(); | ||
} | ||
}); |
38 changes: 38 additions & 0 deletions
38
devilry/apps/administrator/static/extjs_classes/administrator/DefaultEditWindowBase.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
/** Base class for the default config for the Edit/Create new window, which is | ||
* opened to edit/create new item in the admin interface. */ | ||
Ext.define('devilry.administrator.DefaultEditWindowBase', { | ||
extend: 'Ext.window.Window', | ||
width: 800, | ||
height: 600, | ||
layout: 'fit', | ||
maximizable: true, | ||
|
||
config: { | ||
/** | ||
* @cfg | ||
* The {@link devilry.administrator.EditPanel} to use for editing. | ||
*/ | ||
editpanel: undefined | ||
}, | ||
|
||
constructor: function(config) { | ||
this.callParent([config]); | ||
this.initConfig(config); | ||
}, | ||
|
||
initComponent: function() { | ||
var me = this; | ||
this.editpanel.addListener('saveSucess', function(record) { | ||
me.onSaveSuccess(record); | ||
}); | ||
|
||
Ext.apply(this, { | ||
items: this.editpanel | ||
}); | ||
this.callParent(arguments); | ||
}, | ||
|
||
onSaveSuccess: function(record) { | ||
throw "Must implement onSaveSuccess()" | ||
} | ||
}); |
Oops, something went wrong.