分组功能样式微调

Signed-off-by: alan <547533434@qq.com>
This commit is contained in:
alan 2014-12-05 10:53:43 +08:00
parent c9b84d0a35
commit cfb8edbfe2
5 changed files with 31 additions and 7 deletions

View File

@ -225,6 +225,8 @@ class CoursesController < ApplicationController
group.name = params[:group_name]
group.save
end
@canShowCode = isCourseTeacher(User.current.id,@course) && params[:role] != '1'
@is_remote = true
@course_groups = @course.course_groups
end
def join_group
@ -233,6 +235,7 @@ class CoursesController < ApplicationController
member.course_group_id = group.id
member.save
@group = group
search_group_members group
end
def unjoin_group
@ -241,6 +244,7 @@ class CoursesController < ApplicationController
member.course_group_id = 0
member.save
@group = group
search_group_members group
end
def searchgroupmembers

View File

@ -126,13 +126,16 @@ module WatchersHelper
text = l(:label_exit_course)
if joined
link_to text, {:controller => "courses", :action => "join_group", :object_id => "#{group.id}"}, :remote => true, :method => 'delete', :id => "#{group.id}", :confirm => l(:text_are_you_sure_out_group), :class => []+options
link_to text, {:controller => "courses", :action => "join_group", :object_id => "#{group.id}"},
:remote => true, :method => 'delete',
:id => "#{group.id}", :style => "padding: 8px 8px 4px;",
:confirm => l(:text_are_you_sure_out_group), :class => 'group_in'
end
else
text = l(:label_new_join)
form_tag({:controller => "courses", :action => "join_group", :object_id => "#{group.id}"}, :remote => true, :method => 'post') do
submit_tag text, class: "submit f_l", style: "width: 43px;height: 21px;"
submit_tag text, class: "group_in", style: "width: 43px;height: 21px;"
end
end
end

View File

@ -16,10 +16,11 @@
</li>
<% if course_groups.any? %>
<% course_groups.each do |group| %>
<% group_display = group.name + "(" + group.members.count.to_s + "人)" %>
<li class="classbox" id="group_name_<%= group.id %>">
<%= form_tag(searchgroupmembers_course_path(@course,:group_id => group.id), method: 'get', remote: true) do %>
<%#= text_field_tag "group_id", params[:group_id] %>
<%= submit_tag group.name, :onclick => "$asign_id(#{group.id})",:style => "background: #f8df8c; border:0px; color: black; float:left;"%>
<%= submit_tag group_display, :onclick => "$asign_id(#{group.id})",:style => "background: #f8df8c; border:0px; color: black; float:left;"%>
<% if @canShowCode %>
<a href="javascript:void(0)" class="f_l" onclick="$('#add_tag_<%= group.id %>').slideToggle();"><img src="/images/pic_edit.png" width="14" height="15" alt="编辑班级" /></a>
<% end %>
@ -36,12 +37,13 @@
</li>
<% end %>
<% end %>
<% if @canShowCode %>
<li style="margin-left:15px;">
<a href="javascript:void(0)" class="st_add f_l" onclick="$('#add_tag04').slideToggle();">+添加分班</a>
</li>
<li>
<span id="add_tag04" style="display:none; vertical-align: middle;" class="ml10 f_l">
<%= form_tag( addgroups_course_path(@course), method: 'get',:remote=>true) do %>
<%= form_tag( addgroups_course_path(@course), method: 'get',:remote=>true) do %>
<%= text_field_tag "group_name", params[:group_name], size: "20", class: "isTxt w90 f_l", style: "padding: 0px", maxlength: "100" %>
<%= submit_tag '', class: "submit f_l", style: "width: 43px;height: 21px;background: url(/images/btn.png) no-repeat 0 0;" %>
@ -50,6 +52,7 @@
<% end %>
</span>
</li>
<% end %>
</ul>

View File

@ -1,9 +1,9 @@
<div style="font-size: 18px">
<div >
<% if @group %>
<% if !@canShowCode %>
<%= join_in_course_group(@course.course_groups,@group, User.current) %>
<% end %>&nbsp;&nbsp;&nbsp;
<span ><%= @group.name %><%= @subPage_title %></span>
<span style="font-size: 18px"><%= @group.name %><%= @subPage_title %></span>
<% end %>
</div>

View File

@ -79,4 +79,18 @@ a:hover.st_add{ color:#ff8e15;}
.submit{height:21px;border:0; cursor:pointer; background:url(../images/btn.png) no-repeat 0 0;width:42px; margin-top:2px; margin-left:3px; }
.submit_2{height:21px;border:0; cursor:pointer; background:url(../images/btn1.png) no-repeat 0 0;width:42px; margin-top:2px; margin-left:3px; }
.isTxt{background:#fbfbfb url(../images/inputBg.png) repeat-x left top;height:22px;line-height:22px;border:1px solid #c1c1c1;padding:0 5px;color:#666666;}
.isTxt{background:#fbfbfb url(../images/inputBg.png) repeat-x left top;height:22px;line-height:22px;border:1px solid #c1c1c1;padding:0 5px;color:#666666;}
.group_in {
width:60px !important;
height:28px !important;
color:#fff !important;
margin-right:5px !important;
border:none !important;
margin-left:0px !important;
box-shadow: none !important;
border-radius: 0 !important;
text-shadow: none !important;
border:1px solid #1c9ec7;
background:#1c9ec7;
}