Permalink
Browse files

添加评语设置界面

  • Loading branch information...
mouse-lin committed Mar 24, 2012
1 parent 8724400 commit 56656f6f10b6b422500a5c98cab8a184c2f6e0cf
@@ -31,7 +31,7 @@ def destroy_course
render_json "success"
end
- #保存更新班级科目信息
+ #保存更新班级科目信息 | 评语类别、评语 添加更新
def ajax_request
if params[:action_type] == "create"
params[:object_type].constantize.create(params[:form_data])
@@ -41,4 +41,32 @@ def ajax_request
render_json "success"
end
+ def comment
+ respond_to do |wants|
+ wants.html
+ wants.json do
+ comments = Comment.all.collect &fields_provider
+ render_json comments
+ end
+ end
+ end
+
+ def comment_type
+ if fields_provider
+ comment_types = CommentType.all.collect &fields_provider
+ else
+ comment_types = CommentType.all
+ end
+ render_json comment_types
+ end
+
+ def destroy_comment
+ Comment.find(params[:id]).delete
+ render_json "success"
+ end
+
+ def destroy_comment_type
+ CommentType.find(params[:id]).delete
+ render_json "success"
+ end
end
@@ -55,7 +55,7 @@
<a class="dock-item2" href="#"><span>Music</span><img src="../images/music.png" alt="music" /></a>
<a class="dock-item2" href="#"><span>Video</span><img src="../images/video.png" alt="video" /></a>
<a class="dock-item2" href="#"><span>History</span><img src="../images/history.png" alt="history" /></a>
- <a class="dock-item2" href="#"><span>Calendar</span><img src="/images/calendar.png" alt="calendar" /></a>
+ <a class="dock-item2" href="/settings/comment"><span>评语设置</span><img src="/images/calendar.png" alt="calendar" /></a>
<a class="dock-item2" href="/settings/classes"><span>班别科目主档</span><img src="/images/link.png" alt="links" /></a>
<a class="dock-item2" href="/settings"><span>主档设置</span><img src="/images/rss.png" alt="rss" /></a>
<a class="dock-item2" href="logout"><span>退出</span><img src="/images/rss2.png" alt="rss" /></a>
@@ -0,0 +1,6 @@
+<%= javascript_include_tag '/javascripts/PF/pages/comment.js' %>
+<script language="javascript" type="text/javascript">
+ Ext.onReady(function() {
+ Pf.pages.currentInstance = Pf.settings.comment.panel();
+ });
+</script>
View
@@ -21,8 +21,12 @@
get "index"
get "classes"
get "get_course"
+ get "comment"
+ get "comment_type"
post "destroy_classes"
post "destroy_course"
+ post "destroy_comment"
+ post "destroy_comment_type"
post "ajax_request"
end
end
Oops, something went wrong.

0 comments on commit 56656f6

Please sign in to comment.