Merge remote-tracking branch 'origin/dev_hjq' into dev_hjq

dev_repository_hjq
lizanle 10 years ago
commit 2987253303

@ -145,10 +145,14 @@ class FilesController < ApplicationController
ids += version.id.to_s
end
end
resultSet = Attachment.where("((attachments.container_type = 'Project' And attachments.container_id = '#{project.id}') OR (container_type = 'Version' AND container_id IN (#{ids}))) AND filename LIKE :like ", like: "%#{keywords}%").
reorder(sort)
#resultSet = Attachment.find_by_sql("SELECT `attachments`.* FROM `attachments` LEFT OUTER JOIN `homework_attaches` ON `attachments`.container_type = 'HomeworkAttach' AND `attachments`.container_id = `homework_attaches`.id LEFT OUTER JOIN `homework_for_courses` ON `homework_attaches`.bid_id = `homework_for_courses`.bid_id LEFT OUTER JOIN `homework_for_courses` AS H_C ON `attachments`.container_type = 'Bid' AND `attachments`.container_id = H_C.bid_id WHERE (`homework_for_courses`.course_id = 117 OR H_C.course_id = 117 OR (`attachments`.container_type = 'Course' AND `attachments`.container_id = 117)) AND `attachments`.filename LIKE '%#{keywords}%'").reorder("created_on DESC")
end
if ids.blank?
resultSet = Attachment.where("attachments.container_type = 'Project' And attachments.container_id = '#{project.id}' AND filename LIKE :like ", like: "%#{keywords}%").
reorder(sort)
else
resultSet = Attachment.where("((attachments.container_type = 'Project' And attachments.container_id = '#{project.id}') OR (container_type = 'Version' AND container_id IN (#{ids}))) AND filename LIKE :like ", like: "%#{keywords}%").
reorder(sort)
end
end
def find_public_attache keywords,sort = ""
# StoresController#search 将每条文件都查出来,再次进行判断过滤。---> resultSet.to_a.map

@ -1,8 +1,3 @@
<div class="project_r_h">
<h2 class="project_h2"><%= l(:lable_file_sharingarea) %></h2>
</div>
<!--<%#= stylesheet_link_tag 'resource', :media => 'all' %> -->
<script>
function show_upload()

@ -182,12 +182,12 @@
<div class="project_intro">
<div id="course_description" class="course_description">
<h4 ><%= l(:label_project_overview)%></h4>
<div id="course_description_content break_word">
<div id="course_description_content" class="break_word">
<%= textilizable(@project.description) if @project.description && !@project.description.blank? %>
</div>
</div>
<div class="lg-foot" id="lg-foot" onclick="show_more_msg();">
<label id="expend_more_information" value="<%= l(:label_expend_information)%>"><%= l(:label_expend_information)%></label>
<label id="expend_more_information" value="show_more"><%= l(:label_expend_information)%></label>
<span class="g-arr-down">
<img id="arrow" src="/images/jiantou.jpg" width="12" height="6" />
</span>

@ -1,3 +1,4 @@
<%= error_messages_for 'project' %>
<%= labelled_form_for @project do |f| %>
<ul class="newpro_box ">
<li class="ml45 mb10">
@ -7,7 +8,9 @@
<li >
<label class="label02"><span class="c_red">*</span>&nbsp;名称&nbsp;&nbsp;</label>
<input id="project_name" name="project[name]" class=" w543" type="text" value="<%= @project.name%>">
<!--<input id="project_name" name="project[name]" class=" w543" type="text" value="<%#= @project.name%>">-->
<input type="text" name="project[name]" id="project_name" class="w543" maxlength="100" onkeyup="regex_project_name();" value="<%= @project.name %>">
<span class="c_red ml110" id="project_name_notice" style="display: none;">项目名称不能为空!</span>
</li>
<div class="cl"></div>
@ -32,6 +35,6 @@
<div class="cl"></div>
</li>
</ul>
<a href="javascript:void(0)" class="blue_btn ml110" onclick="$('#edit_project_<%= @project.id%>').submit();">保存</a>
<a href="javascript:void(0)" class="blue_btn ml110" onclick="submit_edit_project(<%= @project.id %>);" >保存</a>
<% end %>
<div class="cl"></div>

