<%
  import java.util.Locale;
  import java.text.DateFormat;
  import org.exoplatform.portal.webui.util.Util;
  import org.exoplatform.wiki.webui.UIWikiPortlet;
  import org.exoplatform.wiki.commons.Utils;
  
  Locale currentLocale = Util.getPortalRequestContext().getLocale();
  DateFormat df = DateFormat.getDateTimeInstance(DateFormat.MEDIUM, DateFormat.SHORT, currentLocale);
  
  currentWikiPage = uicomponent.getCurrentWikiPage();
  String creator = Utils.getFullName(currentWikiPage.getOwner());
  String author = Utils.getFullName(currentWikiPage.getAuthor());
  def createdDate = df.format(currentWikiPage.getCreatedDate());
  def updatedDate = df.format(currentWikiPage.getUpdatedDate());
  int attachmentsTotal =  currentWikiPage.getAttachmentsExcludeContent().size();
  int versionsTotal = currentWikiPage.getVersionableMixin().getVersionHistory().getChildren().size() -1 ;
  
  String viewChangeSufix = "_changes";
  String viewChangeAnchor = "#" + uicomponent.COMPARE_REVISION +viewChangeSufix;
  
  String viewChangeActionId = UIWikiPortlet.WIKI_PORTLET_ACTION_PREFIX + uicomponent.COMPARE_REVISION + viewChangeSufix;
  String togglelink= uicomponent.event(uicomponent.TOGGLE_ATTACHMENTS_ACTION);
  
  String addedByLabel = _ctx.appRes("UIWikiPageInfoArea.label.AddedBy").replace("{0}", "<a class=\"Link\" href=\"\">" + creator + "</a>").replace("{1}", createdDate);
  String lastModifiedByLabel = _ctx.appRes("UIWikiPageInfoArea.label.LastModifiedBy").replace("{0}", "<a class=\"Link\" href=\"\">" + author + "</a>").replace("{1}", updatedDate);
  String totalAttachmentsLabel = _ctx.appRes("UIWikiPageInfoArea.label.TotalAttachments").replace("{0}", "<div class=\"TxtFeed\"><strong>" + attachmentsTotal + "</strong><a class=\"Link\" href=\"" + togglelink + "\">");
  %>
<div class="UIWikiPageInfoArea">
	<div class="TxtFeed">
	  ${addedByLabel}&nbsp;-&nbsp;$lastModifiedByLabel
	  <% if (versionsTotal>1) { %>
	  <a class="Link" href="javascript:eXo.wiki.UIWikiAjaxRequest.makeNewHash('$viewChangeAnchor');"><%= "(" + _ctx.appRes("UIWikiPageInfoArea.label.ViewChange") + ")"; %></a>
	  <a onclick="<%=uicomponent.event(uicomponent.COMPARE_REVISION);%>" id="$viewChangeActionId" style="display:none;">&nbsp;</a>
	  <% }%>
	</div>
	<%= totalAttachmentsLabel %></a>&nbsp;-&nbsp;<strong>$versionsTotal</strong><a class="Link" href="<%=uicomponent.event(uicomponent.SHOW_REVISION);%>">&nbsp;<%=_ctx.appRes("UIWikiPageInfoArea.label.TotalRevisions")%></a></div>
</div>
