<#-- 问题内容 空白页 -->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<base href="${baseURL}">
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<@object action="${questionRelated_questionContent_1}" questionId="${url_questionId}"> 
		<#assign question = questionRelated_questionContent_entityBean>
	</@object> 
	
	<title><#if question != null && question?? >${question.title}</#if> - ${title}</title>
	<meta name="description" content="<#if question != null && question?? >${question.summary}</#if>"/>
	<#-- 获取令牌 -->
	<meta name="csrfToken" content="${token}"/>
	<meta name="keywords" content="${title} - ${keywords}"/>
	<meta name="description" content="${title} - ${description}"/>
	<link rel="shortcut icon" type="image/x-icon" href="${baseURL}${commonPath}images/favicon.ico" media="screen" />
	<link href="${commonPath}css/common.css" type="text/css" rel="stylesheet">	
	<link href="${commonPath}css/themify-icons/style.css" type="text/css" rel="stylesheet">
	<script language="javascript" src="${commonPath}js/tool.js" type="text/javascript"></script>
	<script language="javascript" src="${commonPath}js/ajax.js" type="text/javascript"></script>
	<script language="javascript" src="${commonPath}js/json2.js" type="text/javascript"></script>
	<script type="text/javascript" src="${commonPath}js/jquery/jquery.min.js" language="javascript"></script>
	<script type="text/javascript" src="${commonPath}js/jquery/jquery.letterAvatar.js" language="javascript"></script>
	<script type="text/javascript" src="${commonPath}js/kindeditor/kindeditor-min.js" language="javascript"></script>
	<link href="${commonPath}js/layer/skin/default/layer.css"  type="text/css" rel="stylesheet"/>
	<script type="text/javascript" src="${commonPath}js/layer/layer.js" language="javascript"></script>
	<script type="text/javascript" src="${commonPath}js/jquery/readmore2.js" language="javascript"></script>
	<link href="${commonPath}js/simplebox/css/simplebox.css"  type="text/css" rel="stylesheet"/>
	<script type="text/javascript" src="${commonPath}js/simplebox/js/simplebox.js" language="javascript"></script>
	
	<link href="${commonPath}js/prism/default-block/prism.css"  type="text/css" rel="stylesheet"/>
	<script type="text/javascript" src="${commonPath}js/prism/default-block/prism.js" language="javascript"></script>
	<script type="text/javascript" src="${commonPath}js/prism/default-block/clipboard.min.js" language="javascript"></script>
</head>

