diff --git a/app/controllers/bids_controller.rb b/app/controllers/bids_controller.rb index 5ee3d4823..9dd64bd7a 100644 --- a/app/controllers/bids_controller.rb +++ b/app/controllers/bids_controller.rb @@ -181,6 +181,7 @@ class BidsController < ApplicationController end end + #将某个企业外包需求选为作业,目前此功能已放弃 def create_fork @homework = Bid.new @homework.name = params[:bid][:name] @@ -215,6 +216,7 @@ class BidsController < ApplicationController end end + #有两个路由链接到此方法:/bids/:id /calls/:id但是貌似这两个路由都不能访问。。方法作用有待确认 def show @user = @bid.author @jours = @bid.journals_for_messages.where('m_parent_id IS NULL').order('created_on DESC') @@ -250,40 +252,31 @@ class BidsController < ApplicationController else @state = 1 end - respond_to do |format| - # format.html { redirect_to_referer_or {render :text => (watching ? 'Watcher added.' : 'Watcher removed.'), :layout => true}} - # TO_DO format.js { render :partial => 'set_join', :locals => {:user => User.current, :object_id => params[:id]} } end end def unjoin_in_contest - joined = JoinInContest.where('bid_id = ? and user_id = ?', @bid.id, User.current.id) - joined.each do |join| join.delete end - respond_to do |format| - # format.html { redirect_to_referer_or {render :text => (watching ? 'Watcher added.' : 'Watcher removed.'), :layout => true}} format.js { render :partial => 'set_join', :locals => {:user => User.current, :object_id => params[:id]} } end end def new_join - # added by fq - end # added by bai 增加了参与者和竞赛设置 def show_participator render :layout => 'base_contest' - end + #配置竞赛 def settings if @bid.author.id == User.current.id if @bid.reward_type == 2 @@ -296,7 +289,7 @@ class BidsController < ApplicationController end #end - # 显示课程 + # 显示课程作业,但是好像已经废弃 def show_course bids = Bid.where('parent_id = ?', @bid.id) @courses = [] @@ -459,9 +452,7 @@ class BidsController < ApplicationController def show_courseEx if (User.current.logged? && (User.current.member_of_course?(@bid.courses.first) || User.current.admin?)) - # flash[:notice] = "" @membership = User.current.coursememberships.all(:conditions => Course.visible_condition(User.current)) - @user = @bid.author @bidding_project = @bid.biding_projects.all diff --git a/app/views/courses/homework.html.erb b/app/views/courses/homework.html.erb index 751558237..f5fe74953 100644 --- a/app/views/courses/homework.html.erb +++ b/app/views/courses/homework.html.erb @@ -29,10 +29,22 @@

<%= textilizable bid, :description %> -
<%= l(:label_create_time)%> : <%= format_time bid.created_on%>

