This commit is contained in:
huang 2015-01-10 15:42:33 +08:00
commit 293b3a3b42
43 changed files with 323 additions and 90 deletions

1
0)
View File

@ -1 +0,0 @@
终止批处理操作吗(Y/N)? 终止批处理操作吗(Y/N)? 终止批处理操作吗(Y/N)? 终止批处理操作吗(Y/N)?

View File

@ -500,7 +500,8 @@ class CoursesController < ApplicationController
end end
end end
def course def
course
@school_id = params[:school_id] @school_id = params[:school_id]
per_page_option = 10 per_page_option = 10
if @school_id == "0" or @school_id.nil? if @school_id == "0" or @school_id.nil?

View File

@ -0,0 +1,2 @@
class PollAnswerController < ApplicationController
end

View File

@ -0,0 +1,2 @@
class PollController < ApplicationController
end

View File

@ -0,0 +1,2 @@
class PollQuestionController < ApplicationController
end

View File

@ -0,0 +1,2 @@
class PollUserController < ApplicationController
end

View File

@ -0,0 +1,2 @@
class PollVoteController < ApplicationController
end

View File

@ -129,7 +129,7 @@ class UsersController < ApplicationController
end end
def show_new_score def show_new_score
render :layout => false render :layout => 'users_base'
end end
# end # end
@ -188,9 +188,9 @@ class UsersController < ApplicationController
for user in @watcher for user in @watcher
events << Redmine::Activity::Fetcher.new(User.current, :author => @user).events(nil, nil, :limit => 30) events << Redmine::Activity::Fetcher.new(User.current, :author => @user).events(nil, nil, :limit => 30)
end end
@events_by_day = events.group_by(&:event_date) @events_by_day = events.group_by(&:event_date)
unless User.current.admin? unless User.current.admin?

View File

@ -75,16 +75,21 @@ class ZipdownController < ApplicationController
def zip_homework_by_user(homeattach) def zip_homework_by_user(homeattach)
homeworks_attach_path = [] homeworks_attach_path = []
not_exist_file = []
# 需要将所有homework.attachments遍历加入zip # 需要将所有homework.attachments遍历加入zip
# 并且返回zip路径 # 并且返回zip路径
homeattach.attachments.each do |attach| homeattach.attachments.each do |attach|
homeworks_attach_path << attach.diskfile#.to_s.slice((length+1)..-1) if File.exist?(attach.diskfile)
homeworks_attach_path << attach.diskfile
else
not_exist_file << attach.filename
end
end end
zipping("#{homeattach.user.lastname}#{homeattach.user.firstname}_#{((homeattach.user.user_extensions.nil? || homeattach.user.user_extensions.student_id.nil?) ? "" : homeattach.user.user_extensions.student_id)}_#{Time.now.to_i.to_s}.zip", homeworks_attach_path, OUTPUT_FOLDER, true) zipping("#{homeattach.user.lastname}#{homeattach.user.firstname}_#{((homeattach.user.user_extensions.nil? || homeattach.user.user_extensions.student_id.nil?) ? "" : homeattach.user.user_extensions.student_id)}_#{Time.now.to_i.to_s}.zip", homeworks_attach_path, OUTPUT_FOLDER, true, not_exist_file)
end end
def zipping(zip_name_refer, files_paths, output_path, is_attachment=false) def zipping(zip_name_refer, files_paths, output_path, is_attachment=false, not_exist_file=[])
# 输入待打包的文件列表已经打包文件定位到ouput_path # 输入待打包的文件列表已经打包文件定位到ouput_path
ic = Iconv.new('GBK//IGNORE', 'UTF-8//IGNORE') ic = Iconv.new('GBK//IGNORE', 'UTF-8//IGNORE')
input_filename = files_paths input_filename = files_paths
@ -101,9 +106,11 @@ class ZipdownController < ApplicationController
zipfile.add(rename_file, filename) zipfile.add(rename_file, filename)
end end
#zipfile.get_output_stream('ReadMe') do |os| unless not_exist_file.empty?
# os.write 'Homeworks' zipfile.get_output_stream('FILE_LOST.txt') do |os|
#end os.write l(:label_file_lost) + not_exist_file.join(',').to_s
end
end
end end
zipfile_name zipfile_name
rescue Errno => e rescue Errno => e
@ -119,4 +126,4 @@ class ZipdownController < ApplicationController
attach = Attachment.find_by_disk_filename(name) attach = Attachment.find_by_disk_filename(name)
attach.filename attach.filename
end end
end end

View File

