From 1bba235ca0e80c5394c6fef6b2b912b5f07b6efd Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Tue, 24 Mar 2015 15:46:23 +0800 Subject: [PATCH] =?UTF-8?q?1=E3=80=81=E6=9B=B4=E6=96=B0poll.css=E6=96=87?= =?UTF-8?q?=E4=BB=B6=202=E3=80=81=E4=BF=AE=E6=94=B9poll=E7=9A=84index?= =?UTF-8?q?=E7=95=8C=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/poll/_poll.html.erb | 120 +++++++++----------------- app/views/poll/_poll_list.html.erb | 2 +- app/views/poll/index.html.erb | 2 +- public/stylesheets/polls.css | 133 ++++++++++++++--------------- 4 files changed, 104 insertions(+), 153 deletions(-) diff --git a/app/views/poll/_poll.html.erb b/app/views/poll/_poll.html.erb index 33bff6258..4f307279b 100644 --- a/app/views/poll/_poll.html.erb +++ b/app/views/poll/_poll.html.erb @@ -1,91 +1,51 @@ <% has_commit = has_commit_poll?(poll.id ,User.current)%> <% poll_name = poll.polls_name.empty? ? l(:label_poll_new) : poll.polls_name%> -
  • - <% 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") %> +<% if @is_teacher%> +
  • + <% 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 @is_teacher%> <% if poll.polls_status == 1 %> -
  • - <%= link_to l(:button_edit), edit_poll_path(poll.id), :class => "polls_de fr ml15"%> -
  • +
  • 发布问卷
  • + <% elsif poll.polls_status == 2%> +
  • 取消发布
  • <% else%> -
  • - 编辑 -
  • +
  • 发布问卷
  • <% end%> -<% end%> -<% if @is_teacher%> - <% if 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") %> -<% end %> + <% 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_time poll.created_at%> -
  • \ No newline at end of file +
  • <%= 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%> +
  • <%= format_date poll.created_at.to_date%>
  • +<% end%> \ No newline at end of file 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|%> -