Conflicts:
	app/controllers/users_controller.rb
This commit is contained in:
sw 2014-12-24 09:45:23 +08:00
commit 819c4c0bc1
15 changed files with 75 additions and 55 deletions

View File

@ -201,6 +201,7 @@ class FilesController < ApplicationController
def quote_resource_show
@file = Attachment.find(params[:id])
@can_quote = attachment_candown @file
end
def new

View File

@ -433,16 +433,16 @@ class UsersController < ApplicationController
else
activity = Activity.where(where_condition).where('user_id = ?', @user.id).order('id desc')
end
activity = activity.reject { |e|
((e.act_type=="Issue") && ( !e.act.visible?(User.current))) ||
((e.act_type == "Journal") && (!e.act.project.visible?(User.current))) ||
((e.act_type == "Bid") && (e.act.courses.first &&
(!e.act.homework_for_courses.first.course.visible?(User.current) ||
!User.current.member_of_course?(e.act.homework_for_courses.first.course) || !User.current.admin?)))
}
@activity_count = activity.count
@activity_pages = Paginator.new @activity_count, pre_count, params['page']
@activity = activity.slice(@activity_pages.offset,@activity_pages.per_page)
activity_page = activity.slice(@activity_pages.offset,@activity_pages.per_page * 2)
activity_page = activity_page.reject { |e|
((e.act_type=="Issue") && ( !e.act.visible?(User.current))) ||
((e.act_type == "Journal") && (!e.act.project.visible?(User.current))) ||
((e.act_type == "Bid") && ((!User.current.member_of_course?(e.act.courses.first) || !User.current.admin?)))
}
@activity = activity.slice(0,@activity_pages.per_page)
@state = 0
end

View File

@ -227,7 +227,7 @@ module IssuesHelper
strings = []
values_by_field = {}
details.each do |detail|
unless detail.property == 'attachment'
if detail.property == 'cf'
field_id = detail.prop_key
field = CustomField.find_by_id(field_id)
@ -243,7 +243,7 @@ module IssuesHelper
end
end
strings << show_detail(detail, no_html, options)
end
end
values_by_field.each do |field_id, changes|
detail = JournalDetail.new(:property => 'cf', :prop_key => field_id)

View File

@ -51,7 +51,7 @@ class Issue < ActiveRecord::Base
acts_as_nested_set :scope => 'root_id', :dependent => :destroy
acts_as_attachable :after_add => :attachment_added, :after_remove => :attachment_removed
acts_as_attachable :before_add => :attachment_added, :after_remove => :attachment_removed
acts_as_customizable
acts_as_watchable
acts_as_searchable :columns => ['subject', "#{table_name}.description", "#{Journal.table_name}.notes"],
@ -1359,7 +1359,7 @@ class Issue < ActiveRecord::Base
# Callback on file attachment
def attachment_added(obj)
if @current_journal && !obj.new_record? && @current_journal.journalized_id == obj.author_id
if @current_journal && @current_journal.user_id == obj.author_id && JournalDetail.find_all_by_value(obj.filename).count == 0
@current_journal.details << JournalDetail.new(:property => 'attachment', :prop_key => obj.id, :value => obj.filename)
end
end

View File

@ -1,17 +1,19 @@
<div class="cl"></div>
<ul>
<li class="classbox" id = "group_name_0" name="check_group_name">
<% course_member_count = l(:label_all) + " ( " + @membercount.to_s + "人)" %>
<% course_member_count = l(:label_all) %>
<%= link_to course_member_count, searchgroupmembers_course_path(@course,:group_id => 0), :onclick => "checkclass('group_name_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_count = " ( " + group.members.count.to_s + "人)" %>
<li class="classbox" id="group_name_<%= group.id %>" name="check_group_name">
<%= link_to group_display, searchgroupmembers_course_path(@course,:group_id => group.id), method: 'get', remote: true,
:onclick => "checkclass('group_name_#{group.id}')",:style => " border:0px; color: #0d90c3; float:left;"%>
:onclick => "checkclass('group_name_#{group.id}')"%>
<%= link_to group_count, searchgroupmembers_course_path(@course,:group_id => group.id), method: 'get', remote: true,
:onclick => "checkclass('group_name_#{group.id}')", :style => "color: red;"%>
<% if @canShowCode && group.members.count == 0 %>
<%= link_to '', deletegroup_course_path(:group_id => group.id), :method => 'delete', :remote => true,
:data => {confirm: l(:label_delete_group)},

View File