@ -20,7 +20,7 @@ module CoursesHelper
# 返回教师数量即roles表中定义的Manager # 返回教师数量即roles表中定义的Manager
def teacherCount project def teacherCount project
searchTeacherAndAssistant(project).count project.members.count - studentCount(project).to_i
# or # or
# searchTeacherAndAssistant(project).count # searchTeacherAndAssistant(project).count
end end
@ -114,7 +114,7 @@ module CoursesHelper
# 学生人数计算 # 学生人数计算
# add by nwb # add by nwb
def studentCount course def studentCount course
searchStudent(course).count.to_s#course.student.count course.student.count.to_s#course.student.count
end end
#课程成员数计算 #课程成员数计算

View File

@ -38,7 +38,7 @@ class Course < ActiveRecord::Base
validates_presence_of :password, :term,:name validates_presence_of :password, :term,:name
validates_format_of :class_period, :with =>/^[1-9]\d*$/ validates_format_of :class_period, :with =>/^[1-9]\d*$/
validates_format_of :name,:with =>/^[a-zA-Z0-9_\u4e00-\u9fa5]+$/ validates_format_of :name,:with =>/^[^ ]+[a-zA-Z0-9_\u4e00-\u9fa5\s\S]+$/
validates_length_of :description, :maximum => 10000 validates_length_of :description, :maximum => 10000
before_save :self_validate before_save :self_validate
after_create :create_board_sync after_create :create_board_sync

9
app/models/poll.rb Normal file
View File

@ -0,0 +1,9 @@
class Poll < ActiveRecord::Base
#attr_accessible :closed_at, :polls_group_id, :polls_name, :polls_status, :polls_type, :published_at, :user_id
include Redmine::SafeAttributes
belongs_to :user
has_many :poll_questions, :dependent => :destroy
has_many :poll_users, :dependent => :destroy
has_many :users, :through => :poll_users #该文件被哪些用户提交答案过
end

View File

@ -0,0 +1,7 @@
class PollAnswer < ActiveRecord::Base
# attr_accessible :answer_position, :answer_text, :poll_questions_id
include Redmine::SafeAttributes
belongs_to :poll_question
has_many :poll_votes, :dependent => :destroy
end

View File

@ -0,0 +1,8 @@
class PollQuestion < ActiveRecord::Base
# attr_accessible :is_necessary, :polls_id, :question_title, :question_type
include Redmine::SafeAttributes
belongs_to :poll
has_many :poll_answers, :dependent => :destroy
has_many :poll_votes, :dependent => :destroy
end

7
app/models/poll_user.rb Normal file
View File

@ -0,0 +1,7 @@
class PollUser < ActiveRecord::Base
# attr_accessible :poll_id, :user_id
include Redmine::SafeAttributes
belongs_to :poll
belongs_to :user
end

8
app/models/poll_vote.rb Normal file
View File

@ -0,0 +1,8 @@
class PollVote < ActiveRecord::Base
# attr_accessible :poll_answers_id, :poll_questions_id, :user_id, :vote_text
include Redmine::SafeAttributes
belongs_to :poll_answer
belongs_to :poll_question
belongs_to :user
end

View File

@ -77,6 +77,13 @@ class User < Principal
has_many :homework_attaches, :through => :homework_users has_many :homework_attaches, :through => :homework_users
has_many :homework_evaluations has_many :homework_evaluations
#问卷相关关关系
has_many :poll_users, :dependent => :destroy
has_many :poll_votes, :dependent => :destroy
has_many :poll, :dependent => :destroy #用户创建的问卷
has_many :answers, :source => :poll, :through => :poll_users, :dependent => :destroy #用户已经完成问答的问卷
# end
has_and_belongs_to_many :groups, :after_add => Proc.new {|user, group| group.user_added(user)}, has_and_belongs_to_many :groups, :after_add => Proc.new {|user, group| group.user_added(user)},
:after_remove => Proc.new {|user, group| group.user_removed(user)} :after_remove => Proc.new {|user, group| group.user_removed(user)}
has_many :changesets, :dependent => :nullify has_many :changesets, :dependent => :nullify

View File

@ -10,7 +10,7 @@
<td class="location-list"> <td class="location-list">
<strong><%= l(:label_user_location) %> :</strong> <strong><%= l(:label_user_location) %> :</strong>
</td> </td>
<td rowspan="2"> <td rowspan="2" valign="bottom">
<% if User.current.logged? %> <% if User.current.logged? %>
<% unless User.current.user_extensions.identity == 1 %> <% unless User.current.user_extensions.identity == 1 %>
<%= link_to(l(:label_newtype_contest), new_contest_contests_path, :class => 'icon icon-add', :target => "_blank") %> <%= link_to(l(:label_newtype_contest), new_contest_contests_path, :class => 'icon icon-add', :target => "_blank") %>

