Conflicts:
	app/views/files/index.html.erb
exceptionHandle
nwb 11 years ago
commit aa89900813

@ -715,14 +715,14 @@ class BidsController < ApplicationController
def update def update
@bid = Bid.find(params[:id]) @bid = Bid.find(params[:id])
@project = @bid.courses.first @project = @bid.courses.first#Project.find(params[:course_id])
if @bid.update_attributes(params[:bid]) if @bid.update_attributes(params[:bid])
flash[:notice] = l(:label_update_homework_succeed) flash[:notice] = l(:label_update_homework_succeed)
#@project = Project.find(params[:course_id]) #@project = Project.find(params[:course_id])
redirect_to project_homework_path(@project) redirect_to project_homework_path(@project)
else else
@bid.safe_attributes = params[:bid] @bid.safe_attributes = params[:bid]
render :action => 'edit', :layout =>'base_courses' ,:bid_id=>@bid.id,:project_id =>@project render :action => 'edit', :layout =>'base_courses'
end end
end end

@ -43,7 +43,7 @@ class MessagesController < ApplicationController
@reply_pages = Paginator.new @reply_count, REPLIES_PER_PAGE, page @reply_pages = Paginator.new @reply_count, REPLIES_PER_PAGE, page
@replies = @topic.children. @replies = @topic.children.
includes(:author, :attachments, {:board => :project}). includes(:author, :attachments, {:board => :project}).
reorder("#{Message.table_name}.created_on ASC"). reorder("#{Message.table_name}.created_on DESC").
limit(@reply_pages.per_page). limit(@reply_pages.per_page).
offset(@reply_pages.offset). offset(@reply_pages.offset).
all all

@ -295,8 +295,12 @@ class ProjectsController < ApplicationController
project_type = params[:project_type].to_i project_type = params[:project_type].to_i
projects_all = (project_type.eql? Project::ProjectType_course) ? Project.course_entities : Project.project_entities projects_all = (project_type.eql? Project::ProjectType_course) ? Project.course_entities : Project.project_entities
@projects = projects_all.visible @projects = projects_all.visible
@projects_all = @projects.visible.like(params[:name]) if params[:name].present? #@projects_all = @projects.visible.like(params[:name]) if params[:name].present?
if params[:name].present?
@projects_all = @projects.visible.like(params[:name])
else
@projects_all = @projects;
end
@project_count = @projects_all.count @project_count = @projects_all.count
@project_pages = Paginator.new @project_count, per_page_option, params['page'] @project_pages = Paginator.new @project_count, per_page_option, params['page']

@ -55,9 +55,9 @@ module FilesHelper
result = true result = true
end end
if result if result
if contentType != l(:attachment_all) && contentType != attachment.suffix_type if contentType != '0' && contentType != attachment.suffix_type
result = false result = false
end end
end end
result result
end end

