修改课程部分的权限设置,并且修改了作业的侧边栏显示
This commit is contained in:
parent
50894d8950
commit
671b81035c
|
@ -12,7 +12,9 @@ class CoursesController < ApplicationController
|
|||
course.members << members
|
||||
|
||||
StudentsForCourse.create(:student_id => User.current.id, :course_id => params[:object_id])
|
||||
@state = 0
|
||||
else
|
||||
@state = 1
|
||||
end
|
||||
end
|
||||
respond_to do |format|
|
||||
|
|
|
@ -270,9 +270,14 @@ class ProjectsController < ApplicationController
|
|||
end
|
||||
|
||||
def new_homework
|
||||
if User.current.logged? && (User.current.admin? || (!Member.where('user_id = ? and project_id = ?', User.current.id, @project.id).first.nil? && (Member.where('user_id = ? and project_id = ?', User.current.id, @project.id).first.roles&Role.where('id = ? or id = ?', 3, 7)).size >0))
|
||||
@homework = Bid.new
|
||||
@homework.safe_attributes = params[:bid]
|
||||
render :layout => 'base_courses'
|
||||
else
|
||||
render_404
|
||||
end
|
||||
|
||||
end
|
||||
#Ended by young
|
||||
|
||||
|
|
|
@ -1,3 +1,8 @@
|
|||
|
||||
|
||||
$('#join').html('<%= escape_javascript join_in_course(course, user) %>');
|
||||
<% if @state %>
|
||||
<% if @state == 0 %>
|
||||
alert("加入成功")
|
||||
<% else %>
|
||||
alert("密码错误")
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
|
|
@ -145,7 +145,9 @@
|
|||
<li><%= link_to l(:label_course_file), project_files_path(@project), :class => link_class(:files)%></li>
|
||||
<li><%= link_to l(:label_course_news), {:controller => 'news', :action => 'index', :project_id => @project}, :class => link_class(:news)%></li>
|
||||
<!-- <li><%= link_to(l(:label_course_repository), {:controller => 'repositories', :action => 'show', :id => @project, :repository_id => nil, :path => nil, :rev => nil, :course => 1 })%></li> -->
|
||||
<% if User.current.logged? && (User.current.admin? || (!Member.where('user_id = ? and project_id = ?', User.current.id, @project.id).first.nil? && (Member.where('user_id = ? and project_id = ?', User.current.id, @project.id).first.roles&Role.where('id = ? or id = ?', 3, 7)).size >0))%>
|
||||
<li><%= link_to l(:label_settings), {:controller => 'projects', :action => 'settings', :id => @project}, :class => link_class(:settings)%></li></ul>
|
||||
<% end %>
|
||||
</div>
|
||||
<%= yield %>
|
||||
<%= call_hook :view_layouts_base_content %>
|
||||
|
|
|
@ -85,6 +85,15 @@
|
|||
<table>
|
||||
<tr>
|
||||
<td style="padding-top: 5px">
|
||||
<% if @bid.homework_type == 1%>
|
||||
<% if @bid.homeworks.size>0 %>
|
||||
<% for homework in @bid.homeworks %>
|
||||
<%= link_to image_tag(url_to_avatar(homework.user), :class => "avatar", :title => homework.user.name), user_path(homework.user), :class => "avatar" %>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<p class="font_lighter"><%= l(:label_no_course_project) %></p>
|
||||
<% end %>
|
||||
<% else%>
|
||||
<% if @bid.projects.size>0 %>
|
||||
<% for project in @bid.projects%>
|
||||
<%= link_to image_tag(url_to_avatar(project), :class => "avatar", :title => project.name), project_path(project), :class => "avatar" %>
|
||||
|
@ -92,6 +101,7 @@
|
|||
<% else %>
|
||||
<p class="font_lighter"><%= l(:label_no_course_project) %></p>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
|
|
@ -1,3 +1,41 @@
|
|||
<!-- added by fq -->
|
||||
<style>
|
||||
input[type="submit"].bid_btn {
|
||||
vertical-align: middle;
|
||||
width: 60px;/*modified by ming*/
|
||||
height: 25px;
|
||||
line-height: 19px;
|
||||
font-size: 14px;
|
||||
color: rgb(0, 0, 0);
|
||||
background: buttonface;/*url("/images/button/bg103.jpg") no-repeat scroll left top transparent;*/
|
||||
padding: 0px 0px 4px 0px;
|
||||
border-radius: 2px;
|
||||
border: 1px solid rgb(148, 148, 148);
|
||||
box-shadow: none;
|
||||
text-shadow: none;
|
||||
margin-top: -10px;
|
||||
/*margin-right: -4px;*/
|
||||
}
|
||||
input[type="button"].bid_btn {
|
||||
width: 60px;/*modified by ming*/
|
||||
height: 25px;
|
||||
line-height: 19px;
|
||||
font-size: 14px;
|
||||
color: rgb(0, 0, 0);
|
||||
background: buttonface;/*url("/images/button/bg103.jpg") no-repeat scroll left top transparent;*/
|
||||
padding: 0px 0px 4px 0px;
|
||||
border-radius: 2px;
|
||||
border: 1px solid rgb(148, 148, 148);
|
||||
box-shadow: none;
|
||||
text-shadow: none;
|
||||
margin-top: -10px;
|
||||
margin-right: -2px;
|
||||
}
|
||||
textarea:focus {
|
||||
border: #d5dee9 1px solid;
|
||||
}
|
||||
</style>
|
||||
|
||||
<h3 class="title">请输入课程密码</h3>
|
||||
|
||||
<%= form_tag({:controller => 'courses',
|
||||
|
@ -7,10 +45,10 @@
|
|||
:method => :post,
|
||||
:id => 'new-watcher-form') do %>
|
||||
|
||||
<%= text_field_tag 'course_password', nil%>
|
||||
<%= text_field_tag 'course_password', nil, :size => 48%>
|
||||
|
||||
<p class="buttons">
|
||||
<%= submit_tag '加入', :name => nil, :onclick => "hideModal(this);" %>
|
||||
<%= submit_tag l(:button_cancel), :name => nil, :onclick => "hideModal(this);", :type => 'button' %>
|
||||
<p class="buttons" style="padding-top: 10px; padding-bottom: 1px; margin-bottom: 1px">
|
||||
<%= submit_tag '加入', :name => nil, :class => "bid_btn", :onclick => "hideModal(this);" %>
|
||||
<%= submit_tag l(:button_cancel), :name => nil, :class => "bid_btn", :onclick => "hideModal(this);", :type => 'button' %>
|
||||
</p>
|
||||
<% end %>
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
<table width="100%" valign="center">
|
||||
<tr>
|
||||
<td width="16%"><span style="margin-left:0px"><%= l(:label_course_homework_list)%></span></td>
|
||||
<td valign="center"><% if User.current.logged? %>
|
||||
<td valign="center"><% if User.current.logged? && (User.current.admin? || (!Member.where('user_id = ? and project_id = ?', User.current.id, @project.id).first.nil? && (Member.where('user_id = ? and project_id = ?', User.current.id, @project.id).first.roles&Role.where('id = ? or id = ?', 3, 7)).size >0))%>
|
||||
|
||||
<!-- <div class='icon icon-add'> -->
|
||||
<%= link_to(l(:label_course_homework_new), {:controller => 'projects', :action => 'new_homework'}, :class => 'icon icon-add') %>
|
||||
|
|
Loading…
Reference in New Issue