Merge branch 'szzh' into develop

This commit is contained in:
sw 2014-10-11 14:52:45 +08:00
commit 9c3db03225
39 changed files with 351 additions and 275 deletions

View File

@ -257,12 +257,12 @@ class ApplicationController < ActionController::Base
def authorize_attachment_download(ctrl = params[:controller], action = params[:action], global = false) def authorize_attachment_download(ctrl = params[:controller], action = params[:action], global = false)
if @attachment.container_type == "Memo" if @attachment.container_type == "Memo"
allowed = User.current.allowed_to?(:memos_attachments_download,nil,:global => true) allowed = User.current.allowed_to?(:memos_attachments_download,nil,:global => true)
elsif @attachment.container_type == "Project" elsif @attachment.container_type == "Message" && !@project.nil?
return true allowed = User.current.allowed_to?(:projects_attachments_download,@project,:global => false)
elsif @attachment.container_type == "course" elsif @attachment.container_type == "Message" && !@course.nil?
return true allowed = User.current.allowed_to?(:course_attachments_download, @course, :global => false)
elsif @attachment.container_type == "contest" elsif @attachment.container_type == "contest"
return true return true
else else
return true return true
end end

View File

@ -22,7 +22,7 @@ class AttachmentsController < ApplicationController
before_filter :delete_authorize, :only => :destroy before_filter :delete_authorize, :only => :destroy
before_filter :authorize_global, :only => :upload before_filter :authorize_global, :only => :upload
before_filter :authorize_attachment_download, :only => :download before_filter :authorize_attachment_download, :only => :download
before_filter :login_without_softapplication, only: [:download] #before_filter :login_without_softapplication, only: [:download]
accept_api_auth :show, :download, :upload accept_api_auth :show, :download, :upload
require 'iconv' require 'iconv'
@ -68,12 +68,20 @@ class AttachmentsController < ApplicationController
elsif @attachment.container.is_a?(Project) elsif @attachment.container.is_a?(Project)
project = @attachment.container project = @attachment.container
candown= User.current.member_of?(project) || (project.is_public && @attachment.is_public == 1) candown= User.current.member_of?(project) || (project.is_public && @attachment.is_public == 1)
elsif (@attachment.container.has_attribute?(:board) || @attachment.container.has_attribute?(:board_id)) && @attachment.container.board &&
@attachment.container.board.project
project = @attachment.container.board.project
candown = User.current.member_of?(project) || (project.is_public && @attachment.is_public == 1)
elsif (@attachment.container.has_attribute?(:course) ||@attachment.container.has_attribute?(:course_id) ) && @attachment.container.course elsif (@attachment.container.has_attribute?(:course) ||@attachment.container.has_attribute?(:course_id) ) && @attachment.container.course
course = @attachment.container.course course = @attachment.container.course
candown= User.current.member_of_course?(course) || (course.is_public==1 && @attachment.is_public == 1) candown= User.current.member_of_course?(course) || (course.is_public==1 && @attachment.is_public == 1)
elsif @attachment.container.is_a?(Course) elsif @attachment.container.is_a?(Course)
course = @attachment.container course = @attachment.container
candown= User.current.member_of_course?(course) || (course.is_public==1 && @attachment.is_public == 1) candown= User.current.member_of_course?(course) || (course.is_public==1 && @attachment.is_public == 1)
elsif (@attachment.container.has_attribute?(:board) || @attachment.container.has_attribute?(:board_id)) && @attachment.container.board &&
@attachment.container.board.course
course = @attachment.container.board.course
candown= User.current.member_of_course?(course) || (course.is_public==1 && @attachment.is_public == 1)
elsif @attachment.container.class.to_s=="HomeworkAttach" && @attachment.container.bid.reward_type == 3 elsif @attachment.container.class.to_s=="HomeworkAttach" && @attachment.container.bid.reward_type == 3
candown = true candown = true
else else
@ -321,8 +329,11 @@ private
raise ActiveRecord::RecordNotFound if params[:filename] && params[:filename] != @attachment.filename raise ActiveRecord::RecordNotFound if params[:filename] && params[:filename] != @attachment.filename
if @attachment.container_type == 'Course' if @attachment.container_type == 'Course'
@course = @attachment.course @course = @attachment.course
elsif !@attachment.container.nil? && (@attachment.container.has_attribute?(:course) || @attachment.container.has_attribute?(:course)) && @attachment.container.course elsif !@attachment.container.nil? && (@attachment.container.has_attribute?(:course) || @attachment.container.has_attribute?(:course_id)) && @attachment.container.course
@course = @attachment.container.course @course = @attachment.container.course
elsif !@attachment.container.nil? && ((@attachment.container.has_attribute?(:board) || @attachment.container.has_attribute?(:board_id)) && @attachment.container.board &&
@attachment.container.board.course)
@course = @attachment.container.board.course
else else
unless @attachment.container_type == 'Bid' || @attachment.container_type == 'HomeworkAttach' || @attachment.container_type == 'Memo' || @attachment.container_type == 'Softapplication' unless @attachment.container_type == 'Bid' || @attachment.container_type == 'HomeworkAttach' || @attachment.container_type == 'Memo' || @attachment.container_type == 'Softapplication'
@project = @attachment.project @project = @attachment.project

View File

@ -130,7 +130,7 @@ class MyController < ApplicationController
@user.pref.save @user.pref.save
@user.notified_project_ids = (@user.mail_notification == 'selected' ? params[:notified_project_ids] : []) @user.notified_project_ids = (@user.mail_notification == 'selected' ? params[:notified_project_ids] : [])
set_language_if_valid @user.language set_language_if_valid @user.language
flash[:notice] = l(:notice_account_updated) flash.now[:notice] = l(:notice_account_updated)
redirect_to user_path(@user) redirect_to user_path(@user)
return return
else else
@ -160,7 +160,7 @@ class MyController < ApplicationController
@user.destroy @user.destroy
if @user.destroyed? if @user.destroyed?
logout_user logout_user
flash[:notice] = l(:notice_account_deleted) flash.now[:notice] = l(:notice_account_deleted)
end end
redirect_to home_path redirect_to home_path
end end
@ -170,7 +170,7 @@ class MyController < ApplicationController
def password def password
@user = User.current @user = User.current
unless @user.change_password_allowed? unless @user.change_password_allowed?
flash[:error] = l(:notice_can_t_change_password) flash.now[:error] = l(:notice_can_t_change_password)
redirect_to my_account_path redirect_to my_account_path
return return
end end

View File

