parent
2fa01f32fb
commit
9443c139f0
@ -0,0 +1,79 @@
|
|||||||
|
<style type="text/css">
|
||||||
|
input.is_public,input.is_public_checkbox{height:12px;}
|
||||||
|
input.is_public_checkbox{margin-left:4px;margin-right:4px;}
|
||||||
|
</style>
|
||||||
|
<div class="fl">
|
||||||
|
<span id="attachments_fields" xmlns="http://www.w3.org/1999/html">
|
||||||
|
<% if defined?(container) && container && container.saved_attachments %>
|
||||||
|
<% container.attachments.each_with_index do |attachment, i| %>
|
||||||
|
<span id="attachments_p<%= i %>" class="attachment">
|
||||||
|
<%= 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;") %><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') %>
|
||||||
|
<%= if attachment.id.nil?
|
||||||
|
#待补充代码
|
||||||
|
else
|
||||||
|
link_to(' '.html_safe, attachment_path(attachment, :attachment_id => "p#{i}", :format => 'js'), :method => 'delete', :remote => true, :class => 'remove-upload')
|
||||||
|
end
|
||||||
|
%>
|
||||||
|
<%#= render :partial => 'tags/tag', :locals => {:obj => attachment, :object_flag => "6"} %>
|
||||||
|
|
||||||
|
<%= hidden_field_tag "attachments[p#{i}][token]", "#{attachment.token}" %>
|
||||||
|
</span>
|
||||||
|
<div class="cl"></div>
|
||||||
|
<% end %>
|
||||||
|
<% container.saved_attachments.each_with_index do |attachment, i| %>
|
||||||
|
<span id="attachments_p<%= i %>" class="attachment">
|
||||||
|
<%= 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;") %>
|
||||||
|
<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') %>
|
||||||
|
<%= if attachment.id.nil?
|
||||||
|
#待补充代码
|
||||||
|
else
|
||||||
|
link_to(' '.html_safe, attachment_path(attachment, :attachment_id => "p#{i}", :format => 'js'), :method => 'delete', :remote => true, :class => 'remove-upload')
|
||||||
|
end
|
||||||
|
%>
|
||||||
|
<%#= render :partial => 'tags/tag', :locals => {:obj => attachment, :object_flag => "6"} %>
|
||||||
|
|
||||||
|
<%= hidden_field_tag "attachments[p#{i}][token]", "#{attachment.token}" %>
|
||||||
|
</span>
|
||||||
|
<div class="cl"></div>
|
||||||
|
<% end %>
|
||||||
|
<% end %>
|
||||||
|
</span>
|
||||||
|
<% project = project %>
|
||||||
|
<div class="cl"></div>
|
||||||
|
<span class="add_attachment" style="font-weight:normal;">
|
||||||
|
<%#= button_tag "浏览", :type=>"button", :onclick=>"CompatibleSend();" %>
|
||||||
|
<!--%= link_to image_tag(),"javascript:void(0)", :onclick => "_file.click()"%-->
|
||||||
|
<%#= button_tag "文件浏览", :type=>"button", :onclick=>"$('#_file').click();",:onmouseover => 'this.focus()',:class => 'AnnexBtn fl mt3' %>
|
||||||
|
<a href="javascript:void(0);" onclick="$('#_file').click();" class="AnnexBtn fl mt3"></a>
|
||||||
|
<%= file_field_tag 'attachments[dummy][file]',
|
||||||
|
:id => '_file',
|
||||||
|
:class => 'file_selector',
|
||||||
|
:multiple => true,
|
||||||
|
:onchange => 'addInputFiles(this);',
|
||||||
|
:style => ie8? ? '' : 'display:none',
|
||||||
|
:data => {
|
||||||
|
:max_file_size => Setting.attachment_max_size.to_i.kilobytes,
|
||||||
|
:max_file_size_message => l(:error_attachment_too_big, :max_size => number_to_human_size(Setting.attachment_max_size.to_i.kilobytes)),
|
||||||
|
:max_concurrent_uploads => Redmine::Configuration['max_concurrent_ajax_uploads'].to_i,
|
||||||
|
:upload_path => uploads_path(:format => 'js', :project => project),
|
||||||
|
:description_placeholder => l(:label_optional_description),
|
||||||
|
:field_is_public => l(:field_is_public),
|
||||||
|
:are_you_sure => l(:text_are_you_sure),
|
||||||
|
:file_count => l(:label_file_count),
|
||||||
|
:delete_all_files => l(:text_are_you_sure_all)
|
||||||
|
} %>
|
||||||
|
<!--<span id="upload_file_count">-->
|
||||||
|
<!--<%#= l(:label_no_file_uploaded) %>-->
|
||||||
|
<!--</span>-->
|
||||||
|
<!--(<%#= l(:label_max_size) %>:-->
|
||||||
|
<%#= number_to_human_size(Setting.attachment_max_size.to_i.kilobytes) %>
|
||||||
|
<!--)-->
|
||||||
|
</span>
|
||||||
|
|
||||||
|
<% content_for :header_tags do %>
|
||||||
|
<%= javascript_include_tag 'attachments' %>
|
||||||
|
<% end %>
|
||||||
|
</div>
|
@ -0,0 +1,15 @@
|
|||||||
|
<div><img src="images/post_portrait.jpg" width="75" height="75" alt="贴吧图片" id="forum_image" class="mr10 fl" />
|
||||||
|
<a href="javascript:void(0)" class="upImg linkGrey2 fl" onclick="open_upload_diaglog();">上传图片</a>
|
||||||
|
<div class="cl"></div>
|
||||||
|
</div>
|
||||||
|
<div class="mt15">
|
||||||
|
<input type="text" name="postName" class="postCreateInput" placeholder="输入贴吧名称" />
|
||||||
|
</div>
|
||||||
|
<div class="mt15">
|
||||||
|
<input type="text" name="postName" class="postCreateInput" placeholder="输入贴吧描述" />
|
||||||
|
</div>
|
||||||
|
<div class="mt10">
|
||||||
|
<div class="fr"><a href="javascript:void(0);" class="submit_btn">确定</a></div>
|
||||||
|
<div class="fr"><a href="javascript:void(0);" class="linkGrey2 mr10" onclick="$('#new_forum_div').slideToggle();$('#create_btn').parent().slideToggle();">取消</a><span class="mr10 fontGrey">或</span></div>
|
||||||
|
<div class="cl"></div>
|
||||||
|
</div>
|
@ -1,57 +1,38 @@
|
|||||||
<!-- added by fq -->
|
|
||||||
<div class="forums-list">
|
|
||||||
<% if forums.any? %>
|
<% if forums.any? %>
|
||||||
<% forums.each do |forum| %>
|
<% forums.each do |forum| %>
|
||||||
<div class="forums-index">
|
<div class="postRow">
|
||||||
<div class="forums-inex-avatar">
|
<div class="postPortrait"><a href="javascript:void(0);" class="linkGrey2">
|
||||||
<%= forum.creator.nil? ? (link_to image_tag(url_to_avatar(forum.creator), :class => "avatar")) : (link_to image_tag(url_to_avatar(forum.creator), :class => "avatar"), user_path(forum.creator)) %>
|
<%= link_to image_tag(url_to_avatar(forum.creator),:width=>75,:height => 75 ),user_path( forum.creator) %>
|
||||||
</div>
|
</div>
|
||||||
<div class="forums-index-content">
|
<div class="postWrap">
|
||||||
<table class="content-text-list" style="table-layout: fixed;">
|
<div class="postTitle">
|
||||||
<tr>
|
<!--<a href="javascript:void(0);" class="f16 linkBlue">新手讨论吧</a>-->
|
||||||
<td valign="top" width="500px" class=" <%= forum.sticky? ? 'sticky' : '' %><%= forum.locked? ? 'locked' : '' %>" style="word-break: break-all;word-wrap: break-word;">
|
<%= link_to forum.name, forum_path(forum),:class=>"f16 linkBlue" %>
|
||||||
<p >
|
</div>
|
||||||
<%= link_to h(forum.name), forum_path(forum) %>
|
<div class="postDes">描述<%= textAreailizable forum.description%></div>
|
||||||
</p>
|
<div class="postCreater">创建者:<a href="<%= user_path( forum.creator)%>" class="linkGrey2" target="_blank"><%= forum.creator.name %></a></div>
|
||||||
</td>
|
<div class="postDate">创建时间:<%= format_date(forum.created_at) %></div>
|
||||||
</tr>
|
</div>
|
||||||
<tr>
|
<div class="postStatics">
|
||||||
<td style="word-break: break-all;word-wrap: break-word;" class="upload_img">
|
<div>
|
||||||
<p>
|
<!--<a href="javascript:void(0);" class="linkGrey5 fb">280</a>-->
|
||||||
<%= textAreailizable forum.description%>
|
<%= link_to (forum.memo_count), forum_path(forum),:class=>"linkGrey5 fb" %>
|
||||||
</p>
|
</div>
|
||||||
</td>
|
<div>帖子</div>
|
||||||
</tr>
|
</div>
|
||||||
<tr>
|
<div class="slice"></div>
|
||||||
<td style="word-break: break-all;word-wrap: break-word;">
|
<div class="postStatics mr20">
|
||||||
<p >
|
<div>
|
||||||
<%= authoring forum.created_at, forum.creator %>
|
<!--<a href="javascript:void(0);" class="linkGrey5 fb">335</a>-->
|
||||||
</p>
|
<%= link_to (forum.topic_count), forum_path(forum),:class=>"linkGrey5 fb" %>
|
||||||
</td>
|
</div>
|
||||||
</tr>
|
<div>回答</div>
|
||||||
</table>
|
</div>
|
||||||
</div>
|
<div class="cl"></div>
|
||||||
<div class="forums-index-count">
|
</div>
|
||||||
<table class="forums-count-color">
|
|
||||||
<tr class="forums-count-color" align="center">
|
|
||||||
<td>
|
|
||||||
<%= link_to (forum.memo_count), forum_path(forum) %>
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
<%= link_to (forum.topic_count), forum_path(forum) %>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr align="center">
|
|
||||||
<td>回答</td>
|
|
||||||
<td>帖子</td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<% end %>
|
<% end %>
|
||||||
<div class="pagination" style="margin-top: 10px;">
|
|
||||||
<%= pagination_links_full @forums_pages, @forums_count %>
|
|
||||||
</div>
|
|
||||||
<% else %>
|
<% else %>
|
||||||
<% end %>
|
<%= render :partial => "layouts/no_content" %>
|
||||||
</div>
|
<% end %>
|
@ -1,47 +1,31 @@
|
|||||||
<script>$(function(){$("img").removeAttr("alt");});</script>
|
|
||||||
<div class="borad-topic-count">共有 <%=link_to @forum.memos.count %> 个贴子</div>
|
|
||||||
<div style="padding-top: 10px">
|
<div style="padding-top: 10px">
|
||||||
<% if memos.any? %>
|
<% if memos.any? %>
|
||||||
<% memos.each do |topic| %>
|
<% memos.each do |topic| %>
|
||||||
<table class="content-text-list">
|
<div class="postDetailRow">
|
||||||
<tr>
|
<div class="postDetailPortrait">
|
||||||
<td colspan="2" valign="top" style="width: 50px;">
|
<!--<img src="images/homepageImage.jpg" width="50" height="50" alt="贴吧图片" /></a>-->
|
||||||
<%= link_to image_tag(url_to_avatar(topic.author), :class => "avatar"), user_path(topic.author) if topic.author%>
|
<%= link_to image_tag(url_to_avatar(topic.author), :width => 50,:height => 50,:alt => '贴吧图片'), user_path(topic.author) if topic.author%>
|
||||||
</td>
|
</div>
|
||||||
<td>
|
<div class="postDetailWrap">
|
||||||
<table width="630px" border="0">
|
<div class="postDetailTitle"><a href="<%= forum_memo_path(topic.forum, topic) %>" class="f14 linkGrey4 fb"><%=topic.subject%></a></div>
|
||||||
<tr>
|
<div class="postDetailDes"><%= topic.content.html_safe%>
|
||||||
<td valign="top" width="500px" class="<%= topic.sticky ? 'sticky' : '' %> <%= topic.locked? ? 'locked' : '' %>"><%= link_to h(topic.subject), forum_memo_path(topic.forum, topic) %></td>
|
<!--<a href="javascript:void(0);" class="linkBlue2 underline ml8">显示全部</a>-->
|
||||||
<td align="right" rowspan="3">
|
</div>
|
||||||
<table class="borad-count">
|
<% author = topic.last_reply.try(:author)%>
|
||||||
<tr>
|
<% if author%>
|
||||||
<td align="center" class="borad-count-digit"><%= link_to (topic.replies_count), forum_memo_path(topic.forum, topic) %></td>
|
<div class="postDetailCreater">最后回复:<a href="<%= user_path(author) %>" class="linkBlue2" target="_blank"><%= author.name%></a></div>
|
||||||
</tr>
|
<div class="postDetailDate"><%= format_date(topic.last_reply.created_at)%></div>
|
||||||
<tr>
|
<% end%>
|
||||||
<td align="center">回答</td>
|
|
||||||
</tr>
|
</div>
|
||||||
</table></td>
|
<div class="postDetailReply">
|
||||||
</tr>
|
<a href="javascript:void(0);" class="postReplyIcon mr5" target="_blank"></a>
|
||||||
<tr>
|
<%= link_to (topic.replies_count), forum_memo_path(topic.forum, topic),:target =>'_blank',:class=>'linkGrey2' %>
|
||||||
<td colspan="2" ><span class="font_description"> </span></td>
|
</div>
|
||||||
</tr>
|
<div class="cl"></div>
|
||||||
<tr>
|
</div>
|
||||||
<td align="left" colspan="2" ><span class="font_lighter"><%= authoring topic.created_at, topic.author %>
|
|
||||||
<span class="font_description2">
|
|
||||||
<% author = topic.last_reply.try(:author)%>
|
|
||||||
<% if author%>
|
|
||||||
最后回复:<%=link_to_user author %>
|
|
||||||
<% end%>
|
|
||||||
</span>
|
|
||||||
<br />
|
|
||||||
</span></td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
<% end %>
|
<% end %>
|
||||||
<div class="pagination"><%= pagination_links_full @topic_pages, @topic_count %></div>
|
|
||||||
<% else %>
|
<% else %>
|
||||||
<p class="nodata"><%= l(:label_no_data) %></p>
|
<p class="nodata"><%= l(:label_no_data) %></p>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
@ -0,0 +1 @@
|
|||||||
|
$('#new_forum_div').slideToggle();$('#create_btn').parent().slideToggle();
|
@ -0,0 +1,2 @@
|
|||||||
|
$("#forum_tag_list").html("<%= escape_javascript( render :partial=>'forum_tag_list',:locals=>{:forum=>@forum}) %>");
|
||||||
|
$('#add_tag01').hide();
|
@ -1,48 +1,118 @@
|
|||||||
<% @nav_dispaly_home_path_label = 1
|
<script>
|
||||||
@nav_dispaly_main_course_label = 1
|
function add_class(id){
|
||||||
@nav_dispaly_main_project_label = 1
|
if($("#"+id).hasClass("sortArrowActiveD")){
|
||||||
@nav_dispaly_main_contest_label = 1 %>
|
$("#"+id).removeClass("sortArrowActiveD");
|
||||||
<!-- added by fq -->
|
$("#"+id).addClass("sortArrowActiveU");
|
||||||
<div class="top-content">
|
$.ajax({
|
||||||
<table width="940px">
|
type: 'GET',
|
||||||
<tr>
|
url: '<%= forums_path %>' + '.js?' + id + '=asc&page='+<%= @forums_pages.page%>
|
||||||
<td class="info_font" style="width: 220px; color: #15bccf">公共贴吧 </td>
|
|
||||||
<td class="location-list">
|
});
|
||||||
<strong>
|
}else if($("#"+id).hasClass("sortArrowActiveU")){
|
||||||
<%= l(:label_user_location) %> :
|
$("#"+id).removeClass("sortArrowActiveU");
|
||||||
</strong>
|
$("#"+id).addClass("sortArrowActiveD");
|
||||||
</td>
|
$.ajax({
|
||||||
<td rowspan="2">
|
type: 'GET',
|
||||||
<% if User.current.logged? %>
|
url: '<%= forums_path %>' + '.js?' + id + '=desc&page='+<%= @forums_pages.page%>
|
||||||
<%= link_to( l(:label_forum_new), new_forum_path, :class => 'icon icon-add') %>
|
|
||||||
<% end %>
|
});
|
||||||
</td>
|
}else{
|
||||||
<td rowspan="2" width="250px" >
|
$("#"+id).addClass("sortArrowActiveD");
|
||||||
<div class="top-content-search">
|
$.ajax({
|
||||||
<%#= form_tag(:controller => 'forums', :action => "search_forum", :method => :get) do %>
|
type: 'GET',
|
||||||
<%#= text_field_tag 'name', params[:name], :size => 20 %>
|
url: '<%= forums_path %>' + '.js?' + id + '=desc&page='+<%= @forums_pages.page%>
|
||||||
<%#= submit_tag l(:label_search), :class => "enterprise", :name => nil %>
|
|
||||||
<%# end %>
|
});
|
||||||
</div>
|
}
|
||||||
</td>
|
}
|
||||||
</tr>
|
$(function() {
|
||||||
<tr>
|
$("#complex").click(function(){
|
||||||
<td style="padding-left: 8px">
|
$("#reorder_popu").removeClass("sortArrowActiveU");
|
||||||
<a>
|
$("#reorder_popu").removeClass("sortArrowActiveD");
|
||||||
<%= link_to request.host()+"/forums", forums_path %>
|
$("#reorder_time").removeClass("sortArrowActiveD");
|
||||||
</a>
|
$("#reorder_time").removeClass("sortArrowActiveU");
|
||||||
</td>
|
add_class("reorder_complex");
|
||||||
<td >
|
});
|
||||||
<%= link_to l(:field_homepage), home_path %> >
|
$("#popu").click(function () {
|
||||||
<%= link_to "公共贴吧", forums_path %>
|
$("#reorder_complex").removeClass("sortArrowActiveD");
|
||||||
</td>
|
$("#reorder_complex").removeClass("sortArrowActiveU");
|
||||||
</tr>
|
$("#reorder_time").removeClass("sortArrowActiveD");
|
||||||
</table>
|
$("#reorder_time").removeClass("sortArrowActiveU");
|
||||||
</div>
|
add_class("reorder_popu");
|
||||||
<% if @forums.size > 0 %>
|
});
|
||||||
<%= render :partial => 'forums/forum_list', :locals => {:forums => @forums} %>
|
$("#time").click(function () {
|
||||||
<% else %>
|
$("#reorder_complex").removeClass("sortArrowActiveD");
|
||||||
<%= render :partial => "layouts/no_content" %>
|
$("#reorder_complex").removeClass("sortArrowActiveU");
|
||||||
<% end %>
|
$("#reorder_popu").removeClass("sortArrowActiveU");
|
||||||
|
$("#reorder_popu").removeClass("sortArrowActiveD");
|
||||||
|
add_class("reorder_time");
|
||||||
|
});
|
||||||
|
});
|
||||||
|
function check_and_submit(doc){
|
||||||
|
$("#error").hide();
|
||||||
|
if( $("input[name='forum[name]']").val().trim == "" || $("input[name='forum[description]']").val().trim == ""){
|
||||||
|
$("#error").html("名称和描述未填写正确").show();
|
||||||
|
return;
|
||||||
|
}else{
|
||||||
|
doc.parent().parent().submit();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function check_forum_name(){
|
||||||
|
name = $("input[name='forum[name]']").val().trim();
|
||||||
|
if( name != ""){
|
||||||
|
$.get(
|
||||||
|
'<%= check_forum_name_forums_path %>',
|
||||||
|
{"forum_name":name},
|
||||||
|
function(data){
|
||||||
|
|
||||||
<%html_title l(:label_forum)%>
|
if( data == 'true'){
|
||||||
|
$("#error").html("贴吧名称已经存在").show();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function hideError(){
|
||||||
|
$("#error").html("").hide();
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<div class="homepageContentContainer mb10">
|
||||||
|
<div class="homepageContent">
|
||||||
|
<div class="postContainer">
|
||||||
|
<div id="new_forum_div" class="mb5" style="display: none">
|
||||||
|
<div class="red fl mb10" id="error" style="display: none">error</div>
|
||||||
|
<%= form_tag({:controller => 'forums',:action=>'create',:format=>'js'},:method => 'post',:remote=>'true') do |f| %>
|
||||||
|
<div class="mt15">
|
||||||
|
<input type="text" name="forum[name]" class="postCreateInput" onfocus="hideError();" onblur="check_forum_name();" placeholder="输入贴吧名称" />
|
||||||
|
</div>
|
||||||
|
<div class="mt15">
|
||||||
|
<input type="text" name="forum[description]" class="postCreateInput" placeholder="输入贴吧描述" />
|
||||||
|
</div>
|
||||||
|
<div class="mt10">
|
||||||
|
<div class="fr"><a href="javascript:void(0);" class="submit_btn" onclick="check_and_submit($(this));">确定</a></div>
|
||||||
|
<div class="fr"><a href="javascript:void(0);" class="linkGrey2 mr10" onclick=" $('#error').hide();$('#new_forum_div').slideToggle();$('#create_btn').parent().slideToggle();">取消</a><span class="mr10 fontGrey">或</span></div>
|
||||||
|
<div class="cl"></div>
|
||||||
|
</div>
|
||||||
|
<% end %>
|
||||||
|
</div>
|
||||||
|
<div class="postBanner">
|
||||||
|
<div class="postSort" id="complex"><a href="javascript:void(0);" class="linkGrey2 fl">综合</a><a href="javascript:void(0);" id="reorder_complex" class="sortArrowActiveD"></a></div>
|
||||||
|
<div class="postSort" id="popu"><a href="javascript:void(0);" class="linkGrey2 fl">人气</a><a href="javascript:void(0)" id="reorder_popu" ></a></div>
|
||||||
|
<div class="postSort" id="time"><a href="javascript:void(0);" class="linkGrey2 fl">时间</a><a href="javascript:void(0)" id="reorder_time" ></a></div>
|
||||||
|
<div class="creatPost"><a href="javascript:void(0);" id="create_btn" class="c_white db creatPostIcon bBlue" onclick="$('#error').hide();$('#new_forum_div').slideToggle();$(this).parent().slideToggle();">新建贴吧</a></div>
|
||||||
|
<div class="cl"></div>
|
||||||
|
</div>
|
||||||
|
<div id="forum_list">
|
||||||
|
<%= render :partial => 'forum_list',:locals => {:forums=>@forums}%>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="pagination fr" style="margin-top: 10px;">
|
||||||
|
<%= pagination_links_full @forums_pages, @forums_count %>
|
||||||
|
</div>
|
||||||
|
<div class="cl"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
@ -0,0 +1 @@
|
|||||||
|
$("#forum_list").html("<%= escape_javascript(render :partial => 'forum_list',:locals => {:forums=>@forums}) %>");
|
@ -1,42 +1,104 @@
|
|||||||
<!-- added by fq -->
|
<script>
|
||||||
<div id="add-memo" class='lz' style="<% unless @memo.errors.any?%>display: none;<% end %> padding: 20px;">
|
function add_class(id){
|
||||||
<h3>
|
if($("#"+id).hasClass("sortArrowActiveD")){
|
||||||
<%=l(:label_memo_new)%>
|
$("#"+id).removeClass("sortArrowActiveD");
|
||||||
</h3>
|
$("#"+id).addClass("sortArrowActiveU");
|
||||||
<% if User.current.logged? %>
|
$.ajax({
|
||||||
<%= labelled_form_for(@memo, :url => create_memo_forum_path(@forum), :html => {:multipart => true} ) do |f| %>
|
type: 'GET',
|
||||||
<div class="actions" style="max-width:680px">
|
url: '<%= forums_path+"/"+@forum.id.to_s %>' + '.js?' + id + '=asc&page='+<%= @topic_pages.page%>
|
||||||
<%= hidden_field_tag :asset_id,params[:asset_id],:required => false,:style => 'display:none' %>
|
|
||||||
<p>
|
});
|
||||||
<%= f.text_field :subject, :required => true, :maxlength => 50%>
|
}else if($("#"+id).hasClass("sortArrowActiveU")){
|
||||||
</p>
|
$("#"+id).removeClass("sortArrowActiveU");
|
||||||
<p style="max-width:680px">
|
$("#"+id).addClass("sortArrowActiveD");
|
||||||
<%= f.kindeditor :content, :required => true %>
|
$.ajax({
|
||||||
</p>
|
type: 'GET',
|
||||||
<!--<script type="text/javascript">var ckeditor=CKEDITOR.replace('editor02');</script>-->
|
url: '<%= forums_path+"/"+@forum.id.to_s %>' + '.js?' + id + '=desc&page='+<%= @topic_pages.page%>
|
||||||
<p style="color: #ff0000">
|
|
||||||
(<%= l(:label_memos_max_length) %>)
|
});
|
||||||
</p>
|
}else{
|
||||||
<p class="fl" style="margin-top: 5px;">
|
$("#"+id).addClass("sortArrowActiveD");
|
||||||
<%= l(:label_attachment_plural) %>
|
$.ajax({
|
||||||
<br />
|
type: 'GET',
|
||||||
<%= render :partial => 'attachments/form', :locals => {:container => @memo} %>
|
url: '<%= forums_path+"/"+@forum.id.to_s %>' + '.js?' + id + '=desc&page='+<%= @topic_pages.page%>
|
||||||
</p>
|
|
||||||
<div class="cl"></div>
|
});
|
||||||
<%= f.submit :value => l(:label_memo_create) %>
|
}
|
||||||
<%= link_to l(:button_cancel), "#", :onclick => '$("#add-memo").hide(); return false;' %>
|
}
|
||||||
</div>
|
$(function() {
|
||||||
<% end %>
|
$("#complex").click(function(){
|
||||||
<% end %>
|
$("#reorder_popu").removeClass("sortArrowActiveU");
|
||||||
|
$("#reorder_popu").removeClass("sortArrowActiveD");
|
||||||
|
$("#reorder_time").removeClass("sortArrowActiveD");
|
||||||
|
$("#reorder_time").removeClass("sortArrowActiveU");
|
||||||
|
add_class("reorder_complex");
|
||||||
|
});
|
||||||
|
$("#popu").click(function () {
|
||||||
|
$("#reorder_complex").removeClass("sortArrowActiveD");
|
||||||
|
$("#reorder_complex").removeClass("sortArrowActiveU");
|
||||||
|
$("#reorder_time").removeClass("sortArrowActiveD");
|
||||||
|
$("#reorder_time").removeClass("sortArrowActiveU");
|
||||||
|
add_class("reorder_popu");
|
||||||
|
});
|
||||||
|
$("#time").click(function () {
|
||||||
|
$("#reorder_complex").removeClass("sortArrowActiveD");
|
||||||
|
$("#reorder_complex").removeClass("sortArrowActiveU");
|
||||||
|
$("#reorder_popu").removeClass("sortArrowActiveU");
|
||||||
|
$("#reorder_popu").removeClass("sortArrowActiveD");
|
||||||
|
add_class("reorder_time");
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
function check_and_submit(){
|
||||||
|
if($("input[name='memo[subject]']").val().trim() != "" && $("input[name='memo[content]']").val().trim() != ""){
|
||||||
|
$("#new_memo").submit();
|
||||||
|
}else{
|
||||||
|
$("#error").html("主题和内容不能为空").show();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
<div class="postRightContainer">
|
||||||
|
<div id="create_memo_div" style="display: none">
|
||||||
|
<div id="error" class="red fl mb10" style="display: none">error</div>
|
||||||
|
<%= labelled_form_for(@memo, :url => forum_memos_path(@forum)) do |f| %>
|
||||||
|
<div>
|
||||||
|
<input type="text" name="memo[subject]" onfocus="$('#error').hide();" onmouseover="this.style.borderColor='#d9d9d9'" class="postDetailInput" placeholder="输入帖子标题" />
|
||||||
|
</div>
|
||||||
|
<div class="mt15">
|
||||||
|
<input type="text" name="memo[content]" onfocus="$('#error').hide();" onmouseover="this.style.borderColor='#d9d9d9'" class="postDetailInput" placeholder="输入贴子内容" />
|
||||||
|
</div>
|
||||||
|
<div class="mt10">
|
||||||
|
<!--<a href="javascript:void(0);" class="AnnexBtn fl mt3">上传附件</a>-->
|
||||||
|
<%= render :partial => 'file_form', :locals => {:container => @memo} %>
|
||||||
|
<div class="fr">
|
||||||
|
<a href="javascript:void(0);" class="submit_btn" onclick="check_and_submit();">确定</a>
|
||||||
|
</div>
|
||||||
|
<div class="fr"><a href="javascript:void(0);" class="linkGrey2 mr10" onclick="$('#create_memo_div').slideToggle();$('#create_memo_btn').slideToggle();">取消</a><span class="mr10 fontGrey">或</span></div>
|
||||||
|
<div class="cl"></div>
|
||||||
|
</div>
|
||||||
|
<% end %>
|
||||||
|
</div>
|
||||||
|
<div class="postDetailBanner">
|
||||||
|
<div class="postSort" id="complex"><a href="javascript:void(0);" class="linkGrey2 fl">综合</a><a href="javascript:void(0);" id="reorder_complex" class="sortArrowActiveU"></a><!--<a href="javascript:void(0);" class="sortArrowActiveD"></a>--></div>
|
||||||
|
<div class="postSort" id="popu"><a href="javascript:void(0);" class="linkGrey2 fl">人气</a><a href="javascript:void(0);" id="reorder_popu" class=""></a></div>
|
||||||
|
<div class="postSort" id="time"><a href="javascript:void(0);" class="linkGrey2 fl">时间</a><a href="javascript:void(0);" id="reorder_time" class=""></a></div>
|
||||||
|
<div class="creatPost" id="create_memo_btn"><a href="javascript:void(0);" class="c_white db creatPostIcon bBlue" onclick="$('#error').hide();$('#create_memo_div').slideToggle();$(this).parent().slideToggle();">发布新帖</a></div>
|
||||||
|
<div class="cl"></div>
|
||||||
|
</div>
|
||||||
|
<div id="topics_list">
|
||||||
|
<%= render :partial => 'show_topics',:locals => {:memos=>@memos}%>
|
||||||
|
</div>
|
||||||
|
<div class="pagination" style="float: right"><%= pagination_links_full @topic_pages, @topic_count %></div>
|
||||||
|
|
||||||
|
<!--<div class="pageRoll">-->
|
||||||
|
<!--<div class="pageCell"><a href="javascript:void(0);" class="linkBlue">上一页</a></div>-->
|
||||||
|
<!--<div class="pageCell pageCellActive"><a href="javascript:void(0);" class="c_white">1</a></div>-->
|
||||||
|
<!--<div class="pageCell"><a href="javascript:void(0);" class="fontBlue">2</a></div>-->
|
||||||
|
<!--<div class="pageCell"><a href="javascript:void(0);" class="fontBlue">3</a></div>-->
|
||||||
|
<!--<div class="pageCell"><a href="javascript:void(0);" class="fontBlue">...</a></div>-->
|
||||||
|
<!--<div class="pageCell"><a href="javascript:void(0);" class="fontBlue">14</a></div>-->
|
||||||
|
<!--<div class="pageCell"><a href="javascript:void(0);" class="linkBlue">下一页</a></div>-->
|
||||||
|
<!--</div>-->
|
||||||
|
<!--<div class="cl"></div>-->
|
||||||
</div>
|
</div>
|
||||||
<!--modified by huang-->
|
</div>
|
||||||
<span class="contextual-borad">
|
|
||||||
<%= link_to(image_tag('edit.png')+l(:label_forum_edit),{:action => 'edit', :id => @forum}, :method => 'get', :title => l(:button_edit)) if @forum.editable_by?(User.current) %>
|
|
||||||
<%= link_to(image_tag('delete.png')+'删除讨论区', {:action => 'destroy', :id => @forum}, :method => :delete, :data => {:confirm => l(:text_are_you_sure)}, :title => l(:button_delete)
|
|
||||||
) if @forum.destroyable_by?(User.current) %>
|
|
||||||
</span>
|
|
||||||
<span>
|
|
||||||
<%= link_to l(:label_memo_new_from_forum), new_forum_memo_path(@forum), :class => 'icon icon-add',
|
|
||||||
:onclick => 'showAndScrollTo("add-memo", "memo_subject"); return false;' if User.current.logged? %>
|
|
||||||
</span>
|
|
||||||
<%= render :partial => 'forums/show_topics', :locals => {:memos => @memos} %>
|
|
@ -0,0 +1 @@
|
|||||||
|
$("#topics_list").html("<%= escape_javascript(render :partial => 'show_topics',:locals => {:memos=>@memos})%>")
|
@ -0,0 +1,71 @@
|
|||||||
|
<div class="mt10 fl" >
|
||||||
|
<% for attachment in attachments %>
|
||||||
|
<!--<p style="width: 100%;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;">-->
|
||||||
|
<!--<div style="max-width:55%;white-space: nowrap; overflow: hidden; text-overflow: ellipsis;float: left;">-->
|
||||||
|
<!--<span title="<%#= attachment.filename%>" id = "attachment_">-->
|
||||||
|
<% if options[:length] %>
|
||||||
|
<span class="pic_files fl "></span>
|
||||||
|
<%= link_to_short_attachment attachment, :class => 'fl FilesName02', :download => true,:length => options[:length] -%>
|
||||||
|
<a class="fl FilesName02"> (<%= number_to_human_size attachment.filesize , :precision => 0 %>)</a>
|
||||||
|
<% if options[:deletable] %>
|
||||||
|
<%#= link_to image_tag('delete.png'), attachment_path(attachment),
|
||||||
|
:data => {:confirm => l(:text_are_you_sure)},
|
||||||
|
:method => :delete,
|
||||||
|
:class => 'delete',
|
||||||
|
#:remote => true,
|
||||||
|
#:id => "attachments_" + attachment.id.to_s,
|
||||||
|
:title => l(:button_delete) %>
|
||||||
|
<span class="pic_del fl "> <a href="<%=attachment_path(attachment) %>" onclick="confirm(<%=l(:text_are_you_sure) %>)" data-method="delete"> </a></span>
|
||||||
|
<% end %>
|
||||||
|
<div class="cl"></div>
|
||||||
|
<% else %>
|
||||||
|
<span class="pic_files fl "></span>
|
||||||
|
<%= link_to_short_attachment attachment, :class => 'fl FilesName02', :download => true, :length => 32 -%>
|
||||||
|
<a href="javascript:void(0);" class="fl FilesName02"> (<%= number_to_human_size attachment.filesize , :precision => 0 %>)</a>
|
||||||
|
<% if options[:deletable] %>
|
||||||
|
<%#= link_to image_tag('delete.png'), attachment_path(attachment),
|
||||||
|
:data => {:confirm => l(:text_are_you_sure)},
|
||||||
|
:method => :delete,
|
||||||
|
:class => 'delete',
|
||||||
|
#:remote => true,
|
||||||
|
#:id => "attachments_" + attachment.id.to_s,
|
||||||
|
:title => l(:button_delete) %>
|
||||||
|
<a href="<%=attachment_path(attachment) %>" onclick="confirm(<%=l(:text_are_you_sure) %>)" data-method="delete"> <span class="pic_del fl "></span> </a>
|
||||||
|
<% end %>
|
||||||
|
<div class="cl"></div>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
|
<% if attachment.is_text? %>
|
||||||
|
<%= link_to image_tag('magnifier.png'),
|
||||||
|
:controller => 'attachments',
|
||||||
|
:action => 'show',
|
||||||
|
:id => attachment,
|
||||||
|
:filename => attachment.filename%>
|
||||||
|
<% end %>
|
||||||
|
<!--<span title="<%#= attachment.description%>">-->
|
||||||
|
<!--<%#= h(truncate(" - #{attachment.description}", length: options[:length] ? options[:length]:15, omission: '...')) unless attachment.description.blank? %>-->
|
||||||
|
<!--</span>-->
|
||||||
|
|
||||||
|
<!--<%# if options[:wrap] %>-->
|
||||||
|
<!--<br/>-->
|
||||||
|
<!-- -->
|
||||||
|
<!--<%# end %>-->
|
||||||
|
<!--<%# if options[:author] %>-->
|
||||||
|
<!--<span class="author" title="<%#= attachment.author%>">-->
|
||||||
|
<%#= link_to h(truncate(attachment.author.name, length: 10, omission: '...')),user_path(attachment.author) %>
|
||||||
|
<!--<%#= format_time(attachment.created_on) %>-->
|
||||||
|
<!--</span>-->
|
||||||
|
<!--<%# end %>-->
|
||||||
|
<!--</p>-->
|
||||||
|
<% end %>
|
||||||
|
<% if defined?(thumbnails) && thumbnails %>
|
||||||
|
<% images = attachments.select(&:thumbnailable?) %>
|
||||||
|
<% if images.any? %>
|
||||||
|
<div class="pro_pic mb10" width="100" height="73">
|
||||||
|
<% images.each do |attachment| %>
|
||||||
|
<div><%= thumbnail_tag(attachment) %></div>
|
||||||
|
<% end %>
|
||||||
|
</div>
|
||||||
|
<% end %>
|
||||||
|
<% end %>
|
||||||
|
</div>
|
@ -0,0 +1,36 @@
|
|||||||
|
<!-- get_praise_num(obj,1)函数中 1代表返回顶得次数 0返回踩的次数 -->
|
||||||
|
<% if User.current.logged? %>
|
||||||
|
<% if horizontal %>
|
||||||
|
<!-- 横排 -->
|
||||||
|
<div id="praise_tread_<%= obj.id %>" style="float:right;">
|
||||||
|
<% @is_valuate = is_praise_or_tread(obj,user_id)%>
|
||||||
|
<% if @is_valuate.size > 0 %> <!-- 评价过 1代表赞 0代表踩 -->
|
||||||
|
<% @flag = @is_valuate.first.praise_or_tread %>
|
||||||
|
<% if @flag == 1 %> <!-- 顶过 --><!-- modified by bai -->
|
||||||
|
<a href="javascript:void(0);" class="linkGrey2 postLikeIcon" title="<%= l(:label_issue_praise_over)%>" > <%= get_praise_num(obj)%></a>
|
||||||
|
<% end %>
|
||||||
|
<% else %>
|
||||||
|
<% if user_id == obj.author_id %>
|
||||||
|
|
||||||
|
<!--<%#= image_tag "/images/praise_tread/praise_true.png" , weight:"22px", height:"22px",:title => l(:label_issue_not_praise_over) %>-->
|
||||||
|
<a href="javascript:void(0);" class="linkGrey2 postLikeIcon" title="<%= l(:label_issue_not_praise_over)%>" > <%= get_praise_num(obj)%></a>
|
||||||
|
|
||||||
|
<% else %>
|
||||||
|
<!-- 积分少于2分不能踩帖 -->
|
||||||
|
<%# if OptionNumber.get_user_option_number(user_id).nil? || OptionNumber.get_user_option_number(user_id).total_score < 2 %>
|
||||||
|
|
||||||
|
<%#= link_to image_tag("/images/praise_tread/praise_true.png",weight:"22px", height:"22px",:title => l(:label_issue_praise)),
|
||||||
|
:controller=>"praise_tread",:action=>"praise_plus",:remote=>true,:obj_id => obj.id,:obj_type => obj.class,:horizontal => horizontal %>
|
||||||
|
<a href="<%= praise_tread_praise_plus_path({:obj_id=>obj.id,:obj_type=>obj.class,:horizontal => horizontal })%>" data-remote="true" class="linkGrey2 postLikeIcon" title="<%= l(:label_issue_praise)%>" > <%= get_praise_num(obj)%></a>
|
||||||
|
<!--<%# else %>-->
|
||||||
|
|
||||||
|
<!--<%#= link_to image_tag("/images/praise_tread/praise_true.png",weight:"22px", height:"22px",:title => l(:label_issue_praise)),-->
|
||||||
|
<!--:controller=>"praise_tread",:action=>"praise_plus",:remote=>true,:obj_id => obj.id,:obj_type => obj.class,:horizontal => horizontal %>-->
|
||||||
|
<!--<a href="javascript:void(0);" class="linkGrey2 postLikeIcon" title="<%#= l(:label_issue_praise)%>" target="_blank"> <%#= get_praise_num(obj)%></a>-->
|
||||||
|
|
||||||
|
<!--<%# end %>-->
|
||||||
|
<% end %>
|
||||||
|
<% end %>
|
||||||
|
</div>
|
||||||
|
<% end %>
|
||||||
|
<% end %>
|
@ -1,188 +1,115 @@
|
|||||||
|
<%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg',"init_KindEditor","forum" %>
|
||||||
<style type="text/css">
|
<style type="text/css">
|
||||||
.reply_content p {
|
/*回复框*/
|
||||||
margin-top: 13px;
|
div.ke-toolbar{display:none;width:400px;border:none;background:none;padding:0px 0px;}
|
||||||
margin-bottom: 13px;
|
span.ke-toolbar-icon{line-height:26px;font-size:14px;padding-left:26px;}
|
||||||
}
|
span.ke-toolbar-icon-url{background-image:url( /images/public_icon.png )}
|
||||||
|
div.ke-toolbar .ke-outline{padding:0px 0px;line-height:26px;font-size:14px;}
|
||||||
|
span.ke-icon-emoticons{background-position:0px -671px;width:50px;height:26px;}
|
||||||
|
span.ke-icon-emoticons:hover{background-position:-79px -671px;width:50px;height:26px;}
|
||||||
|
div.ke-toolbar .ke-outline{border:none;}
|
||||||
|
/*.ke-container{height: 80px !important;}*/
|
||||||
</style>
|
</style>
|
||||||
<%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg' %>
|
<script>
|
||||||
<div class="lz">
|
init_KindEditor_data('',30);
|
||||||
<!-- 在这里添加赞和踩-->
|
</script>
|
||||||
<span id="praise_tread" style="float: right">
|
<div class="postRightContainer">
|
||||||
<%= render :partial => "/praise_tread/praise_tread",:locals => {:obj => @memo,:show_flag => true,:user_id =>User.current.id,:horizontal => true}%>
|
<div class="postThemeContainer">
|
||||||
|
<div class="postDetailPortrait">
|
||||||
|
<%= link_to image_tag(url_to_avatar(@memo.author),:width=>50,:height => 50,:alt=>'贴吧图像' ),user_path(@memo.author) %>
|
||||||
|
</div>
|
||||||
|
<div class="postThemeWrap">
|
||||||
|
<div class="postDetailTitle"><a href="javascript:void(0);" class="f14 linkGrey4 fb">主题: <%= @memo.subject%></a></div>
|
||||||
|
<div class="postDetailCreater"><a href="javascript:void(0);" class="linkBlue2" target="_blank"><%= @memo.author.name%></a></div>
|
||||||
|
<div class="postDetailDate mb5"><%= format_date( @memo.created_at)%></div>
|
||||||
|
<span id="praise_tread" style="float: right">
|
||||||
|
<%= render :partial => "memos/praise_tread",:locals => {:obj => @memo,:show_flag => true,:user_id =>User.current.id,:horizontal => true}%>
|
||||||
</span>
|
</span>
|
||||||
<div class="lz-left">
|
<div class="cl"></div>
|
||||||
<div>
|
<div class="fl fontGrey3">
|
||||||
<%= link_to image_tag(url_to_avatar(@memo.author), :class => "avatar"), user_path(@memo.author) %>
|
<%= @memo.content.html_safe%>
|
||||||
</div>
|
</div>
|
||||||
<p class="clearfix">
|
<div class="cl"></div>
|
||||||
<%=link_to @memo.author.name, user_path(@memo.author) %>
|
<div class="mt10 fl">
|
||||||
</p>
|
<% if @memo.attachments.any?%>
|
||||||
</div>
|
<% options = {:author => true, :deletable => @memo.deleted_attach_able_by?(User.current) } %>
|
||||||
<div class="memo-section">
|
<%= render :partial => 'attachments_links', :locals => {:attachments => @memo.attachments, :options => options, :is_float => true} %>
|
||||||
<div class="contextual-borad">
|
<% end %>
|
||||||
<!-- <%#= link_to(
|
</div>
|
||||||
image_tag('comment.png'),
|
</div>
|
||||||
{:action => 'quote', :id => @memo},
|
<div class="cl"></div>
|
||||||
:remote => true,
|
</div>
|
||||||
:method => 'get',
|
<div class="cl"></div>
|
||||||
:title => l(:button_quote)
|
<div class="homepagePostReply">
|
||||||
)if !@memo.locked? && User.current.logged? %> -->
|
<div nhname='new_message' style="display:none;">
|
||||||
<%= link_to(
|
<%= form_for(@memo_new, url: forum_memos_path, :html => {:multipart => true}) do |f|%>
|
||||||
l(:button_quote),
|
<%= f.hidden_field :subject, :required => true, value: @memo.subject %>
|
||||||
{:action => 'quote', :id => @memo},
|
<%= f.hidden_field :forum_id, :required => true, value: @memo.forum_id %>
|
||||||
:remote => true,
|
<%= f.hidden_field :parent_id, :required => true, value: @memo.id %>
|
||||||
:method => 'get',
|
<textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea' name="memo[content]"></textarea>
|
||||||
:title => l(:button_quote)
|
<p nhname='contentmsg'></p>
|
||||||
)if !@memo.locked? && User.current.logged? %>
|
<div nhname='toolbar_container' style="float:left;padding-top:3px;"></div>
|
||||||
|
<a id="new_message_cancel_btn" href="javascript:void(0)" class="grey_n_btn fr " style="margin-top:6px;">取消</a>
|
||||||
<%= link_to(
|
<a id="new_message_submit_btn" href="javascript:void(0)" class="blue_n_btn fr mr5 " style="margin-top:6px;">留言</a>
|
||||||
#image_tag('edit.png'),
|
<% end%>
|
||||||
l(:button_edit),
|
</div>
|
||||||
{:action => 'edit', :id => @memo},
|
<div class="cl"></div>
|
||||||
:method => 'get',
|
<% @replies.each do |reply| %>
|
||||||
:title => l(:button_edit)
|
<div class="homepagePostReplyContainer">
|
||||||
) if @memo.editable_by?(User.current) %>
|
<div class="homepagePostReplyPortrait">
|
||||||
<!-- <%#= link_to(
|
<!--<a href="javascript:void(0);"><img src="images/homepageImage.jpg" width="45" height="45" alt="用户头像" /></a>-->
|
||||||
image_tag('delete.png'),
|
<%= link_to image_tag(url_to_avatar(reply.author), :width => 45,:height => 45), user_path(reply.author) %>
|
||||||
{:action => 'destroy', :id => @memo},
|
</div>
|
||||||
:method => :delete,
|
<div class="homepagePostReplyDes">
|
||||||
:data => {:confirm => l(:text_are_you_sure)},
|
<div class="homepagePostReplyPublisher"><a href="<%=user_path(reply.author)%>" class="newsBlue mr10 f14"><%= reply.author.name%></a>
|
||||||
:title => l(:button_delete)
|
<% if reply.parent && reply.parent.id != @memo.id%>
|
||||||
) if @memo.destroyable_by?(User.current) %> -->
|
<span class="f14">回复</span><a href="<%= user_path(reply.parent.author)%>" class="newsBlue mr10 ml15 f14"><%= reply.parent.author.name%></a>
|
||||||
<%= link_to(
|
<% end %>
|
||||||
l(:button_delete),
|
|
||||||
{:action => 'destroy', :id => @memo},
|
|
||||||
:method => :delete,
|
|
||||||
:data => {:confirm => l(:text_are_you_sure)},
|
|
||||||
:title => l(:button_delete)
|
|
||||||
) if @memo.destroyable_by?(User.current) %>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div> </div>
|
<%= format_date(reply.created_at)%>
|
||||||
|
<!--<a href="javascript:void(0);" class="replyGrey fr ml10" >删除</a>-->
|
||||||
|
<%= link_to(
|
||||||
|
l(:button_delete),
|
||||||
|
{:action => 'destroy', :id => reply},
|
||||||
|
:method => :delete,
|
||||||
|
:data => {:confirm => l(:text_are_you_sure)},
|
||||||
|
:title => l(:button_delete),:class=>'replyGrey fr ml10'
|
||||||
|
) if reply.destroyable_by?(User.current) %>
|
||||||
|
<a href="javascript:void(0);" class="newsBlue fr" nhname="reply_btn">回复</a></div>
|
||||||
|
<div class="homepagePostReplyContent"><%= reply.content.html_safe%></div>
|
||||||
|
<div nhname='div_form' class="mt10 ml80" style="display:none;">
|
||||||
|
<%= form_for(@memo_new, url: forum_memos_path, :method=>'post') do |f| %>
|
||||||
|
|
||||||
<div class="memo-title <%= @memo.sticky ? 'sticky' : '' %> <%= @memo.locked? ? 'locked' : '' %>"
|
<%= f.hidden_field :subject, :required => true, value: reply.subject %>
|
||||||
style="word-break: break-all;word-wrap: break-word;">
|
<%= f.hidden_field :forum_id, :required => true, value: reply.forum_id %>
|
||||||
<%= label_tag l(:field_subject) %>:
|
<%= f.hidden_field :parent_id, :required => true, value: reply.id %>
|
||||||
<%=h @memo.subject %>
|
<%= hidden_field_tag :quote,"",:required => false,:style => 'display:none' %>
|
||||||
</div>
|
<textarea name='memo[content]' style="display:none;"></textarea>
|
||||||
<div class="memo-content" id="memo-content_div">
|
<p nhname='contentmsg'></p>
|
||||||
<%= @memo.content.html_safe %>
|
<div nhname='toolbar_container' style="float:left;padding-top:3px;"></div>
|
||||||
<p>
|
<a nhname="cancel_btn" href="javascript:;" class="grey_n_btn fr" style="margin-top:3px;">取消</a>
|
||||||
<% if @memo.attachments.any?%>
|
<a nhname="submit_btn" href="javascript:;" class="blue_n_btn fr mr5" style="margin-top:3px;">发布</a>
|
||||||
<% options = {:author => true, :deletable => @memo.deleted_attach_able_by?(User.current) } %>
|
<% end %>
|
||||||
<%= render :partial => 'attachments/links', :locals => {:attachments => @memo.attachments, :options => options, :is_float => true} %>
|
<div class="cl"></div>
|
||||||
<% end %>
|
|
||||||
</p>
|
|
||||||
<div class="clearfix"></div>
|
|
||||||
</div>
|
|
||||||
<div class="memo-timestamp">
|
|
||||||
<%= authoring @memo.created_at, @memo.author %>
|
|
||||||
</div>
|
</div>
|
||||||
|
<div class="cl"></div>
|
||||||
</div>
|
</div>
|
||||||
<br />
|
<div class="cl"></div>
|
||||||
</div>
|
|
||||||
<div class="replies">
|
|
||||||
<h3 class="comments"><%= l(:label_reply_plural) %> (<%= @replies.nil? ? 0 : @replies.size %>)</h3>
|
|
||||||
<% pages_count = @reply_pages.offset %>
|
|
||||||
<% @replies.each do |reply| %>
|
|
||||||
<div class="reply" id="<%= "reply-#{reply.id}" %>">
|
|
||||||
<p class="font_lighter"><!--<span style="display: inline"><%#= pages_count += 1 %>楼 :</span>--></p>
|
|
||||||
<div class="contextual-borad">
|
|
||||||
<!-- <%#= link_to(
|
|
||||||
image_tag('comment.png'),
|
|
||||||
{:action => 'quote', :id => reply},
|
|
||||||
:remote => true,
|
|
||||||
:method => 'get',
|
|
||||||
:title => l(:button_quote)
|
|
||||||
)if !@memo.locked? && User.current.logged? %> -->
|
|
||||||
<%= link_to(
|
|
||||||
l(:button_quote),
|
|
||||||
{:action => 'quote', :id => reply},
|
|
||||||
:remote => true,
|
|
||||||
:method => 'get',
|
|
||||||
:title => l(:button_quote)
|
|
||||||
)if !@memo.locked? && User.current.logged? %>
|
|
||||||
|
|
||||||
<%= link_to(
|
|
||||||
#image_tag('edit.png'),
|
|
||||||
l(:button_edit),
|
|
||||||
{:action => 'edit', :id => reply},
|
|
||||||
:title => l(:button_edit)
|
|
||||||
) if reply.editable_by?(User.current) %>
|
|
||||||
<!-- <%#= link_to(
|
|
||||||
image_tag('delete.png'),
|
|
||||||
{:action => 'destroy', :id => reply},
|
|
||||||
:method => :delete,
|
|
||||||
:data => {:confirm => l(:text_are_you_sure)},
|
|
||||||
:title => l(:button_delete)
|
|
||||||
) if reply.destroyable_by?(User.current) %> -->
|
|
||||||
<%= link_to(
|
|
||||||
l(:button_delete),
|
|
||||||
{:action => 'destroy', :id => reply},
|
|
||||||
:method => :delete,
|
|
||||||
:data => {:confirm => l(:text_are_you_sure)},
|
|
||||||
:title => l(:button_delete)
|
|
||||||
) if reply.destroyable_by?(User.current) %>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
<br/>
|
|
||||||
<table class="borad-text-list" style="table-layout: fixed;">
|
|
||||||
<tr>
|
|
||||||
<td rowspan="3" valign="top" width="60px">
|
|
||||||
<%= link_to image_tag(url_to_avatar(reply.author), :class => "avatar"), user_path(reply.author) %>
|
|
||||||
</td>
|
|
||||||
<td class="comments" style="word-wrap: break-word;word-break: break-all;">
|
|
||||||
<div class="reply_content" >
|
|
||||||
<%=h sanitize(reply.content.html_safe) %>
|
|
||||||
</div>
|
|
||||||
<p>
|
|
||||||
<% if reply.attachments.any?%>
|
|
||||||
<% options = {:author => true, :deletable => reply.deleted_attach_able_by?(User.current) } %>
|
|
||||||
<%= render :partial => 'attachments/links', :locals => {:attachments => reply.attachments, :options => options, :is_float => true} %>
|
|
||||||
<% end %>
|
|
||||||
</p>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td class="font_lighter" style="float:right">
|
|
||||||
<%= authoring reply.created_at, reply.author %>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
</div>
|
|
||||||
<% end %>
|
|
||||||
<div class="pagination">
|
|
||||||
<%= pagination_links_full @reply_pages, @reply_count, :per_page_links => false %>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
<% end %>
|
||||||
|
<!--<div class="homepagePostReplyContainer borderBottomNone">-->
|
||||||
<% if User.current.login? %>
|
<!--<div class="homepagePostReplyPortrait"><a href="javascript:void(0);"><img src="images/homepageImage.jpg" width="45" height="45" alt="用户头像" /></a></div>-->
|
||||||
<div class="reply-box" style="">
|
<!--<div class="homepagePostReplyDes">-->
|
||||||
<%= render :partial => 'reply_box' %>
|
<!--<div class="homepagePostReplyPublisher">-->
|
||||||
</div>
|
<!--<a href="javascript:void(0);" class="newsBlue mr15 f14">linchun</a>-->
|
||||||
<% else %>
|
<!--<span class="f14">回复</span><a href="javascript:void(0);" class="newsBlue mr10 ml15 f14">Tangxiang</a>刚刚-->
|
||||||
<div style="font-size: 14px;margin:20px;">
|
<!--<a href="javascript:void(0);" class="replyGrey fr ml10">删除</a><a href="javascript:void(0);" class="newsBlue fr">回复</a></div>-->
|
||||||
<%= l(:label_user_login_tips) %>
|
<!--<div class="homepagePostReplyContent">点击设置就可以了。</div>-->
|
||||||
<%= link_to l(:label_user_login_new), signin_path %>
|
<!--</div>-->
|
||||||
<hr/>
|
<!--<div class="cl"></div>-->
|
||||||
</div>
|
<!--</div>-->
|
||||||
<% end %>
|
</div>
|
||||||
|
<div class="pagination">
|
||||||
|
<%= pagination_links_full @reply_pages, @reply_count, :per_page_links => false %>
|
||||||
<script type="text/javascript">
|
</div>
|
||||||
jQuery(document).ready(function($) {
|
</div>
|
||||||
transpotUrl('.lz');
|
|
||||||
transpotUrl('.replies');
|
|
||||||
});
|
|
||||||
window.onready = function() {
|
|
||||||
var maxwidth = $("#memo-content_div").width();
|
|
||||||
$("#memo-content_div").children().each(function(){
|
|
||||||
if($(this).width()>maxwidth)
|
|
||||||
{
|
|
||||||
$(this).width(maxwidth);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
};
|
|
||||||
$("img").removeAttr("align");
|
|
||||||
</script>
|
|
@ -1,4 +1,9 @@
|
|||||||
|
<% if @obj_type == 'Memo'%>
|
||||||
$('#praise_tread_<%= @obj.id %>').html('<%= j(
|
$('#praise_tread_<%= @obj.id %>').html('<%= j(
|
||||||
render :partial => "/praise_tread/praise_tread",:locals => {:obj => @obj,:user_id => User.current.id,:horizontal => @horizontal}
|
render :partial => "/memos/praise_tread",:locals => {:obj => @obj,:user_id => User.current.id,:horizontal => @horizontal}
|
||||||
)%>');
|
)%>');
|
||||||
|
<% else %>
|
||||||
|
$('#praise_tread_<%= @obj.id %>').html('<%= j(
|
||||||
|
render :partial => "/praise_tread/praise_tread",:locals => {:obj => @obj,:user_id => User.current.id,:horizontal => @horizontal}
|
||||||
|
)%>');
|
||||||
|
<% end %>
|
||||||
|
After Width: | Height: | Size: 2.3 KiB |
@ -0,0 +1,101 @@
|
|||||||
|
$(function(){
|
||||||
|
KindEditor.ready(function(K){
|
||||||
|
$("a[nhname='reply_btn']").live('click',function(){
|
||||||
|
var params = {};
|
||||||
|
params.kindutil = K;
|
||||||
|
params.container = $(this).parent().parent('div');
|
||||||
|
params.div_form = $("div[nhname='div_form']",params.container);
|
||||||
|
params.form = $("form",params.div_form);
|
||||||
|
params.textarea = $("textarea[name='memo[content]']",params.div_form);
|
||||||
|
//params.textarea.prev('div').css("height","60px");
|
||||||
|
params.contentmsg = $("p[nhname='contentmsg']",params.div_form);
|
||||||
|
params.toolbar_container = $("div[nhname='toolbar_container']",params.div_form);
|
||||||
|
params.cancel_btn = $("a[nhname='cancel_btn']",params.div_form);
|
||||||
|
params.submit_btn = $("a[nhname='submit_btn']",params.div_form);
|
||||||
|
params.height = 30;
|
||||||
|
if(params.textarea.data('init') == undefined){
|
||||||
|
params.editor = init_editor(params);
|
||||||
|
init_form(params);
|
||||||
|
params.cancel_btn.click(function(){
|
||||||
|
nh_reset_form(params);
|
||||||
|
toggleAndSettingWordsVal(params.div_form, params.textarea);
|
||||||
|
});
|
||||||
|
params.submit_btn.click(function(){
|
||||||
|
params.form.submit();
|
||||||
|
});
|
||||||
|
params.textarea.data('init',1);
|
||||||
|
}
|
||||||
|
params.cancel_btn.click();
|
||||||
|
setTimeout(function(){
|
||||||
|
if(!params.div_form.is(':hidden')){
|
||||||
|
params.textarea.show();
|
||||||
|
params.textarea.focus();
|
||||||
|
params.textarea.hide();
|
||||||
|
}
|
||||||
|
},300);
|
||||||
|
});
|
||||||
|
|
||||||
|
$("a[nhname='sub_reply_btn']").live('click',function(){
|
||||||
|
var params = {};
|
||||||
|
params.kindutil = K;
|
||||||
|
params.container = $(this).parent().parent('div');
|
||||||
|
params.div_form = $("div[nhname='sub_div_form']",params.container);
|
||||||
|
params.form = $("form",params.div_form);
|
||||||
|
params.textarea = $("textarea[name='user_notes']",params.div_form);
|
||||||
|
//params.textarea.prev('div').css("height","60px");
|
||||||
|
params.contentmsg = $("p[nhname='sub_contentmsg']",params.div_form);
|
||||||
|
params.toolbar_container = $("div[nhname='sub_toolbar_container']",params.div_form);
|
||||||
|
params.cancel_btn = $("a[nhname='sub_cancel_btn']",params.div_form);
|
||||||
|
params.submit_btn = $("a[nhname='sub_submit_btn']",params.div_form);
|
||||||
|
params.height = 30;
|
||||||
|
if(params.textarea.data('init') == undefined){
|
||||||
|
params.editor = init_editor(params);
|
||||||
|
init_form(params);
|
||||||
|
params.cancel_btn.click(function(){
|
||||||
|
nh_reset_form(params);
|
||||||
|
toggleAndSettingWordsVal(params.div_form, params.textarea);
|
||||||
|
});
|
||||||
|
params.submit_btn.click(function(){
|
||||||
|
params.form.submit();
|
||||||
|
});
|
||||||
|
params.textarea.data('init',1);
|
||||||
|
}
|
||||||
|
params.cancel_btn.click();
|
||||||
|
setTimeout(function(){
|
||||||
|
if(!params.div_form.is(':hidden')){
|
||||||
|
params.textarea.show();
|
||||||
|
params.textarea.focus();
|
||||||
|
params.textarea.hide();
|
||||||
|
}
|
||||||
|
},300);
|
||||||
|
});
|
||||||
|
|
||||||
|
$("div[nhname='new_message']").each(function(){
|
||||||
|
var params = {};
|
||||||
|
params.kindutil = K;
|
||||||
|
params.div_form = $(this);
|
||||||
|
params.form = $("form",params.div_form);
|
||||||
|
if(params.form==undefined || params.form.length==0){
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
params.textarea = $("textarea[nhname='new_message_textarea']",params.div_form);
|
||||||
|
params.contentmsg = $("p[nhname='contentmsg']",params.div_form);
|
||||||
|
params.toolbar_container = $("div[nhname='toolbar_container']",params.div_form);
|
||||||
|
params.cancel_btn = $("#new_message_cancel_btn");
|
||||||
|
params.submit_btn = $("#new_message_submit_btn");
|
||||||
|
params.height = 30;
|
||||||
|
if(params.textarea.data('init') == undefined){
|
||||||
|
params.editor = init_editor(params);
|
||||||
|
init_form(params);
|
||||||
|
params.cancel_btn.click(function(){
|
||||||
|
nh_reset_form(params);
|
||||||
|
});
|
||||||
|
params.submit_btn.click(function(){
|
||||||
|
params.form.submit();
|
||||||
|
});
|
||||||
|
params.textarea.data('init',1);
|
||||||
|
$(this).show();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
After Width: | Height: | Size: 11 KiB |
After Width: | Height: | Size: 3.0 KiB |
Loading…
Reference in new issue