View File

@ -1,21 +1,21 @@
<script type="text/javascript"> <script type="text/javascript">
jQuery(document).ready(function () { function check_groupname() {
var $group_name = $('#group_name') var $group_name = $('#group_name');
$group_name.blur(function (event) {
if ($(this).is('#group_name')) {
$.get( $.get(
'<%=valid_ajax_course_path%>', '<%=valid_ajax_course_path%>',
{ valid: "name", { valid: "name",
value: this.value }, value: document.getElementById('group_name').value },
function (data) { function (data) {
if (!data.valid) { if (!data.valid) {
alert('<%= l(:label_groupname_repeat) %>'); alert(data.message);
} }
}); });
}
}
});
});
</script> </script>
<script type=" text/javascript" charset="utf-8"> <script type=" text/javascript" charset="utf-8">
function validate_groupname(value1) { function validate_groupname(value1) {
@ -48,9 +48,9 @@
} }
function validate_add_group() { function validate_add_group() {
value1 = document.getElementById('group_name').value;
validate_groupname(value1); check_groupname();
validate_groupname_null(value1);
} }
</script> </script>

View File

@ -13,7 +13,7 @@
<td class="location-list"> <td class="location-list">
<strong><%= l(:label_user_location) %> :</strong> <strong><%= l(:label_user_location) %> :</strong>
</td> </td>
<td rowspan="2"> <td rowspan="2" valign="bottom">
<% if User.current.logged?%> <% if User.current.logged?%>
<% if User.current.user_extensions.identity == 0 %> <% if User.current.user_extensions.identity == 0 %>
<%= link_to(l(:label_course_new), {:controller => 'courses', :action => 'new'}, :class => 'icon icon-add') if User.current.allowed_to?(:add_course, nil, :global => true) %></td> <%= link_to(l(:label_course_new), {:controller => 'courses', :action => 'new'}, :class => 'icon icon-add') if User.current.allowed_to?(:add_course, nil, :global => true) %></td>

View File

@ -78,8 +78,8 @@
</span> </span>
&nbsp;&nbsp;作品描述&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;作品描述&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</label> </label>
<%= f.text_area "description", :class => "w620", :maxlength => 3000, :placeholder => "最多3000个汉字", :onkeyup => "regexDescription();"%> <%= f.text_area "description", :class => "w620", :style=>"width:432px;", :maxlength => 3000, :placeholder => "最多3000个汉字", :onkeyup => "regexDescription();"%>
<span id="homework_attach_description_span" style="padding-left: 100px;"></span> <br/> <span id="homework_attach_description_span" style="padding-left: 100px;"></span>
</p> </p>
<div class="cl"></div> <div class="cl"></div>
<p> <p>

View File

@ -41,11 +41,14 @@
</td> </td>
<td rowspan="2" width="250px"> <td rowspan="2" width="250px">
<div class="project-search"> <div class="project-search">
<%= form_tag(:controller => 'bids', :action => 'contest', :method => :get) do %> <%= form_tag({:controller => 'bids', :action => 'contest'}, :id => "contest_search_form",:method => :get) do %>
<%= text_field_tag 'name', params[:name], :size => 20 %> <%= text_field_tag 'name', params[:name], :size => 20 %>
<%= hidden_field_tag 'reward_type', @bid.reward_type %> <%= hidden_field_tag 'reward_type', @bid.reward_type %>
<%= hidden_field_tag 'project_type', params[:project_type] %> <%= hidden_field_tag 'project_type', params[:project_type] %>
<%= submit_tag l(:label_search), :class => "enterprise", :name => nil %> <a href="#" onclick="$('#contest_search_form').submit();" class="ButtonColor m3p10" style="float:left;padding-top: 3px; margin: 0px;padding-bottom:0px;" >
<%= l(:label_search)%>
</a>
<%#= submit_tag l(:label_search), :class => "enterprise", :name => nil %>
<% end %> <% end %>
</div> </div>
</td> </td>

View File

