2014-09-15 10:58:14 +08:00
|
|
|
|
<!DOCTYPE html>
|
|
|
|
|
<html lang="en">
|
|
|
|
|
<head>
|
|
|
|
|
<meta charset="utf-8" />
|
|
|
|
|
<title><%= h html_title %></title>
|
|
|
|
|
<meta name="description" content="<%= Redmine::Info.app_name %>" />
|
|
|
|
|
<meta name="keywords" content="issue,bug,tracker" />
|
|
|
|
|
<%= csrf_meta_tag %>
|
|
|
|
|
<%= favicon %>
|
2015-09-18 17:44:16 +08:00
|
|
|
|
<%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2','application','prettify', 'nyan','leftside', :media => 'all' %>
|
2014-09-15 10:58:14 +08:00
|
|
|
|
<%= stylesheet_link_tag 'rtl', :media => 'all' if l(:direction) == 'rtl' %>
|
2015-12-01 17:23:14 +08:00
|
|
|
|
<%= javascript_include_tag('jquery-1.8.3-ui-1.9.2-ujs-2.0.3', 'application', 'jquery.colorbox-min') %>
|
2015-12-06 15:03:36 +08:00
|
|
|
|
|
|
|
|
|
<%= import_ke(enable_at: false, prettify: true, init_activity: false) %>
|
|
|
|
|
|
|
|
|
|
|
2014-09-15 10:58:14 +08:00
|
|
|
|
<%= heads_for_theme %>
|
2015-03-26 15:44:39 +08:00
|
|
|
|
|
2014-09-15 10:58:14 +08:00
|
|
|
|
<%= call_hook :view_layouts_base_html_head %>
|
|
|
|
|
<%= yield :header_tags -%>
|
2015-09-18 17:44:16 +08:00
|
|
|
|
<%= stylesheet_link_tag 'base','header','new_user', :media => 'all'%>
|
2015-11-17 15:24:01 +08:00
|
|
|
|
<!-- MathJax的配置 -->
|
|
|
|
|
<script type="text/javascript"
|
|
|
|
|
src="/javascripts/MathJax/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
|
|
|
|
|
</script>
|
|
|
|
|
<!-- 配置 : 在生成的公式图片上去掉Math定义的右键菜单,$$ $$ \( \) \[ \] 中的公式给予显示-->
|
|
|
|
|
<script type="text/x-mathjax-config">
|
|
|
|
|
MathJax.Hub.Config({
|
|
|
|
|
showMathMenu: false,
|
|
|
|
|
showMathMenuMSIE: false,
|
|
|
|
|
tex2jax: {inlineMath: [['$','$'], ['\\(','\\)']]}
|
|
|
|
|
});
|
|
|
|
|
</script>
|
2015-09-18 17:44:16 +08:00
|
|
|
|
<script>
|
|
|
|
|
var desc;
|
|
|
|
|
function edit_desc(){
|
2015-09-19 10:25:02 +08:00
|
|
|
|
if(<%=@forum.creator.id == User.current.id%>) {
|
|
|
|
|
desc = $("#forum_desc_span").html();
|
2015-09-28 14:11:46 +08:00
|
|
|
|
$("#forum_desc_span").html("<textarea id='forum_desc_input' onblur='change_forum_desc();' style='width: 200px;height: 80px; max-width: 207px; max-height: 80px; border: 1px solid #d9d9d9;outline: none;margin: 0px 0px 12px 0px;'>" + desc + "</textarea>");
|
2015-09-19 10:25:02 +08:00
|
|
|
|
$("#forum_desc_input").focus();
|
|
|
|
|
}
|
2015-09-18 17:44:16 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function change_forum_desc(){
|
|
|
|
|
$.ajax({
|
|
|
|
|
url: '<%= forums_path + '/'+@forum.id.to_s+".js" %>',
|
|
|
|
|
type: 'PUT',
|
|
|
|
|
dataType: 'json',
|
|
|
|
|
data:{"forum[description]":$("#forum_desc_input").val().trim()},
|
|
|
|
|
success:function(data){
|
|
|
|
|
if(data == true){
|
|
|
|
|
$("#forum_desc_span").html($("#forum_desc_input").val().trim());
|
|
|
|
|
}else{
|
|
|
|
|
$("#forum_desc_span").html(desc);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function delete_forum_tag(doc){
|
|
|
|
|
tag_name = doc.parent().children().eq(0).html().trim();
|
|
|
|
|
$.ajax(
|
|
|
|
|
"<%= delete_forum_tag_forum_path(@forum)+ '.js?tag_name='%>"+tag_name,
|
|
|
|
|
{},
|
|
|
|
|
function(data){
|
|
|
|
|
alert(data == true)
|
|
|
|
|
if(data == true){
|
|
|
|
|
doc.parent().remove();
|
|
|
|
|
}else{
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function addTag(){
|
2015-09-19 10:28:30 +08:00
|
|
|
|
if(<%=@forum.creator.id == User.current.id%>) {
|
2015-09-21 16:01:32 +08:00
|
|
|
|
if ($("input[name='addTag']").val().trim() != "" ) {
|
2015-11-03 14:56:32 +08:00
|
|
|
|
if($("input[name='addTag']").val().trim().length <= 120) {
|
2015-09-21 16:01:32 +08:00
|
|
|
|
$.get(
|
|
|
|
|
'<%= add_forum_tag_forum_path(@forum)%>' + "?tag_str=" + $("input[name='addTag']").val(),
|
|
|
|
|
{}
|
|
|
|
|
);
|
2015-09-23 11:02:22 +08:00
|
|
|
|
$("input[name='addTag']").val('');
|
2015-09-21 16:01:32 +08:00
|
|
|
|
}else{
|
2015-11-03 14:56:32 +08:00
|
|
|
|
alert("标签名字长度不能超过120个字符");
|
2015-09-21 16:01:32 +08:00
|
|
|
|
}
|
2015-09-19 10:28:30 +08:00
|
|
|
|
}
|
2015-09-18 17:44:16 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
2015-09-23 11:02:22 +08:00
|
|
|
|
|
|
|
|
|
var tagNameHtml; //当前双击的链接的父节点的html
|
|
|
|
|
var tagName; //标签的值
|
|
|
|
|
var parentCssBorder; //当前双击的链接的父节点
|
|
|
|
|
var ele; //当前双击的链接
|
|
|
|
|
var taggableId; //标签的id
|
|
|
|
|
var taggableType; //被标签的类型
|
|
|
|
|
//这里renameTag有两种情况,一种是改变某个资源的tag名称。如果其他资源也有这个tag。则新增一个改变后的tag名
|
|
|
|
|
//第二种是改变某个tag名称。其他所有的资源如果拥有这个tag。那么对应的tag名也要改掉。
|
|
|
|
|
//目前这两种依据 的来源就是 是否 传了参数 id。如果有id。就指定了资源id,就是第一种情况。如果没有id。就是第二种情况
|
|
|
|
|
function rename_tag(domEle,name,id,type){
|
|
|
|
|
if(domEle.children().get(0) != undefined ){ //已经是编辑框的情况下不要动
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
tagNameHtml = domEle.parent().html()
|
|
|
|
|
tagName = name;
|
|
|
|
|
parentCssBorder = domEle.parent().css("border");
|
|
|
|
|
ele = domEle;
|
|
|
|
|
taggableId = id;
|
|
|
|
|
taggableType = type;
|
|
|
|
|
width = parseInt(domEle.css('width').replace('px','')) >=100 ? parseInt(domEle.css('width').replace('px','')) : 100
|
|
|
|
|
domEle.html('<input name="" id="renameTagName" maxlength="<%=Setting.tags_max_length%>" minlength="<%= Setting.tags_min_length%>" style="width:'+width+'px;" value="'+name+'"/>');
|
|
|
|
|
domEle.parent().css("border","1px solid #ffffff");
|
|
|
|
|
$("#renameTagName").focus();
|
|
|
|
|
}
|
2015-10-13 09:25:52 +08:00
|
|
|
|
$("#renameTagName").live('blur',function(){
|
|
|
|
|
if($("#renameTagName")[0] != undefined ){//存在renameTagName,则处于编辑状态
|
2015-09-23 11:02:22 +08:00
|
|
|
|
if($("#renameTagName").val().trim() == tagName){ //如果值一样,则恢复原来的状态
|
|
|
|
|
ele.parent().css("border","");
|
|
|
|
|
ele.parent().html(tagNameHtml);
|
|
|
|
|
|
|
|
|
|
}else{ //否则就要更新tag名称了
|
|
|
|
|
if(confirm("是否将标签改为 "+ $("#renameTagName").val().trim())){
|
|
|
|
|
$.post(
|
|
|
|
|
'<%= update_tag_name_path %>',
|
|
|
|
|
{"taggableId": taggableId, "taggableType": taggableType, "tagName": tagName, "renameName": $("#renameTagName").val().trim()}
|
|
|
|
|
)
|
|
|
|
|
}else{
|
|
|
|
|
ele.parent().css("border","");
|
|
|
|
|
ele.parent().html(tagNameHtml);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
2015-10-13 09:25:52 +08:00
|
|
|
|
//监听所有的单击事件
|
|
|
|
|
// $(document).click(function(e){
|
|
|
|
|
// node = document.elementFromPoint(e.clientX, e.clientY);
|
|
|
|
|
// if(node.tagName == "INPUT"){ //如果是输入框的聚焦,那么就不要进行下去了
|
|
|
|
|
// return;
|
|
|
|
|
// }
|
|
|
|
|
// if($("#renameTagName")[0] != undefined ){//存在renameTagName,则处于编辑状态
|
|
|
|
|
// if($("#renameTagName").val().trim() == tagName){ //如果值一样,则恢复原来的状态
|
|
|
|
|
// ele.parent().css("border","");
|
|
|
|
|
// ele.parent().html(tagNameHtml);
|
|
|
|
|
//
|
|
|
|
|
// }else{ //否则就要更新tag名称了
|
|
|
|
|
// if(confirm("是否将标签改为 "+ $("#renameTagName").val().trim())){
|
|
|
|
|
// $.post(
|
|
|
|
|
// '<%#= update_tag_name_path %>',
|
|
|
|
|
// {"taggableId": taggableId, "taggableType": taggableType, "tagName": tagName, "renameName": $("#renameTagName").val().trim()}
|
|
|
|
|
// )
|
|
|
|
|
// }else{
|
|
|
|
|
// ele.parent().css("border","");
|
|
|
|
|
// ele.parent().html(tagNameHtml);
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// });
|
2015-09-25 15:23:12 +08:00
|
|
|
|
|
2015-09-29 16:40:55 +08:00
|
|
|
|
function del_forum_confirm(){
|
2015-09-25 15:23:12 +08:00
|
|
|
|
if(confirm('您确定要删除么?')){
|
|
|
|
|
$("#del_link").click();
|
|
|
|
|
}
|
|
|
|
|
}
|
2015-09-18 17:44:16 +08:00
|
|
|
|
</script>
|
2015-08-25 15:09:02 +08:00
|
|
|
|
</head>
|
2015-09-29 15:13:05 +08:00
|
|
|
|
<body class="<%= h body_css_classes %>" onload="prettyPrint();">
|
2015-08-25 15:09:02 +08:00
|
|
|
|
|
|
|
|
|
<div class="cl"></div>
|
2015-09-29 15:24:15 +08:00
|
|
|
|
<div class="navContainer">
|
2015-08-25 15:09:02 +08:00
|
|
|
|
<% if User.current.logged? %>
|
|
|
|
|
<%= render :partial => 'layouts/logined_header' %>
|
|
|
|
|
<% else%>
|
|
|
|
|
<%= render :partial => 'layouts/unlogin_header' %>
|
|
|
|
|
<% end%>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="cl"></div>
|
2015-09-18 17:44:16 +08:00
|
|
|
|
<div class="homepageContentContainer">
|
|
|
|
|
<div class="homepageContent">
|
2015-09-29 12:05:30 +08:00
|
|
|
|
<div class="postRouteContainer mb10">
|
2015-09-29 14:27:53 +08:00
|
|
|
|
» <a href="<%= forums_path%>" class="postRouteLink">贴吧</a> » <a href="<%= forum_path(@forum)%>" title="<%=@forum.name %>" class="postRouteLink"><%= truncate(@forum.name,:lenght=>32)%></a> <%if @memo %> » <font class="fontGrey2"><%= @memo.subject%></font><% end %>
|
2015-09-29 12:05:30 +08:00
|
|
|
|
</div>
|
2015-09-18 17:44:16 +08:00
|
|
|
|
<div class="homepageLeft">
|
|
|
|
|
<div class="postDetailContainer">
|
|
|
|
|
<div class="fl mr10 pr"> <%= link_to image_tag(url_to_avatar(@forum.creator),:width=>75,:height => 75,:alt=>'贴吧图像' ),user_path( @forum.creator) %>
|
|
|
|
|
<!--<div class="homepageEditProfile"><a href="javascript:void(0);" class="homepageEditProfileIcon"></a></div>-->
|
|
|
|
|
</div>
|
|
|
|
|
<div class="fl">
|
2015-09-28 11:42:32 +08:00
|
|
|
|
<div class="f16 fontBlue mb10" style="word-break: break-all; word-wrap:break-word;white-space:pre-wrap;"><%= @forum.name%></div>
|
2015-09-18 17:44:16 +08:00
|
|
|
|
<div class="fontGrey2 mb8">吧主:<a href="<%= user_path(@forum.creator)%>" class="linkBlue"><%= @forum.creator.name%></a></div>
|
2015-09-24 16:17:50 +08:00
|
|
|
|
<div class="fontGrey3">回答:<a href="javascript:void(0);" class="linkOrange mr5" style="cursor: default"><%= @forum.memo_count %></a> 帖子:<a href="javascript:void(0);" class="linkOrange" style="cursor: default"><%=@forum.topic_count%></a></div>
|
2015-09-18 17:44:16 +08:00
|
|
|
|
</div>
|
|
|
|
|
<div class="cl"></div>
|
2015-09-28 13:35:59 +08:00
|
|
|
|
<div class="fontGrey2 mt10"><span id="forum_desc_span" style="word-break:normal; width:auto; display:block; white-space:pre-wrap;word-wrap : break-word ;overflow: hidden ;"><%= @forum.description.html_safe%></span>
|
2015-09-29 17:54:33 +08:00
|
|
|
|
<%if @forum.creator.id == User.current.id%>
|
|
|
|
|
<a href="javascript:void(0);" onclick="edit_desc();">
|
|
|
|
|
<%= image_tag('signature_edit.png',{:width=>12,:height=>12})%>
|
|
|
|
|
</a>
|
|
|
|
|
<%end%>
|
2015-09-18 17:44:16 +08:00
|
|
|
|
</div>
|
|
|
|
|
<div class="mt15">
|
|
|
|
|
<div id="forum_tag_list">
|
|
|
|
|
<%= render :partial=>'forums/forum_tag_list',:locals=>{:forum=>@forum}%>
|
|
|
|
|
</div>
|
2015-09-19 10:27:39 +08:00
|
|
|
|
<% if(@forum.creator.id == User.current.id)%>
|
2015-09-18 17:44:16 +08:00
|
|
|
|
<a href="javascript:void(0)" class="yellowBtn f_l" onclick="$('#add_tag01').slideToggle();">+ 添加标签</a>
|
2015-09-19 10:27:39 +08:00
|
|
|
|
<% end %>
|
2015-09-18 17:44:16 +08:00
|
|
|
|
<span id="add_tag01" style="display:none; vertical-align: middle;" class="ml10 f_l">
|
2015-09-21 17:04:41 +08:00
|
|
|
|
<input type="text" name="addTag" size="20" class="isTxt w90 f_l" maxlength="<%=Setting.tags_max_length%>" minlength="<%= Setting.tags_min_length%>" />
|
2015-09-18 17:44:16 +08:00
|
|
|
|
<input type="button" class="submit f_l" onclick="addTag();" />
|
|
|
|
|
</span></div>
|
|
|
|
|
<div class="cl"></div>
|
2015-09-24 09:52:57 +08:00
|
|
|
|
<%if @forum.creator.id == User.current.id%>
|
2015-09-23 15:14:37 +08:00
|
|
|
|
<span class="postEdit">
|
|
|
|
|
</span>
|
2015-09-23 16:27:13 +08:00
|
|
|
|
<a href="<%= edit_forum_path(@forum) %>" class="linkGrey3">编辑贴吧</a>
|
2015-09-29 16:40:55 +08:00
|
|
|
|
<a href="javascript:void(0);" data-method="delete" onclick="del_forum_confirm();" class="fr linkGrey3">删除贴吧</a>
|
2015-09-25 15:23:12 +08:00
|
|
|
|
<a href="<%= forum_path(@forum)%>" data-method="delete" id="del_link" type="hidden"></a>
|
2015-09-23 15:14:37 +08:00
|
|
|
|
<span class="postDelete"></span>
|
|
|
|
|
<% end %>
|
2015-09-18 17:44:16 +08:00
|
|
|
|
</div>
|
|
|
|
|
<div class="postDetailContainer mt10">
|
|
|
|
|
<div class="fl mr10"><%= link_to image_tag(url_to_avatar(User.current),:width=>50,:height => 50,:alt=>'贴吧图像' ),user_path( User.current) %></div>
|
|
|
|
|
<div class="fl f16 fontGrey2">我在贴吧</div>
|
|
|
|
|
<div class="cl"></div>
|
|
|
|
|
<div class="mt8">
|
|
|
|
|
<div class="homepageImageBlock" style="width: 68px !important;">
|
2015-09-24 16:17:50 +08:00
|
|
|
|
<div><a href="javascript:void(0);" class="homepageImageNumber" style="cursor: default"><%= @my_replies_count%></a></div>
|
2015-09-18 17:44:16 +08:00
|
|
|
|
<div class="homepageImageText">回答</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="homepageVerDiv"></div>
|
|
|
|
|
<div class="homepageImageBlock" style="width: 68px !important;">
|
2015-09-24 16:17:50 +08:00
|
|
|
|
<div><a href="javascript:void(0);" class="homepageImageNumber" style="cursor: default"><%= @my_topic_count%></a></div>
|
2015-09-18 17:44:16 +08:00
|
|
|
|
<div class="homepageImageText">发帖</div>
|
|
|
|
|
</div>
|
2015-08-25 15:09:02 +08:00
|
|
|
|
|
2015-09-18 17:44:16 +08:00
|
|
|
|
<div class="cl"></div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<!--<%#= render_flash_messages %>-->
|
|
|
|
|
<%= yield %>
|
|
|
|
|
<%#= call_hook :view_layouts_base_content %>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2015-12-02 09:28:01 +08:00
|
|
|
|
<div id="ajax-indicator" style="display:none;"><span><%= l(:label_loading) %></span></div>
|
|
|
|
|
<div id="ajax-modal" style="display:none;"></div>
|
2015-08-25 15:09:02 +08:00
|
|
|
|
<div class="cl"></div>
|
|
|
|
|
<%= render :partial => 'layouts/footer' %>
|
|
|
|
|
<div class="cl"></div>
|
2015-09-18 17:44:16 +08:00
|
|
|
|
<%#= call_hook :view_layouts_base_body_bottom %>
|
2014-09-15 10:58:14 +08:00
|
|
|
|
</body>
|
|
|
|
|
</html>
|
|
|
|
|
|