主页
-
Contact
+
评价学生
Portfolio
Music
Video
diff --git a/config/routes.rb b/config/routes.rb
index c327ab8..9cbb116 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -6,6 +6,9 @@
get 'get_classes_students'
get 'student_detail'
get 'student_score'
+ get 'comment_student'
+ post 'comment_type_tree_nodes'
+ get 'commets_by_type'
end
end
resources :settings do
@@ -20,7 +23,6 @@
end
-
#可切换不同用户列表
devise_for :users do
diff --git "a/files/.~lock.\347\225\214\351\235\2422.xlsx#" "b/files/.~lock.\347\225\214\351\235\2422.xlsx#"
new file mode 100644
index 0000000..8418252
--- /dev/null
+++ "b/files/.~lock.\347\225\214\351\235\2422.xlsx#"
@@ -0,0 +1 @@
+rice ,rice,rode,22.03.2012 15:44,file:///home/rice/.openoffice.org/3;
\ No newline at end of file
diff --git a/lib/tasks/genrate_data.rake b/lib/tasks/genrate_data.rake
index 2d30b6d..f328d53 100644
--- a/lib/tasks/genrate_data.rake
+++ b/lib/tasks/genrate_data.rake
@@ -88,8 +88,8 @@ namespace :data do
Comment.destroy_all
cms = Comment.create(cmses)
cmtses = [
- { :type => "思想德语" },
- { :type => "学风" },
+ { :name => "思想德语" },
+ { :name => "学风" },
]
CommentType.destroy_all
cmts = CommentType.create(cmtses)
diff --git a/public/images/Temp.png b/public/images/Temp.png
index c4f9742..c17f8bc 100644
Binary files a/public/images/Temp.png and b/public/images/Temp.png differ
diff --git a/public/images/icon/application_form_add.png b/public/images/icon/application_form_add.png
new file mode 100644
index 0000000..28c2175
Binary files /dev/null and b/public/images/icon/application_form_add.png differ
diff --git a/public/images/icon/cog_edit.png b/public/images/icon/cog_edit.png
new file mode 100644
index 0000000..47b75a4
Binary files /dev/null and b/public/images/icon/cog_edit.png differ
diff --git a/public/images/icon/cross.gif b/public/images/icon/cross.gif
new file mode 100644
index 0000000..2eb2865
Binary files /dev/null and b/public/images/icon/cross.gif differ
diff --git a/public/images/icon/delete.gif b/public/images/icon/delete.gif
new file mode 100644
index 0000000..5e2a3b1
Binary files /dev/null and b/public/images/icon/delete.gif differ
diff --git a/public/images/icon/find.png b/public/images/icon/find.png
new file mode 100644
index 0000000..1547479
Binary files /dev/null and b/public/images/icon/find.png differ
diff --git a/public/images/icon/form_edit.png b/public/images/icon/form_edit.png
new file mode 100644
index 0000000..af486c9
Binary files /dev/null and b/public/images/icon/form_edit.png differ
diff --git a/public/images/icon/grid.png b/public/images/icon/grid.png
new file mode 100644
index 0000000..c4da495
Binary files /dev/null and b/public/images/icon/grid.png differ
diff --git a/public/images/icon/print.png b/public/images/icon/print.png
new file mode 100644
index 0000000..5445f64
Binary files /dev/null and b/public/images/icon/print.png differ
diff --git a/public/images/icon/save.gif b/public/images/icon/save.gif
new file mode 100644
index 0000000..8174749
Binary files /dev/null and b/public/images/icon/save.gif differ
diff --git a/public/images/icon/table_add.png b/public/images/icon/table_add.png
new file mode 100644
index 0000000..2a3e5c4
Binary files /dev/null and b/public/images/icon/table_add.png differ
diff --git a/public/images/icon/tick.png b/public/images/icon/tick.png
new file mode 100644
index 0000000..a9925a0
Binary files /dev/null and b/public/images/icon/tick.png differ
diff --git a/public/images/icon/upload.gif b/public/images/icon/upload.gif
new file mode 100755
index 0000000..63039d9
Binary files /dev/null and b/public/images/icon/upload.gif differ
diff --git a/public/images/icon/user_add.png b/public/images/icon/user_add.png
new file mode 100644
index 0000000..deae99b
Binary files /dev/null and b/public/images/icon/user_add.png differ
diff --git a/public/images/icon/user_delete.png b/public/images/icon/user_delete.png
new file mode 100644
index 0000000..acbb563
Binary files /dev/null and b/public/images/icon/user_delete.png differ
diff --git a/public/images/icon/user_edit.png b/public/images/icon/user_edit.png
new file mode 100644
index 0000000..c1974cd
Binary files /dev/null and b/public/images/icon/user_edit.png differ
diff --git a/public/javascripts/PF/pages/comment_student.js b/public/javascripts/PF/pages/comment_student.js
new file mode 100644
index 0000000..753bf2d
--- /dev/null
+++ b/public/javascripts/PF/pages/comment_student.js
@@ -0,0 +1,189 @@
+Ext.ns("Pf.classes.commentStudent");
+
+Ext.onReady(function() {
+ Pf.classes.commentStudent = new Pf.classes.commentStudent.MainPanel();
+ Pf.pages.currentInstance = Pf.classes.commentStudent;
+});
+
+Pf.classes.commentStudent.MainPanel = Ext.extend(Ext.Panel, {
+ autoScroll : true,
+ region : 'center',
+ layout : 'border',
+
+ initComponent : function () {
+ this.addDefaultComponents();
+ Pf.classes.commentStudent.MainPanel.superclass.initComponent.call(this);
+ },
+
+ addDefaultComponents : function(){
+ this.tree = this.createTree();
+ this.commentGrid = this.createCommentGrid();
+ this.studentForm = this.createForm();
+ this.items = [ {
+ region : 'center',
+ layout : 'border',
+ items : [
+ this.tree,
+ this.commentGrid,
+ new Ext.FormPanel({
+ region: 'south',
+ frame : true,
+ height : 180,
+ labelAlign : 'top',
+ items: [ { xtype : 'textarea',fieldLabel: "评语", id : 's-comment', width : "100%", height : 145 } ],
+ }),
+ ]},
+ this.studentForm
+ ]
+
+ },
+
+ createTree : function () {
+ root = new Ext.tree.AsyncTreeNode({ text: '类型', expanded: true,nodeType: 'async' });
+ var tree = new Ext.tree.TreePanel({
+ autoScroll: true,
+ containerScroll: true,
+ region: "west",
+ title: "评价类型",
+ width: 130,
+ split: true,
+ frame : true,
+ collapseMode: 'mini',
+ loader: new Ext.tree.TreeLoader({ dataUrl: '/homes/comment_type_tree_nodes.json', requestMethod: 'POST', preloadChildren: false }),
+ root: root,
+ listeners: {
+ click : function (node) {
+ if(node.isLeaf){
+ var store = Ext.getCmp('comment-grid').getStore();
+ store.removeAll();
+ store.load({ params : { ct_id : node.attributes.id } });
+ }
+ }
+ }
+ });
+ return tree;
+ },
+
+ createCommentGrid : function () {
+ var scope = this;
+ var store = new Pf.util.FieldsJsonStore({
+ root : 'root',
+ url : '/homes/commets_by_type.joson',
+ fields : ["id",'content']
+ });
+ var cm = new Ext.grid.ColumnModel({
+ columns: [
+ { header: '评价详情' , dataIndex: 'content' },
+ ],
+ defaults: { menuDisabled : true, sortable : true }
+ });
+ var grid = new Ext.grid.EditorGridPanel({
+ id : 'comment-grid',
+ region : 'center',
+ store: store,
+ border: false,
+ title : '评价详细',
+ stripeRows: true,
+ loadMask : true,
+ viewConfig: { forceFit: true },
+ bbar : new Pf.util.Bbar({ store : store }),
+ cm : cm,
+ sm : new Ext.grid.RowSelectionModel({ }),
+ listeners: {
+ celldblclick : function(grid,rowIndex,columnIndex) {
+ var content = grid.getStore().getAt(rowIndex).get("content");
+ scope.addComment(content,false);
+ }
+ }
+ });
+ return grid;
+ },
+
+ createForm : function () {
+ var scope = this;
+ var classCombox = new Ext.form.ComboBox({
+ fieldLabel : '班级',
+ triggerAction : 'all',
+ displayField : 'name',
+ mode : 'remote',
+ autoSelect : true,
+ width : 130,
+ forceSelection : true,
+ store : new Pf.util.FieldsJsonStore({
+ url : '/homes/get_classes.json',
+ fields : ["id", "name"],
+ autoLoad: false
+ }),
+ listeners : {
+ select : function(combo, record, index) {
+ }
+ }
+ });
+
+ var form = new Ext.FormPanel({
+ region : 'east',
+ title : '学生信息',
+ frame : true,
+ autoScroll : true,
+ width : 280,
+ lableWidth: 55,
+ labelAlign : 'top',
+ bodyStyle: 'padding:5px 15px 0',
+ defaults : { anchor : '95%' },
+ defaultType : 'textfield',
+ layout: 'form',
+ items: [
+ new Ext.form.FieldSet({
+ title : '头像',
+ layout : 'fit',
+ height : 140,
+ items :[{
+ html : '
'
+ }]
+ }),
+ classCombox
+ ,{
+ fieldLabel: '学号',
+ name: 'number',
+ },{
+ fieldLabel: '姓名',
+ name: 'name',
+ },{
+ fieldLabel: '性别',
+ name: 'sex',
+ },{
+ fieldLabel: '班级',
+ name: 'classes/name',
+ }, {
+ fieldLabel: '总分',
+ name: 'total_score',
+ }, {
+ fieldLabel: '评级',
+ name: 'grade',
+ }
+ ],
+ buttonAlign: 'center',
+ buttons: [
+ { text : '保存', handler : function() { scope.saveComment() } },
+ { text : '清除', handler : function() { scope.addComment("",true) } },
+ { text : '重置', handler : function() { scope.addComment(currentStu.get('comment'), true)} }
+ ]
+ });
+ return form;
+ },
+
+ addComment : function (content, clear) {
+ var commentArea = Ext.getCmp('s-comment');
+ if (clear) {
+ commentArea.setValue(content);
+ }else{
+ commentArea.setValue(commentArea.getValue() + content);
+ };
+ },
+
+ saveComment : function () {
+
+ }
+
+});
+
diff --git a/public/javascripts/PF/pages/home_index.js b/public/javascripts/PF/pages/home_index.js
index abf7076..909e497 100644
--- a/public/javascripts/PF/pages/home_index.js
+++ b/public/javascripts/PF/pages/home_index.js
@@ -21,7 +21,7 @@ Pf.classes.homeIndex.MainPanel = Ext.extend(Ext.Panel, {
tbar : new Ext.Toolbar({
id : 'form-tbar',
items : [
- { id : 'update-btn', text: '打印', handler: Pf.util.scope(this.printHandler,this) },
+ { id : 'update-btn', text: '打印', handler: Pf.util.scope(this.printHandler,this), icon : Pf.Icon.Print },
]
}),
items : [ this.form ]
diff --git a/public/javascripts/PF/public/init.js b/public/javascripts/PF/public/init.js
index 0a8a978..135c4aa 100644
--- a/public/javascripts/PF/public/init.js
+++ b/public/javascripts/PF/public/init.js
@@ -1 +1,15 @@
Ext.ns("Pf.classes","Pf.pages","Pf.widgets","Pf.util","Pf.settings");
+
+Pf.Icon = {
+ Print : '/images/icon/print.png',
+ Edi : '/images/icon/table_edit.png',
+ CEdi : '/images/icon/cog_edit.png',
+ Show : '/images/icon/grid.png',
+ Cancel: '/images/icon/cross.gif',
+ Des : '/images/icon/delete.gif',
+ Add : '/images/icon/add.png',
+ Save : '/images/icon/save.gif',
+ Up : '/images/icon/upload.gif',
+ Ue : '/images/icon/user_edit.png',
+ AUe : '/images/icon/user_add.png',
+}