修改《分组界面》样式

Signed-off-by: alan <547533434@qq.com>
This commit is contained in:
alan 2014-12-05 23:34:16 +08:00
parent 62497913d7
commit fbe6ce16d7
7 changed files with 35 additions and 44 deletions

View File

@ -123,17 +123,17 @@ module WatchersHelper
url_f = join_group_path(:object_id => group.id)
if @isjoin == true
joined = user.member_of_course_group?(group)
text = l(:label_exit_course)
text = l(:label_exit_group)
if joined
link_to text, {:controller => "courses", :action => "join_group", :object_id => "#{group.id}"},
:remote => true, :method => 'delete',
:id => "#{group.id}", :style => "padding: 8px 8px 4px;",
: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)
text = l(:label_new_join_group)
form_tag({:controller => "courses", :action => "join_group", :object_id => "#{group.id}"}, :remote => true, :method => 'post') do
submit_tag text, class: "group_in", style: "width: 43px;height: 21px;"
end

View File

@ -26,11 +26,11 @@ class Principal < ActiveRecord::Base
has_many :members, :foreign_key => 'user_id', :dependent => :destroy
has_many :memberships, :class_name => 'Member', :foreign_key => 'user_id', :include => [ :project, :roles ], :conditions => "#{Project.table_name}.status<>#{Project::STATUS_ARCHIVED}", :order => "#{Project.table_name}.name"
has_many :coursememberships, :class_name => 'Member', :foreign_key => 'user_id', :include => [ :course, :roles ], :order => "#{Course.table_name}.name"
has_many :coursememberships, :class_name => 'Member', :foreign_key => 'user_id', :include => [ :course, :roles ], :conditions => "#{Course.table_name}.status<>#{Course::STATUS_ARCHIVED}", :order => "#{Course.table_name}.name"
has_many :projects, :through => :memberships
#add by nwb
has_many :courses, :through => :coursememberships
has_many :course_groups, :through => :coursememberships
has_many :course_groups, :through => :members
has_many :issue_categories, :foreign_key => 'assigned_to_id', :dependent => :nullify
# Groups and active users

View File

@ -26,31 +26,19 @@
<ul>
<li style=" color:#8b8b8b;">分班:</li>
<li class="classbox">
<% course_member_count = l(:label_all) + "(" + @membercount.to_s + "人)" %>
<%= form_tag( searchgroupmembers_course_path(@course, :group_id => 0), method: 'get',:remote=>true) do %>
<%= hidden_field_tag "all", params[:group_id], name: 'all' %>
<%= submit_tag course_member_count, :style => "background: #f8df8c; border:0px; color: black" %>
<% end %>
<% course_member_count = l(:label_all) + " ( " + @membercount.to_s + "人)" %>
<%= link_to course_member_count, searchgroupmembers_course_path(@course,:group_id => 0), method: 'get', remote: true,:style => " border:0px; color: #0d90c3; float:left;"%>
</li>
<% if course_groups.any? %>
<% course_groups.each do |group| %>
<% group_display = group.name + "(" + group.members.count.to_s + "人)" %>
<% 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_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 %>
<%= link_to group_display, searchgroupmembers_course_path(@course,:group_id => group.id), method: 'get', remote: true, :onclick => "$asign_id(#{group.id})",:style => " border:0px; color: #0d90c3; 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 %>
</li>
</li>
<li>
<%= form_tag(updategroupname_course_path(@course,:group_id => group.id), method: 'get', remote:true, update: 'group_name') do %>
<span id="add_tag_<%= group.id %>" style="display:none; vertical-align: middle;" class=" f_l">

View File

@ -1,13 +1,18 @@
<div >
<div style="margin-left: 15px">
<% if User.current.logged? && User.current.member_of_course?(@course) && @group %>
<% if !@canShowCode %>
<%= join_in_course_group(@course.course_groups,@group, User.current) %>
<% end %>&nbsp;&nbsp;&nbsp;
<span style="font-size: 18px"><%= @group.name %><%= @subPage_title %></span>
<span style="font-size: 18px; float: left; margin-right: 35px"><%= l(:label_current_group)%>:&nbsp;<%= @group.name %></span>
<% end %>
<%= form_tag( searchmembers_course_path(@course), method: 'get',:class => "f_l",:style => "margin-left: 5px; ",:remote=>true) do %>
<%= text_field_tag 'name', params[:name], name: "name", :class => 'f_1', :style => "height:15px"%>
<%= submit_tag l(:label_search), :class => "f_2"%>
<%#= link_to l(:label_search),'' , :class => 'f_2' %>
<% end %>
<% end %>
</div>
<div class="cl"></div>
<% if members.any? %>
<% if @result_count %>
<p style="font-size: 18px;"><%= l(:label_search_member_count) %><%= @result_count %><%= l(:label_member_people) %></p>

View File

@ -3,20 +3,14 @@
<div class="st_list">
<div class="st_search">
<span class="f_l"><%= @subPage_title %></span>
<% if @subPage_title == l(:label_student_list) %>
<%= form_tag( searchmembers_course_path(@course), method: 'get',:class => "f_l",:remote=>true) do %>
<%= text_field_tag 'name', params[:name], name: "name", :class => 'f_1'%>
<%= submit_tag l(:label_search), :class => "f_2"%>
<%#= link_to l(:label_search),'' , :class => 'f_2' %>
<% end %>
<% end %>
</div>
<div class="cl"></div>
<% if @subPage_title == l(:label_student_list) %>
<div class="st_addclass" id = "st_groups">
<%= render :partial => 'groups_name', locals: {:course_groups => @course_groups} %>
</div>
<% end %>
<div class="cl"></div>

View File

@ -572,6 +572,7 @@ zh:
label_member:
label_search_member_count: 共搜索到
label_member_people:
label_current_group: 当前分班
label_limit_groupname: 组别名不能超出20字符
label_limit_groupname_null: 组别名不能为空
label_member_new: 添加成员
@ -1906,7 +1907,9 @@ zh:
label_bids_task_list: 作业列表
label_join_course: 加入
label_exit_course: 退出
label_exit_group: 退出当前分班
label_new_join: 加入
label_new_join_group: 加入当前分班
label_new_course_password: 课程密码
label_new_course_school: 开课学校
label_new_course_description: 课程描述

View File

@ -20,9 +20,9 @@ a:hover{ }
.c_red{ color:#ec0016;}
.w90{width:90px;}
.ml10{margin-left:10px;}
.st_search input.f_2 {
input.f_2 {
width:60px !important;
height:28px !important;
height:24px !important;
color:#fff !important;
margin-right:5px !important;
border:none !important;
@ -81,16 +81,17 @@ a:hover.st_add{ color:#ff8e15;}
.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;}
.group_in {
width:60px !important;
width:90px !important;
height:28px !important;
color:#fff !important;
color:#1c9ec7!important;
margin-right:5px !important;
border:none !important;
font-size: 14px !important;
margin-left:0px !important;
box-shadow: none !important;
float: right;
border-radius: 0 !important;
text-shadow: none !important;
border:1px solid #1c9ec7;
background:#1c9ec7;
padding: 0px !important;
background:#ffffff !important;
}