@ -2,6 +2,8 @@
@nav_dispaly_forum_label = 1 @nav_dispaly_forum_label = 1
@nav_dispaly_course_label = nil @nav_dispaly_course_label = nil
@nav_dispaly_store_all_label = 1 %> @nav_dispaly_store_all_label = 1 %>
<% teacher_num = teacherCount(@course) %>
<% student_num = studentCount(@course) %>
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en"> <html lang="en">
<head> <head>
@ -46,9 +48,13 @@
</td> </td>
<td rowspan="2" width="250px"> <td rowspan="2" width="250px">
<div class="top-content-search"> <div class="top-content-search">
<%= form_tag(:controller => 'courses', :action => 'search', :method => :get) do %>
<%= text_field_tag 'name', params[:name], :size => 20 %> <%= form_tag({:controller => 'courses', :action => 'search'},:id => "course_search_form", :method => :get) do %>
<%= submit_tag l(:label_search), :class => "enterprise", :name => nil %> <%= text_field_tag 'name', params[:name], :size => 20, :style => "float:left" %>
<a href="#" onclick="$('#course_search_form').submit();" class="ButtonColor m3p10" style="float:left;padding-top: 3px; margin: 0px;padding-bottom:0px;" >
<%= l(:label_search)%>
</a>
<%#= submit_tag l(:label_search), :class => "ButtonColor m3p10", :name => nil, :style => "float:left;padding-top: 3px; margin: 0px;padding-bottom:0px;" %>
<% end %> <% end %>
</div> </div>
</td> </td>
@ -120,19 +126,19 @@
<td class="font_index"> <td class="font_index">
<!-- 1 教师; 2 学生0 全部--> <!-- 1 教师; 2 学生0 全部-->
<% if User.current.member_of_course?(@course) %> <% if User.current.member_of_course?(@course) %>
<%= link_to "#{teacherCount(@course)}", course_member_path(@course, :role => 1), :course => '1' %> <%= link_to "#{teacher_num}", course_member_path(@course, :role => 1), :course => '1' %>
<% else %> <% else %>
<span> <span>
<%= teacherCount(@course)%> <%= teacher_num %>
</span> </span>
<% end%> <% end%>
</td> </td>
<td class="font_index"> <td class="font_index">
<% if (User.current.logged? && @course.open_student == 1) || (User.current.member_of_course?(@course)) %> <% if (User.current.logged? && @course.open_student == 1) || (User.current.member_of_course?(@course)) %>
<%= link_to "#{studentCount(@course)}", course_member_path(@course, :role => 2), :course => '1' %> <%= link_to "#{student_num}", course_member_path(@course, :role => 2), :course => '1' %>
<% else %> <% else %>
<span> <span>
<%= studentCount(@course)%> <%= student_num %>
</span> </span>
<% end %> <% end %>
</td> </td>
@ -141,10 +147,10 @@
</td> </td>
<tr class="font_aram"> <tr class="font_aram">
<td align="center" width="80px" id="teacherCount"> <td align="center" width="80px" id="teacherCount">
<%= l(:label_x_base_courses_teacher, :count => teacherCount(@course)) %> <%= l(:label_x_base_courses_teacher, :count => teacher_num) %>
</td> </td>
<td align="center" width="80px" id="studentCount"> <td align="center" width="80px" id="studentCount">
<%= l(:label_x_base_courses_student, :count => studentCount(@course)) %> <%= l(:label_x_base_courses_student, :count => student_num) %>
</td> </td>
<td align="center" width="80px"> <td align="center" width="80px">
<%= l(:label_x_course_data, :count => files_count) %> <%= l(:label_x_course_data, :count => files_count) %>

View File

@ -61,14 +61,14 @@
if(regexName1()){$("#contst_search_form").submit();} if(regexName1()){$("#contst_search_form").submit();}
} }
</script> </script>
<div class="project-search"> <div class="project-search" style="float: left; margin: 0px">
<%= form_tag({controller: 'contests', action: 'index'}, method: :get, :id => "contst_search_form") do %> <%= form_tag({controller: 'contests', action: 'index'}, method: :get, :id => "contst_search_form") do %>
<%= text_field_tag 'name', params[:name], :size => 20, :onkeyup => 'regexName1();', :width => "125px" %> <%= text_field_tag 'name', params[:name], :size => 20, :onkeyup => 'regexName1();', :width => "125px", :style=>"float:left" %>
<%= hidden_field_tag 'project_type', params[:project_type] %> <%= hidden_field_tag 'project_type', params[:project_type] %>
<%#= submit_tag l(:label_search), :class => "enterprise", :name => nil %> <%#= submit_tag l(:label_search), :class => "enterprise", :name => nil %>
<a href="#" onclick="submitSerch();" class="ButtonColor m3p10" style="padding-top: 7px !important;"> <a href="#" onclick="submitSerch();" class="ButtonColor m3p10" style="float:left;padding-top: 3px; margin: 0px;padding-bottom:0px;" >
<%= l(:label_search)%> <%= l(:label_search)%>
</a> </a>
<br /> <br />
<span id="contest_name_span_head"></span> <span id="contest_name_span_head"></span>
<% end %> <% end %>
@ -78,8 +78,8 @@
<tr> <tr>
<td> <td>
<%=link_to l(:field_homepage), home_path %> > <%=link_to l(:field_homepage), home_path %> >
<a> <a href="http://<%= Setting.host_contest %>" class="link_other_item">
<%=link_to l(:label_contest_innovate), home_path %> <%=l(:label_contests_management_platform)%>
</a> > </a> >
<span title="<%= @contest.name%>"> <span title="<%= @contest.name%>">
<%= link_to h(truncate(@contest.name, length: 20, omission: '...')), show_contest_contest_path(@contest) %> <%= link_to h(truncate(@contest.name, length: 20, omission: '...')), show_contest_contest_path(@contest) %>