<body >
<#-- 引入页头 -->
<@include action="${newPublic_2}"/>
<div class="skeleton">
	<div class="main wrap">
		<#if question != null && question?? >
		<div class="questionContentModule">
	        <div class="left">
	        	<div class="question-wrap">
			        <div class="questionTag">
			        	<#list question.questionTagAssociationList as questionTag>
							<a href="askList?questionTagId=${questionTag.questionTagId}"  class="tag">${questionTag.questionTagName}</a>		
						</#list>
			        </div>
			        
			        <div class="rightInfo">
			        	<div class="report" onclick="addReportUI('${question.id}',40)">
							<span><i class="cms-error-warning-line" ></i>举报</span>
						</div>
			        	<#if question.userName == systemUser.userName>
							<div class="appendQuestion" >
								<span onclick="appendQuestionLayer('${question.id}');"><i class="cms-append" ></i>追加提问</span>
							</div>
							
							
							<script type="text/javascript">
								//追加提问展开层
								function appendQuestionLayer(questionId){
									var parameter = "";//URI参数
									parameter += "questionId="+questionId;
									
									
									//回复页面
									get_request(function(value){
										if(value != ""){
											$("#appendQuestion-post").html(value);
										}
									},
									getBasePath()+"user/appendQuestion?"+parameter+"&timestamp=" + new Date().getTime(), true);
									
								}
								function cancelAppendQuestion(){
									$("#appendQuestion-post").html("");
								}
							</script> 
							
						</#if>
			        	<#if question.ipAddress != null && question.ipAddress??>
							<div class="ipAddress">
								<span><i class="cms-map-pin-line" ></i>${question.ipAddress}</span>
							</div>
						</#if>
			        </div>
			        
		        	<div class="questionBox">
		                <div class="title">${question.title}</div>
		                
		                <div id="appendQuestion-post" class="appendQuestion-post">
					
						</div>
		                <div class="questionInfo clearfix" >
		                	<div class="postTime">${question.postTime}</div>
		                	<div class="viewTotal-icon"><i class="cms-view"></i></div>
		                	<div class="viewTotal">${question.viewTotal}次阅读</div>
		                	<div class="answer-icon"><i class="cms-commentCount"></i></div>
		                	<div class="answer">${question.answerTotal}个回答</div>
		                </div>
		                <#if question.amount gt 0 || question.point gt 0 >
		                <div class="reward" >
		                	<div class="info" >
		                		<i class="icon cms-deposit" ></i>
		                		悬赏<#if question.amount gt 0>金额<span class="symbol">¥</span><span class="amount">${question.amount}</span>元 </#if>
		                		<#if question.point gt 0>
		                			<span class="point">${question.point}</span>积分
		                		</#if>
		                	</div>
		                </div>
		                </#if>
						<div class="${(RequestParameters.reportModule != null && RequestParameters.reportModule=='40')?string('content reportMark','content')}">
							<#if question.account == null || question.account == ''>
								<div class="cancelAccount">此用户账号已注销</div>
							</#if>
		                	<#noescape>${question.content}</#noescape>          
						</div>
						<#list question.appendQuestionItemList as appendQuestionItem>
							<div class="appendBox ${(appendQuestionItem_index%2==0 )?then(' odd' ,' even')}" >
								<div class="head">
									<span class="prompt">第${appendQuestionItem_index + 1}条附言</span>
									<span class="appendTime">${appendQuestionItem.postTime?datetime}</span>
								</div>
			                	<div class="appendContent" >
			                		<#noescape>${appendQuestionItem.content}</#noescape>
			                	</div> 
							</div>		
						</#list>
						
						<div class="favorite-formModule">
							<#-- 引入添加收藏夹 -->
							<@include action="${favoriteRelated_addFavorite_2}"/>
						</div>
					</div>
				</div>
				
				<#-- 引入添加答案 -->
				<@include action="${questionRelated_addAnswer_1}"/>
				
				<#-- 引入回答列表 -->
				<@include action="${questionRelated_answer_1}"/>
				
				<#-- 引入采纳答案 -->
				<@include action="${questionRelated_adoptionAnswer_1}"/>
				
			</div>
			<div class="right">
				<div class="userInfo-wrap clearfix">
					<div class="userInfo">
						<div class="author">
				            <a href="user/control/home?userName=${question.userName}" >
								<#if question.avatarName != null>
									<img src="${question.avatarPath}${question.avatarName}" >
								<#else>
									<!--[if (IE)]><img src="${commonPath}images/min_avata.png"><![endif]-->
									<!--[if !(IE)]><!--><img avatar="${(question.nickname != null && question.nickname??) ?string(question.nickname , question.account)}" ><!--<![endif]-->
								</#if>
							</a>
						</div>
						<p class="name">
							<a href="user/control/home?userName=${question.userName}" target="_blank">
								${(question.nickname != null && question.nickname??) ?string(question.nickname , question.account)}
							</a>
						</p>
						<#if question.userRoleNameList?size gt 0>
							<div class="role">
								<#list question.userRoleNameList as roleName>
									<i class="userRoleName">${roleName}</i>				
								</#list>
							</div>
						</#if>
						<#if question.isStaff>
							<div class="role">
								<i class="staff">官方人员</i>	
							</div>
						</#if>
						<ul>
			            	<li>
			                	<span id="answerCount">0</span>
			                    <span>回答</span>
			                </li>
			                <li>
			                    <span id="followerCount">0</span>
			                    <span>粉丝</span>
			                </li>
			                <li>
			                    <span id="followCount">0</span>
			                    <span>关注</span>
			             	</li>
			             	<input type="hidden" id="_userName" value="${question.userName}"/>
			             	
			             	<script language="javascript" type="text/javascript">
								//查询回答总数
								function queryAnswerCount(){
									//获取用户名称
									var userName = document.getElementById("_userName").value;
									get_request(function(value){
										if(value != ""){
											var data = JSON.parse(value);
									        document.getElementById("answerCount").innerHTML = data;
								        }
									},
										"queryAnswerCount?userName="+userName+"&timestamp=" + new Date().getTime(), true);
								}
								queryAnswerCount();
								
								//查询粉丝总数
								function queryFollowerCount(){
									//获取用户名称
									var userName = document.getElementById("_userName").value;
									get_request(function(value){
										if(value != ""){
											var data = JSON.parse(value);
									        document.getElementById("followerCount").innerHTML = data;
								        }
									},
										"queryFollowerCount?userName="+userName+"&timestamp=" + new Date().getTime(), true);
								}
								queryFollowerCount();
								
								
								//查询关注总数
								function queryFollowCount(){
									//获取用户名称
									var userName = document.getElementById("_userName").value;
									get_request(function(value){
										if(value != ""){
											var data = JSON.parse(value);
									        document.getElementById("followCount").innerHTML = data;
								        }
									},
										"queryFollowCount?userName="+userName+"&timestamp=" + new Date().getTime(), true);
								}
								queryFollowCount();
							</script>
			             	
			             	
			             	
			             	
			             	
						</ul>
						<#if !question.isStaff>
							<div class="action-button">
								<#-- 引入关注用户 -->
								<@include action="${followRelated_addFollow_2}"/>
								<span class="privateMessageBox" >
									<button type="button" class="privateMessageButton" onClick="javascript:window.location.href='${baseURL}user/control/privateMessageChatList?friendUserName=${question.userName}'">发私信</button>
								</span>
							</div>
						</#if>
					</div>
				</div>
				<!-- 相似问题 -->
				<#-- 引入相似问题 -->
				<@include action="${questionRelated_likeQuestion_1}" questionId="${url_questionId}"/>
				
			</div>
		</div>
		</#if> 
	</div>