@ -18,17 +18,7 @@
<%= @group.name %>
</span>
<% end %>
<% if @subPage_title && @subPage_title == l(:label_student_list)%>
<%= 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"%>
<% if @group %>
<%= hidden_field "search_group_id", params[:search_group_id],:value => "#{@group.id}", name: 'search_group_id' %>
<%= submit_tag l(:label_search_member_in_group), :name => "ingroup",:class => "f_2"%>
<% end %>
<%= submit_tag l(:label_search_member_in_course), :name => 'incourse',:onclick => "checkclass('group_name_0')",:class => "f_2"%>
<%#= link_to l(:label_search),'' , :class => 'f_2' %>
<% end %>
<% end %>
</div>
<div class="cl"></div>
@ -38,7 +28,7 @@
<% end %>
<div class="cl"></div>
<div class="st_box">
<ul class="st_box_top">
<ul class="st_box_top" style="margin-left: 17px;">
<% if @subPage_title == l(:label_student_list) %>
<li class="ml358"><%= link_to '作业积分', member_score_sort_course_path ,method: 'get', remote: true, :onclick => "change_pic('pic')"%>
<a id="pic" href="#" class="st_down"></a></li>
@ -48,7 +38,7 @@
<% end %>
</ul>
<div id="list_detail">
<div id="list_detail" style="margin-left: 17px">
<% members.each do |member| %>
<div class="cl"></div><!--st_box_top end-->

View File

@ -57,9 +57,21 @@
<%= stylesheet_link_tag 'course_group', :media => 'all' %>
<script type="text/javascript" src="javascripts/jquery-1.8.3-ui-1.9.2-ujs-2.0.3.js"></script>
<div class="st_list">
<div class="st_search">
<div class="st_search" style="margin-left: 14px">
<span class="f_l"><%= @subPage_title %></span>
<span>
<% if @subPage_title && @subPage_title == l(:label_student_list)%>
<%= 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; float: left;"%>
<% if @group %>
<%= hidden_field "search_group_id", params[:search_group_id],:value => "#{@group.id}", name: 'search_group_id' %>
<%= submit_tag l(:label_search_member), :name => "ingroup",:class => "f_2", :style => "float: left "%>
<% else %>
<%= submit_tag l(:label_search_member),:style => "float: left", :name => 'incourse',:onclick => "checkclass('group_name_0')",:class => "f_2"%>
<% end %>
<% end %>
<% end %>
</span>
</div>
<div class="cl"></div>
<% if @subPage_title == l(:label_student_list) %>

View File

@ -19,7 +19,7 @@
<div class=" ">
<%= link_to_attachment file, :download => true,:text => truncate(file.filename,length: 35, omission: '...'), :title => file.filename+"\n"+file.description.to_s, :style => "overflow: hidden; white-space: nowrap;text-overflow: ellipsis;",:class => "c_dblue f_14 f_b f_l" %>
<% if User.current.logged? %>
<% if is_course_teacher(User.current,@course) && file.author_id == User.current.id %>
<% if is_course_teacher(User.current,@course) && file.author_id == User.current.id && course_contains_attachment?(@course,file) %>
<%= link_to("选入我的其他课程",quote_resource_show_course_file_path(@course,file),:class => "f_l re_select",:remote => true) if has_course?(User.current,file) %>
<% if delete_allowed && file.container_id == @course.id && file.container_type == "Course" %>

View File

@ -1,17 +1,24 @@
<div id="popbox_upload" style="margin-top: -30px;margin-left: -20px;margin-right: -10px;">
<div class="upload_con">
<h2>将此课件引入我的课程资源库</h2>
<div class="upload_box">
<div id="error_show" style="color: red;"></div>
<%= form_tag course_attach_relations_path,
method: :post,
remote: true,
id: "relation_file_form" do %>
<%= hidden_field_tag(:file_id, file.id) %>
<%= content_tag('div', courses_check_box_tags('courses[course][]', User.current.courses,course,file), :id => 'courses')%>
<a id="submit_quote" href="javascript:void(0)" class="upload_btn" onclick="submit_quote();">引&nbsp;&nbsp;用</a><a href="javascript:void(0)" class="upload_btn upload_btn_grey" onclick="closeModal();">取&nbsp;&nbsp;消</a>
<% end -%>
</div>
<% if error == '403' %>
<div class="upload_box">
<div style="color: red;">您没有权限引用此资源</div>
</div>
<% else %>
<div class="upload_box">
<div id="error_show" style="color: red;"></div>
<%= form_tag course_attach_relations_path,
method: :post,
remote: true,
id: "relation_file_form" do %>
<%= hidden_field_tag(:file_id, file.id) %>
<%= content_tag('div', courses_check_box_tags('courses[course][]', User.current.courses,course,file), :id => 'courses')%>
<a id="submit_quote" href="javascript:void(0)" class="upload_btn" onclick="submit_quote();">引&nbsp;&nbsp;用</a><a href="javascript:void(0)" class="upload_btn upload_btn_grey" onclick="closeModal();">取&nbsp;&nbsp;消</a>
<% end -%>
</div>
<% end %>
</div>
</div>

View File