View File

@ -64,10 +64,10 @@
} }
</script> </script>
<%= form_tag(projects_search_path, :method => :get, :id => "project_search_form") do %> <%= form_tag(projects_search_path, :method => :get, :id => "project_search_form") do %>
<%= text_field_tag 'name', params[:name], :size => 20, :onkeyup => "regexName();" %> <%= text_field_tag 'name', params[:name], :size => 20, :onkeyup => "regexName();", :style => "float:left" %>
<%= hidden_field_tag 'project_type', params[:project_type] %> <%= hidden_field_tag 'project_type', params[:project_type] %>
<%#= submit_tag l(:label_search), :class => "enterprise", :name => nil %> <%#= submit_tag l(:label_search), :class => "enterprise", :name => nil %>
<a href="#" onclick="submitSerch();" class="ButtonColor m3p10" > <a href="#" onclick="submitSerch();" class="ButtonColor m3p10" style="float:left;padding-top: 3px; margin: 0px;padding-bottom:0px;" >
<%= l(:label_search)%> <%= l(:label_search)%>
</a> </a>
<br /> <br />

View File

@ -205,7 +205,7 @@
<td align="right"> <td align="right">
<%#= submit_tag l(:button_submit), :name => nil , <%#= submit_tag l(:button_submit), :name => nil ,
:class => "bid_btn" %> :class => "bid_btn" %>
<a href="#" onclick='$("#my_brief_introduction").parent().submit();' class="ButtonColor m3p10" > <a href="#" onclick='$("#my_brief_introduction").parent().submit();' class="ButtonColor m3p10" style="padding: 5px 10px;" >
<%= l(:label_submit)%> <%= l(:label_submit)%>
</a> </a>
</td> </td>
@ -221,16 +221,16 @@
<div class="inf_user_context"> <div class="inf_user_context">
<table style="font-family:'微软雅黑'" width="240"> <table style="font-family:'微软雅黑'" width="240">
<tr> <tr>
<td style="padding-left: 5px" width="70px"> <td style=" float: right" width="70px">
<%= l(:label_user_joinin) %> <span style="float: right"> <%= l(:label_user_joinin) %></span>
</td> </td>
<td class="font_lighter_sidebar" style="padding-left: 0px" width="170px"> <td class="font_lighter_sidebar" style="padding-left: 0px" width="170px">
<%= format_time(@user.created_on) %> <%= format_time(@user.created_on) %>
</td> </td>
</tr> </tr>
<tr> <tr>
<td style="padding-left: 5px"> <td style=" float: right" width="70px">
<%= l(:label_user_login) %> <span style="float: right"> <%= l(:label_user_login) %></span>
</td> </td>
<td class="font_lighter_sidebar" style="padding-left: 0px"> <td class="font_lighter_sidebar" style="padding-left: 0px">
<%= format_time(@user.last_login_on) %> <%= format_time(@user.last_login_on) %>
@ -239,8 +239,8 @@
<% unless @user.user_extensions.nil? %> <% unless @user.user_extensions.nil? %>
<% if @user.user_extensions.identity == 0 || @user.user_extensions.identity == 1 %> <% if @user.user_extensions.identity == 0 || @user.user_extensions.identity == 1 %>
<tr> <tr>
<td style="padding-left: 5px" width="70px"> <td style=" float: right" width="70px">
<%= l(:field_occupation) %> <span style="float: right"><%= l(:field_occupation) %></span>
</td> </td>
<td class="font_lighter_sidebar" style="padding-left: 0px" width="170px"> <td class="font_lighter_sidebar" style="padding-left: 0px" width="170px">
<% unless @user.user_extensions.school.nil? %> <% unless @user.user_extensions.school.nil? %>
@ -250,8 +250,8 @@
</tr> </tr>
<% elsif @user.user_extensions.identity == 3 %> <% elsif @user.user_extensions.identity == 3 %>
<tr> <tr>
<td style="padding-left: 5px" width="70px"> <td style=" float: right" width="70px">
<%= l(:field_occupation) %> <span style="float: right"> <%= l(:field_occupation) %></span>
</td> </td>
<td class="font_lighter_sidebar" style="padding-left: 0px" width="170px"> <td class="font_lighter_sidebar" style="padding-left: 0px" width="170px">
<%= @user.user_extensions.occupation %> <%= @user.user_extensions.occupation %>
@ -259,8 +259,8 @@
</tr> </tr>
<% elsif @user.user_extensions.identity == 2 %> <% elsif @user.user_extensions.identity == 2 %>
<tr> <tr>
<td style="padding-left: 18px" width="70px"> <td style=" float: right" width="70px">
<%= l(:label_company_name) %> <span style="float: right"> <%= l(:label_company_name) %></span>
</td> </td>
<td class="font_lighter_sidebar" style="padding-left: 0px" width="170px"> <td class="font_lighter_sidebar" style="padding-left: 0px" width="170px">
<%= @user.firstname %> <%= @user.firstname %>
@ -268,8 +268,8 @@
</tr> </tr>
<% end %> <% end %>
<tr> <tr>
<td style="padding-left: 31px" width="76px"> <td style=" float: right" width="70px">
<%= l(:label_location) %> <span style="float: right"> <%= l(:label_location) %></span>
</td> </td>
<td class="font_lighter_sidebar" style="padding-left: 0px" width="170px"> <td class="font_lighter_sidebar" style="padding-left: 0px" width="170px">
<%= @user.user_extensions.location %> <%= @user.user_extensions.location %>
@ -278,8 +278,8 @@
</tr> </tr>
<tr> <tr>
<% if @user.user_extensions.identity == 0 %> <% if @user.user_extensions.identity == 0 %>
<td style="padding-left: 31px" width="76px" > <td style=" float: right" width="70px" >
<%= l(:label_technical_title) %> <span style="float: right"> <%= l(:label_technical_title) %></span>
</td> </td>
<td class="font_lighter_sidebar" style="padding-left: 0px" width="170px"> <td class="font_lighter_sidebar" style="padding-left: 0px" width="170px">
<span id = "td_tech_title"></span> <span id = "td_tech_title"></span>
@ -289,8 +289,8 @@
<% if @user.user_extensions.identity == 1 %> <% if @user.user_extensions.identity == 1 %>
<% if(is_watching?(@user) ) %> <% if(is_watching?(@user) ) %>
<tr> <tr>
<td style="padding-left: 31px" width="70px" > <td style=" float: right" width="70px" >
<%= l(:label_bidding_user_studentcode)%> <span style="float: right"> <%= l(:label_bidding_user_studentcode)%></span>
</td> </td>
<td class="font_lighter_sidebar" style="padding-left: 0px" width="170px"> <td class="font_lighter_sidebar" style="padding-left: 0px" width="170px">
<%= @user.user_extensions.student_id %> <%= @user.user_extensions.student_id %>
@ -298,7 +298,7 @@
</tr> </tr>
<% else %> <% else %>
<tr> <tr>
<td style="padding-left: 31px" width="70px" > <td style=" float: right" width="70px" >
<%= l(:label_identity)%> <%= l(:label_identity)%>
</td> </td>
<td class="font_lighter_sidebar" style="padding-left: 0px" width="170px"> <td class="font_lighter_sidebar" style="padding-left: 0px" width="170px">
@ -309,7 +309,7 @@
<% end %> <% end %>
<% elsif @user.user_extensions.identity == 3 %> <% elsif @user.user_extensions.identity == 3 %>
<tr> <tr>
<td style="padding-left: 31px" width="70px" > <td style=" float: right" width="70px" >
<%= l(:label_identity)%> <%= l(:label_identity)%>
</td> </td>
<td class="font_lighter_sidebar" style="padding-left: 0px" width="170px"> <td class="font_lighter_sidebar" style="padding-left: 0px" width="170px">