-
<%= l(:label_expend_information)%> - +
+ <%= l(:button_more)%>... +
+ <%= l(:label_end_time)%>:<%= bid.deadline%> + <% if betweentime(bid.deadline) < 0 %> + + <%= l(:label_commit_limit)%> + + <% else %> + +
+
+ <% end %>
diff --git a/app/views/poll/_choice_show.html.erb b/app/views/poll/_choice_show.html.erb index d541386d3..408b9d490 100644 --- a/app/views/poll/_choice_show.html.erb +++ b/app/views/poll/_choice_show.html.erb @@ -7,21 +7,21 @@ <%= l(:label_poll_proportion) %> <% poll_question.poll_answers.each do |poll_answer| %> - - <%= poll_answer.answer_text %> - <%= poll_answer.poll_votes.count %> - -
- -
- <%= statistics_result_percentage(poll_answer.poll_votes.count, total_answer(poll_question.id)) %>% - + + <%= poll_answer.answer_text %> + <%= poll_answer.poll_votes.count %> + +
+ +
+ <%= statistics_result_percentage(poll_answer.poll_votes.count, total_answer(poll_question.id)) %>% + <% end %> - - <%= l(:label_poll_valid_commit) %> - <%= total_answer(poll_question.id) %> -   - + + <%= l(:label_poll_valid_commit) %> + <%= total_answer(poll_question.id) %> +   + diff --git a/app/views/poll/_edit_MC.html.erb b/app/views/poll/_edit_MC.html.erb index 19a1e1e89..9209bf61d 100644 --- a/app/views/poll/_edit_MC.html.erb +++ b/app/views/poll/_edit_MC.html.erb @@ -7,7 +7,7 @@ $("#is_necessary_<%=poll_question.id%>").replaceWith("/>"); $("#poll_answers_<%=poll_question.id%>").html("<% poll_question.poll_answers.reorder('answer_position').each do |poll_answer| %>" + "
  • " + - "" + + "" + "" + "" + "" + @@ -29,7 +29,7 @@
  • " + - "" + + "" + "" + "" + "" + @@ -17,6 +17,7 @@
    + /> @@ -26,7 +27,7 @@
      <% poll_question.poll_answers.reorder("answer_position").each do |poll_answer| %>
    • - + @@ -36,7 +37,7 @@
  • - <% if @is_teacher %> - <% if has_commit %> - - <%= link_to poll_name, poll_result_poll_path(poll.id), :class => "polls_title polls_title_w fl", :style => "max-width: 550px;width: 550px;" %> - - <% else %> - <%= link_to poll_name, poll_path(poll.id), :class => "polls_title polls_title_w fl" %> - <% end %> - <% else %> - <% if has_commit && poll.polls_status == 2 %> - <%= link_to poll_name, poll_result_poll_path(poll.id), :class => "polls_title polls_title_w fl", :style => "max-width: 500px;width: auto;" %> - <% elsif !has_commit && poll.polls_status == 2 %> - <%= link_to poll_name, poll_path(poll.id), :class => "polls_title polls_title_w fl", :style => "max-width: 550px;width: 550px;" %> - <% end %> - <% end %> -
  • -<% if !@is_teacher && has_commit && poll.polls_status == 2%> -
  • 已答
  • -<% end %> - -<%if @is_teacher%> - <% if poll.polls_status == 1%> -
  • 统计结果
  • - <% elsif poll.polls_status == 2 || poll.polls_status == 3 %> -
  • - <%= link_to l(:label_statistical_results), statistics_result_poll_path(poll.id), :class => "pollsbtn fl ml10"%> -
  • - <% end%> -<% end%> - - -<%if @is_teacher %> - <% if poll.polls_status == 1 %> -
  • - - 发布问卷 - -
  • - <% elsif poll.polls_status == 2%> -
  • - - 取消发布 - -
  • - <% else%> -
  • - 发布问卷 -
  • - <% end%> -<% end%> - -
  • - <% if @is_teacher %> - - <%= link_to(l(:button_delete), poll, - method: :delete, :confirm => l(:text_are_you_sure), :remote => true, :class => "polls_de fr ml15 mr10") %> - <% end%> -
  • - <% if @is_teacher%> - <% if poll.polls_status == 1 %> -
  • - <%= link_to l(:button_edit), edit_poll_path(poll.id), :class => "polls_de fr ml15"%> -
  • - <% else%> -
  • - 编辑 -
  • - <% end%> -<% end%> - -<% if @is_teacher%> - <% if poll.polls_status == 2 %> -
  • - 关闭 -
  • +
  • + <% if has_commit %> + <%= link_to poll_name, poll_result_poll_path(poll.id), :class => "polls_title polls_title_w fl c_dblue"%> <% else %> -
  • - 关闭 -
  • + <%= link_to poll_name, poll_path(poll.id), :class => "polls_title polls_title_w fl c_dblue" %> + <% end %> + + + <% if poll.polls_status == 1%> +
  • 统计结果
  • + <% elsif poll.polls_status == 2 || poll.polls_status == 3 %> +
  • <%= link_to l(:label_statistical_results), statistics_result_poll_path(poll.id), :class => "pollsbtn fl ml10"%>
  • + <% end%> + + <% if poll.polls_status == 1 %> +
  • 发布问卷
  • + <% elsif poll.polls_status == 2%> +
  • 取消发布
  • + <% else%> +
  • 发布问卷
  • + <% end%> + + <%= link_to(l(:button_delete), poll,:method => :delete, :confirm => l(:text_are_you_sure), :remote => true, :class => "polls_de fr ml5 mr10") %> + + <% if poll.polls_status == 1 %> +
  • <%= link_to l(:button_edit), edit_poll_path(poll.id), :class => "polls_de fr ml5"%>
  • + <% else%> +
  • 编辑
  • + <% end%> + + <% if poll.polls_status == 2 %> +
  • 关闭
  • + <% else %> +
  • 关闭
  • + <% end%> + +
  • <%= format_date poll.created_at.to_date%>
  • +<% else%> + <% if poll.polls_status == 2%> + <% if has_commit%> +
  • <%= link_to poll_name, poll_result_poll_path(poll.id), :class => "polls_title polls_title_st fl c_dblue" %>
  • +
  • 已答
  • + <%else%> + <%= link_to poll_name, poll_path(poll.id), :class => "polls_title polls_title_st fl c_dblue"%> + <%end%> <% end%> - -<% end %> - - -
  • - <%= format_time poll.created_at%> -
  • \ No newline at end of file +
  • <%= format_date poll.created_at.to_date%>
  • +<% end%> \ No newline at end of file diff --git a/app/views/poll/_poll_form.html.erb b/app/views/poll/_poll_form.html.erb index b73de94e0..b7a90b9a9 100644 --- a/app/views/poll/_poll_form.html.erb +++ b/app/views/poll/_poll_form.html.erb @@ -1,106 +1,97 @@ - - - - - 问卷调查_问卷编辑 - <%= stylesheet_link_tag 'polls', :media => 'all' %> - <%#= javascript_include_tag "polls" %> +<%= stylesheet_link_tag 'polls', :media => 'all' %> - - - - + } +
    @@ -116,7 +107,7 @@ <%= render :partial => 'poll_content', :locals => {:poll => @poll}%>
    -
    +
    - - diff --git a/app/views/poll/_poll_list.html.erb b/app/views/poll/_poll_list.html.erb index f57a4a5ff..becfc32a5 100644 --- a/app/views/poll/_poll_list.html.erb +++ b/app/views/poll/_poll_list.html.erb @@ -9,7 +9,7 @@
    <% @polls.each do |poll|%> -