@ -1,4 +1,9 @@
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'show_quote_resource',:locals => {:course => @course,:file => @file}) %>');
<% if @can_quote %>
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'show_quote_resource',:locals => {:course => @course,:file => @file,:error => ''}) %>');
<% else %>
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'show_quote_resource',:locals => {:course => @course,:file => @file,:error => '403'}) %>');
<% end %>
showModal('ajax-modal', '513px');
$('#ajax-modal').siblings().remove();
$('#ajax-modal').before("<span style='float: right;cursor:pointer;padding-left: 513px;'><a href='javascript:void(0)' onclick='closeModal()'><img src='/images/bid/close.png' width='26px' height='26px' /></a></span>");

View File

@ -67,7 +67,7 @@
<%= text_field_tag 'name', params[:name], :size => 20, :onkeyup => "regexName();" %>
<%= hidden_field_tag 'project_type', params[:project_type] %>
<%#= submit_tag l(:label_search), :class => "enterprise", :name => nil %>
<a href="#" onclick="submitSerch();" class="ButtonColor m3p10" style="padding-top: 7px !important;">
<a href="#" onclick="submitSerch();" class="ButtonColor m3p10" >
<%= l(:label_search)%>
</a>
<br />

View File

@ -570,8 +570,7 @@ zh:
label_role_new: 新建角色
label_role_and_permissions: 角色和权限
label_member: 成员
label_search_member_in_group: 班内搜索
label_search_member_in_course: 课内搜索
label_search_member: 搜索
label_search_member_count: 共搜索到
label_member_people:
label_delete_group: 确定删除分班?

View File

@ -2899,7 +2899,7 @@ div.repos_explain{
input[class~='ButtonClolr'],.ButtonColor{
color: #fffbff !important;
padding: 5px;
/*padding: 5px;*/
width: auto;
height: 24px ;
font-family: '微软雅黑',Arial,Helvetica,sans-serif;

View File

@ -40,12 +40,14 @@ input.f_2 {
.st_list{ width:688px; padding-left:5px; height:800px;}
.st_search{ margin:10px 0;}
.st_search span{ font-size:14px; font-weight:bold; color:#606060; margin-right:35px;}
.st_search input{ border:1px solid #1c9ec7; background:#fff; height:20px; color:#c4c4c4; width:200px;}
.st_search input{ border:1px solid #1c9ec7; height:20px; width:200px;}
.st_search a:hover{ background:#048fbb; text-decoration:none;}
/*.st_search input.f_2{ background:#1c9ec7; padding: 3px; margin-left: 3px; color:#fff;border:1px solid #1c9ec7; text-align:center; display:block; width:45px; height:28px; font-size:12px; }*/
.classbox{ border:1px solid #f8df8c; background:#fffce6; color:#0d90c3; padding:0 3px; float:left; margin-left:15px;}
.st_addclass ul li.selected { border:1px solid #f8df8c; background:#f8df8c; color:#0d90c3; padding:0 3px; float:left; margin-left:15px;}
.classbox a { border:0px; color: #0d90c3; float:left;text-decoration: none;}
.st_addclass ul li.selected {border:1px solid #f8df8c; background:#f6f098; padding:0 3px; float:left; margin-left:15px;}
.st_addclass ul li.selected a { color:#716cad;text-decoration: none;}
.st_addclass{ margin-top:5px;}
.st_addclass ul li{ margin-bottom:10px;}
.st_addclass ul li,.st_addclass a,.st_addclass img{ float:left;}
@ -83,11 +85,11 @@ a:hover.st_add{ color:#ff8e15;}
.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:90px !important;
height:28px !important;
color:#1c9ec7!important;
margin-right:5px !important;
border:none !important;
font-size: 14px !important;
font-size: 12px !important;
margin-left:0px !important;
box-shadow: none !important;
float: right;

View File

@ -1,10 +1,10 @@
body{ font-size:12px !important; font-family:"微软雅黑","宋体" !important; line-height:1.9 !important; background:#fff !important; font-style:normal !important;}
.resource{ font-size:12px !important; font-family:"微软雅黑","宋体" !important; line-height:1.9 !important; background:#fff !important; font-style:normal !important;}
div,html,img,ul,li,p,body,h1,h2,h3,h4,p,a,table,tr,td,fieldset,input,form,span,textarea{ margin:0; padding:0;}
div,img,tr,td,textarea{ border:0;}
table,tr,td{border:0; cellspacing:0; cellpadding:0;}
ul,li{ list-style-type:none}
.cl{ clear:both; overflow:hidden; }
a{ text-decoration:none; text-align:center; }
#resource a{ text-decoration:none; text-align:center; }
a:hover{ text-decoration:underline;}
/**** 常用***/
.f_l{ float:left;}
@ -72,12 +72,14 @@ a:hover.re_select{
border: 1px solid #64bdd9 !important;
color: #64bdd9 !important;
margin-left: 10px !important;
text-align: center;
}
a:hover.re_open
{
background: #64bdd9;
color: #fff !important;
text-decoration: none !important;
text-align: center;
}
a.re_de{ color:#6883b6; margin-left:15px;}
.re_con_box{ border-bottom:1px dashed #dadada; padding:10px 0;}