View File

@ -1,7 +1,7 @@
<% @nav_dispaly_home_path_label = 1 <% @nav_dispaly_home_path_label = 1
@nav_dispaly_main_course_label = 1 @nav_dispaly_user_label = 1
@nav_dispaly_main_project_label = 1 @nav_dispaly_store_all_label = 1
@nav_dispaly_main_contest_label = 1 %> %>
<% @nav_dispaly_forum_label = 1%> <% @nav_dispaly_forum_label = 1%>
<!DOCTYPE html> <!DOCTYPE html>
<html lang="<%= current_language %>"> <html lang="<%= current_language %>">
@ -39,12 +39,12 @@
</div> </div>
</div> </div>
<div id="ajax-indicator" style="display:none;"><span><%= l(:label_loading) %></span></div> <div id="ajax-indicator" ><span><%= l(:label_loading) %></span></div>
<div id="ajax-modal" style="display:none;"></div> <div id="ajax-modal" style="display:none;"></div>
</div> </div>
</div> </div>
<!--<#%= call_hook :view_layouts_base_body_bottom %>--> <%= call_hook :view_layouts_base_body_bottom %>
</body> </body>
</html> </html>

View File

@ -10,7 +10,7 @@
<tr> <tr>
<td class="info_font" style="width: 220px; color: #15bccf"><%= l(:label_course_practice) %></td> <td class="info_font" style="width: 220px; color: #15bccf"><%= l(:label_course_practice) %></td>
<td class="location-list"><strong><%= l(:label_user_location) %> :</strong></td> <td class="location-list"><strong><%= l(:label_user_location) %> :</strong></td>
<td rowspan="2"> <td rowspan="2" valign="bottom">
<% if User.current.logged?%> <% if User.current.logged?%>
<% if User.current.user_extensions.identity == 0 %> <% if User.current.user_extensions.identity == 0 %>
<%= link_to(l(:label_course_new), {:controller => 'projects', :action => 'new', :course => 1, :project_type => @project_type}, :class => 'icon icon-add') if User.current.allowed_to?(:add_project, nil, :global => true) %></td> <%= link_to(l(:label_course_new), {:controller => 'projects', :action => 'new', :course => 1, :project_type => @project_type}, :class => 'icon icon-add') if User.current.allowed_to?(:add_project, nil, :global => true) %></td>
@ -35,7 +35,7 @@
<tr> <tr>
<td class="info_font" style="width: 220px; color: #15bccf"><%= l(:label_project_deposit) %></td> <td class="info_font" style="width: 220px; color: #15bccf"><%= l(:label_project_deposit) %></td>
<td class="location-list"><strong><%= l(:label_user_location) %> :</strong></td> <td class="location-list"><strong><%= l(:label_user_location) %> :</strong></td>
<td rowspan="2"> <td rowspan="2" valign="bottom">
<% if User.current.logged? %> <% if User.current.logged? %>
<%= link_to(l(:label_project_new), {:controller => 'projects', :action => 'new', :course => 0, :project_type => @project_type}, :class => 'icon icon-add') if User.current.allowed_to?(:add_project, nil, :global => true) %> <%= link_to(l(:label_project_new), {:controller => 'projects', :action => 'new', :course => 0, :project_type => @project_type}, :class => 'icon icon-add') if User.current.allowed_to?(:add_project, nil, :global => true) %>
<% end %> <% end %>