</div>
<#-- 引入页脚 -->
<@include action="${newPublic_3}"/>
</body>

<!-- 代码高亮显示 -->
<script type="text/javascript">
	//代码语言类
	function languageClassName(originalClass, newClass) {
		var o = new Object()
		o.originalClass = originalClass;//原始样式标签名称
		o.newClass = newClass;//新样式标签名称
		return o;
	}

	$(document).ready(function(){
	    //代码语言映射集合
	    var languageMapping_arr = new Array();
		var languageClassName_xml = languageClassName("lang-xml","language-xml");
	    languageMapping_arr.push(languageClassName_xml);
	    var languageClassName_css = languageClassName("lang-css","language-css");
	    languageMapping_arr.push(languageClassName_css);
	    var languageClassName_html = languageClassName("lang-html","language-html");
	    languageMapping_arr.push(languageClassName_html);
	    var languageClassName_js = languageClassName("lang-js","language-JavaScript");
	    languageMapping_arr.push(languageClassName_js);
	    var languageClassName_java = languageClassName("lang-java","language-java");
	    languageMapping_arr.push(languageClassName_java);
	    var languageClassName_pl = languageClassName("lang-pl","language-perl");
	    languageMapping_arr.push(languageClassName_pl);
	    var languageClassName_py = languageClassName("lang-py","language-python");
	    languageMapping_arr.push(languageClassName_py);
	    var languageClassName_rb = languageClassName("lang-rb","language-ruby");
	    languageMapping_arr.push(languageClassName_rb);
	    var languageClassName_go = languageClassName("lang-go","language-Go");
	    languageMapping_arr.push(languageClassName_go);  
	    var languageClassName_cpp = languageClassName("lang-cpp","language-C++");
	    languageMapping_arr.push(languageClassName_cpp);  
	    var languageClassName_cs = languageClassName("lang-cs","language-C#");
	    languageMapping_arr.push(languageClassName_cs);  
	    var languageClassName_bsh = languageClassName("lang-bsh","language-Bash + Shell");
	    languageMapping_arr.push(languageClassName_bsh);  
	      
	  
	    var doc_pre = $(".content,.appendContent,.answerContent").find('pre[class^="prettyprint"]');
	    doc_pre.each(function(){
	        var class_val = $(this).attr('class');
	      	var lan_class = "";
	        var class_arr = new Array();
	        class_arr = class_val.split(' ');
	        for(var i=0; i<class_arr.length; i++){
	        	var className = $.trim(class_arr[i]);
	        	
	        	if(className != null && className != ""){
	        		if (className.lastIndexOf('lang-', 0) === 0) {
	        			lan_class = className;
			            break;
			        }
	        	}	
	        }
	        
	        for(var i=0; i<languageMapping_arr.length; i++){
		    	var languageMapping = languageMapping_arr[i];
		    	if(languageMapping.originalClass == lan_class){
			    //	var pre_content = '<code>'+$(this).html()+'</code>';
			        $(this).html($(this).html());
			        $(this).attr("class",'line-numbers '+languageMapping.newClass);
		    	}
		    }
		    if(lan_class == ""){
		    //	var pre_content = '<code>'+$(this).html()+'</code>';
			    $(this).html($(this).html());
			    $(this).attr("class",'line-numbers language-markup');
		    }
	    });
	});
	
	//添加举报页
	function addReportUI(parameterId,module) {
		
		
		var parameter = "";//URI参数
		parameter += "parameterId="+parameterId;
		parameter += "&module="+module;
		
		//举报页面
		get_request(function(value){
			if(value != ""){
				layer.open({
				    type: 1, 
				    title:"举报",
				    content: value, 
				    area: ['700px', '500px'],//宽高
					end: function(layero, index){
					}
				});
				//$("#editComment-post_"+commentId).html(value);
			}
		},
		getBasePath()+"user/addReport?"+parameter+"&timestamp=" + new Date().getTime(), true);
	}
</script>


<!-- 图片点击放大 -->
<script type="text/javascript">
	$(function () {
    	//图片不含宽度的元素,因为svg表情不放大，svg表情后端默认设置了宽度
    	$(".content img:not([width]),.appendContent img:not([width]),.answerContent img:not([width])").simplebox();
	
    	//$(".content img,.appendContent img,.answerContent img").simplebox();
	});
</script>
</html>