Merge branch 'szzh' of http://xianbo_trustie2@repository.trustie.net/xianbo/trustie2.git into szzh
commit
472ccc45bf
@ -0,0 +1,8 @@
|
|||||||
|
class ForumObserver < ActiveRecord::Observer
|
||||||
|
def after_create(forum)
|
||||||
|
Thread.start do
|
||||||
|
Mailer.forum_add(forum).deliver if Setting.notified_events.include?('forum_add')
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
|
end
|
@ -1,7 +1,9 @@
|
|||||||
# Added by young
|
# Added by young
|
||||||
class JournalsForMessageObserver < ActiveRecord::Observer
|
class JournalsForMessageObserver < ActiveRecord::Observer
|
||||||
def after_create(journals_for_message)
|
def after_create(journals_for_message)
|
||||||
|
thread1 = Thread.start do
|
||||||
Mailer.journals_for_message_add(User.current, journals_for_message).deliver
|
Mailer.journals_for_message_add(User.current, journals_for_message).deliver
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
@ -0,0 +1,8 @@
|
|||||||
|
class MemoObserver < ActiveRecord::Observer
|
||||||
|
def after_create(memo)
|
||||||
|
|
||||||
|
thread1=Thread.new do
|
||||||
|
Mailer.forum_message_added(memo).deliver if Setting.notified_events.include?('forum_message_added')
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
@ -0,0 +1,29 @@
|
|||||||
|
|
||||||
|
<p>
|
||||||
|
<span class="c_blue" style="color:#1b55a7;">
|
||||||
|
<%= link_to(h("#{@forum.creator.login}(#{@forum.creator.show_name})"), @issue_author_url , :style=>'color:#1b55a7; font-weight:bold;') %>
|
||||||
|
|
||||||
|
</span><%= l(:label_forum_new)%>
|
||||||
|
<%= link_to(h(@forum.name), @forum_url,:style=>'color:#1b55a7; font-weight:bold;') %>
|
||||||
|
</p>
|
||||||
|
<div class="mail_box" style="border:1px solid #c8c8c8; width:570px; height: auto; padding:15px; margin-top:10px; margin-bottom:10px;">
|
||||||
|
<ul style="list-style-type:none; margin:0; padding:0;">
|
||||||
|
<li style="list-style-type:none; margin:0; padding:0;"><span style="float: left;"><strong><%= l(:mail_issue_subject)%></strong></span>
|
||||||
|
<span style="float: left; width: 526px"> <%= link_to(h(@forum.name), @forum_url,:style=>'color:#1b55a7; font-weight:bold;') %></span></li>
|
||||||
|
|
||||||
|
<li style="list-style-type:none; margin:0; padding:0;"><span style="float: left;"><strong><%= l(:mail_issue_content)%></strong></span>
|
||||||
|
<span style="float: left; width: 526px">
|
||||||
|
<%= @forum.description.html_safe %>
|
||||||
|
</span>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
</ul>
|
||||||
|
<div class="cl" style="margin-top: 30px; clear:both; overflow:hidden;"></div>
|
||||||
|
<label class="mail_reply">
|
||||||
|
<%= link_to(l(:mail_issue_reply), @forum_url, :class => "mail_reply", :style =>'display:block; float:right; width:80px; text-align:center; height:30px; background:#15bccf; color:#fff; font-weight:normal; font-size:14px; line-height: 30px;') %>
|
||||||
|
</label>
|
||||||
|
<div class="cl" style="margin-top: 30px; clear:both; overflow:hidden;"></div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -0,0 +1,4 @@
|
|||||||
|
<%= @forum_url %>
|
||||||
|
<%= @author.name %>
|
||||||
|
|
||||||
|
<%= @forum.description %>
|
@ -0,0 +1,32 @@
|
|||||||
|
|
||||||
|
<p>
|
||||||
|
<span class="c_blue" style="color:#1b55a7;">
|
||||||
|
<%= link_to(h("#{@author.login}(#{@author.show_name})"), @issue_author_url , :style=>'color:#1b55a7; font-weight:bold;') %>
|
||||||
|
</span><%= l(:mail_issue_title_userin)%>
|
||||||
|
<span class="c_blue" style="color:#1b55a7;">
|
||||||
|
<%= link_to(h(@forum.name), @forum_url,:style=>'color:#1b55a7; font-weight:bold;') %>
|
||||||
|
|
||||||
|
</span><%= l(:mail_issue_title_active)%></p>
|
||||||
|
<div class="mail_box" style="border:1px solid #c8c8c8; width:570px; height: auto; padding:15px; margin-top:10px; margin-bottom:10px;">
|
||||||
|
<ul style="list-style-type:none; margin:0; padding:0;">
|
||||||
|
<li style="list-style-type:none; margin:0; padding:0;"><span style="float: left;"><strong><%= l(:mail_issue_subject)%></strong></span>
|
||||||
|
<span style="float: left; width: 526px"> <%= link_to(h(@memo.subject), @memo_url,:style=>'color:#1b55a7; font-weight:bold;') %></span></li>
|
||||||
|
<li style="list-style-type:none; margin:0; padding:0;"><span style="float: left;"><strong><%= l(:mail_issue_sent_from)%></strong></span>
|
||||||
|
<%= link_to(h(@forum.name), @forum_url,:style=>'color:#1b55a7; font-weight:bold;') %>
|
||||||
|
</li>
|
||||||
|
<li style="list-style-type:none; margin:0; padding:0;"><span style="float: left;"><strong><%= l(:mail_issue_content)%></strong></span>
|
||||||
|
<span style="float: left; width: 526px">
|
||||||
|
<%= @memo.content.html_safe %>
|
||||||
|
</span>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
</ul>
|
||||||
|
<div class="cl" style="margin-top: 30px; clear:both; overflow:hidden;"></div>
|
||||||
|
<label class="mail_reply">
|
||||||
|
<%= link_to(l(:mail_issue_reply), @memo_url, :class => "mail_reply", :style =>'display:block; float:right; width:80px; text-align:center; height:30px; background:#15bccf; color:#fff; font-weight:normal; font-size:14px; line-height: 30px;') %>
|
||||||
|
</label>
|
||||||
|
<div class="cl" style="margin-top: 30px; clear:both; overflow:hidden;"></div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -0,0 +1,5 @@
|
|||||||
|
<%= @memo_url %>
|
||||||
|
<%= @author.name %>
|
||||||
|
|
||||||
|
<%= @memo.subject %>
|
||||||
|
<%= @memo.content %>
|
@ -1,8 +1,9 @@
|
|||||||
<div class="mail_content">
|
<div class="mail_content" style="margin-top:30px; margin:0; padding:0; border:0;">
|
||||||
|
|
||||||
|
|
||||||
<%= render :partial => 'issue', :formats => [:html], :locals => { :issue => @issue, :issue_url => @issue_url } %>
|
<%= render :partial => 'issue', :formats => [:html], :locals => { :issue => @issue, :issue_url => @issue_url } %>
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
<div class="mail_foot" style="margin:0; padding:0; border:0;"><%= link_to( l(:mail_issue_footer), @user_url , :style=>'font-size:12px; font-weight:normal; color:#1b55a7;') %> </div>
|
||||||
|
|
||||||
|
@ -1,2 +1,3 @@
|
|||||||
|
|
||||||
<%= render :partial => 'issue', :formats => [:text], :locals => { :issue => @issue, :issue_url => @issue_url } %>
|
<%= render :partial => 'issue', :formats => [:text], :locals => { :issue => @issue, :issue_url => @issue_url } %>
|
||||||
|
<%= link_to( l(:mail_issue_footer), @user_url) %>
|
@ -1,5 +1,25 @@
|
|||||||
<em>尊敬的用户,<%= @user %>给你留言了:</em>
|
|
||||||
<div><%= @message %></div>
|
<p>
|
||||||
<h1>点击链接查看最新回复<%= link_to(@url, @url) %></h1>
|
<span class="c_blue" style="color:#1b55a7;">
|
||||||
<h4><%= link_to(l(:lable_not_receive_mail),"http://" + Setting.host_name + "/my/account")%></h4>
|
|
||||||
|
<%= link_to(h("#{@user.login}(#{@user.show_name})"), @issue_author_url , :style=>'color:#1b55a7; font-weight:bold;') %>
|
||||||
|
</span>给你留言了
|
||||||
|
</p>
|
||||||
|
<div class="mail_box" style="border:1px solid #c8c8c8; width:570px; height: auto; padding:15px; margin-top:10px; margin-bottom:10px;">
|
||||||
|
<ul style="list-style-type:none; margin:0; padding:0;">
|
||||||
|
|
||||||
|
<li style="list-style-type:none; margin:0; padding:0;"><span style="float: left;"><strong><%= l(:mail_issue_content)%></strong></span>
|
||||||
|
<span style="float: left; width: 526px">
|
||||||
|
<%= @message %>
|
||||||
|
</span>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
</ul>
|
||||||
|
<div class="cl" style="margin-top: 30px; clear:both; overflow:hidden;"></div>
|
||||||
|
<label class="mail_reply">
|
||||||
|
<%= link_to(l(:mail_issue_reply), @url, :class => "mail_reply", :style =>'display:block; float:right; width:80px; text-align:center; height:30px; background:#15bccf; color:#fff; font-weight:normal; font-size:14px; line-height: 30px;') %>
|
||||||
|
</label>
|
||||||
|
<div class="cl" style="margin-top: 30px; clear:both; overflow:hidden;"></div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,4 +1,38 @@
|
|||||||
<h1><%=h @message.board.project.name %> - <%=h @message.board.name %>: <%= link_to(h(@message.subject), @message_url) %></h1>
|
|
||||||
<em><%=h @message.author %></em>
|
|
||||||
|
|
||||||
<%= textilizable(@message, :content, :only_path => false) %>
|
<p>
|
||||||
|
<span class="c_blue" style="color:#1b55a7;">
|
||||||
|
<%= link_to(h("#{@message.author.login}(#{@message.author.show_name})"), @issue_author_url , :style=>'color:#1b55a7; font-weight:bold;') %>
|
||||||
|
|
||||||
|
</span><%= l(:mail_issue_title_userin)%>
|
||||||
|
<span class="c_blue" style="color:#1b55a7;">
|
||||||
|
<% if @message.project %>
|
||||||
|
<%=h @message.board.project.name %> - <%=h @message.board.name %>: <%= link_to(h(@message.subject), @message_url,:style=>'color:#1b55a7; font-weight:bold;') %>
|
||||||
|
<% elsif @message.course %>
|
||||||
|
<%=h @message.board.course.name %> - <%=h @message.board.name %>: <%= link_to(h(@message.subject), @message_url,:style=>'color:#1b55a7; font-weight:bold;') %>
|
||||||
|
<% end %>
|
||||||
|
</span><%= l(:mail_issue_title_active)%></p>
|
||||||
|
<div class="mail_box" style="border:1px solid #c8c8c8; width:570px; height: auto; padding:15px; margin-top:10px; margin-bottom:10px;">
|
||||||
|
<ul style="list-style-type:none; margin:0; padding:0;">
|
||||||
|
<li style="list-style-type:none; margin:0; padding:0;"><span style="float: left;"><strong><%= l(:mail_issue_subject)%></strong></span><span style="float: left; width: 526px"> <%= link_to(h(@message.subject), @message_url, :style=>'color:#1b55a7; font-weight:bold;') %></span></li>
|
||||||
|
<li style="list-style-type:none; margin:0; padding:0;"><span style="float: left;"><strong><%= l(:mail_issue_sent_from)%></strong></span>
|
||||||
|
<% if @message.project %>
|
||||||
|
<span style="float: left; width: 526px"><%=h @message.board.project.name %> - <%=h @message.board.name %></span>
|
||||||
|
<% elsif @message.course %>
|
||||||
|
<span style="float: left; width: 526px"><%=h @message.board.course.name %> - <%=h @message.board.name %></span>
|
||||||
|
<% end %>
|
||||||
|
</li>
|
||||||
|
<li style="list-style-type:none; margin:0; padding:0;"><span style="float: left;"><strong><%= l(:mail_issue_content)%></strong></span>
|
||||||
|
<span style="float: left; width: 526px">
|
||||||
|
<%= @message.content %>
|
||||||
|
</span>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
</ul>
|
||||||
|
<div class="cl" style="margin-top: 30px; clear:both; overflow:hidden;"></div>
|
||||||
|
<label class="mail_reply">
|
||||||
|
<%= link_to(l(:mail_issue_reply), @message_url, :class => "mail_reply", :style =>'display:block; float:right; width:80px; text-align:center; height:30px; background:#15bccf; color:#fff; font-weight:normal; font-size:14px; line-height: 30px;') %>
|
||||||
|
</label>
|
||||||
|
<div class="cl" style="margin-top: 30px; clear:both; overflow:hidden;"></div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,4 +1,41 @@
|
|||||||
<h1><%= link_to(h(@news.title), @news_url) %></h1>
|
|
||||||
<em><%=h @news.author.name %></em>
|
|
||||||
|
|
||||||
<%= textilizable(@news, :description, :only_path => false) %>
|
<p>
|
||||||
|
<span class="c_blue" style="color:#1b55a7;">
|
||||||
|
|
||||||
|
<%= link_to(h("#{@news.author.login}(#{@news.author.show_name})"), @issue_author_url , :style=>'color:#1b55a7; font-weight:bold;') %>
|
||||||
|
|
||||||
|
</span><%= l(:mail_issue_title_userin)%>
|
||||||
|
<span class="c_blue" style="color:#1b55a7;">
|
||||||
|
<% if @news.project %>
|
||||||
|
<%=h @news.project.name %> : <%= link_to(h(@news.title), @news_url,:style=>'color:#1b55a7; font-weight:bold;') %>
|
||||||
|
<% elsif @news.course %>
|
||||||
|
<%=h @news.course.name %> : <%= link_to(h(@news.title), @news_url,:style=>'color:#1b55a7; font-weight:bold;') %>
|
||||||
|
<% end %>
|
||||||
|
</span><%= l(:mail_issue_title_active)%></p>
|
||||||
|
<div class="mail_box" style="border:1px solid #c8c8c8; width:570px; height: auto; padding:15px; margin-top:10px; margin-bottom:10px;">
|
||||||
|
<ul style="list-style-type:none; margin:0; padding:0;">
|
||||||
|
<li style="list-style-type:none; margin:0; padding:0;"><span style="float: left;"><strong><%= l(:mail_issue_subject)%></strong></span>
|
||||||
|
<span style="float: left; width: 526px"> <%= link_to(h(@news.title), @news_url,:style=>'color:#1b55a7; font-weight:bold;') %></span></li>
|
||||||
|
<li style="list-style-type:none; margin:0; padding:0;"><span style="float: left;"><strong><%= l(:mail_issue_sent_from)%></strong></span>
|
||||||
|
<% if @news.project %>
|
||||||
|
<span style="float: left; width: 526px"><%=h @news.project.name %></span>
|
||||||
|
<% elsif @news.course %>
|
||||||
|
<span style="float: left; width: 526px"><%=h @news.course.name %></span>
|
||||||
|
<% end %>
|
||||||
|
</li>
|
||||||
|
<li style="list-style-type:none; margin:0; padding:0;"><span style="float: left;"><strong><%= l(:mail_issue_content)%></strong></span>
|
||||||
|
<span style="float: left; width: 526px">
|
||||||
|
<%= @news.description %>
|
||||||
|
</span>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
</ul>
|
||||||
|
<div class="cl" style="margin-top: 30px; clear:both; overflow:hidden;"></div>
|
||||||
|
<label class="mail_reply">
|
||||||
|
<%= link_to(l(:mail_issue_reply), @news_url, :class => "mail_reply", :style =>'display:block; float:right; width:80px; text-align:center; height:30px; background:#15bccf; color:#fff; font-weight:normal; font-size:14px; line-height: 30px;') %>
|
||||||
|
</label>
|
||||||
|
<div class="cl" style="margin-top: 30px; clear:both; overflow:hidden;"></div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -0,0 +1,68 @@
|
|||||||
|
<% has_commit = has_commit_poll?(poll.id ,User.current)%>
|
||||||
|
<% poll_name = poll.polls_name.empty? ? l(:label_poll_new) : poll.polls_name%>
|
||||||
|
<li title="<%= poll.polls_name %>">
|
||||||
|
<% if @is_teacher %>
|
||||||
|
<% if has_commit %>
|
||||||
|
<sapn class="polls_title fl">
|
||||||
|
<%= link_to poll_name, poll_result_poll_path(poll.id), :class => "polls_title polls_title_w fl", :style => "max-width: 550px;width: 550px;" %>
|
||||||
|
</sapn>
|
||||||
|
<% 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 %>
|
||||||
|
</li>
|
||||||
|
<% if !@is_teacher && has_commit && poll.polls_status == 2%>
|
||||||
|
<li class="pollsbtn_tip fl ml5">已答</li>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
|
<%if @is_teacher%>
|
||||||
|
<% if poll.polls_status == 1 %>
|
||||||
|
<li class="pollsbtn fl ml10 pollsbtn_grey">统计结果</li>
|
||||||
|
<% elsif poll.polls_status == 2%>
|
||||||
|
<li>
|
||||||
|
<%= link_to l(:label_statistical_results), statistics_result_poll_path(poll.id), :class => "pollsbtn fl ml10"%>
|
||||||
|
</li>
|
||||||
|
<% end%>
|
||||||
|
<% end%>
|
||||||
|
|
||||||
|
<li>
|
||||||
|
<%if @is_teacher %>
|
||||||
|
<% if poll.polls_status == 1 %>
|
||||||
|
<a href="#" class="pollsbtn btn_pu fl ml5" onclick="poll_submit(<%= poll.id%>,<%= poll.polls_name.length %>);">发布问卷</a>
|
||||||
|
<% elsif poll.polls_status == 2%>
|
||||||
|
<a href="#" class="pollsbtn btn_de fl ml5" onclick="republish_poll(<%= poll.id%>);">取消发布</a>
|
||||||
|
<% end%>
|
||||||
|
<% end%>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<% if @is_teacher %>
|
||||||
|
<!--新建状态的问卷可删除-->
|
||||||
|
<%= link_to(l(:button_delete), poll,
|
||||||
|
method: :delete, :confirm => l(:text_are_you_sure), :remote => true, :class => "polls_de fr ml20 mr10") %>
|
||||||
|
<% end%>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<% if @is_teacher%>
|
||||||
|
<% if poll.polls_status == 1 %>
|
||||||
|
<%= link_to l(:button_edit), edit_poll_path(poll.id), :class => "polls_de fr ml20"%>
|
||||||
|
<% elsif poll.polls_status == 2%>
|
||||||
|
<li class="polls_de_grey fr ml20">编辑</li>
|
||||||
|
<% end%>
|
||||||
|
<% end%>
|
||||||
|
</li>
|
||||||
|
<!--<li>-->
|
||||||
|
<!--<% if @is_teacher && poll.polls_status == 2%>-->
|
||||||
|
<!--<a class="polls_de fr ml20" onclick="republish_poll(<%= poll.id%>);">-->
|
||||||
|
<!--取消发布-->
|
||||||
|
<!--</a>-->
|
||||||
|
<!--<% end %>-->
|
||||||
|
<!--</li>-->
|
||||||
|
<li class="polls_date fr mr10">
|
||||||
|
<%= format_time poll.created_at%>
|
||||||
|
</li>
|
@ -0,0 +1,32 @@
|
|||||||
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||||
|
<script type="text/javascript">
|
||||||
|
function clickCanel(){hideModal("#popbox02");}
|
||||||
|
</script>
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
<div id="popbox02">
|
||||||
|
<div class="upload_con">
|
||||||
|
<div class="upload_box">
|
||||||
|
<p class="polls_box_p">
|
||||||
|
问卷取消发布后学生提交的问卷答案将会被清空,
|
||||||
|
<br />
|
||||||
|
是否确定取消发布该问卷?
|
||||||
|
</p>
|
||||||
|
<div class="polls_btn_box">
|
||||||
|
<%= link_to "确 定",republish_poll_poll_path(poll.id), :class => "upload_btn", :onclick => "clickCanel();" %>
|
||||||
|
<a class="upload_btn upload_btn_grey" onclick="clickCanel();">
|
||||||
|
取 消
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
<div class="cl"></div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
@ -0,0 +1,26 @@
|
|||||||
|
<li class="ur_question_item checkbox">
|
||||||
|
<div class="ur_title">
|
||||||
|
<span class="title_index">
|
||||||
|
第<%= poll_question.question_number%>题:
|
||||||
|
</span>
|
||||||
|
<%= poll_question.question_title %>
|
||||||
|
<span class="title_index">[多选题]</span>
|
||||||
|
<%if poll_question.is_necessary == 1%>
|
||||||
|
<span class="ur_required" title="必答">*</span>
|
||||||
|
<%end%>
|
||||||
|
</div>
|
||||||
|
<div class="cl"></div>
|
||||||
|
<div class="ur_inputs">
|
||||||
|
<table class="ur_table">
|
||||||
|
<tbody>
|
||||||
|
<% poll_question.poll_votes.where("user_id = #{User.current.id}").each do |answer|%>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<%= answer.poll_answer.answer_text %>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<% end%>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</li><!--多选题 end-->
|
@ -0,0 +1,27 @@
|
|||||||
|
<li class="ur_question_item radio">
|
||||||
|
<div class="ur_title">
|
||||||
|
<span class="title_index">
|
||||||
|
第<%= poll_question.question_number%>题:
|
||||||
|
</span>
|
||||||
|
<%= poll_question.question_title %>
|
||||||
|
<span class="title_index">[单选题]</span>
|
||||||
|
<%if poll_question.is_necessary == 1%>
|
||||||
|
<span class="ur_required" title="必答">*</span>
|
||||||
|
<%end%>
|
||||||
|
</div>
|
||||||
|
<div class="cl"></div>
|
||||||
|
<div class="ur_inputs">
|
||||||
|
<table class="ur_table" >
|
||||||
|
<tbody>
|
||||||
|
<% poll_question.poll_votes.where("user_id = #{User.current.id}").each do |answer|%>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<%= answer.poll_answer.answer_text %>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<% end%>
|
||||||
|
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</li><!--单选题 end-->
|
@ -0,0 +1,20 @@
|
|||||||
|
<li class="ur_question_item textarea">
|
||||||
|
<div class="ur_preview">
|
||||||
|
<div class="ur_title">
|
||||||
|
<span class="title_index">
|
||||||
|
第<%= poll_question.question_number%>题:
|
||||||
|
</span>
|
||||||
|
<%= poll_question.question_title %>
|
||||||
|
<span class="title_index">[多行主观]</span>
|
||||||
|
<%if poll_question.is_necessary == 1%>
|
||||||
|
<span class="ur_required" title="必答">*</span>
|
||||||
|
<%end%>
|
||||||
|
</div>
|
||||||
|
<div class="cl"></div>
|
||||||
|
<div class="ur_inputs">
|
||||||
|
<p>
|
||||||
|
<%= get_anwser_vote_text(poll_question.id,User.current.id).html_safe%>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</li><!--多行输入 end-->
|
@ -0,0 +1,18 @@
|
|||||||
|
<li class="ur_question_item text">
|
||||||
|
<div class="ur_title">
|
||||||
|
<span class="title_index">
|
||||||
|
第<%= poll_question.question_number%>题:
|
||||||
|
</span>
|
||||||
|
<%= poll_question.question_title %>
|
||||||
|
<span class="title_index">[单行主观]</span>
|
||||||
|
<%if poll_question.is_necessary == 1%>
|
||||||
|
<span class="ur_required" title="必答">*</span>
|
||||||
|
<%end%>
|
||||||
|
</div>
|
||||||
|
<div class="cl"></div>
|
||||||
|
<div class="ur_inputs">
|
||||||
|
<p>
|
||||||
|
<%= get_anwser_vote_text poll_question.id,User.current.id%>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</li><!--当行输入 end-->
|
@ -0,0 +1,36 @@
|
|||||||
|
<%= stylesheet_link_tag 'polls', :media => 'all' %>
|
||||||
|
<div class="polls_content polls_box">
|
||||||
|
<div class="ur_page_head" >
|
||||||
|
<h1 class="ur_page_title">
|
||||||
|
<%= @poll.polls_name.empty? ? l(:label_poll_new) : @poll.polls_name %>
|
||||||
|
</h1>
|
||||||
|
<p class="ur_prefix_content">
|
||||||
|
<%= @poll.polls_description%>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
<div class="ur_card">
|
||||||
|
<ol class="ur_questions">
|
||||||
|
<% @poll_questions.each do |poll_question|%>
|
||||||
|
<% if poll_question.question_type == 1%>
|
||||||
|
<%= render :partial => 'show_MC_result', :locals => {:poll_question => poll_question} %>
|
||||||
|
<% elsif poll_question.question_type == 2%>
|
||||||
|
<%= render :partial => 'show_MCQ_result', :locals => {:poll_question => poll_question} %>
|
||||||
|
<% elsif poll_question.question_type == 3%>
|
||||||
|
<%= render :partial => 'show_single_result', :locals => {:poll_question => poll_question} %>
|
||||||
|
<% elsif poll_question.question_type == 4%>
|
||||||
|
<%= render :partial => 'show_mulit_result', :locals => {:poll_question => poll_question} %>
|
||||||
|
<% end%>
|
||||||
|
<% end%>
|
||||||
|
</ol>
|
||||||
|
</div> <!--ur_cards end-->
|
||||||
|
<div class="cl"></div>
|
||||||
|
|
||||||
|
<!-- 分页 -->
|
||||||
|
<div class="polls_content" id="polls">
|
||||||
|
<ul class="wlist">
|
||||||
|
<%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => false, :flag => true%>
|
||||||
|
</ul>
|
||||||
|
<div class="cl"></div>
|
||||||
|
</div>
|
||||||
|
</div><!--问卷内容end-->
|
||||||
|
|
@ -0,0 +1,2 @@
|
|||||||
|
$("#polls_<%= @poll.id %>").html("<%= escape_javascript(render :partial => 'poll',:locals => {:poll => @poll}) %>");
|
||||||
|
alert("发布成功");
|
@ -0,0 +1,2 @@
|
|||||||
|
$("#polls_<%= @poll.id %>").html("<%= escape_javascript(render :partial => 'poll',:locals => {:poll => @poll}) %>");
|
||||||
|
alert("取消成功");
|
@ -0,0 +1,9 @@
|
|||||||
|
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'projects/join_project') %>');
|
||||||
|
showModal('ajax-modal', '510px');
|
||||||
|
$('#ajax-modal').css('height','260px');
|
||||||
|
$('#ajax-modal').siblings().remove();
|
||||||
|
$('#ajax-modal').before("<span style='float: right;cursor:pointer;padding-left: 513px;'>" +
|
||||||
|
"<a href='#' onclick='hidden_join_course_form();'><img src='/images/bid/close.png' width='26px' height='26px' /></a></span>");
|
||||||
|
$('#ajax-modal').parent().removeClass("alert_praise");
|
||||||
|
$('#ajax-modal').parent().css("top","").css("left","");
|
||||||
|
$('#ajax-modal').parent().addClass("alert_box");
|
@ -0,0 +1,11 @@
|
|||||||
|
class AddInitialProducts < ActiveRecord::Migration
|
||||||
|
def up
|
||||||
|
Forum.create(:name =>"new forum", :description => "", :topic_count => "0",
|
||||||
|
:memo_count => "0", :last_memo_id =>"0", :creator_id =>"2",
|
||||||
|
:sticky =>"0", :locked =>"0")
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
def down
|
||||||
|
end
|
||||||
|
end
|
@ -0,0 +1,9 @@
|
|||||||
|
class AddShowResult < ActiveRecord::Migration
|
||||||
|
def up
|
||||||
|
add_column :polls, :show_result, :integer, default: 1
|
||||||
|
end
|
||||||
|
|
||||||
|
def down
|
||||||
|
remove_column :polls, :show_result
|
||||||
|
end
|
||||||
|
end
|
After Width: | Height: | Size: 2.8 KiB |
After Width: | Height: | Size: 9.2 KiB |
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 2.4 KiB |
@ -0,0 +1,5 @@
|
|||||||
|
require 'spec_helper'
|
||||||
|
|
||||||
|
describe ForumObserver do
|
||||||
|
pending "add some examples to (or delete) #{__FILE__}"
|
||||||
|
end
|
@ -0,0 +1,5 @@
|
|||||||
|
require 'spec_helper'
|
||||||
|
|
||||||
|
describe MemoObserver do
|
||||||
|
pending "add some examples to (or delete) #{__FILE__}"
|
||||||
|
end
|
@ -0,0 +1,38 @@
|
|||||||
|
# This file is copied to spec/ when you run 'rails generate rspec:install'
|
||||||
|
ENV["RAILS_ENV"] ||= 'test'
|
||||||
|
require File.expand_path("../../config/environment", __FILE__)
|
||||||
|
require 'rspec/rails'
|
||||||
|
require 'rspec/autorun'
|
||||||
|
|
||||||
|
# Requires supporting ruby files with custom matchers and macros, etc,
|
||||||
|
# in spec/support/ and its subdirectories.
|
||||||
|
Dir[Rails.root.join("spec/support/**/*.rb")].each { |f| require f }
|
||||||
|
|
||||||
|
RSpec.configure do |config|
|
||||||
|
# ## Mock Framework
|
||||||
|
#
|
||||||
|
# If you prefer to use mocha, flexmock or RR, uncomment the appropriate line:
|
||||||
|
#
|
||||||
|
# config.mock_with :mocha
|
||||||
|
# config.mock_with :flexmock
|
||||||
|
# config.mock_with :rr
|
||||||
|
|
||||||
|
# Remove this line if you're not using ActiveRecord or ActiveRecord fixtures
|
||||||
|
config.fixture_path = "#{::Rails.root}/spec/fixtures"
|
||||||
|
|
||||||
|
# If you're not using ActiveRecord, or you'd prefer not to run each of your
|
||||||
|
# examples within a transaction, remove the following line or assign false
|
||||||
|
# instead of true.
|
||||||
|
config.use_transactional_fixtures = true
|
||||||
|
|
||||||
|
# If true, the base class of anonymous controllers will be inferred
|
||||||
|
# automatically. This will be the default behavior in future versions of
|
||||||
|
# rspec-rails.
|
||||||
|
config.infer_base_class_for_anonymous_controllers = false
|
||||||
|
|
||||||
|
# Run specs in random order to surface order dependencies. If you find an
|
||||||
|
# order dependency and want to debug it, you can fix the order by providing
|
||||||
|
# the seed, which is printed after each run.
|
||||||
|
# --seed 1234
|
||||||
|
config.order = "random"
|
||||||
|
end
|
Loading…
Reference in new issue