View File

@ -77,10 +77,10 @@
<%= f.text_field :object_id,:value=> obj.id,:style=>"display:none"%> <%= f.text_field :object_id,:value=> obj.id,:style=>"display:none"%>
<%= f.text_field :object_flag,:value=> object_flag,:style=>"display:none"%> <%= f.text_field :object_flag,:value=> object_flag,:style=>"display:none"%>
<!--<%#= f.submit l(:button_project_tags_add),:class => "ButtonColor m3p10" %>--> <!--<%#= f.submit l(:button_project_tags_add),:class => "ButtonColor m3p10" %>-->
<a href="#" onclick='$("#tags_name").parent().submit();' class="ButtonColor m3p10" > <a href="#" onclick='$("#tags_name").parent().submit();' class="ButtonColor m3p10" style="padding: 3px 6px">
<%= l(:button_project_tags_add)%> <%= l(:button_project_tags_add)%>
</a> </a>
<%= link_to_function l(:button_cancel), '$("#put-tag-form").slideUp();',:class=>'ButtonColor m3p10'%> <%= link_to_function l(:button_cancel), '$("#put-tag-form").slideUp();',:class=>'ButtonColor m3p10' ,:style=>"padding:3px 6px"%>
<% end %> <% end %>
</div> </div>
<% end %> <% end %>

View File

@ -2239,4 +2239,5 @@ zh:
label_course_prompt: 课程: label_course_prompt: 课程:
label_contain_resource: 已包含资源: label_contain_resource: 已包含资源:
label_quote_resource_failed: ",此资源引用失败! " label_quote_resource_failed: ",此资源引用失败! "
label_file_lost: 以下文件在服务器丢失,请联系相关人员重新上传:

View File

@ -0,0 +1,19 @@
class CreatePolls < ActiveRecord::Migration
def up
create_table :polls do |t|
t.string :polls_name
t.string :polls_type
t.integer :polls_group_id
t.integer :polls_status
t.integer :user_id
t.datetime :published_at
t.datetime :closed_at
t.timestamps
end
end
def down
drop_table :polls
end
end