@ -226,7 +226,14 @@ class UsersController < ApplicationController
end end
end end
membership = @user.coursememberships.all#@user.coursememberships.all(:conditions => Course.visible_condition(User.current)) #@user.coursememberships.all(:conditions => Course.visible_condition(User.current))
if User.current == @user || User.current.admin?
membership = @user.coursememberships.all
else
membership = @user.coursememberships.all(:conditions => Course.visible_condition(User.current))
end
membership.sort! {|older, newer| newer.created_on <=> older.created_on } membership.sort! {|older, newer| newer.created_on <=> older.created_on }
@memberships = [] @memberships = []
membership.collect { |e| membership.collect { |e|
@ -235,9 +242,9 @@ class UsersController < ApplicationController
## 判断课程是否过期 [需封装] ## 判断课程是否过期 [需封装]
@memberships_doing = [] @memberships_doing = []
@memberships_done = [] @memberships_done = []
now_time = Time.now.year #now_time = Time.now.year
@memberships.map { |e| @memberships.map { |e|
end_time = e.course.get_time.year #end_time = e.course.get_time.year
isDone = course_endTime_timeout?(e.course) isDone = course_endTime_timeout?(e.course)
if isDone if isDone
@memberships_done.push e @memberships_done.push e

View File

@ -17,6 +17,7 @@ class ZipdownController < ApplicationController
@project = obj.courses[0] @project = obj.courses[0]
end end
end end
def assort def assort
obj_class = params[:obj_class] obj_class = params[:obj_class]
obj_id = params[:obj_id] obj_id = params[:obj_id]
@ -76,18 +77,18 @@ class ZipdownController < ApplicationController
homeattaches = bid.homeworks homeattaches = bid.homeworks
#记录所有作业是不是有附件有一个附件就改为true #记录所有作业是不是有附件有一个附件就改为true
has_file = false #has_file = false
# 得到每一个人所有文件打包的zip文件 # 得到每一个人所有文件打包的zip文件
# 并将每一个人的zip打包为一个并返回路径 # 并将每一个人的zip打包为一个并返回路径
user_zip_paths = homeattaches.map do |homeattach| user_zip_paths = homeattaches.map do |homeattach|
if homeattach.attachments.count > 0 if homeattach.attachments.count > 0
zip_homework_by_user homeattach zip_homework_by_user homeattach
has_file = true unless has_file #has_file = true unless has_file
end end
end end
unless has_file #unless has_file
render file: 'public/no_file_fond.html' , :layout => 'course_base' # render file: 'public/no_file_fond.html' , :layout => 'course_base'
end #end
zipping "#{Time.now.to_i}_#{bid.name}.zip", user_zip_paths, OUTPUT_FOLDER zipping "#{Time.now.to_i}_#{bid.name}.zip", user_zip_paths, OUTPUT_FOLDER
#@paths = homeworks_attach_path #@paths = homeworks_attach_path

View File

@ -303,27 +303,27 @@ module WelcomeHelper
str << content_tag("span", "发表了") << str << content_tag("span", "发表了") <<
content_tag("span", find_all_event_type(event)) << content_tag("span", find_all_event_type(event)) <<
':&nbsp;'.html_safe << ':&nbsp;'.html_safe <<
link_to(truncate(strip_tags(event.event_description).gsub(/&nbsp;/,''), length: 30, omission:'...'), event.event_url) link_to(strip_tags(event.event_description).gsub(/&nbsp;/,''), event.event_url)
when 'issue', 'message' , 'bid' , 'wiki-page' , 'document' when 'issue', 'message' , 'bid' , 'wiki-page' , 'document'
str << content_tag("span", "发表了") << str << content_tag("span", "发表了") <<
content_tag("span", find_all_event_type(event)) << content_tag("span", find_all_event_type(event)) <<
':&nbsp;'.html_safe << ':&nbsp;'.html_safe <<
link_to(truncate(event.event_title, length: 30, omission:'...'), event.event_url) link_to(event.event_title, event.event_url)
when 'reply' ,'Reply', 'Memo' when 'reply' ,'Reply', 'Memo'
str << content_tag("span", "发表了") << str << content_tag("span", "发表了") <<
content_tag("span", find_all_event_type(event)) << content_tag("span", find_all_event_type(event)) <<
':&nbsp;'.html_safe << ':&nbsp;'.html_safe <<
link_to(truncate(strip_tags(event.event_description).gsub(/&nbsp;/,''), length: 30, omission:'...'), event.event_url) link_to(strip_tags(event.event_description).gsub(/&nbsp;/,''), event.event_url)
when 'attachment' when 'attachment'
str << content_tag('span', '上传了') << str << content_tag('span', '上传了') <<
content_tag('span', find_all_event_type(event)) << content_tag('span', find_all_event_type(event)) <<
':&nbsp;'.html_safe << ':&nbsp;'.html_safe <<
link_to(truncate(event.event_title, length: 30, omission:'...'), event.event_url) << link_to(event.event_title, event.event_url) <<
link_to(('&nbsp;['.html_safe+l(:label_downloads_list).to_s << ']'), project_files_path(event.container.project), :class => "attachments_list_color") link_to(('&nbsp;['.html_safe+l(:label_downloads_list).to_s << ']'), project_files_path(event.container.project), :class => "attachments_list_color")
else else
str << content_tag("span", "更新了") << str << content_tag("span", "更新了") <<
content_tag("span", find_all_event_type(event)) << content_tag("span", find_all_event_type(event)) <<
':&nbsp;'.html_safe << link_to(truncate(event.event_title, length: 30, omission:'...'), event.event_url) ':&nbsp;'.html_safe << link_to(event.event_title, event.event_url)
end end
str str
rescue Exception => e rescue Exception => e
@ -405,7 +405,8 @@ module WelcomeHelper
"show_bids" => true, "show_bids" => true,
"show_contest" => true "show_contest" => true
} }
activity.scope_select{|t| ['changesets', 'documents', 'memos', 'messages', 'journals_for_messages', 'bids', 'news', 'contestnotification'].include?(t) ? nil : 'You may think you know what the following code does, may be. but why don"t you close this file and go play with something else, Now?' } activity.scope_select{|t| ['changesets', 'documents', 'memos', 'messages', 'journals_for_messages', 'bids', 'news', 'contestnotification'].include?(t) ?
nil : 'You may think you know what the following code does, may be. but why don"t you close this file and go play with something else, Now?' }
activity.events_welcome(nil, nil, {:limit => limit, :types => 'welcome'}) activity.events_welcome(nil, nil, {:limit => limit, :types => 'welcome'})
end end

View File

@ -411,6 +411,17 @@ class Attachment < ActiveRecord::Base
end end
end end
# Finds an attachment that matches the given token
def self.find_by_token_only(token)
if token.to_s =~ /^(\d+)\.([0-9a-f]+)$/
attachment_id, attachment_digest = $1, $2
attachment = Attachment.where(:id => attachment_id, :digest => attachment_digest).first
if attachment
attachment
end
end
end
# Bulk attaches a set of files to an object # Bulk attaches a set of files to an object
# #
# Returns a Hash of the results: # Returns a Hash of the results:

View File

@ -26,7 +26,7 @@
&nbsp; &nbsp;
<div class="autoscroll"> <div class="autoscroll">
<table class="list" style="width: 100%;table-layout: fixed"> <table class="list" style="width: 100%;table-layout: fixed;">
<thead> <thead>
<tr > <tr >
<%= sort_header_tag('login', :caption => l(:field_login)) %> <%= sort_header_tag('login', :caption => l(:field_login)) %>

View File

@ -5,7 +5,7 @@
<%= text_field_tag("attachments[p#{i}][filename]", attachment.filename, :class => 'filename readonly', :readonly=>'readonly')%> <%= text_field_tag("attachments[p#{i}][filename]", attachment.filename, :class => 'filename readonly', :readonly=>'readonly')%>
<%= text_field_tag("attachments[p#{i}][description]", attachment.description, :maxlength => 254, :placeholder => l(:label_optional_description), :class => 'description', :style=>"display: inline-block;") %> <%= text_field_tag("attachments[p#{i}][description]", attachment.description, :maxlength => 254, :placeholder => l(:label_optional_description), :class => 'description', :style=>"display: inline-block;") %>
<span class="ispublic-label"><%= l(:field_is_public)%>:</span> <span class="ispublic-label"><%= l(:field_is_public)%>:</span>
<%= check_box_tag("attachments[p#{i}][is_public_checkbox]", attachment.is_public, :class => 'is_public')%> <%= check_box_tag("attachments[p#{i}][is_public_checkbox]", attachment.is_public,attachment.is_public == 1 ? true : false,:class => 'is_public')%>
<%= if attachment.id.nil? <%= if attachment.id.nil?
#待补充代码 #待补充代码
else else

View File

@ -7,7 +7,8 @@
<%= text_field_tag("attachments[p#{i}][description]", attachment.description, :maxlength => 255, :placeholder => l(:label_optional_description), :class => 'description', :style=>"display: inline-block;") + <%= text_field_tag("attachments[p#{i}][description]", attachment.description, :maxlength => 255, :placeholder => l(:label_optional_description), :class => 'description', :style=>"display: inline-block;") +
link_to('&nbsp;'.html_safe, attachment_path(attachment, :attachment_id => "p#{i}", :format => 'js'), :method => 'delete', :remote => true, :class => 'remove-upload') %> link_to('&nbsp;'.html_safe, attachment_path(attachment, :attachment_id => "p#{i}", :format => 'js'), :method => 'delete', :remote => true, :class => 'remove-upload') %>
<%#= render :partial => 'tags/tag', :locals => {:obj => attachment, :object_flag => "6"} %> <%#= render :partial => 'tags/tag', :locals => {:obj => attachment, :object_flag => "6"} %>
<%= check_box_tag("attachments[p#{i}][is_public_checkbox]", attachment.is_public, :class => 'is_public')%> <span class="ispublic-label"><%= l(:field_is_public)%>:</span>
<%= check_box_tag("attachments[p#{i}][is_public_checkbox]", attachment.is_public,attachment.is_public == 1 ? true : false, :class => 'is_public')%>
<%= hidden_field_tag "attachments[p#{i}][token]", "#{attachment.token}" %> <%= hidden_field_tag "attachments[p#{i}][token]", "#{attachment.token}" %>
</span> </span>
<% end %> <% end %>
@ -18,7 +19,8 @@
<%= text_field_tag("attachments[p#{i}][description]", attachment.description, :maxlength => 255, :placeholder => l(:label_optional_description), :class => 'description', :style=>"display: inline-block;") + <%= text_field_tag("attachments[p#{i}][description]", attachment.description, :maxlength => 255, :placeholder => l(:label_optional_description), :class => 'description', :style=>"display: inline-block;") +
link_to('&nbsp;'.html_safe, attachment_path(attachment, :attachment_id => "p#{i}", :format => 'js'), :method => 'delete', :remote => true, :class => 'remove-upload') %> link_to('&nbsp;'.html_safe, attachment_path(attachment, :attachment_id => "p#{i}", :format => 'js'), :method => 'delete', :remote => true, :class => 'remove-upload') %>
<%#= render :partial => 'tags/tag', :locals => {:obj => attachment, :object_flag => "6"} %> <%#= render :partial => 'tags/tag', :locals => {:obj => attachment, :object_flag => "6"} %>
<%= check_box_tag("attachments[p#{i}][is_public_checkbox]", attachment.is_public, :class => 'is_public')%> <span class="ispublic-label"><%= l(:field_is_public)%>:</span>
<%= check_box_tag("attachments[p#{i}][is_public_checkbox]", attachment.is_public,attachment.is_public == 1 ? true : false, :class => 'is_public')%>
<%= hidden_field_tag "attachments[p#{i}][token]", "#{attachment.token}" %> <%= hidden_field_tag "attachments[p#{i}][token]", "#{attachment.token}" %>
</span> </span>
<% end %> <% end %>

View File

@ -78,7 +78,7 @@
<% end %> <% end %>
</td> </td>
<td rowspan="4" style="text-align: center;vertical-align: middle;width: 30px"> <td rowspan="4" style="text-align: center;vertical-align: middle;width: 30px">
<% if Time.parse(@bid.deadline.to_s) < Time.parse(homework.created_at.to_s) %> <% if Time.parse(@bid.deadline.to_s).strftime("%Y-%m-%d") < Time.parse(homework.created_at.to_s).strftime("%Y-%m-%d") %>
<span class="required">迟交</span> <span class="required">迟交</span>
<% end %> <% end %>
</td> </td>

View File

@ -2,38 +2,35 @@
<%= form_tag({:controller => 'calendars', :action => 'show', :project_id => @project}, <%= form_tag({:controller => 'calendars', :action => 'show', :project_id => @project},
:method => :get, :id => 'query_form') do %> :method => :get, :id => 'query_form') do %>
<%= hidden_field_tag 'set_filter', '1' %> <%= hidden_field_tag 'set_filter', '1' %>
<fieldset id="filters" class="collapsible <%= @query.new_record? ? "" : "collapsed" %>"> <fieldset id="filters" class="collapsible <%= @query.new_record? ? "" : "collapsed" %>">
<legend onclick="toggleFieldset(this);"><%= l(:label_filter_plural) %></legend> <legend onclick="toggleFieldset(this);"><%= l(:label_filter_plural) %></legend>
<div style="<%= @query.new_record? ? "" : "display: none;" %>"> <div style="<%= @query.new_record? ? "" : "display: none;" %>">
<%= render :partial => 'queries/filters', :locals => {:query => @query} %> <%= render :partial => 'queries/filters', :locals => {:query => @query} %>
</div> </div>
</fieldset> </fieldset>
<p style="float:right;">
<%= link_to_previous_month(@year, @month) %> | <%= link_to_next_month(@year, @month) %>
</p>
<p class="buttons">
<%= label_tag('month', l(:label_month)) %>
<%= select_month(@month, :prefix => "month", :discard_type => true) %>
<%= label_tag('year', l(:label_year)) %>
<%= select_year(@year, :prefix => "year", :discard_type => true) %>
<p style="float:right;"> <%= link_to_function l(:button_apply), '$("#query_form").submit()', :class => 'icon icon-checked' %>
<%= link_to_previous_month(@year, @month) %> | <%= link_to_next_month(@year, @month) %> <%= link_to l(:button_clear), { :project_id => @project, :set_filter => 1 }, :class => 'icon icon-reload' %>
</p> </p>
<p class="buttons">
<%= label_tag('month', l(:label_month)) %>
<%= select_month(@month, :prefix => "month", :discard_type => true) %>
<%= label_tag('year', l(:label_year)) %>
<%= select_year(@year, :prefix => "year", :discard_type => true) %>
<%= link_to_function l(:button_apply), '$("#query_form").submit()', :class => 'icon icon-checked' %>
<%= link_to l(:button_clear), { :project_id => @project, :set_filter => 1 }, :class => 'icon icon-reload' %>
</p>
<% end %> <% end %>
<%= error_messages_for 'query' %> <%= error_messages_for 'query' %>
<% if @query.valid? %> <% if @query.valid? %>
<%= render :partial => 'common/calendar', :locals => {:calendar => @calendar} %> <%= render :partial => 'common/calendar', :locals => {:calendar => @calendar} %>
<p class="legend cal">
<p class="legend cal"> <span class="starting"><%= l(:text_tip_issue_begin_day) %></span>
<span class="starting"><%= l(:text_tip_issue_begin_day) %></span> <span class="ending"><%= l(:text_tip_issue_end_day) %></span>
<span class="ending"><%= l(:text_tip_issue_end_day) %></span> <span class="starting ending"><%= l(:text_tip_issue_begin_end_day) %></span>
<span class="starting ending"><%= l(:text_tip_issue_begin_end_day) %></span> </p>
</p>
<% end %> <% end %>
<% content_for :sidebar do %> <% content_for :sidebar do %>

View File

@ -1,32 +1,38 @@
<table class="cal"> <table class="cal" style="width: 100%;table-layout: fixed;">
<thead> <thead>
<tr><th scope="col" title="<%= l(:label_week) %>" class="week-number"></th><% 7.times do |i| %><th scope="col"><%= day_name( (calendar.first_wday+i)%7 ) %></th><% end %></tr> <tr>
</thead> <th scope="col" title="<%= l(:label_week) %>" class="week-number"></th>
<tbody> <% 7.times do |i| %>
<tr> <th scope="col" style='white-space: nowrap;overflow: hidden;text-overflow: ellipsis;'><%= day_name( (calendar.first_wday+i)%7 ) %></th>
<% day = calendar.startdt <% end %>
while day <= calendar.enddt %> </tr>
<%= ("<td class='week-number' title='#{ l(:label_week) }'>#{(day+(11-day.cwday)%7).cweek}</td>".html_safe) if day.cwday == calendar.first_wday %> </thead>
<td class="<%= day.month==calendar.month ? 'even' : 'odd' %><%= ' today' if Date.today == day %>"> <tbody>
<p class="day-num"><%= day.day %></p> <tr>
<% calendar.events_on(day).each do |i| %> <% day = calendar.startdt
<% if i.is_a? Issue %> while day <= calendar.enddt %>
<div class="<%= i.css_classes %> <%= 'starting' if day == i.start_date %> <%= 'ending' if day == i.due_date %> tooltip"> <%= ("<td class='week-number' title='#{ l(:label_week) }'>#{(day+(11-day.cwday)%7).cweek}</td>".html_safe) if day.cwday == calendar.first_wday %>
<%= h("#{i.project} -") unless @project && @project == i.project %> <td class="<%= day.month==calendar.month ? 'even' : 'odd' %><%= ' today' if Date.today == day %>"
<%= link_to_issue i, :truncate => 30 %> style="word-break: break-all;word-wrap: break-word;">
<span class="tip"><%= render_issue_tooltip i %></span> <p class="day-num"><%= day.day %></p>
</div> <% calendar.events_on(day).each do |i| %>
<% else %> <% if i.is_a? Issue %>
<span class="icon icon-package"> <div class="<%= i.css_classes %> <%= 'starting' if day == i.start_date %> <%= 'ending' if day == i.due_date %> tooltip">
<%= h("#{i.project} -") unless @project && @project == i.project %> <%= h("#{i.project} -") unless @project && @project == i.project %>
<%= link_to_version i%> <%= link_to_issue i, :truncate => 30 %>
</span> <span class="tip"><%= render_issue_tooltip i %></span>
<% end %> </div>
<% end %> <% else %>
</td> <span class="icon icon-package">
<%= '</tr><tr>'.html_safe if day.cwday==calendar.last_wday and day!=calendar.enddt %> <%= h("#{i.project} -") unless @project && @project == i.project %>
<% day = day + 1 <%= link_to_version i%>
end %> </span>
</tr> <% end %>
</tbody> <% end %>
</td>
<%= '</tr><tr>'.html_safe if day.cwday==calendar.last_wday and day!=calendar.enddt %>
<% day = day + 1
end %>
</tr>
</tbody>
</table> </table>

View File

@ -13,14 +13,14 @@
</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" ,:class => "tableth") %>
<%#= 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",:class => "tableth") %>
<%= 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",:class => "tableth") %>
<%= 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",:class => "tableth") %>
<%= sort_header_tag('field_file_dense', :caption => l(:field_file_dense), :default_order => 'desc', :scope => "col", :id => "vzebra-field_file_dense") %> <%= sort_header_tag('field_file_dense', :caption => l(:field_file_dense), :default_order => 'desc', :scope => "col", :id => "vzebra-field_file_dense",:class => "tableth") %>
<%= 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",:class => "tableth") %>
<%= sort_header_tag('operation', :caption => "", :scope => "col", :id => "vzebra-children") %> <%= sort_header_tag('operation', :caption => "", :scope => "col", :id => "vzebra-children",:class => "tableth") %>
<!-- <%#= sort_header_tag('description', :caption => l(:field_description)) %> --> <!-- <%#= sort_header_tag('description', :caption => l(:field_description)) %> -->
</tr> </tr>
</thead> </thead>

View File

@ -1,55 +1,31 @@
<% is_teacher = is_course_teacher User.current,homework.bid.courses.first %> <% is_teacher = is_course_teacher User.current,homework.bid.courses.first %>
<% if comprehensive_evaluation != nil && comprehensive_evaluation.count > 0 %>
<div style="height: <%= is_teacher ? 250 : 100%>px; padding-bottom: 10px"> <div style="padding-bottom: 10px">
<div style="font-size: 15px"> <div style="font-size: 15px">
<strong>作业综评:</strong> <strong><%= l(:lable_teacher_evaluation)%></strong>
<% if teaher_score != "0.00" %> <% if teaher_score != "0.00" %>
<%= render :partial => 'show_score', locals: {:stars => teaher_score} %> <%= render :partial => 'show_score', locals: {:stars => teaher_score} %>
<% end %>
</div>
<div style="font-size: 14px;">
<div style="margin-left: 20px;margin-bottom: 10px;margin-top: 10px;"> <%= comprehensive_evaluation.first.notes%> </div>
</div>
<% if is_teacher %>
<%= render :partial => 'evaluation', :locals => {:homework => homework} %>
<div>
<%= render :partial => 'evaluation_add_jour',
:locals => {:homework_attach => homework,
:sta => 0,
:is_comprehensive_evaluation => 1,
:comprehensive_evaluation => comprehensive_evaluation.first.notes} %>
</div>
<% end %>
</div>
<% else %>
<% if is_teacher %>
<div style="height: 200px; padding-bottom: 10px">
<div style="font-size: 15px">
<strong>作业综评:</strong>
<% if teaher_score != "0.00" %>
<%= render :partial => 'show_score', locals: {:stars => teaher_score} %>
<% end %>
</div>
<%= render :partial => 'evaluation', :locals => {:homework => homework} %>
<div>
<%= render :partial => 'evaluation_add_jour',
:locals => {:homework_attach => homework,
:sta => 0,
:is_comprehensive_evaluation => 1,
:comprehensive_evaluation => nil} %>
</div>
</div>
<% else %>
<div style="height: 80px; padding-bottom: 10px">
<div style="font-size: 15px">
<strong>作业综评:</strong>
<% if teaher_score != "0.00" %>
<%= render :partial => 'show_score', locals: {:stars => teaher_score} %>
<% end %>
</div>
<% if teaher_score == "0.00" %>
<div style="text-align: center;font-size: 15px;color: #15BCCC;vertical-align:middle;padding-top: 15px; "><strong>老师还未进行评价!</strong></div>
<% end %>
</div>
<% end %> <% end %>
<% end %> <div style="font-size: 14px;">
<div style="margin-left: 20px;margin-bottom: 10px;margin-top: 10px;">
<%= comprehensive_evaluation.first.notes if !comprehensive_evaluation.nil? && comprehensive_evaluation.count > 0%>
</div>
</div>
<% if(teaher_score == "0.00" && !(!comprehensive_evaluation.nil? && comprehensive_evaluation.count > 0))%>
<% if is_teacher %>
<%#= render :partial => 'teacher_evaluation',
:locals => {:homework => homework, :comprehensive_evaluation => comprehensive_evaluation} %>
<% else %>
<div style="text-align: center;font-size: 15px;color: #15BCCC;vertical-align:middle;padding-top: 15px; ">
<strong><%= l(:lable_teacher_evaluation_no) %></strong>
</div>
<% end %>
<% end %>
</div>
</div>
<div>
<% if is_teacher %>
<%= render :partial => 'teacher_evaluation',:locals => {:homework => homework} %>
<% end %>
</div>

View File

@ -0,0 +1,8 @@
<%= render :partial => 'evaluation', :locals => {:homework => homework} %>
<div>
<%= render :partial => 'evaluation_add_jour',
:locals => {:homework_attach => homework,
:sta => 0,
:is_comprehensive_evaluation => 1,
:comprehensive_evaluation => l(:label_leave_a_message)} %>
</div>

View File

@ -189,7 +189,7 @@
</div> </div>
<div style="padding-bottom: 8px"> <div style="padding-bottom: 8px">
<% if @course.description && @course.description.size>0 %> <% if @course.description && @course.description.lstrip.rstrip.size>0 %>
<div class="font_lighter_sidebar" style="word-break:break-all; word-wrap:break-word;"> <div class="font_lighter_sidebar" style="word-break:break-all; word-wrap:break-word;">
<%= textilizable @course.description %> <%= textilizable @course.description %>

View File

@ -6,11 +6,11 @@
<!--[form:message]--> <!--[form:message]-->
<% unless replying %> <% unless replying %>
<p><label for="message_subject"><%= l(:field_subject) %><span class="required"> *&nbsp;&nbsp;</span></label><br/> <p><label for="message_subject"><%= l(:field_subject) %><span class="required"> *&nbsp;&nbsp;</span></label><br/>
<%= f.text_field :subject, :size => 60, :style => "width: 99%;", :id => "message_subject" %><!--by young--> <%= f.text_field :subject, :size => 60, :style => "width: 99%;", :id => "message_subject", :maxlength => 254 %><!--by young-->
</p> </p>
<% else %> <% else %>
<p><label for="message_subject"><%= l(:field_subject) %><span class="required"> *&nbsp;&nbsp;</span></label><br/> <p><label for="message_subject"><%= l(:field_subject) %><span class="required"> *&nbsp;&nbsp;</span></label><br/>
<%= f.text_field :subject, :size => 60, :style => "width: 99%;", :id => "message_subject", :readonly => true %> <%= f.text_field :subject, :size => 60, :style => "width: 99%;", :id => "message_subject", :readonly => true %>
</p> </p>
<% end %> <% end %>
<p> <p>

View File

@ -12,8 +12,6 @@
); );
</script> </script>
<script type="text/javascript"> <script type="text/javascript">
function get_options(value) { function get_options(value) {
$.ajax({ $.ajax({
@ -21,17 +19,12 @@
url: '/school/get_options/' + encodeURIComponent(value), url: '/school/get_options/' + encodeURIComponent(value),
data: 'text', data: 'text',
success: function (data) { success: function (data) {
$("#province").val(value) $("#province").val(value)
$("#schoollist").html(data); $("#schoollist").html(data);
} }
}); });
} }
</script> </script>
<div class="contextual" style="padding-right: 10px;"> <div class="contextual" style="padding-right: 10px;">
<%= link_to(l(:button_change_password), {:action => 'password'}, :class => 'icon icon-passwd') if @user.change_password_allowed? %> <%= link_to(l(:button_change_password), {:action => 'password'}, :class => 'icon icon-passwd') if @user.change_password_allowed? %>
<%= call_hook(:view_my_account_contextual, :user => @user) %> <%= call_hook(:view_my_account_contextual, :user => @user) %>
@ -39,9 +32,7 @@
<h3 style="padding-left: 10px;"><%= l(:label_my_account) %></h3> <h3 style="padding-left: 10px;"><%= l(:label_my_account) %></h3>
<%= error_messages_for 'user' %> <%= error_messages_for 'user' %>
<fieldset class="box" style="margin:10px;"> <fieldset class="box" style="margin:10px;">
<%= labelled_form_for :user, @user, <%= labelled_form_for :user, @user,
:url => {:action => "account"}, :url => {:action => "account"},
:html => {:id => 'my_account_form', :html => {:id => 'my_account_form',
@ -70,7 +61,6 @@
<div> <div>
<span id='name' style='display:none'> <span id='name' style='display:none'>
<p style="width:530px;padding-left: 26px;"> <p style="width:530px;padding-left: 26px;">
<%= f.text_field :lastname, :required => true %> <%= f.text_field :lastname, :required => true %>
<span class='font_lighter'><%= l(:field_lastname_eg) %></span> <span class='font_lighter'><%= l(:field_lastname_eg) %></span>
@ -82,7 +72,8 @@
</span> </span>
<span id='enterprise' style='display:none'> <span id='enterprise' style='display:none'>
<p style="width:400px;padding-left: 26px;"><%= l(:label_company_name)%><%= text_field_tag :enterprise_name, @user.firstname %> <p style="width:400px;padding-left: 26px;">
<%= l(:label_company_name)%><%= text_field_tag :enterprise_name, @user.firstname %>
</p> </p>
</span> </span>
@ -95,10 +86,10 @@
</p> </p>
<% else %> <% else %>
<% if @user.user_extensions.gender == 0 %><!-- label_gender_male --> <% if @user.user_extensions.gender == 0 %><!-- label_gender_male -->
<p style="width:400px;padding-left: 26px;"> <p style="width:400px;padding-left: 26px;">
<%= l(:label_gender) %>&nbsp;&nbsp; <%= l(:label_gender) %>&nbsp;&nbsp;
<%= select_tag 'gender', "<option value = '0'>#{l(:label_gender_male)}</option><option value = '1'>#{l(:label_gender_female)}</option>".html_safe, :class => 'gender' %> <%= select_tag 'gender', "<option value = '0'>#{l(:label_gender_male)}</option><option value = '1'>#{l(:label_gender_female)}</option>".html_safe, :class => 'gender' %>
</p> </p>
<% else %> <% else %>
<p style="width:400px;padding-left: 26px;"> <p style="width:400px;padding-left: 26px;">
<%= l(:label_gender) %>&nbsp;&nbsp; <%= l(:label_gender) %>&nbsp;&nbsp;
@ -107,12 +98,11 @@
<% end %> <% end %>
<% end %> <% end %>
</span> </span>
<!-- added by Wen --> <!-- added by Wen -->
<p style="padding-left: 26px;"> <p style="padding-left: 26px;">
<% if User.current.user_extensions.school.nil? %> <% if User.current.user_extensions.school.nil? %>
<%= l(:field_occupation) %>&nbsp;<span class="required">*</span> <%= l(:field_occupation) %>&nbsp;
<span class="required">*</span>
<input id="province" name="province" type="text" value="请单击选择省份及学校" readonly> <input id="province" name="province" type="text" value="请单击选择省份及学校" readonly>
<input id="occupation" name="occupation" type="hidden"/> <input id="occupation" name="occupation" type="hidden"/>
<input id="occupation_name" type="text" readonly/> <input id="occupation_name" type="text" readonly/>
@ -126,8 +116,7 @@
<div id="WOpenWindow"> <div id="WOpenWindow">
<a class="modal_close" href="#"></a> <a class="modal_close" href="#"></a>
<h2><%= l(:lable_school_list)%></h2>
<h2>学校列表</h2>
&nbsp;&nbsp; &nbsp;&nbsp;
<div class="pcontent"> <div class="pcontent">
<ul id="provincelist" class="school_list"> <ul id="provincelist" class="school_list">
@ -234,39 +223,40 @@
<% unless @user.user_extensions.identity == 2 %> <% unless @user.user_extensions.identity == 2 %>
<p style="width:400px;padding-left: 26px;"> <p style="width:400px;padding-left: 26px;">
<%= l(:label_identity) %> <%= l(:label_identity) %>
<select onchange="showtechnical_title(this.value, document.getElementById('userTechnical_title'));" name="identity" id="userIdentity" class="location"> <select onchange="showtechnical_title(this.value, document.getElementById('userTechnical_title'));" name="identity" id="userIdentity" class="location">
<option value=""><%= l(:label_account_identity_choose) %></option> <option value=""><%= l(:label_account_identity_choose) %></option>
<option value="0"><%= l(:label_account_identity_teacher) %></option> <option value="0"><%= l(:label_account_identity_teacher) %></option>
<option value="1"><%= l(:label_account_identity_student) %></option> <option value="1"><%= l(:label_account_identity_student) %></option>
<option value="3"><%= l(:label_account_identity_developer) %></option> <option value="3"><%= l(:label_account_identity_developer) %></option>
</select> </select>
<span id='technical_title' style='display:none'> <span id='technical_title' style='display:none'>
<select name="technical_title" id="userTechnical_title"></select> <select name="technical_title" id="userTechnical_title"></select>
</span> </span>
<span id='no' style='display:none'> <span id='no' style='display:none'>
<!-- modified by fq --> <!-- modified by fq -->
<% unless User.current.user_extensions.student_id.nil? %> <% unless User.current.user_extensions.student_id.nil? %>
<%= text_field_tag :no, User.current.user_extensions.student_id, :placeholder => "请输入学号" %> <%= text_field_tag :no, User.current.user_extensions.student_id, :placeholder => "请输入学号" %>
<% else %> <% else %>
<%= text_field_tag :no, nil, :placeholder => "请输入学号" %></span> <%= text_field_tag :no, nil, :placeholder => "请输入学号" %></span>
<% end %> <% end %>
<!-- end --> <!-- end -->
</span> </span>
<% else %> </p>
<span style="display:none"> <% else %>
<select onchange="showtechnical_title(this.value, document.getElementById('userTechnical_title'));" name="identity" id="userIdentity" class="location"> <p>
<option value=""><%= l(:label_account_identity_choose) %></option> <span style="display:none">
<option value="0"><%= l(:label_account_identity_teacher) %></option> <select onchange="showtechnical_title(this.value, document.getElementById('userTechnical_title'));" name="identity" id="userIdentity" class="location">
<option value="1"><%= l(:label_account_identity_student) %></option> <option value=""><%= l(:label_account_identity_choose) %></option>
<option value="2"><%= l(:label_account_identity_enterprise) %></option> <option value="0"><%= l(:label_account_identity_teacher) %></option>
<option value="3"><%= l(:label_account_identity_developer) %></option> <option value="1"><%= l(:label_account_identity_student) %></option>
<option value="2"><%= l(:label_account_identity_enterprise) %></option>
</select> <option value="3"><%= l(:label_account_identity_developer) %></option>
</span> </select>
</p> </span>
</p>
<% end %> <% end %>
</div> </div>

View File

@ -74,7 +74,6 @@
<%= labelled_form_for @news, :url => course_news_index_path(@course), <%= labelled_form_for @news, :url => course_news_index_path(@course),
:html => {:id => 'news-form', :multipart => true} do |f| %> :html => {:id => 'news-form', :multipart => true} do |f| %>
<%= render :partial => 'news/course_form', :locals => {:f => f, :is_new => true} %> <%= render :partial => 'news/course_form', :locals => {:f => f, :is_new => true} %>
<%#= submit_tag l(:button_create), :class => 'whiteButton m3p10 h30', :name => nil %><!-- button-submit -->
<%= link_to l(:button_create), "#", :onclick => 'submitNews();', :onmouseover => 'submitFocus(this);', :class => 'whiteButton m3p10' %>| <%= link_to l(:button_create), "#", :onclick => 'submitNews();', :onmouseover => 'submitFocus(this);', :class => 'whiteButton m3p10' %>|
<%= preview_link preview_news_path(:course_id => @course), 'news-form', target='preview', {:class => 'whiteButton m3p10'} %> <%= preview_link preview_news_path(:course_id => @course), 'news-form', target='preview', {:class => 'whiteButton m3p10'} %>
| |
@ -90,26 +89,48 @@
</p> </p>
<% else %> <% else %>
<% @newss.each do |news| %> <% @newss.each do |news| %>
<table class="content-text-list"> <table class="content-text-list">
<tr> <tr>
<td colspan="2" valign="top" width="50"><%= link_to image_tag(url_to_avatar(news.author), :class => "avatar"), user_path(news.author) %></td> <td colspan="2" valign="top" width="50">
<%= link_to image_tag(url_to_avatar(news.author), :class => "avatar"), user_path(news.author) %>
</td>
<td> <td>
<table width="580px" border="0"> <table width="580px" border="0">
<tr> <tr>
<td colspan="2" valign="top"> <td colspan="2" valign="top">
<strong><%= link_to_user(news.author) if news.respond_to?(:author) %></strong><span style="margin-left: 4px;" class="font_lighter"><%= l(:label_project_notice) %></span><span><%= link_to h(news.title), news_path(news) %></span> <strong>
<span style="float: right"><%= delete_link news_path(news) if User.current.allowed_to?(:manage_news, @couese) %> </span> <%= link_to_user(news.author) if news.respond_to?(:author) %>
</strong>
<span style="margin-left: 4px;" class="font_lighter">
<%= l(:label_project_notice) %>
</span>
<span>
<%= link_to h(news.title), news_path(news) %>
</span>
<span style="float: right">
<%= delete_link news_path(news) if User.current.allowed_to?(:manage_news, @couese) %>
</span>
</td> </td>
</tr> </tr>
<tr> <tr>
<td colspan="2" width="580px"> <td colspan="2" width="580px">
<span class="font_description"><%= textilizable(news, :description) %></span></td> <span class="font_description">
<%= textilizable(news, :description) %>
</span>
</td>
</tr> </tr>
<tr> <tr>
<td align="left"><span class="font_lighter"> <%= l :label_update_time %> <td align="left">
&nbsp;<%= format_time(news.created_on) %></span></td> <span class="font_lighter">
<td width="350" align="right" class="a"><%= link_to l(:label_project_newother), news_path(news) %><%= "(#{l(:label_x_comments, :count => news.comments_count)})" if news.comments_count >= 0 %></td> <%= l :label_update_time %>
&nbsp;
<%= format_time(news.created_on) %>
</span>
</td>
<td width="350" align="right" class="a">
<%= link_to l(:label_project_newother), news_path(news) %>
<%= "(#{l(:label_x_comments, :count => news.comments_count)})" if news.comments_count >= 0 %>
</td>
</tr> </tr>
</table> </table>
</td> </td>

View File

@ -123,9 +123,10 @@
</tr> </tr>
<tr> <tr>
<td colspan="2" width="580px" > <td colspan="2" width="580px" >
<p class="font_description"> <span class="font_description">
<%= textilizable(comment.comments) %> <%= textilizable(comment.comments) %>
</p></td> </span>
</td>
</tr> </tr>
<tr> <tr>
<td align="left"><span class="font_lighter"> <%= format_time(comment.created_on) %></span></td> <td align="left"><span class="font_lighter"> <%= format_time(comment.created_on) %></span></td>

View File

@ -101,21 +101,29 @@
<table class="content-text-list"> <table class="content-text-list">
<tr> <tr>
<td colspan="2" valign="top" width="50"><%= link_to image_tag(url_to_avatar(news.author), :class => "avatar"), user_path(news.author) %></td> <td colspan="2" valign="top" width="50">
<%= link_to image_tag(url_to_avatar(news.author), :class => "avatar"), user_path(news.author) %>
</td>
<td> <td>
<table width="580px" border="0"> <table width="580px" border="0">
<% if @project.project_type == 1 %> <% if @project.project_type == 1 %>
<tr> <tr>
<td colspan="2" valign="top"> <td colspan="2" valign="top">
<strong><%= link_to_user(news.author) if news.respond_to?(:author) %></strong><span style="margin-left: 4px;" class="font_lighter"><%= l(:label_project_notice) %></span><span><%= link_to h(news.title), news_path(news) %></span> <strong><%= link_to_user(news.author) if news.respond_to?(:author) %></strong>
<span style="margin-left: 4px;" class="font_lighter"><%= l(:label_project_notice) %></span>
<span><%= link_to h(news.title), news_path(news) %></span>
<span style="float: right"><%= delete_link news_path(news) if User.current.allowed_to?(:manage_news, @project) %> </span> <span style="float: right"><%= delete_link news_path(news) if User.current.allowed_to?(:manage_news, @project) %> </span>
</td> </td>
</tr> </tr>
<% else %> <% else %>
<tr> <tr>
<td colspan="2" valign="top"> <td colspan="2" valign="top">
<strong><%= link_to_user(news.author) if news.respond_to?(:author) %></strong><span style="margin-left: 4px;" class="font_lighter"><%= l(:label_project_newshare) %></span><span> <%= link_to h(news.title), news_path(news) %></span> <strong><%= link_to_user(news.author) if news.respond_to?(:author) %></strong>
<span style="float: right" class='delete_icon'> <%= delete_link news_path(news) if User.current.allowed_to?(:manage_news, @project) %> </span> <span style="margin-left: 4px;" class="font_lighter"><%= l(:label_project_newshare) %></span>
<span> <%= link_to h(news.title), news_path(news) %></span>
<span style="float: right" class='delete_icon'>
<%= delete_link news_path(news) if User.current.allowed_to?(:manage_news, @project) %>
</span>
</td> </td>
</tr> </tr>
<% end %> <% end %>

View File

@ -80,7 +80,9 @@
<div id="comments" style="margin-bottom:16px;"> <div id="comments" style="margin-bottom:16px;">
<div style="margin:15px"> <div style="margin:15px">
<span class="font_description"> <%= textilizable(@news, :description) %> </span> <span class="font_description">
<%= textilizable(@news, :description) %>
</span>
<br/> <br/>
<%= link_to_attachments @news %> <%= link_to_attachments @news %>
<br/> <br/>
@ -115,22 +117,35 @@
<% next if comment.new_record? %> <% next if comment.new_record? %>
<table width="660px" border="0" align="center"> <table width="660px" border="0" align="center">
<tr> <tr>
<td colspan="2" valign="top" width="50" ><%= image_tag(url_to_avatar(comment.author), :class => "avatar")%></td> <td colspan="2" valign="top" width="50" >
<%= image_tag(url_to_avatar(comment.author), :class => "avatar")%>
</td>
<td> <td>
<table width="580px" border="0"> <table width="580px" border="0">
<tr> <tr>
<td colspan="2" valign="top"><strong><%= link_to_user(comment.author) if comment.respond_to?(:author) %> </strong><span class="font_lighter"><%= l(:label_project_newadd) %></span><%= l(:label_comment_plural) %></td> <td colspan="2" valign="top">
<strong><%= link_to_user(comment.author) if comment.respond_to?(:author) %> </strong>
<span class="font_lighter"><%= l(:label_project_newadd) %></span>
<%= l(:label_comment_plural) %>
</td>
</tr> </tr>
<tr> <tr>
<td colspan="2" width="580px" > <td colspan="2" width="580px" >
<p class="font_description"> <span class="font_description">
<%= textilizable(comment.comments) %> <%= textilizable(comment.comments) %>
</p></td> </span>
</td>
</tr> </tr>
<tr> <tr>
<td align="left"><span class="font_lighter"> <%= format_time(comment.created_on) %></span></td> <td align="left">
<td width="200" align="right" class="a"><%= link_to_if_authorized image_tag('delete.png'), {:controller => 'comments', :action => 'destroy', :id => @news, :comment_id => comment}, <span class="font_lighter"> <%= format_time(comment.created_on) %></span>
:data => {:confirm => l(:text_are_you_sure)}, :method => :delete, :title => l(:button_delete) %></td> </td>
<td width="200" align="right" class="a">
<%= link_to_if_authorized image_tag('delete.png'), {:controller => 'comments', :action => 'destroy', :id => @news, :comment_id => comment},
:data => {:confirm => l(:text_are_you_sure)},
:method => :delete,
:title => l(:button_delete) %>
</td>
</tr> </tr>
</table></td> </table></td>
</tr> </tr>

View File

@ -4,7 +4,7 @@
<hr /> <hr />
<% attachments_results.each do |file| %> <% attachments_results.each do |file| %>
<p class="font_description2"> <p class="font_description2">
<table border=0 cellSpacing=0 cellPadding=0> <table border=0 cellSpacing=0 cellPadding=0 style="width: 100%;table-layout: fixed;">
<tbody> <tbody>
<tr> <tr>
<td class="r1"> <td class="r1">

View File

@ -6,7 +6,7 @@
<strong><%= l(:label_tags_bid) %>:<%= link_to "#{bid.name}", <strong><%= l(:label_tags_bid) %>:<%= link_to "#{bid.name}",
:controller => "bids",:action => "show",:id => bid.id %></strong> :controller => "bids",:action => "show",:id => bid.id %></strong>
<br /> <br />
<strong><%= l(:label_tags_bid_description) %>:</strong><%= bid.description %> <strong><%= l(:label_tags_bid_description) %>:</strong><%= textilizable bid.description %>
<%= bid.updated_on %> <%= bid.updated_on %>
</p> </p>
<div class="line_under"></div> <div class="line_under"></div>

View File

@ -6,7 +6,7 @@
<strong><%= l(:label_tags_contest) %>:<%= link_to "#{contest.name}", <strong><%= l(:label_tags_contest) %>:<%= link_to "#{contest.name}",
:controller => "contests",:action => "show_contest",:id => contest.id %></strong> :controller => "contests",:action => "show_contest",:id => contest.id %></strong>
<br /> <br />
<strong><%= l(:label_tags_contest_description) %>:</strong><%= contest.description %> <strong><%= l(:label_tags_contest_description) %>:</strong><%= textilizable contest.description %>
<%= contest.updated_on %> <%= contest.updated_on %>
</p> </p>
<div class="line_under"></div> <div class="line_under"></div>

View File

@ -5,7 +5,7 @@
<p class="font_description2"> <p class="font_description2">
<strong><%= l(:label_course) %>:<%= link_to "#{course.name}",course_path(course) %></strong> <strong><%= l(:label_course) %>:<%= link_to "#{course.name}",course_path(course) %></strong>
<br /> <br />
<strong><%= l(:label_new_course_description) %>:</strong><%= course.description %> <strong><%= l(:label_new_course_description) %>:</strong><%= textilizable course.description %>
<%= course.updated_at %> <%= course.updated_at %>
</p> </p>
<div class="line_under"></div> <div class="line_under"></div>

View File

@ -5,7 +5,7 @@
<p class="font_description2"> <p class="font_description2">
<strong><%= l(:label_tags_issue) %><%= link_to "#{issue.subject}",:controller => "issues",:action => "show",:id => issue.id %></strong> <strong><%= l(:label_tags_issue) %><%= link_to "#{issue.subject}",:controller => "issues",:action => "show",:id => issue.id %></strong>
<br /> <br />
<strong><%= l(:label_tags_issue_description) %></strong><%= issue.description %> <strong><%= l(:label_tags_issue_description) %></strong><%= textilizable issue.description %>
</p> </p>
<div class="line_under"></div> <div class="line_under"></div>
<% end %> <% end %>

View File

@ -6,7 +6,7 @@
<p class="font_description2"> <p class="font_description2">
<strong><%= l(:label_tags_project_name) %><%= link_to "#{prj.name}",:controller => "open_source_projects",:action => "show",:id => prj.id %></strong> <strong><%= l(:label_tags_project_name) %><%= link_to "#{prj.name}",:controller => "open_source_projects",:action => "show",:id => prj.id %></strong>
<br /> <br />
<strong><%= l(:label_tags_project_description) %></strong><%= prj.short_description %> <strong><%= l(:label_tags_project_description) %></strong><%= textilizable prj.short_description %>
</p> </p>
</div> </div>
<div class="line_under"></div> <div class="line_under"></div>

View File

@ -6,7 +6,7 @@
<p class="font_description2"> <p class="font_description2">
<strong><%= l(:label_tags_project_name) %><%= link_to "#{prj.name}",:controller => "projects",:action => "show",:id => prj.id %></strong> <strong><%= l(:label_tags_project_name) %><%= link_to "#{prj.name}",:controller => "projects",:action => "show",:id => prj.id %></strong>
<br /> <br />
<strong><%= l(:label_tags_project_description) %></strong><%= prj.description %> <strong><%= l(:label_tags_project_description) %></strong><%= textilizable prj.description %>
</p> </p>
</div> </div>
<div class="line_under"></div> <div class="line_under"></div>

View File

@ -39,19 +39,20 @@
</div> </div>
<div class="course welcome_left" id="welcome_left"> <div class="course welcome_left" id="welcome_left">
<span class="font_welcome_school"> <% if @school_id.nil? and (User.current.user_extensions.nil? || User.current.user_extensions.school.nil?) %> <span class="font_welcome_school">
<% if @school_id.nil? and (User.current.user_extensions.nil? || User.current.user_extensions.school.nil?) %>
<% else %> <% else %>
<% if @school_id == "0" %> <% if @school_id == "0" %>
<% else %> <% else %>
<% if @school_id.nil? %> <% if @school_id.nil? %>
<%= link_to School.find(User.current.user_extensions.school.id).name, options={:action => 'course', :school_id => User.current.user_extensions.school.id}, html_options={:class => 'font_welcome_school', :method => 'get'} %> <%= link_to School.find(User.current.user_extensions.school.id).name, options={:action => 'course', :school_id => User.current.user_extensions.school.id}, html_options={:class => 'font_welcome_school', :method => 'get'} %>
<br/> <br/>
<% else %> <% else %>
<%= link_to School.find(@school_id).name, options={:action => 'course', :school_id => @school_id}, html_options={:class => 'font_welcome_school', :method => 'get'} %> <%= link_to School.find(@school_id).name, options={:action => 'course', :school_id => @school_id}, html_options={:class => 'font_welcome_school', :method => 'get'} %>
<br/> <br/>
<% end %>
<% end %> <% end %>
<% end %> <% end %>
<% end %>
</span> </span>
<% unless @course_page.nil? %> <% unless @course_page.nil? %>
<span class="font_welcome_trustie"><%= @course_page.title %> </span> <span class="font_welcome_trustie"><%= @course_page.title %> </span>

View File

@ -75,9 +75,7 @@
</span> </span>
<div class="d-p-projectlist-box"> <div class="d-p-projectlist-box">
<ul class="d-p-projectlist"> <ul class="d-p-projectlist">
<% #projects = find_miracle_project(10, 3) %>
<% @projects.map do |project| %> <% @projects.map do |project| %>
<!--<%# cache cache_key_for_project(project) do %> -->
<li style="overflow:auto;word-break:break-all;height:100%;word-wrap: break-word;" class='<%= cycle("odd", "even") %>'> <li style="overflow:auto;word-break:break-all;height:100%;word-wrap: break-word;" class='<%= cycle("odd", "even") %>'>
<div style="float: left;"> <div style="float: left;">
<%= image_tag(get_project_avatar(project), :class => "avatar-4") %> <%= image_tag(get_project_avatar(project), :class => "avatar-4") %>
@ -122,7 +120,7 @@
<%= image_tag url_to_avatar(event.event_author), :class => "avatar-3" %> <%= image_tag url_to_avatar(event.event_author), :class => "avatar-3" %>
</div> </div>
<div class="inner-right" style="float: right; width:86%; height: 100%; "> <div class="inner-right" style="float: right; width:86%; height: 100%; overflow: hidden;text-overflow: ellipsis;white-space: nowrap;" >
<span style="color: green;"> <span style="color: green;">
<%= link_to event.event_author, (user_path(event.event_author) if event.event_author), <%= link_to event.event_author, (user_path(event.event_author) if event.event_author),
:style => "color:green;", :target => "_blank" %> :style => "color:green;", :target => "_blank" %>

View File

@ -1634,7 +1634,7 @@ zh:
label_issue_cancel_query: 取消查询 label_issue_cancel_query: 取消查询
field_reward_type: 奖励类型 field_reward_type: 奖励类型
label_tags_no: 暂无标签! label_tags_no: 暂无标签!
label_course_description_no: 你还未对该课程添加描述! label_course_description_no: 该课程添加描述!
label_bid_publish: 发布了 label_bid_publish: 发布了
label_bid_project: 项目 label_bid_project: 项目
label_project_no_follow: 该项目暂未被关注! label_project_no_follow: 该项目暂未被关注!
@ -2145,3 +2145,6 @@ zh:
lable_sure_exit_project: 是否确认退出该项目 lable_sure_exit_project: 是否确认退出该项目
lable_input_class: 在此输入课时 lable_input_class: 在此输入课时
lable_input_class_vilidate: 学时只能为整数 lable_input_class_vilidate: 学时只能为整数
lable_school_list: 学校列表
lable_teacher_evaluation_no: 老师还未进行评价
lable_teacher_evaluation: 作业综评

View File

@ -79,9 +79,11 @@ module Redmine
if res.is_public if res.is_public
if( (self.class.to_s=="Project" && self.is_public == false) || if( (self.class.to_s=="Project" && self.is_public == false) ||
(self.has_attribute?(:project) && self.project && self.project.is_public == false) || (self.has_attribute?(:project) && self.project && self.project.is_public == false) ||
(self.has_attribute?(:board) && self.board.project && self.board.project.is_public == false) ||
(self.class.to_s=="HomeworkAttach" && self.bid.reward_type == 3) || (self.class.to_s=="HomeworkAttach" && self.bid.reward_type == 3) ||
(self.class.to_s=="Course" && self.is_public == false) || (self.class.to_s=="Course" && self.is_public == false) ||
(self.has_attribute?(:course) && self.course && self.course.is_public == false) (self.has_attribute?(:course) && self.course && self.course.is_public == false) ||
(self.has_attribute?(:board) && self.board.course && self.board.course.is_public == false)
) )
res.is_public = false res.is_public = false
end end
@ -120,19 +122,25 @@ module Redmine
end end
if attachments.is_a?(Array) if attachments.is_a?(Array)
attachments.each do |attachment| attachments.each do |attachment|
next unless attachment.is_a?(Hash) if attachment.is_a?(Hash)
a = nil a = nil
if file = attachment['file'] file = attachment['file']
next unless file.size > 0 token = attachment['token']
a = Attachment.create(:file => file, :author => author) t = file && file.size > 0
elsif token = attachment['token'] if file && file.size > 0
a = Attachment.find_by_token(token) a = Attachment.create(:file => file, :author => author)
next unless a elsif token
a.filename = attachment['filename'] unless attachment['filename'].blank? a = Attachment.find_by_token_only(token)
a.content_type = attachment['content_type'] if a
a.filename = attachment['filename'] unless attachment['filename'].blank?
a.content_type = attachment['content_type']
end
end
end end
if !attachment[:is_public] if a && !attachment['is_public_checkbox']
a.is_public = false a.is_public = false
elsif a && attachment['is_public_checkbox']
a.is_public = true
end end
set_attachment_public(a) set_attachment_public(a)
next unless a next unless a

View File

@ -384,20 +384,20 @@ Redmine::MenuManager.map :project_menu do |menu|
# menu.push :activity, { :controller => 'activities', :action => 'index' } # menu.push :activity, { :controller => 'activities', :action => 'index' }
#menu.push :roadmap, { :controller => 'versions', :action => 'index' }, :param => :project_id #menu.push :roadmap, { :controller => 'versions', :action => 'index' }, :param => :project_id
# :if => Proc.new { |p| p.shared_versions.any? } # :if => Proc.new { |p| p.shared_versions.any? }
menu.push :issues, { :controller => 'issues', :action => 'index' }, :param => :project_id, :caption => :label_issue_plural menu.push :issues, { :controller => 'issues', :action => 'index' },:if => Proc.new {|p| p.enabled_module_names.include?('issue_tracking') } ,:param => :project_id, :caption => :label_issue_plural
# menu.push :new_issue, { :controller => 'issues', :action => 'new', :copy_from => nil }, :param => :project_id, :caption => :label_issue_new, # menu.push :new_issue, { :controller => 'issues', :action => 'new', :copy_from => nil }, :param => :project_id, :caption => :label_issue_new,
# :html => { :accesskey => Redmine::AccessKeys.key_for(:new_issue) } # :html => { :accesskey => Redmine::AccessKeys.key_for(:new_issue) }
# menu.push :gantt, { :controller => 'gantts', :action => 'show' }, :param => :project_id, :caption => :label_gantt # menu.push :gantt, { :controller => 'gantts', :action => 'show' }, :param => :project_id, :caption => :label_gantt
# menu.push :calendar, { :controller => 'calendars', :action => 'show' }, :param => :project_id, :caption => :label_calendar # menu.push :calendar, { :controller => 'calendars', :action => 'show' }, :param => :project_id, :caption => :label_calendar
menu.push :news, { :controller => 'news', :action => 'index' }, :param => :project_id, :caption => :label_news_plural menu.push :news, { :controller => 'news', :action => 'index' }, :if => Proc.new {|p| p.enabled_module_names.include?('news') },:param => :project_id, :caption => :label_news_plural
# menu.push :documents, { :controller => 'documents', :action => 'index' }, :param => :project_id, :caption => :label_document_plural # menu.push :documents, { :controller => 'documents', :action => 'index' }, :param => :project_id, :caption => :label_document_plural
# menu.push :wiki, { :controller => 'wiki', :action => 'show', :id => nil }, :param => :project_id, # menu.push :wiki, { :controller => 'wiki', :action => 'show', :id => nil }, :param => :project_id,
# :if => Proc.new { |p| p.wiki && !p.wiki.new_record? } # :if => Proc.new { |p| p.wiki && !p.wiki.new_record? }
menu.push :boards, { :controller => 'boards', :action => 'index', :id => nil }, :param => :project_id, menu.push :boards, { :controller => 'boards', :action => 'index', :id => nil }, :param => :project_id,
:if => Proc.new { |p| p.boards.any? }, :caption => :label_board_plural :if => Proc.new { |p| p.boards.any? && p.enabled_module_names.include?('boards') }, :caption => :label_board_plural
#menu.push :files, { :controller => 'files', :action => 'index' }, :param => :project_id, :caption => :label_file_new #menu.push :files, { :controller => 'files', :action => 'index' }, :param => :project_id, :caption => :label_file_new
menu.push :repository, { :controller => 'repositories', :action => 'show', :repository_id => nil, :path => nil, :rev => nil }, menu.push :repository, { :controller => 'repositories', :action => 'show', :repository_id => nil, :path => nil, :rev => nil },
:if => Proc.new { |p| p.repository && !p.repository.new_record? && !( !User.current.member_of?(p) && p.hidden_repo ) } :if => Proc.new { |p| p.repository && !p.repository.new_record? && !( !User.current.member_of?(p) && p.hidden_repo ) && p.enabled_module_names.include?('repository') }
menu.push :settings, { :controller => 'projects', :action => 'settings' }, :last => true menu.push :settings, { :controller => 'projects', :action => 'settings' }, :last => true
end end
@ -415,7 +415,7 @@ Redmine::MenuManager.map :course_menu do |menu|
end end
Redmine::MenuManager.map :user_menu do |menu| Redmine::MenuManager.map :user_menu do |menu|
menu.push :activity, {:controller => 'users', :action => 'show', :host => Setting.user_domain } menu.push :activity, {:controller => 'users', :action => 'show', :host => Setting.user_domain }
menu.push :user_course, {:controller => 'users', :action => 'user_courses'} menu.push :user_course, {:controller => 'users', :action => 'user_courses'},:if => Proc.new {|c| FirstPage.where("page_type = 'project'").first.show_course != 2}
#menu.push :user_homework, {:controller => 'users', :action => 'user_homeworks'} by huang #menu.push :user_homework, {:controller => 'users', :action => 'user_homeworks'} by huang
menu.push :user_project, {:controller => 'users', :action => 'user_projects', :host => Setting.project_domain} menu.push :user_project, {:controller => 'users', :action => 'user_projects', :host => Setting.project_domain}
# menu.push :requirement_focus, {:controller => 'users', :action => 'watch_bids'} by huang # menu.push :requirement_focus, {:controller => 'users', :action => 'watch_bids'} by huang

View File

@ -109,12 +109,17 @@ module Redmine
end end
if cur_objs if cur_objs
cur_objs.each do |cur_obj| cur_objs.each do |cur_obj|
if cur_obj.class == Issue #if cur_obj.class.to_s == 'Issue'
if cur_obj.project != nil && cur_obj.project.project_status != nil # if cur_obj.project != nil && cur_obj.project.project_status != nil && cur_obj.project.is_public == 1
e += [cur_obj] # e += [cur_obj]
end # end
else #else
# e += [cur_obj]
#end
if cur_obj.project != nil && cur_obj.project.project_status != nil && cur_obj.project.is_public == true
e += [cur_obj] e += [cur_obj]
#else
# e += [cur_obj]
end end
end end
end end

View File

@ -73,7 +73,7 @@ Redmine::Plugin.register :redmine_code_review do
menu :project_menu, :code_review, { :controller => 'code_review', :action => 'index' }, :caption => :code_reviews, menu :project_menu, :code_review, { :controller => 'code_review', :action => 'index' }, :caption => :code_reviews,
:if => Proc.new{|project| :if => Proc.new{|project|
setting = CodeReviewProjectSetting.find_or_create(project) setting = CodeReviewProjectSetting.find_or_create(project)
project.repository != nil and setting and !setting.hide_code_review_tab project.repository != nil and setting and !setting.hide_code_review_tab and project.enabled_module_names.include?('code_review')
}, :after => :repository }, :after => :repository

View File

@ -750,8 +750,14 @@ ul.user_course_sort li{list-style-type:none;
.font_description{ .font_description{
font-size:14px; font-size:14px;
line-height: 1.5em; line-height: 1.5em;
word-break:break-all;
word-wrap: break-word;
} }
.font_description img{
max-width: 90%;
max-height: 90%; /* 设置最大宽度和高度 */
}
.font_description2{ .font_description2{
font-size:13px; font-size:13px;
line-height: 1.5em; line-height: 1.5em;
@ -1383,7 +1389,7 @@ a.toggle-all:hover {text-decoration:none;}
table.list tbody tr:hover { background-color:#ffffdd; } table.list tbody tr:hover { background-color:#ffffdd; }
table.list tbody tr.group:hover { background-color:inherit; } table.list tbody tr.group:hover { background-color:inherit; }
table td {padding:2px;} table td {padding:2px;word-break: break-all;word-wrap: break-word;}
table p {margin:0;} table p {margin:0;}
.odd {background-color:#f6f7f8;} .odd {background-color:#f6f7f8;}
.even {background-color: #fff;} .even {background-color: #fff;}
@ -2813,4 +2819,4 @@ div.repos_explain{
cursor: pointer; cursor: pointer;
} }
.tableth{background-color:#EEEEEE; padding: 4px; white-space:pre;} .list .tableth{background-color:#EEEEEE; padding: 4px; white-space:pre;}