@ -24,7 +24,7 @@
:html => {:id => "member-#{member.id}-roles-form", :class => 'hol'}}
) do |f| %>
<% roles.each do |role| %>
<ul class="m120" style="text-align: left;" >
<ul class="ml80" style="text-align: left;" >
<%= check_box_tag 'membership[role_ids][]', role.id, member.roles.include?(role),
:disabled => member.member_roles.detect { |mr| mr.role_id == role.id && !mr.inherited_from.nil? } %>
<label ><%= h role %></label>
@ -32,7 +32,7 @@
<!--<br/>-->
<% end %>
<%= hidden_field_tag 'membership[role_ids][]', '' %>
<div class="m130">
<div class="ml80">
<a href="javascript:void(0)" class="member_btn" onclick="$('#member-<%= member.id%>-roles-form').submit();" style="margin-right: 10px;">
<%= l(:button_change)%>
</a>

@ -47,14 +47,14 @@ function show_more_msg() {
var information = $("#expend_more_information");
var arrow = $("#arrow");
var val = information.attr("value");
if (val == "展开更多信息") {
if (val == "show_more") {
$("#expend_more_information").text("收起描述信息");
information.attr("value", "收起描述信息");
information.attr("value", "hide_more");
arrow.attr("src", "/images/jiantouup.jpg")
}
else {
$("#expend_more_information").text("展开更多信息");
information.attr("value", "展开更多信息");
information.attr("value", "show_more");
arrow.attr("src", "/images/jiantou.jpg")
}
}
@ -90,7 +90,7 @@ function regexContent() {
return false;
}
// 项目编辑和提交
// 项目讨论区编辑和提交
function submitProjectsBoard() {
if (regexSubject() && regexContent()) {
$("#message-form").submit();
@ -161,7 +161,7 @@ function course_setting(id) {
$('#tbc_0' + (3 - id)).removeClass().addClass("undis");
}
//项目类型
//项目类型(朋友圈、开发组、科研组)
function show_window() {
$('#light').css('display', 'block');
$('#fade').css('display', 'block');
@ -189,6 +189,32 @@ function project_setting(n) {
}
}
}
//配置-验证项目名称
function regex_project_name()
{
var name = $.trim($("#project_name").val());
if(name.length == 0)
{
$("#project_name_notice").show();
return false;
}
else
{
$("#project_name_notice").hide();
return true;
}
}
//配置-信息提交
function submit_edit_project(id)
{
if(regex_project_name())
{
$("#edit_project_"+id).submit();
}
}
//配置--成员---申请列表--拒绝
function refusal_applied_member() {
$('#new_membership').append("<input name = 'refusal_button' style='display: none;'>");

@ -50,7 +50,7 @@ a:hover.subnav_green{ background:#14ad5a;}
.project_intro{ width:220px; padding:10px; background:#fff; margin-top:10px; padding-top:5px; color:#6d6d6d; line-height:1.9;}
.course_description{max-height: 112px;overflow:hidden; word-break: break-all;word-wrap: break-word;}
.course_description_none{max-height: none;}
.lg-foot{ border:1px solid #e8eef2; color: #929598; text-align:center; width:220px; height:23px; cursor:pointer;}
.lg-foot{ border:1px solid #e8eef2; color: #929598; text-align:center; width:220px; height:23px; cursor:pointer;display: none;}
.lg-foot:hover{ color:#787b7e; border:1px solid #d4d4d4;}
/****标签(和资源库的tag样式一致)***/
.project_Label{ width:220px; padding:10px; background:#fff; margin-top:10px; padding-top:5px; margin-bottom:10px;}

Loading…
Cancel
Save