@ -13,9 +13,11 @@
<span class="font_lighter"><%= l(:label_user_create_project_homework) %></span> <span class="font_lighter"><%= l(:label_user_create_project_homework) %></span>
<span><%= link_to(bid.name, respond_path(bid), :class => 'bid_path') %></span> <span><%= link_to(bid.name, respond_path(bid), :class => 'bid_path') %></span>
<span style="float: right"> <span style="float: right">
<% if(User.current.logged? && (!Member.where('user_id = ? and project_id = ?', User.current.id, bid.courses.first.id).first.nil? && (Member.where('user_id = ? and project_id = ?', User.current.id, bid.courses.first.id).first.roles&Role.where('id = ? or id = ? or id =?',5, 10, 7)).size >0)) %>
<%# 提交作业按钮 %> <%# 提交作业按钮 %>
<%= link_to l(:label_commit_homework), '#OpenWindow', rel: 'leanModal', onclick: "showSubH(#{bid.id}, '#{bid.name}');" if User.current.member_of?(@project) %> <%= link_to l(:label_commit_homework), '#OpenWindow', rel: 'leanModal', onclick: "showSubH(#{bid.id}, '#{bid.name}');" if User.current.member_of?(@project) %>
<% if (User.current.admin?||User.current.id==bid.author_id) %> <% end %>
<% if (User.current.admin?||User.current.id==bid.author_id) %>
<%= link_to( <%= link_to(
l(:button_edit), l(:button_edit),
{:action => 'edit', :controller=>'bids', :project_id =>@project.id, :bid_id => bid.id}, {:action => 'edit', :controller=>'bids', :project_id =>@project.id, :bid_id => bid.id},
@ -33,10 +35,19 @@
</tr> </tr>
<tr> <tr>
<td colspan="2"><span class="font_lighter"> <td colspan="2"><span class="font_lighter">
<% if bid.homework_type == 1%> <% @bidding_project = bid.biding_projects.all
<%= l(:label_x_homework_project, :count => bid.homeworks.count) %>(<strong><%= link_to bid.homeworks.count, project_for_bid_path(bid.id) %></strong>) @temp = []
@bidding_project.each do |pro|
if pro.project && pro.project.project_status
@temp << pro
end
@temp
end
%>
<% if bid.homework_type == 1%>
<%= l(:label_x_homework_project, :count => @temp.count) %>(<strong><%= link_to @temp.count, project_for_bid_path(bid.id) %></strong>)
<% else %> <% else %>
<%= l(:label_x_homework_project, :count => bid.biding_projects.count) %>(<strong><%= link_to bid.biding_projects.count, project_for_bid_path(bid.id) %></strong>) <%= l(:label_x_homework_project, :count => @temp.count) %>(<strong><%= link_to @temp.count, project_for_bid_path(bid.id) %></strong>)
<% end %></span> <% end %></span>
<span class="font_lighter"><%= l(:label_x_responses, :count => bid.commit) %>(<strong><%= link_to bid.commit, respond_path(bid) %></strong>)</span> <span class="font_lighter"><%= l(:label_x_responses, :count => bid.commit) %>(<strong><%= link_to bid.commit, respond_path(bid) %></strong>)</span>
<span style="float: right"> <span style="float: right">

@ -148,11 +148,12 @@
</span></td> </span></td>
</tr> </tr>
<tr> <tr>
<td> <td colspan="2">
<% if Time.parse(@bid.deadline.to_s) < Time.parse(b_project.created_at.to_s) %> <% if Time.parse(@bid.deadline.to_s) < Time.parse(b_project.created_at.to_s) %>
<span class="required">迟交</span> <span class="required">迟交</span>
<% end %> <% end %>
</td> </td>
<td align="right"><%= link_to image_tag('delete.png') %></td>
</tr> </tr>
</table> </table>
</td> </td>

@ -3,72 +3,70 @@
<% attachmenttypes = @project.attachmenttypes %> <% attachmenttypes = @project.attachmenttypes %>
<% delete_allowed = User.current.allowed_to?(:manage_files, @project) %> <% delete_allowed = User.current.allowed_to?(:manage_files, @project) %>
<% edit_allowed = User.current.allowed_to?(:manage_files, @project) %> <% edit_allowed = User.current.allowed_to?(:manage_files, @project) %>
<ul id="all_browse_ul"> <table class="list files" id="ver-zebra">
<table class="list files" id="ver-zebra" > <colgroup>
<colgroup> <col class="vzebra-odd"/>
<col class="vzebra-odd" /> <col class="vzebra-even"/>
<col class="vzebra-even" /> <col class="vzebra-odd"/>
<col class="vzebra-odd" /> <col class="vzebra-even"/>
<col class="vzebra-even" /> <!-- <col class="vzebra-odd"/> -->
<col class="vzebra-odd" /> </colgroup>
</colgroup> <thead>
<thead><tr> <tr>
<%= sort_header_tag('filename', :caption => l(:field_filename), :scope =>"col" , :id => "vzebra-adventure")%> <%= sort_header_tag('filename', :caption => l(:field_filename), :scope => "col", :id => "vzebra-adventure") %>
<%= sort_header_tag('created_on', :caption => l(:label_date), :default_order => 'desc', :scope =>"col" , :id => "vzebra-comedy")%> <%#= sort_header_tag('created_on', :caption => l(:label_date), :default_order => 'desc', :scope => "col", :id => "vzebra-comedy") %>
<%= sort_header_tag('size', :caption => l(:field_filesize), :default_order => 'desc', :scope =>"col", :id=> "vzebra-children")%> <%= sort_header_tag('size', :caption => l(:field_filesize), :default_order => 'desc', :scope => "col", :id => "vzebra-children") %>
<%= sort_header_tag('attach_type', :caption => l(:attachment_browse), :default_order => 'desc', :scope =>"col", :id=> "vzebra-attachmenttype")%> <%= sort_header_tag('attach_type', :caption => l(:attachment_browse), :default_order => 'desc', :scope => "col", :id => "vzebra-attachmenttype") %>
<%= sort_header_tag('content_type', :caption => l(:attachment_sufix_browse), :default_order => 'desc', :scope =>"col", :id=> "vzebra-contenttype")%> <%= sort_header_tag('content_type', :caption => l(:attachment_sufix_browse), :default_order => 'desc', :scope => "col", :id => "vzebra-contenttype") %>
<%= sort_header_tag('downloads', :caption => l(:field_downloads), :default_order => 'desc', :scope =>"col", :id => "vzebra-action") %> <%= sort_header_tag('downloads', :caption => l(:field_downloads), :default_order => 'desc', :scope => "col", :id => "vzebra-action") %>
<%= sort_header_tag('operation', :caption => "", :scope =>"col", :id => "vzebra-children") %> <%= sort_header_tag('operation', :caption => "", :scope => "col", :id => "vzebra-children") %>
<!-- <%= sort_header_tag('description', :caption => l(:field_description)) %> --> <!-- <%= sort_header_tag('description', :caption => l(:field_description)) %> -->
</tr></thead> </tr>
<tbody> </thead>
<% @containers.each do |container| %> <tbody>
<% next if container.attachments.empty? -%> <% @containers.each do |container| %>
<% if container.is_a?(Version) -%> <% next if container.attachments.empty? -%>
<tr> <% if container.is_a?(Version) -%>
<th colspan="5" align="left" style="line-height: 30px; font-size: 14px; "> <tr>
<%= link_to(h(container), {:controller => 'versions', :action => 'show', :id => container}, :class => "icon icon-package", :style => "color: #666666;") %> <th colspan="5" align="left" style="line-height: 30px; font-size: 14px; ">
</th> <%= link_to(h(container), {:controller => 'versions', :action => 'show', :id => container}, :class => "icon icon-package", :style => "color: #666666;") %>
</tr> </th>
<% end -%> </tr>
<% container.attachments.each do |file| %>
<tr class="file <%= cycle("odd", "odd") %>">
<td class="filename" style="font-size: 13px; width: 240px; "><%= link_to_attachment file, :download => true, :title => file.filename+"\n"+file.description.to_s, :style => "width: 230px; overflow: hidden; white-space: nowrap;text-overflow: ellipsis;" %></td>
<td class="created_on"><%= format_time(file.created_on) %></td>
<td class="filesize"><%= number_to_human_size(file.filesize) %></td>
<td class="attach_type">
<div id="attach_type_id_label<%= file.id %>" style="white-space:nowrap;"><%= file.attachmentstype.typeName %></div>
&nbsp;
<div id="attach_type_id_edit<%= file.id %>" style="white-space:nowrap;">
<%= render :partial => 'attachments/type_edit', :locals => {:attachmenttypes => attachmenttypes,
:attachment => file,:contentype=>selContentType} %>
</div>
</td>
<td class="content_type"><%= file.show_suffix_type %></td>
<td class="downloads"><%= file.downloads %></td>
<!-- <td class="digest" width="300px"><%= file.description %></td> -->
<td align="center">
<%= link_to(image_tag('delete.png'), attachment_path(file),
:data => {:confirm => l(:text_are_you_sure)}, :method => :delete) if delete_allowed %>
</td>
</tr>
<tr>
<td class='description' colspan="5">
<div class="tags_area">
<% @preTags = %w|预设A 预设B 预设C 预设D 预设E 预设Z | %>
<%= render :partial => 'tags/tag', :locals => {:obj => file, :object_flag => "6"}%>
<div class="tags_gradint"></div>
</div>
<div class="read-more hidden"><a href="javascript:void(0);" onclick="readmore(this);"> 更多 </a></div>
</td>
</tr>
<% end -%>
<% reset_cycle %>
<% end -%> <% end -%>
<!-- %= h downloadAll(@containers) % --> <% container.attachments.each do |file| %>
<!-- %= link_to "download all file", (downloadAll(@containers)) % --> <tr class="file <%= cycle("odd", "odd") %>">
<td class="filename" style="font-size: 13px; "><%= link_to_attachment file, :download => true, :title => file.filename+"\n"+file.description.to_s, :style => "width: 230px; overflow: hidden; white-space: nowrap;text-overflow: ellipsis;" %></td>
<!-- <td class="created_on"><%#= format_time(file.created_on) %></td> -->
<td class="filesize"><%= number_to_human_size(file.filesize) %></td>
<td class="attach_type">
<span id="attach_type_id_label<%= file.id %>" style="white-space:nowrap;"><%= file.attachmentstype.typeName %></span>
<span id="attach_type_id_edit<%= file.id %>" style="white-space:nowrap;">
<%= render :partial => 'attachments/type_edit', :locals => {:attachmenttypes => attachmenttypes, :attachment => file, :contentype => selContentType} %>
</span>
</td>
<td class="content_type"><%= file.show_suffix_type %></td>
<td class="downloads"><%= file.downloads %></td>
<!-- <td class="digest" width="300px"><%= file.description %></td> -->
<td align="center">
<%= link_to(image_tag('delete.png'), attachment_path(file),
:data => {:confirm => l(:text_are_you_sure)}, :method => :delete) if delete_allowed %>
</td>
</tr>
<tr>
<td class='description' colspan="6">
<div class="tags_area">
<%# @preTags = %w|预设A 预设B 预设C 预设D 预设E 预设Z | %>
<%= render :partial => 'tags/tag', :locals => {:obj => file, :object_flag => "6"} %>
<div class="tags_gradint"></div>
</div>
<div class="read-more hidden"><a href="javascript:void(0);" onclick="readmore(this);"> 更多 </a></div>
</td>
</tr>
<% end -%>
<% reset_cycle %>
<% end -%>
<!-- %= h downloadAll(@containers) % -->
<!-- %= link_to "download all file", (downloadAll(@containers)) % -->
</tbody> </tbody>
</table> </table>
</ul>

@ -3,73 +3,69 @@
<% attachmenttypes = @project.attachmenttypes %> <% attachmenttypes = @project.attachmenttypes %>
<% delete_allowed = User.current.allowed_to?(:manage_files, @project) %> <% delete_allowed = User.current.allowed_to?(:manage_files, @project) %>
<% edit_allowed = User.current.allowed_to?(:manage_files, @project) %> <% edit_allowed = User.current.allowed_to?(:manage_files, @project) %>
<div id="catarory_browse_div" class="catarory_browse_div"> <table class="list files" id="ver-zebra">
<ul id="catarory_browse_ul"> <colgroup>
<table class="list files" id="ver-zebra1"> <col class="vzebra-odd"/>
<colgroup> <col class="vzebra-even"/>
<col class="vzebra-odd"/> <col class="vzebra-odd"/>
<col class="vzebra-even"/> <col class="vzebra-even"/>
<col class="vzebra-odd"/> <!-- <col class="vzebra-odd"/> -->
<col class="vzebra-even"/> </colgroup>
<col class="vzebra-odd"/> <thead>
</colgroup> <tr>
<thead> <%= sort_header_tag('filename', :caption => l(:field_filename), :scope => "col", :id => "vzebra-adventure") %>
<tr> <%#= sort_header_tag('created_on', :caption => l(:label_date), :default_order => 'desc', :scope => "col", :id => "vzebra-comedy") %>
<%= sort_header_tag('filename', :caption => l(:field_filename), :scope => "col", :id => "vzebra-adventure") %> <%= sort_header_tag('size', :caption => l(:field_filesize), :default_order => 'desc', :scope => "col", :id => "vzebra-children") %>
<%= sort_header_tag('created_on', :caption => l(:label_date), :default_order => 'desc', :scope => "col", :id => "vzebra-comedy") %> <%= sort_header_tag('attach_type', :caption => l(:attachment_browse), :default_order => 'desc', :scope => "col", :id => "vzebra-attachmenttype") %>
<%= sort_header_tag('size', :caption => l(:field_filesize), :default_order => 'desc', :scope => "col", :id => "vzebra-children") %> <%= sort_header_tag('content_type', :caption => l(:attachment_sufix_browse), :default_order => 'desc', :scope =>"col", :id=> "vzebra-contenttype")%>
<%= sort_header_tag('attach_type', :caption => l(:attachment_browse), :default_order => 'desc', :scope => "col", :id => "vzebra-attachmenttype") %> <%= sort_header_tag('downloads', :caption => l(:field_downloads), :default_order => 'desc', :scope => "col", :id => "vzebra-action") %>
<%= sort_header_tag('content_type', :caption => l(:attachment_sufix_browse), :default_order => 'desc', :scope =>"col", :id=> "vzebra-contenttype")%> <%= sort_header_tag('operation', :caption => "", :scope => "col", :id => "vzebra-children") %>
<%= sort_header_tag('downloads', :caption => l(:field_downloads), :default_order => 'desc', :scope => "col", :id => "vzebra-action") %> <!-- <%= sort_header_tag('description', :caption => l(:field_description)) %> -->
<%= sort_header_tag('operation', :caption => "", :scope => "col", :id => "vzebra-children") %> </tr>
<!-- <%= sort_header_tag('description', :caption => l(:field_description)) %> --> </thead>
</tr> <tbody>
</thead> <% @containers.each do |container| %>
<tbody> <% next if container.attachments.empty? -%>
<% @containers.each do |container| %> <% container.attachments.each do |file| %>
<% next if container.attachments.empty? -%> <% if isTypeOk(file,selAttachType,selContentType) %>
<% container.attachments.each do |file| %> <tr class="file <%= cycle("odd", "odd") %>">
<% if isTypeOk(file,selAttachType,selContentType) %> <td class="filename" style="font-size: 13px; "><%= link_to_attachment file, :download => true, :title => file.filename+"\n"+file.description.to_s, :style => "width: 230px; overflow: hidden; white-space: nowrap;text-overflow: ellipsis;" %></td>
<tr class="file <%= cycle("odd", "odd") %>"> <!-- <td class="created_on"><%#= format_time(file.created_on) %></td> -->
<td class="filename" style="font-size: 13px; width: 240px; "><%= link_to_attachment file, :download => true, :title => file.filename+"\n"+file.description.to_s, :style => "width: 230px; overflow: hidden; white-space: nowrap;text-overflow: ellipsis;" %></td> <td class="filesize"><%= number_to_human_size(file.filesize) %></td>
<td class="created_on"><%= format_time(file.created_on) %></td> <td class="attach_type">
<td class="filesize"><%= number_to_human_size(file.filesize) %></td> <span id="attach_type_id_label<%= file.id %>" style="white-space:nowrap;"><%= file.attachmentstype.typeName %></span>
<td class="attach_type"> &nbsp;
<div id="attach_type_id_label<%= file.id %>" style="white-space:nowrap;"><%= file.attachmentstype.typeName %></div> <span id="attach_type_id_edit<%= file.id %>" style="white-space:nowrap;">
&nbsp; <%= render :partial => 'attachments/type_edit', :locals => {:attachmenttypes => attachmenttypes,
<div id="attach_type_id_edit<%= file.id %>" style="white-space:nowrap;"> :attachment => file,:contentype=>selContentType} %>
<%= render :partial => 'attachments/type_edit', :locals => {:attachmenttypes => attachmenttypes, </span>
:attachment => file,:contentype=>selContentType} %> </td>
</div> <td class="content_type"><%= file.show_suffix_type %></td>
</td> <td class="downloads"><%= file.downloads %></td>
<td class="content_type"><%= file.show_suffix_type %></td> <!-- <td class="digest" width="300px"><%= file.description %></td> -->
<td class="downloads"><%= file.downloads %></td> <td align="center">
<!-- <td class="digest" width="300px"><%= file.description %></td> --> <%= link_to(image_tag('delete.png'), attachment_path(file),
<td align="center"> :data => {:confirm => l(:text_are_you_sure)}, :method => :delete) if delete_allowed %>
<%= link_to(image_tag('delete.png'), attachment_path(file), </td>
:data => {:confirm => l(:text_are_you_sure)}, :method => :delete) if delete_allowed %> </tr>
</td> <tr>
</tr> <td class='description' colspan="6">
<tr> <div class="tags_area">
<td class='description' colspan="5"> <%# @preTags = %w|预设A 预设B 预设C 预设D 预设E 预设Z | %>
<div class="tags_area"> <%= render :partial => 'tags/tag', :locals => {:obj => file, :object_flag => "6"} %>
<% @preTags = %w|预设A 预设B 预设C 预设D 预设E 预设Z | %> <div class="tags_gradint"></div>
<%= render :partial => 'tags/tag', :locals => {:obj => file, :object_flag => "6"} %> </div>
<div class="tags_gradint"></div> <div class="read-more hidden"><a href="javascript:void(0);" onclick="readmore(this);"> 更多 </a>
</div> </div>
<div class="read-more hidden"><a href="javascript:void(0);" onclick="readmore(this);"> 更多 </a> </td>
</div> </tr>
</td> <% end -%>
</tr> <% end -%>
<% end -%> <% reset_cycle %>
<% end -%> <% end -%>
<% reset_cycle %> <!-- %= h downloadAll(@containers) % -->
<% end -%> <!-- %= link_to "download all file", (downloadAll(@containers)) % -->
<!-- %= h downloadAll(@containers) % -->
<!-- %= link_to "download all file", (downloadAll(@containers)) % -->
</tbody> </tbody>
</table> </table>
</ul>
</div>

@ -1,5 +1,5 @@
<% if @attachtype==0 && @contenttype==l(:attachment_all)%> <% if @attachtype==0 && @contenttype=='0' %>
$("#all_browse_div").html('<%= j(render partial: "show_all_attachment")%>'); $("#all_browse_div").html('<%= j(render partial: "show_all_attachment")%>');
<%else%> <%else%>
$("#all_browse_div").html('<%= j(render partial: "sort_by_attachtypel")%>'); $("#all_browse_div").html('<%= j(render partial: "sort_by_attachtypel")%>');
<%end%> <%end%>

File diff suppressed because it is too large Load Diff

@ -124,7 +124,7 @@
<table class="borad-text-list"> <table class="borad-text-list">
<tr> <tr>
<td class="font_lighter"><%= reply_count += 1 %>楼 </td> <td class="font_lighter"><span style="display: none"><%= reply_count += 1 %>楼</span> </td>
<td> <td>
<div class="contextual-borad"> <div class="contextual-borad">
<%= link_to( <%= link_to(

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save