#*
 * Aipo is a groupware program developed by Aimluck,Inc.
 * Copyright (C) 2004-2010 Aimluck,Inc.
 * http://aipostyle.com/
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License as
 * published by the Free Software Foundation, either version 3 of the
 * License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Affero General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *#

## ---------------------------------------------------------------------------
#set ($indicator_id = "indicator-dlg-")
## ---------------------------------------------------------------------------
#ALdialogheader("記事詳細（${result.Detail.OwnerName}）")
#ALajaxIndicator("$indicator_id" "$!portlet.ID" "")
<div id="messageDiv"></div>
#ALajaxscreenformheader("blogEntryForm" $jslink $portlet "BlogEntryFormJSONScreen" "aimluck.io.disableForm(this, true)")
#ALtableheaderWide()
<tr>
#ALtdheadheaderAtt("style='text-align:left; white-space: normal'")
$!{result.Detail.ThemaName}
#ALtdheadfooter()
</tr>
<tr>
#ALtditemheader()
<div class="clearfix">
<h3>$!{result.Detail.Title}</h3>
<div class="alignleft">投稿日：$!{result.Detail.CreateDate}</div>
<div class="alignright">
#if($!result.isMatch($!{result.UserId} , $!{result.Detail.OwnerId.Value}))
#ALbutton("eventSubmit_doBlog_entry_delete" "削除する" "aipo.blog.delBlogEntry(this,'$indicator_id','$!{portlet.ID}');")
#end
</div>
</div>
<div>
$!{result.Detail.Note}
#if($!result.Detail.AttachmentFileList && $!result.Detail.AttachmentFileList.size() > 0)
<div style="padding-top:15px;">
#foreach( $attachmentFile in $!result.Detail.AttachmentFileList )
<div style="padding-top:5px;">
<img src="images/blog/blog_item.gif">&nbsp;<a href="$jslink.getTemplate("BlogFileRawScreen").addQueryData("ownerid", $!{result.Detail.OwnerId}).addQueryData("entityid", $!result.Detail.EntryId).addQueryData("attachmentIndex", $attachmentFile.FileId)"> $result.getStringCR($attachmentFile.FileNameField) </a><br>
#if($attachmentFile.isImage())
<div style="padding-top:3px;padding-left:12px;">
<div id='popc' style='position:absolute'></div>
<a href="javascript:aipo.blog.popupCenter('$jslink.getTemplate("BlogFileRawScreen").addQueryData("ownerid", $!{result.Detail.OwnerId}).addQueryData("entityid", $!result.Detail.EntryId).addQueryData("attachmentIndex", $attachmentFile.FileId)');"><img class="width_thumbs" border="0" alt="$attachmentFile.FileName" title="$attachmentFile.FileName" src="$jslink.getTemplate("BlogFileThumbnailScreen").addQueryData("ownerid", $!{result.Detail.OwnerId}).addQueryData("entityid", $!result.Detail.EntryId).addQueryData("attachmentIndex", $attachmentFile.FileId)"></a><br>

&nbsp;（マウスのクリックで画像を拡大縮小できます）
</div>
#end
</div>
#end
</div>
#end
</div>
#ALtditemfooter()
</tr>
#ALtablefooter()

#if($!result.CommentList && $!result.CommentList.size() > 0)
##ALajaxpageview('BlogEntryCommentListScreen' $result)
#ALtableheaderWide()
<tr>
#ALtdheadAtt("コメント" "style='text-align:left;'")
</tr>
#foreach ($record in $result.CommentList)
<tr>
#ALtditemheader()
<div class="clearfix">
<div class="alignleft">
投稿者：<a href="$!jslink.getPortletById($!portlet.ID).addQueryData('eventSubmit_doBlog_entry_list_user','1').addQueryData('view_uid',${record.OwnerId}).addQueryData('action','controls.Maximize')">$!{record.OwnerName}</a>
&nbsp;&nbsp;&nbsp;投稿日：$!{record.UpdateDate}
</div>
<div class="alignright">
#if($!result.isMatch($!{result.UserId} , $!{record.OwnerId.Value}))
#ALbutton("eventSubmit_doBlog_comment_delete" "削除する" "aipo.blog.delCommentReply(this, ${record.CommentId}, '$!indicator_id', '$!portlet.ID');")
#end
</div>
</div>
<div>
${record.Comment}
</div>
#ALtditemfooter()
</tr>
#end

#ALtablefooter()
##pageview($link $result)

#end
#ALformfooter()

<!-- form comment -->
#ALerrmsg($errmsgsOnCommentDetail)
<div id="messageDiv"></div>
#ALajaxIndicator("$!portlet.ID" "${indicator_str}しています...")
<form name="blogForm$!portlet.ID" id="blogForm$!portlet.ID" action="$!jslink.getPortletById($!portlet.ID).addQueryData('template','BlogEntryFormJSONScreen').addQueryData('entityid', $!{result.Detail.EntryId})" method="post" onsubmit="aimluck.io.submit(this,'$indicator_id','$!portlet.ID',aipo.blog.onReceiveMessage);return false;">
#ALajaxscreenformheader("blogForm" $jslink $portlet "BlogEntryFormJSONScreen" "aimluck.io.submit(this,'$indicator_id','$!portlet.ID',aipo.blog.onReceiveMessage)")
<input type="hidden" name="mode" value="comment" />
<input type="hidden" name="entityid" value="$!{result.Detail.EntryId}" />
#ALtableheaderWide()
#ALtdcaption("#ALrequired($!resultOnCommentDetail.getFieldName('comment'))")
#ALtditemheader()
#ALtextarea('comment' $!resultOnCommentDetail.Comment 10 40)
#ALtditemfooter()
#ALtablefooter()
#ALbuttonheader()
#ALsubmit('eventSubmit_doBlog_entry_reply' 'コメントする')#ALajaxbuttonClose()
#ALbuttonfooter()
#ALformfooter()
#ALdialogfooter()