View File

@ -0,0 +1,16 @@
class CreatePollQuestions < ActiveRecord::Migration
def up
create_table :poll_questions do |t|
t.string :question_title
t.integer :question_type
t.integer :is_necessary
t.integer :poll_id
t.timestamps
end
end
def down
drop_table :poll_questions
end
end

View File

@ -0,0 +1,15 @@
class CreatePollAnswers < ActiveRecord::Migration
def up
create_table :poll_answers do |t|
t.integer :poll_question_id
t.text :answer_text
t.integer :answer_position
t.timestamps
end
end
def down
drop_table :poll_answers
end
end

View File

@ -0,0 +1,16 @@
class CreatePollVotes < ActiveRecord::Migration
def up
create_table :poll_votes do |t|
t.integer :user_id
t.integer :poll_question_id
t.integer :poll_answer_id
t.text :vote_text
t.timestamps
end
end
def down
drop_table :poll_votes
end
end

View File

@ -0,0 +1,14 @@
class CreatePollUsers < ActiveRecord::Migration
def up
create_table :poll_users do |t|
t.integer :user_id
t.integer :poll_id
t.timestamps
end
end
def down
drop_table :poll_users
end
end

View File

@ -11,7 +11,7 @@
# #
# It's strongly recommended to check this file into your version control system. # It's strongly recommended to check this file into your version control system.
ActiveRecord::Schema.define(:version => 20141231085350) do ActiveRecord::Schema.define(:version => 20150108035338) do
create_table "activities", :force => true do |t| create_table "activities", :force => true do |t|
t.integer "act_id", :null => false t.integer "act_id", :null => false
@ -790,6 +790,51 @@ ActiveRecord::Schema.define(:version => 20141231085350) do
t.integer "project_id" t.integer "project_id"
end end
create_table "poll_answers", :force => true do |t|
t.integer "poll_question_id"
t.text "answer_text"
t.integer "answer_position"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
end
create_table "poll_questions", :force => true do |t|
t.string "question_title"
t.integer "question_type"
t.integer "is_necessary"
t.integer "poll_id"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
end
create_table "poll_users", :force => true do |t|
t.integer "user_id"
t.integer "poll_id"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
end
create_table "poll_votes", :force => true do |t|
t.integer "user_id"
t.integer "poll_question_id"
t.integer "poll_answer_id"
t.text "vote_text"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
end
create_table "polls", :force => true do |t|
t.string "polls_name"
t.string "polls_type"
t.integer "polls_group_id"
t.integer "polls_status"
t.integer "user_id"
t.datetime "published_at"
t.datetime "closed_at"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
end
create_table "praise_tread_caches", :force => true do |t| create_table "praise_tread_caches", :force => true do |t|
t.integer "object_id", :null => false t.integer "object_id", :null => false
t.string "object_type" t.string "object_type"

View File

@ -2912,7 +2912,7 @@ input[class~='ButtonClolr'],.ButtonColor{
input[class~='m3p10'], .m3p10 { input[class~='m3p10'], .m3p10 {
margin-top: 5px; margin-top: 5px;
padding: 5px 10px !important; padding: 5px 10px;
height: 20px; height: 20px;
display: inline-block; display: inline-block;
color: #ffffff; color: #ffffff;

View File

@ -149,7 +149,7 @@ a:hover.tijiao{ background:#0f99a9 !important;}
.ni_con p{ color:#808181;} .ni_con p{ color:#808181;}
.ni_con a:hover{ text-decoration:none;} .ni_con a:hover{ text-decoration:none;}
.ui-widget-header{display: none;}

View File

@ -0,0 +1,7 @@
require 'test_helper'
class PollAnswersTest < ActiveSupport::TestCase
# test "the truth" do
# assert true
# end
end

View File

@ -0,0 +1,7 @@
require 'test_helper'
class PollQuestionsTest < ActiveSupport::TestCase
# test "the truth" do
# assert true
# end
end

View File

@ -0,0 +1,7 @@
require 'test_helper'
class PollUserTest < ActiveSupport::TestCase
# test "the truth" do
# assert true
# end
end

View File

@ -0,0 +1,7 @@
require 'test_helper'
class PollVotesTest < ActiveSupport::TestCase
# test "the truth" do
# assert true
# end
end

7
test/unit/polls_test.rb Normal file
View File

@ -0,0 +1,7 @@
require 'test_helper'
class PollsTest < ActiveSupport::TestCase
# test "the truth" do
# assert true
# end
end