<!DOCTYPE html>
    <html lang="en">
      <head>
        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <meta name="description" content="Qora Web Server">
        <link rel="shortcut icon" href="favicon.ico">
        <title>/qblog Qora Blog</title>
        <link href="/index/libs/bootstrap/3/css/theme.css" rel="stylesheet">
        <link href="/index/libs/css/style.css" rel="stylesheet">
        <link href="/index/libs/css/sidebar.css" rel="stylesheet">
        <link href="/index/libs/css/timeline.css" rel="stylesheet">
        <style type="text/css">
          .media:first-child {
          margin-top: 0;
          padding-left: 20px;
          padding-top: 20px;
          padding-right: 20px;
          }
          .media-object {
          height: 74px;
          }
          .media-heading {
          margin-top: 20px;
          margin-bottom: 5px;
          }
          p.post-header {
          padding-bottom: 0px !important;
          font-size: 15px;
          }
          p.post-content {
          padding-top: 0px !important;
          word-break: break-all;
          word-wrap: break-word;
          }
          body {
          padding-top: 50px;
          }
          .sub-header {
          padding-bottom: 10px;
          border-bottom: 1px solid #eee;
          }
          .navbar-fixed-top {
          border: 0;
          z-index: 9999;
          }
          .sidebar {
          display: none;
          }
          @media (min-width: 768px) {
          .sidebar {
          position: fixed;
          top: 51px;
          bottom: 0;
          left: 0;
          z-index: 1000;
          display: block;
          padding: 20px;
          overflow-x: hidden;
          overflow-y: auto;
          background-color: #f5f5f5;
          border-right: 1px solid #eee;
          }
          }
          .nav-sidebar {
          margin-right: -21px;
          margin-bottom: 20px;
          margin-left: -20px;
          }
          .nav-sidebar > li > a {
          padding-right: 20px;
          padding-left: 20px;
          }
          .nav-sidebar > .active > a,
          .nav-sidebar > .active > a:hover,
          .nav-sidebar > .active > a:focus {
          color: #fff;
          background-color: #428bca;
          }
          .main {
          padding-top: 0px;
          }
          .main-tabs {
          width: 100%;
          padding-top: 15px;
          padding-left: 0px;
          padding-right: 0px;
          background-color: lightgray;
          display: none;
          }
          img.logo-header {
          background-color: transparent;
          height: 100%;
          }
          .col-lg-8 {
          padding-left: 0px;
          }
          @media (min-width: 768px) {
          .main {
          padding-right: 40px;
          }
          }
          .main .page-header {
          margin-top: 0;
          }
          .placeholders {
          margin-bottom: 30px;
          text-align: center;
          }
          .placeholders h4 {
          margin-bottom: 0;
          }
          .placeholder {
          margin-bottom: 20px;
          }
          .placeholder img {
          display: inline-block;
          border-radius: 50%;
          }
          .r-t {
          margin: 0px;
          }
          .r-l {
          margin: 0px;
          }
          span.label.label-default {
          background-color: #fff;
          color: lightgray;
          font-size: 90%;
          line-height: 1;
          }
          span.label.label-default a {
          color: #ddd;
          text-decoration: none;
          }
          a.r-l:hover,
          a.r-l:focus {
          color: #6467FF;
          text-decoration: none;
          }
          .navbar-header {
          width: 110px;
          }
          .modal-dialog.modal-lg {
          padding-top: 100px;
          }
          .modal-content {
          height: 620px;
          /*width: 700px;*/
          }
          .tl-profile {
          border: 1px solid #ddd;
          -webkit-box-shadow: 0 1px 6px rgba(0, 0, 0, 0.175);
          box-shadow: 0 1px 6px rgba(0, 0, 0, 0.175);
          margin-top: 40px;
          }
          .tl-profile img.tl-image-lg{
          z-index: 0;
          width: 100%;
          margin-bottom: 10px;
          }
          .tl-image-profile
          {
          margin: -90px 10px 0px 50px;
          z-index: 9;
          width: 21%;
          margin-bottom: 20px;
          }
          @media (max-width:768px)
          {
          .tl-profile-text>h1{
          font-weight: 700;
          font-size:16px;
          }
          .tl-image-profile
          {
          margin: -45px 10px 0px 25px;
          z-index: 9;
          width: 20%;
          }
          }
          .profile-options
          {
          width:100%;
          font-size: 20px;
          }
          .co-tabs {
          border-bottom: 3px solid #6467ff;
          margin-right: 10px;
          }
          ul.co-lists.list-unstyled {
          text-align: center;
          }
          li.co-top {
          font-size: 10px;
          }
          li.co-bottom {
          font-size: 15px;
          }
          .po-tabs
          {
          border: 1px solid #ddd;
          }
          li.po-tabs a
          {
          color: #ddd;
          }
          li.po-tabs a:hover
          {
          color: #6467ff;
          text-decoration: none;
          }
          #apimessage {
          position: fixed;
          top: 0px;
          left: 0px;
          width: 100%;
          z-index: 9999;
          }
          span.glyphicon.glyphicon-edit {
          font-size: 17px;
          top: -2px;
          left: -6px;
          }
          button.btn.btn-lg.btn-primary {
          height: 37px;
          width: 37px;
          }
          .modal-dialog.modal-lg {
          top: -50px;
          }
          .menu-grid span.glyphicon.glyphicon-edit {
          left: 2px;
          }
          .btn-group.post-actions {
          display: flex;
          }
        </style>
      </head>
      <body>
        <div id="PostModal" class="modal fade">
          <div class="modal-dialog modal-lg">
            <div class="modal-content">
              <iframe width="100%" height="100%" frameborder="0" src="postblog.html?blogname={{blogname|escape(strategy="url_param")}}"></iframe>
            </div>
          </div>
        </div>
    	<div id="commentModal" class="modal fade">
    	  <div class="modal-dialog modal-lg">
            <div class="modal-content">
              <iframe id=commentIframe width="100%" height="100%" frameborder="0" src="#"></iframe>
            </div>
          </div>
        </div>
        {{navbar}}
        <div class="container">
          <div class="row">
            <div class="main">
            {% autoescape true%}
             	{%if blogprofile.getProfileGraphicOpt() is empty%}
              <div class="tl-profile"><img align="left" src="/index/img/banner_01.png" alt="" class="tl-image-lg">
              {%else%}
              <div class="tl-profile"><img align="left" src="{{blogprofile.getProfileGraphicOpt()}}" alt="" class="tl-image-lg">
              {%endif%}
    
              {% if blogprofile.getAvatarOpt() is empty%}
                <img align="left" src="/index/img/qora-user.png" alt="" class="tl-image-profile thumbnail">
              {%else%}
                <img align="left" src="{{blogprofile.getAvatarOpt()}}" alt="" class="tl-image-profile thumbnail">
                {%endif%}
                <div class="tl-profile-text">
                  <h1>{{blogname}}</h1>
                  <ul class="profile-options list-inline">&nbsp;&nbsp;
                    <li class="co-tabs pull-left"><ul class="co-lists list-unstyled"><li class="co-top translate">Followers</li><li class="co-bottom">{{ follower.size() }}</li></ul></li>
                    <li class="co-tabs pull-left"><ul class="co-lists list-unstyled"><li class="co-top translate">Following</li><li class="co-bottom">{{ blogprofile.getFollowedBlogs().size() }}</li></ul></li>
              		{% if blogprofile is not empty and  blogprofile.isBlogEnabled()%}
                  <li class="po-tabs pull-right"><a><span style='cursor: pointer;' onclick="javascript:processfollow()">{%if isFollowing%}<span class="translate">Unfollow</span> {%else%}<span class="translate">Follow</span> {%endif%}<div id="divFollow" class="glyphicon glyphicon-user"{%if isFollowing%}style="color: #6467FF;"{%else%}{%endif%}></div> <span id=profFollower>
    			  </span></span></a></li>
                  {%endif%}
                  </ul>
                </div>
               {% endautoescape %}
              </div>        	{{apimessage}} <div id=apimessage></div>
              {% if blogenabled %}
              <ul class="timeline">{% for blogpost in blogposts %}
                <li id="{{blogpost.getSignature()}}">
                  <div class="timeline-badge primary"><a><i rel="tooltip" title="{{blogpost.creationTime}}" id="" class="glyphicon glyphicon-record"></i></a></div>
                  <div class="timeline-panel">
                    <div class="timeline-heading">
                      <div class="media">
                      	{% if blogpost.shareAuthorOpt() is not null %}
                      	{% if blogpost.getNameOpt() is not null %}
                      	<h6><span class="glyphicon glyphicon-retweet"></span>  <b><a href="/index/blog.html?blogname={{blogpost.shareAuthorOpt()|escape(strategy="url_param")}}">{{blogpost.shareAuthorOpt()}}</a></b> shared <b><a href="/index/blog.html?blogname={{blogpost.nameOrCreator|escape(strategy="url_param")}}">{{blogpost.nameOrCreator}}</a></b> post</h6>
                      	{%else%}
                      	<h6><span class="glyphicon glyphicon-retweet"></span>  <b><a href="/index/blog.html?blogname={{blogpost.shareAuthorOpt()|escape(strategy="url_param")}}">{{blogpost.shareAuthorOpt()}}</a></b> shared <b>{{blogpost.nameOrCreator}}</b> post</h6>
                      	{%endif%}
                      	{%endif%}
                        {% if blogpost.getProfileOpt() is not null and blogpost.getProfileOpt().isProfileEnabled() %}
                        <div class="media-left media-middle"><a href="/index/blog.html?blogname={{blogpost.nameOrCreator|escape(strategy="url_param")}}"><img src="{{blogpost.getAvatar()}}" alt="" class="media-object"></a></div>
                        {%else%}
                        <div class="media-left media-middle"><img src="{{blogpost.getAvatar()}}" alt="" class="media-object"></div>
                        {%endif%}
                        <div class="media-body">
                        	{% if blogpost.getProfileOpt() is not null and blogpost.getProfileOpt().isProfileEnabled() %}
                          <h6 class="media-heading"><b><a href="/index/blog.html?blogname={{blogpost.getProfileOpt().getName().getName()|escape(strategy="url_param")}}">{{blogpost.nameOrCreator}}</a></b></h6>{{blogpost.creationTime}}
                        	{%else%}
                          <h6 class="media-heading"><b>{{blogpost.nameOrCreator}}</b></h6>{{blogpost.creationTime}}
                        	{%endif%}
                        </div>
                        <div class="media-right">
                          <div class="btn-group post-actions">
                            <a class="btn btn-default" href="/index/showpost.html?msg={{blogpost.getSignature()}}">
                              <i class="glyphicon glyphicon-link"></i>
                            </a>
                            {% if blogpost.getShareSignatureOpt() is not null%}
                              <button class ="btn btn-default" onclick="javascript:processDelete('{{blogpost.getShareSignatureOpt()}}')" >
                                <i class="glyphicon glyphicon-trash" style=""></i>
                              </button>
                            {% else%}
                              <button class ="btn btn-default" onclick="javascript:processDelete('{{blogpost.getSignature()}}')" >
                                <i class="glyphicon glyphicon-trash" style=""></i>
                              </button>
                              {% endif%}
                          </div>
                          <div style="display:none;">
                            <textarea id="clipboard_textarea" name="clipboard_textarea">hello</textarea>
                          </div>
                      </div>
    
                        </div>
                      </div>
                    <div class="timeline-body">
                      <a href="/index/showpost.html?msg={{blogpost.getSignature()}}"><p class="post-header"><b>{{blogpost.titleOpt}}</b></a></p>
                      <p class="post-content">{{blogpost.description}}</p>
                    </div>
                    <div class="timeline-footer">
                      <a><span onclick="javascript:processLike('{{blogpost.getSignature()}}', {{blogpost.isLiking()}})" ><i class="glyphicon glyphicon-heart" style=""><font color=white>.</font>{{blogpost.getLikes()}}</i></a>
                      <a class="pull-right"><span onclick="javascript:processShare('{{blogpost.getSignature()}}' , '{{blogpost.getBlognameOpt()|escape(strategy="js")}}')" ><i class="glyphicon glyphicon-share"><font color=white>.</font>{{blogpost.getShares()}}</i></a>
                       
    				   <div class="commentList">
                       {% for comment in blogpost.getComments() %}
                        <div class="commentEntry">
                        
    					<div class="media-left">
    					{% if comment.getNameOpt() is not null %}
                          <a href="/index/blog.html?blogname={{comment.nameOrCreator|escape(strategy="url_param")}}">
                          {%else%}
                          <a href="#">
                      	{%endif%}
                         {%if comment.getAvatar() is empty%}
                            <img class="media-object commenterImage" src="/index/img/qora-user.png" alt="user image">
              			{%else%}
                            <img class="media-object commenterImage" src="{{comment.getAvatar()}}" alt="user image">
              			{%endif%}
                          </a>
    					
    					</div>
    					  
    					<div class="media-body">
                          {% if comment.getNameOpt() is not null %}
    						<h4 class="media-heading Commenter"><a href="/index/blog.html?blogname={{comment.nameOrCreator|escape(strategy="url_param")}}">{{comment.nameOrCreator}}</a></h4>
              			{%else%}
    						<h4 class="media-heading Commenter">{{comment.nameOrCreator}}</h4>
              			{%endif%}
              				 {% if comment.getTitleOpt() is not null %}
                            <b><p class="commentText">{{comment.titleOpt}}</p></b>
                            {%endif%}
                            <p class="commentText">{{comment.description}}</p>
                            <span class="date sub-text">{{comment.creationTime}}</span>
    					</div>
                        
    					<div class="media-right">
    						<button class ="btn btn-default" onclick="javascript:processCommentDelete('{{comment.getSignature()}}')" >
    							<i class="glyphicon glyphicon-trash" style=""></i>
    						</button>
    					</div>
    					
    					</div>
                    {% endfor %}
                    {%if blogprofile is empty or blogprofile.isCommentingAllowed() %}
                        <form class="form-inline" role="form">
                          <div class="form-group">
                            <a style="cursor: pointer;" onclick="javascript:showCommentForm('{{blogpost.getSignature()}}');" class="translate">Comment</a>
                          </div>
                        </form>
                    {%endif%}
                    </div>
                  </div>
                  </div>
                </li>			{% endfor %}
                {%else%}
                 <h1 style="font-family: Verdana;"><span class="translate">This blog is currently disabled.</span><br>
                 {% if ownProfileName is not null %}
            	<span class="translate">You can enable the blog <a href='/index/settings.html?profilename={{ownProfileName|escape(strategy="url_param")}}'>here</a></span>
            	{%endif%}
          		</h1><br>
                {% endif %}
                <li class="clearfix"></li>
              </ul>
            </div>
          </div>
        </div>
      </div>
        <script type="text/javascript">
    
    		var profileisFollowing;
    		{% if isFollowing %}
    		profileisFollowing = true;
    		{% else %}
    		profileisFollowing = false;
    		{%  endif %}
    
           function getParameter(name) {
            if (name = (new RegExp('[?&]' + encodeURIComponent(name) + '=([^&]*)')).exec(location.search))
                return decodeURIComponent(name[1]);
        	}
    
    		function parseError(error) {
    			try {
    				var error = JSON.parse(error);
    				message = error.message;
    			} catch (e) {
    				message = error;
    			}
    			return message;
    		}
    					
        	function processfollow() {
    			var  blogname;
    			var follow = !profileisFollowing;
    			blogname = getParameter('blogname');
    
          // $("#apimessage").fadeTo(2500, 500).slideUp(1000, function(){
          //     $("#apimessage").alert('close');
          // });
    			if (!blogname) {
    				$("#apimessage").html("<center><div class=\"alert alert-dismissible alert-danger\" role=\"alert\"><button type=\"button\" class=\"close\" data-dismiss=\"alert\">×</button>"
    								+ Lang.getInstance().translate("You can't follow the Mainblog")
    								+ "<br>"
    								+ "</div></center>");
    				return 0;
    			}
    
    			{% if activeProfile is null %}
    				$("#apimessage").html("<center><div class=\"alert alert-dismissible alert-danger\" role=\"alert\"><button type=\"button\" class=\"close\" data-dismiss=\"alert\">×</button>"
    								+ Lang.getInstance().translate("This feature can only be used with an active profile.\nPlease choose a Profile first!")
    								+ "</div></center>");
    				return 0;
    			{%  endif %}
    
    			$.post(
    			"/index/followblog.html",
    			{
    				blogname: blogname,
    				follow: follow
    			}).done( function(data) {
    				if(data.type == 'youAlreadyFollowThisBlog'){
    					$("#apimessage").html("<center><div class=\"alert alert-dismissible alert-danger\" role=\"alert\"><button type=\"button\" class=\"close\" data-dismiss=\"alert\">×</button>" 
    										+ Lang.getInstance().translate("Blog follow not successful<br>You already follow this blog")
    										+ "</div></center>");
    				} else if (data.type == 'youCantFollowYourOwnProfiles'){
    					$("#apimessage").html("<center><div class=\"alert alert-dismissible alert-danger\" role=\"alert\"><button type=\"button\" class=\"close\" data-dismiss=\"alert\">×</button>" 
    										+ Lang.getInstance().translate("Blog follow not successful<br>You can't follow your own profiles")
    										+ "</div></center>");
    				} else if (data.type == 'YouFollowThisBlogNow'){
    					$("#apimessage").html("<div class=\"alert alert-dismissible alert-success\" role=\"alert\"><button type=\"button\" class=\"close\" data-dismiss=\"alert\">×</button>" 
    										+ Lang.getInstance().translate("You follow this blog now")
    										+ "<br>"
    										+ "</div>");
    				} else if (data.type == 'BlogFollowNotSuccessful'){
    					$("#apimessage").html("<center><div class=\"alert alert-dismissible alert-danger\" role=\"alert\"><button type=\"button\" class=\"close\" data-dismiss=\"alert\">×</button>" 
    										+ Lang.getInstance().translate("Blog follow not successful")
    										+ "<br>"
    										+ parseError(data.result)
    										+ "</div></center>");
    				} else if (data.type == 'unfollowSuccessful'){
    					$("#apimessage").html("<div class=\"alert alert-dismissible alert-success\" role=\"alert\"><button type=\"button\" class=\"close\" data-dismiss=\"alert\">×</button>" 
    										+ Lang.getInstance().translate("Unfollow successful")
    										+ "<br>"
    										+ "</div>");
    				} else if (data.type == 'blogUnfollowNotSuccessful'){
    					$("#apimessage").html("<center><div class=\"alert alert-dismissible alert-danger\" role=\"alert\"><button type=\"button\" class=\"close\" data-dismiss=\"alert\">×</button>" 
    										+ Lang.getInstance().translate("Blog unfollow not successful")
    										+ "<br>"
    										+ parseError(data.result)
    										+ "</div></center>");
    				}
    
    				if(data.hasOwnProperty('follower'))
    				{
    						$("#profFollower").html('');
    				}
    
    				if(data.hasOwnProperty('isFollowing'))
    				{
    					profileisFollowing = data.isFollowing;
    
    					if(data.isFollowing)
    					{
    						$("#divFollow").css("color", "#6467FF");
    					}
    					else
    					{
    						$("#divFollow").css("color", "");
    					}
    				}
    
    			}).fail( function(xhr, textStatus, errorThrown) {
    				$("#apimessage").html('<center><div class=\"alert alert-dismissible alert-danger\" role=\"alert\"><button type=\"button\" class=\"close\" data-dismiss=\"alert\">×</button>' 
    										+ Lang.getInstance().translate('Follow Error')
    										+ '<br>' 
    										+ Lang.getInstance().translate('Connection Error')
    										+ '<br>'
    										+ xhr.responseText + '</div></center>');
    			});
    
       		 }
    
    		   		 (function() {
    		    var v = document.getElementsByClassName("youtube-player");
    		    for (var n = 0; n < v.length; n++) {
    		        var p = document.createElement("div");
    		        p.innerHTML = labnolThumb(v[n].dataset.id);
    		        p.onclick = labnolIframe;
    		        v[n].appendChild(p);
    		    }
    		})();
    
    		function labnolThumb(id) {
    		    return '<img class="youtube-thumb" src="//i.ytimg.com/vi/' + id + '/hqdefault.jpg"><div class="play-button"></div>';
    		}
    
    		function labnolIframe() {
    		    var iframe = document.createElement("iframe");
    		    iframe.setAttribute("src", "//www.youtube.com/embed/" + this.parentNode.dataset.id + "?autoplay=1&autohide=2&border=0&wmode=opaque&enablejsapi=1&controls=0&showinfo=0");
    		    iframe.setAttribute("frameborder", "0");
    		    iframe.setAttribute("id", "youtube-iframe");
    		    this.parentNode.replaceChild(iframe, this);
    		}
    
    
    		function processDelete(signature) {
    
    			$.post(
    			"/index/deletepost.html",
    			{
    				signature: signature,
    			}).done( function(data) {
    				if(data.type == 'deleteError'){
    					$("#apimessage").html('<center><div class=\"alert alert-dismissible alert-danger\" role=\"alert\"><button type=\"button\" class=\"close\" data-dismiss=\"alert\">×</button>' 
    										+ Lang.getInstance().translate('Delete Error') + '<br>'
    										+ Lang.getInstance().translate(data.errordetail) + '</div></center>');
    				} else if (data.type == 'deleteSuccessful'){
    					$("#apimessage").html('<center><div class=\"alert alert-dismissible alert-success\" role=\"alert\"><button type=\"button\" class=\"close\" data-dismiss=\"alert\">×</button>' 
    										+ Lang.getInstance().translate('Delete successful') + '<br>'
    										+ '</div></center>');
    					setTimeout(function() { window.location.reload(); }, 1500);
    				}
    
    
    			}).fail( function(xhr, textStatus, errorThrown) {
    			
    				$("#apimessage").html('<center><div class=\"alert alert-dismissible alert-danger\" role=\"alert\"><button type=\"button\" class=\"close\" data-dismiss=\"alert\">×</button>' 
    										+ Lang.getInstance().translate('Delete Error') + '<br>'
    										+ Lang.getInstance().translate('Connection Error') + '<br>'
    										+ parseError(xhr.responseText) + '</div></center>');
    			});
    
    			return 0;
       		 }
    		function processCommentDelete(signature) {
    
    			$.post(
    			"/index/deletecomment.html",
    			{
    				signature: signature,
    			}).done( function(data) {
    				if(data.type == 'deleteError'){
    					$("#apimessage").html('<center><div class=\"alert alert-dismissible alert-danger\" role=\"alert\"><button type=\"button\" class=\"close\" data-dismiss=\"alert\">×</button>' 
    										+ Lang.getInstance().translate('Delete Error') + '<br>'
    										+ Lang.getInstance().translate(parseError(data.errordetail)) + '</div></center>');
    				} else if (data.type == 'deleteSuccessful'){
    					$("#apimessage").html('<center><div class=\"alert alert-dismissible alert-success\" role=\"alert\"><button type=\"button\" class=\"close\" data-dismiss=\"alert\">×</button>' 
    										+ Lang.getInstance().translate('Delete successful') + '<br>'
    										+ '</div></center>');
    					setTimeout(function() { window.location.reload(); }, 1500);
    				}
    
    
    			}).fail( function(xhr, textStatus, errorThrown) {
    				
    				$("#apimessage").html('<center><div class=\"alert alert-dismissible alert-danger\" role=\"alert\"><button type=\"button\" class=\"close\" data-dismiss=\"alert\">×</button>' 
    										+ Lang.getInstance().translate('Delete Error') + '<br>'
    										+ Lang.getInstance().translate('Connection Error') + '<br>'
    										+ parseError(xhr.responseText) + '</div></center>');
    			});
    
    			return 0;
       		 }
    
    
    		function processShare(signature, blogname) {
    
    			{% if activeProfile is null %}
    				$("#apimessage").html("<center><div class=\"alert alert-dismissible alert-danger\" role=\"alert\"><button type=\"button\" class=\"close\" data-dismiss=\"alert\">×</button>"
    									+ Lang.getInstance().translate("This feature can only be used with an active profile.\nPlease choose a Profile first!")
    									+ "</div></center>");
    				return 0;
    			{%  endif %}
    
    			$.post(
    			"/index/sharepost.html",
    			{
    				signature: signature,
    				blogname: blogname,
    			}).done( function(data) {
    				if(data.type == 'YouAlreadySharedThisPost'){
    					$("#apimessage").html('<center><div class="alert alert-dismissible alert-danger" role="alert"><button type=\"button\" class=\"close\" data-dismiss=\"alert\">×</button>' 
    										+ Lang.getInstance().translate('You already shared this post')
    										+ '<br></div></center>');
    				} else if (data.type == 'YouCantShareYourOwnPosts'){
    					$("#apimessage").html('<center><div class=\"alert alert-dismissible alert-danger\" role=\"alert\"><button type=\"button\" class=\"close\" data-dismiss=\"alert\">×</button>' 
    										+ Lang.getInstance().translate('Share not successful')
    										+ '<br>'
    										+ Lang.getInstance().translate('This Blogentry is already in your blog.')
    										+ '</div></center>');
    				} else if (data.type == 'ShareSuccessful'){
    					$("#apimessage").html('<center><div class=\"alert alert-dismissible alert-success\" role=\"alert\"><button type=\"button\" class=\"close\" data-dismiss=\"alert\">×</button>' 
    										+ Lang.getInstance().translate('Share successful')
    										+ '<br>'
    										+ '</div></center>');
    				} else if (data.type == 'ShareNotSuccessful'){
    					$("#apimessage").html('<center><div class=\"alert alert-dismissible alert-danger\" role=\"alert\"><button type=\"button\" class=\"close\" data-dismiss=\"alert\">×</button>' 
    										+ Lang.getInstance().translate('Share not successful')
    										+ '<br>'
    										+ parseError(data.result) + '</div></center>');
    				} else if (data.type == 'error'){
    					$("#apimessage").html('<center><div class=\"alert alert-dismissible alert-danger\" role=\"alert\"><button type=\"button\" class=\"close\" data-dismiss=\"alert\">×</button>' 
    										+ Lang.getInstance().translate('Share Error')
    										+ '<br>'
    										+ data.error + '</div></center>');
    				}else if (data.type == 'BlogIsDisabled'){
    					("#apimessage").html('<center><div class=\"alert alert-dismissible alert-danger\" role=\"alert\"><button type=\"button\" class=\"close\" data-dismiss=\"alert\">×</button>' 
    										+ Lang.getInstance().translate('Share not successful')
    										+ '<br>'
    										+ Lang.getInstance().translate('The Blog of your active profile is disabled!')
    										+ '</div></center>');
    				}
    
    
    			}).fail( function(xhr, textStatus, errorThrown) {
    				$("#apimessage").html('<center><div class=\"alert alert-dismissible alert-danger\" role=\"alert\"><button type=\"button\" class=\"close\" data-dismiss=\"alert\">×</button>' 
    										+ Lang.getInstance().translate('Share Error')
    										+ '<br>'
    										+ Lang.getInstance().translate('Connection Error')
    										+ '<br>'
    										+ parseError(xhr.responseText) + '</div></center>');
    			});
    
    			return 0;
       		 }
    
    
        	function processLike(signature, isLikeing) {
    			var blogname;
    			var like = !isLikeing;
    
    
    
    			{% if activeProfile is null %}
    				$("#apimessage").html("<center><div class=\"alert alert-dismissible alert-danger\" role=\"alert\"><button type=\"button\" class=\"close\" data-dismiss=\"alert\">×</button>"
    									+ Lang.getInstance().translate("This feature can only be used with an active profile.\nPlease choose a Profile first!")
    									+ "</div></center>");
    				return 0;
    			{%  endif %}
    
    			$.post(
    			"/index/likepost.html",
    			{
    				signature: signature,
    				like: like
    			}).done( function(data) {
    				if(data.type == 'YouAlreadyLikeThisPost'){
    					$("#apimessage").html('<center><div class="alert alert-dismissible alert-danger" role="alert"><button type=\"button\" class=\"close\" data-dismiss=\"alert\">×</button>'
    										+ Lang.getInstance().translate('You already like this post')
    										+ '<br></div></center>');
    				} else if (data.type == 'YouCantLikeYourOwnPosts'){
    					$("#apimessage").html('<center><div class=\"alert alert-dismissible alert-danger\" role=\"alert\"><button type=\"button\" class=\"close\" data-dismiss=\"alert\">×</button>'
    										+ Lang.getInstance().translate('Like not successful')
    										+ '<br>'
    										+ Lang.getInstance().translate('You can\'t like your own posts')
    										+ '</div></center>');
    				} else if (data.type == 'LikeSuccessful'){
    					$("#apimessage").html('<center><div class=\"alert alert-dismissible alert-success\" role=\"alert\"><button type=\"button\" class=\"close\" data-dismiss=\"alert\">×</button>'
    										+ Lang.getInstance().translate('Like successful')
    										+ '<br>'
    										+ '</div></center>');
    				} else if (data.type == 'LikeNotSuccessful'){
    					try {
    						var error = JSON.parse(data.result);
    						message = error.message;
    					} catch (e) {
    						message = data.result;
    					}
    
    					$("#apimessage").html('<center><div class=\"alert alert-dismissible alert-danger\" role=\"alert\"><button type=\"button\" class=\"close\" data-dismiss=\"alert\">×</button>' 
    										+ Lang.getInstance().translate('Like not successful')
    										+ '<br>'
    										+ message + '</div></center>');
    				} else if (data.type == 'LikeRemovedSuccessful'){
    
    					$("#apimessage").html('<center><div class=\"alert alert-dismissible alert-success\" role=\"alert\"><button type=\"button\" class=\"close\" data-dismiss=\"alert\">×</button>'
    										+ Lang.getInstance().translate('Like removed successful') 
    										+ '<br>'
    										+ '</div></center>');
    				} else if (data.type == 'LikeRemovedNotSuccessful'){
    					$("#apimessage").html('<center><div class=\"alert alert-dismissible alert-danger\" role=\"alert\"><button type=\"button\" class=\"close\" data-dismiss=\"alert\">×</button>'
    										+ Lang.getInstance().translate('Like remove not successful')
    										+ '<br>'
    										+ parseError(data.result)
    										+ '</div></center>');
    					$("#profLikes").html(data.newlikes);
    				} else if (data.type == 'error'){
    					$("#apimessage").html('<center><div class=\"alert alert-dismissible alert-danger\" role=\"alert\"><button type=\"button\" class=\"close\" data-dismiss=\"alert\">×</button>' 
    										+ Lang.getInstance().translate('Like Error')
    										+ '<br>'
    										+ parseError(data.error) + '</div></center>');
    				}
    
    				if(data.hasOwnProperty('likes'))
    				{
    					if(data.likes == 0)
    					{
    						$("#profLikes").html('');
    					}
    					else
    					{
    						$("#profLikes").html(data.likes);
    					}
    				}
    
    
    			}).fail( function(xhr, textStatus, errorThrown) {
    				$("#apimessage").html('<center><div class=\"alert alert-dismissible alert-danger\" role=\"alert\"><button type=\"button\" class=\"close\" data-dismiss=\"alert\">×</button>'
    										+ Lang.getInstance().translate('Like Error')
    										+ '<br>'
    										+ Lang.getInstance().translate('Connection Error')
    										+ '<br>'
    										+ xhr.responseText + '</div></center>');
    			});
    
    			return 0;
       		 }
    		 
    		 function showCommentForm(signature) {
    			$("#commentIframe").attr("src", "postblog.html?postid="+signature);
    			$("#commentModal").modal('show'); 
    		 }
    		 
    </script>
    <script type="text/javascript">
        $('ul.nav-tabs > li').removeClass('active');
        if (window.location.pathname === '/index/blogsearch.html') {
            $('ul.nav-tabs > li:nth-child(2)').addClass('active');
        } else {
            $('ul.nav-tabs > li:nth-child(1)').addClass('active');
        }
    
    
        var transformToAssocArray;
        transformToAssocArray = function(prmstr) {
            var i, params, prmarr, tmparr;
            params = {};
            prmarr = prmstr.split('&');
            i = 0;
            while (i < prmarr.length) {
                tmparr = prmarr[i].split('=');
                params[tmparr[0]] = tmparr[1];
                i++;
            }
            return params;
        };
        var getSearchParameters;
        getSearchParameters = function() {
            var prmstr;
            prmstr = decodeURIComponent(window.location.search.substr(1));
            if (prmstr != null && prmstr != '') {
                return transformToAssocArray(prmstr);
            } else {
                return {};
            }
        };
    
        $(document).ready(function() {
    
       		  $('#name').change(function() {
                $('ul.nav-tabs > li:nth-child(1) > a').attr('href', '/index/hashtag.html?hashtag=' + $('#name').val());
                $('ul.nav-tabs > li:nth-child(2) > a').attr('href', '/index/hashtag.html?hashtag=' + $('#name').val());
            });
            $('ul.nav-tabs > li:nth-child(1) > a').attr('href', '/index/hashtag.html?hashtag=' + $('#name').val());
            $('ul.nav-tabs > li:nth-child(2) > a').attr('href', '/index/hashtag.html?hashtag=' + $('#name').val());
    
            searchval = $('#name').val();
            $('#name').val(searchval);
    
              $('#button').click(function() {
    
                var url;
                url = void 0;
                searchval = $('#name').val();
                  if (window.location.pathname === '/index/hashtag.html') {
           		 	document.location.href = '/index/hashtag.html?hashtag=' + searchval;
           		 } else {
           		 	document.location.href = '/index/hashtag.html?hashtag=' + searchval;
            	}
            });
            $('#name').keypress(function(e) {
                if (e.which === 13) {
                    $('#button').trigger('click');
                }
            });
    
            var my_posts = $("[rel=tooltip]");
    
    		var size = $(window).width();
    
    		if(my_posts.length > 1)
    		{
    			$("ul.timeline li:odd").addClass("timeline-inverted");
    		}
    
    		for (i = 0; i < my_posts.length; i++) {
                the_post = $(my_posts[i]);
                if (the_post.hasClass('invert') && size >= 767) {
                    the_post.tooltip({
                        placement: 'left'
                    });
                    the_post.css("cursor", "pointer");
                } else {
                    the_post.tooltip({
                        placement: 'rigth'
                    });
                    the_post.css("cursor", "pointer");
                }
            }
            {% if hideprofile is not empty%}
          $(".tl-profile").hide();
          $(".timeline").css("padding-top","40px");
          {%endif%}
    
          {% if msg is not null %} $('html, body').animate({
            scrollTop: $("#{{msg}}").offset().top
        }, 2000);
        {%endif%}
    
    	  $('#name').val(getSearchParameters().hashtag);
            if (getSearchParameters().hashtag === void 0) {
                $('#name').val('');
            }
    
    
    
        });
    
        $(function () {
          $('[data-toggle="tooltip"]').tooltip()
        })
    
        </script>
        <script type="text/javascript">
        $(document).ready(function(){
        {% for blogpost in blogposts %}
        if (window.location.search === '?msg={{blogpost.getSignature()}}') {
          $('#{{blogpost.getSignature()}} > .timeline-panel').toggleClass("highlighted");
          $('#{{blogpost.getSignature()}} > .timeline-badge').toggleClass("highlighted");
        };
        if (window.location.search === '?blogname={{blogpost.nameOrCreator|escape(strategy="url_param")}}&msg={{blogpost.getSignature()}}') {
          $('#{{blogpost.getSignature()}} > .timeline-panel').toggleClass("highlighted");
          $('#{{blogpost.getSignature()}} > .timeline-badge').toggleClass("highlighted");
       };
        if (window.location.search === '?hashtag={{hashtag}}&msg={{blogpost.getSignature()}}') {
          $('#{{blogpost.getSignature()}} > .timeline-panel').toggleClass("highlighted");
          $('#{{blogpost.getSignature()}} > .timeline-badge').toggleClass("highlighted");
       };
        {% endfor %}
    	
    	Lang.getInstance().translateByClass();
      });
    
        </script>
    <script type="text/javascript">
    {% for blogpost in blogposts %}
        function changeTextarea{{blogpost.getSignature()}}( str ) {
            var textarea = document.getElementById('clipboard_textarea')
    
            textarea.value = str;
        }
    
        $('a').mouseout(function(){
           $('#clipboard_textarea').hide();
        });
        $('a').mouseover(function(){
        $('#clipboard_textarea').show();
        });
            $('#clipboard_textarea').mouseover(function(){
            $(this).show();
            });
    {% endfor %}
        </script>
    <script>
    
    </script>
      </body>
    </html>
    
    <!DOCTYPE html>
    <html lang="en">
      <head>
        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <meta name="description" content="Qora Web Server">
        <link rel="shortcut icon" href="favicon.ico">
        <title>/qblog/blog.html Qora Blog</title>
        <link href="/index/libs/bootstrap/3/css/theme.css" rel="stylesheet">
        <link href="/index/libs/css/style.css" rel="stylesheet">
        <link href="/index/libs/css/sidebar.css" rel="stylesheet">
        <link href="/index/libs/css/timeline.css" rel="stylesheet">
        <style type="text/css">
          .media:first-child {
          margin-top: 0;
          padding-left: 20px;
          padding-top: 20px;
          padding-right: 20px;
          }
          .media-object {
          height: 74px;
          }
          .media-heading {
          margin-top: 20px;
          margin-bottom: 5px;
          }
          p.post-header {
          padding-bottom: 0px !important;
          font-size: 15px;
          }
          p.post-content {
          padding-top: 0px !important;
          word-break: break-all;
          word-wrap: break-word;
          }
          body {
          padding-top: 50px;
          }
          .sub-header {
          padding-bottom: 10px;
          border-bottom: 1px solid #eee;
          }
          .navbar-fixed-top {
          border: 0;
          z-index: 9999;
          }
          .sidebar {
          display: none;
          }
          @media (min-width: 768px) {
          .sidebar {
          position: fixed;
          top: 51px;
          bottom: 0;
          left: 0;
          z-index: 1000;
          display: block;
          padding: 20px;
          overflow-x: hidden;
          overflow-y: auto;
          background-color: #f5f5f5;
          border-right: 1px solid #eee;
          }
          }
          .nav-sidebar {
          margin-right: -21px;
          margin-bottom: 20px;
          margin-left: -20px;
          }
          .nav-sidebar > li > a {
          padding-right: 20px;
          padding-left: 20px;
          }
          .nav-sidebar > .active > a,
          .nav-sidebar > .active > a:hover,
          .nav-sidebar > .active > a:focus {
          color: #fff;
          background-color: #428bca;
          }
          .main {
          padding-top: 0px;
          }
          .main-tabs {
          width: 100%;
          padding-top: 15px;
          padding-left: 0px;
          padding-right: 0px;
          background-color: lightgray;
          display: none;
          }
          img.logo-header {
          background-color: transparent;
          height: 100%;
          }
          .col-lg-8 {
          padding-left: 0px;
          }
          @media (min-width: 768px) {
          .main {
          padding-right: 40px;
          }
          }
          .main .page-header {
          margin-top: 0;
          }
          .placeholders {
          margin-bottom: 30px;
          text-align: center;
          }
          .placeholders h4 {
          margin-bottom: 0;
          }
          .placeholder {
          margin-bottom: 20px;
          }
          .placeholder img {
          display: inline-block;
          border-radius: 50%;
          }
          .r-t {
          margin: 0px;
          }
          .r-l {
          margin: 0px;
          }
          span.label.label-default {
          background-color: #fff;
          color: lightgray;
          font-size: 90%;
          line-height: 1;
          }
          span.label.label-default a {
          color: #ddd;
          text-decoration: none;
          }
          a.r-l:hover,
          a.r-l:focus {
          color: #6467FF;
          text-decoration: none;
          }
          .navbar-header {
          width: 110px;
          }
          .modal-dialog.modal-lg {
          padding-top: 100px;
          }
          .modal-content {
          height: 620px;
          /*width: 700px;*/
          }
          .tl-profile {
          border: 1px solid #ddd;
          -webkit-box-shadow: 0 1px 6px rgba(0, 0, 0, 0.175);
          box-shadow: 0 1px 6px rgba(0, 0, 0, 0.175);
          margin-top: 40px;
          }
          .tl-profile img.tl-image-lg{
          z-index: 0;
          width: 100%;
          margin-bottom: 10px;
          }
          .tl-image-profile
          {
          margin: -90px 10px 0px 50px;
          z-index: 9;
          width: 21%;
          margin-bottom: 20px;
          }
          @media (max-width:768px)
          {
          .tl-profile-text>h1{
          font-weight: 700;
          font-size:16px;
          }
          .tl-image-profile
          {
          margin: -45px 10px 0px 25px;
          z-index: 9;
          width: 20%;
          }
          }
          .profile-options
          {
          width:100%;
          font-size: 20px;
          }
          .co-tabs {
          border-bottom: 3px solid #6467ff;
          margin-right: 10px;
          }
          ul.co-lists.list-unstyled {
          text-align: center;
          }
          li.co-top {
          font-size: 10px;
          }
          li.co-bottom {
          font-size: 15px;
          }
          .po-tabs
          {
          border: 1px solid #ddd;
          }
          li.po-tabs a
          {
          color: #ddd;
          }
          li.po-tabs a:hover
          {
          color: #6467ff;
          text-decoration: none;
          }
          #apimessage {
          position: fixed;
          top: 0px;
          left: 0px;
          width: 100%;
          z-index: 9999;
          }
          span.glyphicon.glyphicon-edit {
          font-size: 17px;
          top: -2px;
          left: -6px;
          }
          button.btn.btn-lg.btn-primary {
          height: 37px;
          width: 37px;
          }
          .modal-dialog.modal-lg {
          top: -50px;
          }
          .menu-grid span.glyphicon.glyphicon-edit {
          left: 2px;
          }
          .btn-group.post-actions {
          display: flex;
          }
        </style>
      </head>
      <body>
        <div id="PostModal" class="modal fade">
          <div class="modal-dialog modal-lg">
            <div class="modal-content">
              <iframe width="100%" height="100%" frameborder="0" src="postblog.html?blogname={{blogname|escape(strategy="url_param")}}"></iframe>
            </div>
          </div>
        </div>
    	<div id="commentModal" class="modal fade">
    	  <div class="modal-dialog modal-lg">
            <div class="modal-content">
              <iframe id=commentIframe width="100%" height="100%" frameborder="0" src="#"></iframe>
            </div>
          </div>
        </div>
        {{navbar}}
        <div class="container">
          <div class="row">
            <div class="main">
            {% autoescape true%}
             	{%if blogprofile.getProfileGraphicOpt() is empty%}
              <div class="tl-profile"><img align="left" src="/index/img/banner_01.png" alt="" class="tl-image-lg">
              {%else%}
              <div class="tl-profile"><img align="left" src="{{blogprofile.getProfileGraphicOpt()}}" alt="" class="tl-image-lg">
              {%endif%}
    
              {% if blogprofile.getAvatarOpt() is empty%}
                <img align="left" src="/index/img/qora-user.png" alt="" class="tl-image-profile thumbnail">
              {%else%}
                <img align="left" src="{{blogprofile.getAvatarOpt()}}" alt="" class="tl-image-profile thumbnail">
                {%endif%}
                <div class="tl-profile-text">
                  <h1>{{blogname}}</h1>
                  <ul class="profile-options list-inline">&nbsp;&nbsp;
                    <li class="co-tabs pull-left"><ul class="co-lists list-unstyled"><li class="co-top translate">Followers</li><li class="co-bottom">{{ follower.size() }}</li></ul></li>
                    <li class="co-tabs pull-left"><ul class="co-lists list-unstyled"><li class="co-top translate">Following</li><li class="co-bottom">{{ blogprofile.getFollowedBlogs().size() }}</li></ul></li>
              		{% if blogprofile is not empty and  blogprofile.isBlogEnabled()%}
                  <li class="po-tabs pull-right"><a><span style='cursor: pointer;' onclick="javascript:processfollow()">{%if isFollowing%}<span class="translate">Unfollow</span> {%else%}<span class="translate">Follow</span> {%endif%}<div id="divFollow" class="glyphicon glyphicon-user"{%if isFollowing%}style="color: #6467FF;"{%else%}{%endif%}></div> <span id=profFollower>
    			  </span></span></a></li>
                  {%endif%}
                  </ul>
                </div>
               {% endautoescape %}
              </div>        	{{apimessage}} <div id=apimessage></div>
              {% if blogenabled %}
              <ul class="timeline">{% for blogpost in blogposts %}
                <li id="{{blogpost.getSignature()}}">
                  <div class="timeline-badge primary"><a><i rel="tooltip" title="{{blogpost.creationTime}}" id="" class="glyphicon glyphicon-record"></i></a></div>
                  <div class="timeline-panel">
                    <div class="timeline-heading">
                      <div class="media">
                      	{% if blogpost.shareAuthorOpt() is not null %}
                      	{% if blogpost.getNameOpt() is not null %}
                      	<h6><span class="glyphicon glyphicon-retweet"></span>  <b><a href="/index/blog.html?blogname={{blogpost.shareAuthorOpt()|escape(strategy="url_param")}}">{{blogpost.shareAuthorOpt()}}</a></b> shared <b><a href="/index/blog.html?blogname={{blogpost.nameOrCreator|escape(strategy="url_param")}}">{{blogpost.nameOrCreator}}</a></b> post</h6>
                      	{%else%}
                      	<h6><span class="glyphicon glyphicon-retweet"></span>  <b><a href="/index/blog.html?blogname={{blogpost.shareAuthorOpt()|escape(strategy="url_param")}}">{{blogpost.shareAuthorOpt()}}</a></b> shared <b>{{blogpost.nameOrCreator}}</b> post</h6>
                      	{%endif%}
                      	{%endif%}
                        {% if blogpost.getProfileOpt() is not null and blogpost.getProfileOpt().isProfileEnabled() %}
                        <div class="media-left media-middle"><a href="/index/blog.html?blogname={{blogpost.nameOrCreator|escape(strategy="url_param")}}"><img src="{{blogpost.getAvatar()}}" alt="" class="media-object"></a></div>
                        {%else%}
                        <div class="media-left media-middle"><img src="{{blogpost.getAvatar()}}" alt="" class="media-object"></div>
                        {%endif%}
                        <div class="media-body">
                        	{% if blogpost.getProfileOpt() is not null and blogpost.getProfileOpt().isProfileEnabled() %}
                          <h6 class="media-heading"><b><a href="/index/blog.html?blogname={{blogpost.getProfileOpt().getName().getName()|escape(strategy="url_param")}}">{{blogpost.nameOrCreator}}</a></b></h6>{{blogpost.creationTime}}
                        	{%else%}
                          <h6 class="media-heading"><b>{{blogpost.nameOrCreator}}</b></h6>{{blogpost.creationTime}}
                        	{%endif%}
                        </div>
                        <div class="media-right">
                          <div class="btn-group post-actions">
                            <a class="btn btn-default" href="/index/showpost.html?msg={{blogpost.getSignature()}}">
                              <i class="glyphicon glyphicon-link"></i>
                            </a>
                            {% if blogpost.getShareSignatureOpt() is not null%}
                              <button class ="btn btn-default" onclick="javascript:processDelete('{{blogpost.getShareSignatureOpt()}}')" >
                                <i class="glyphicon glyphicon-trash" style=""></i>
                              </button>
                            {% else%}
                              <button class ="btn btn-default" onclick="javascript:processDelete('{{blogpost.getSignature()}}')" >
                                <i class="glyphicon glyphicon-trash" style=""></i>
                              </button>
                              {% endif%}
                          </div>
                          <div style="display:none;">
                            <textarea id="clipboard_textarea" name="clipboard_textarea">hello</textarea>
                          </div>
                      </div>
    
                        </div>
                      </div>
                    <div class="timeline-body">
                      <a href="/index/showpost.html?msg={{blogpost.getSignature()}}"><p class="post-header"><b>{{blogpost.titleOpt}}</b></a></p>
                      <p class="post-content">{{blogpost.description}}</p>
                    </div>
                    <div class="timeline-footer">
                      <a><span onclick="javascript:processLike('{{blogpost.getSignature()}}', {{blogpost.isLiking()}})" ><i class="glyphicon glyphicon-heart" style=""><font color=white>.</font>{{blogpost.getLikes()}}</i></a>
                      <a class="pull-right"><span onclick="javascript:processShare('{{blogpost.getSignature()}}' , '{{blogpost.getBlognameOpt()|escape(strategy="js")}}')" ><i class="glyphicon glyphicon-share"><font color=white>.</font>{{blogpost.getShares()}}</i></a>
                       
    				   <div class="commentList">
                       {% for comment in blogpost.getComments() %}
                        <div class="commentEntry">
                        
    					<div class="media-left">
    					{% if comment.getNameOpt() is not null %}
                          <a href="/index/blog.html?blogname={{comment.nameOrCreator|escape(strategy="url_param")}}">
                          {%else%}
                          <a href="#">
                      	{%endif%}
                         {%if comment.getAvatar() is empty%}
                            <img class="media-object commenterImage" src="/index/img/qora-user.png" alt="user image">
              			{%else%}
                            <img class="media-object commenterImage" src="{{comment.getAvatar()}}" alt="user image">
              			{%endif%}
                          </a>
    					
    					</div>
    					  
    					<div class="media-body">
                          {% if comment.getNameOpt() is not null %}
    						<h4 class="media-heading Commenter"><a href="/index/blog.html?blogname={{comment.nameOrCreator|escape(strategy="url_param")}}">{{comment.nameOrCreator}}</a></h4>
              			{%else%}
    						<h4 class="media-heading Commenter">{{comment.nameOrCreator}}</h4>
              			{%endif%}
              				 {% if comment.getTitleOpt() is not null %}
                            <b><p class="commentText">{{comment.titleOpt}}</p></b>
                            {%endif%}
                            <p class="commentText">{{comment.description}}</p>
                            <span class="date sub-text">{{comment.creationTime}}</span>
    					</div>
                        
    					<div class="media-right">
    						<button class ="btn btn-default" onclick="javascript:processCommentDelete('{{comment.getSignature()}}')" >
    							<i class="glyphicon glyphicon-trash" style=""></i>
    						</button>
    					</div>
    					
    					</div>
                    {% endfor %}
                    {%if blogprofile is empty or blogprofile.isCommentingAllowed() %}
                        <form class="form-inline" role="form">
                          <div class="form-group">
                            <a style="cursor: pointer;" onclick="javascript:showCommentForm('{{blogpost.getSignature()}}');" class="translate">Comment</a>
                          </div>
                        </form>
                    {%endif%}
                    </div>
                  </div>
                  </div>
                </li>			{% endfor %}
                {%else%}
                 <h1 style="font-family: Verdana;"><span class="translate">This blog is currently disabled.</span><br>
                 {% if ownProfileName is not null %}
            	<span class="translate">You can enable the blog <a href='/index/settings.html?profilename={{ownProfileName|escape(strategy="url_param")}}'>here</a></span>
            	{%endif%}
          		</h1><br>
                {% endif %}
                <li class="clearfix"></li>
              </ul>
            </div>
          </div>
        </div>
      </div>
        <script type="text/javascript">
    
    		var profileisFollowing;
    		{% if isFollowing %}
    		profileisFollowing = true;
    		{% else %}
    		profileisFollowing = false;
    		{%  endif %}
    
           function getParameter(name) {
            if (name = (new RegExp('[?&]' + encodeURIComponent(name) + '=([^&]*)')).exec(location.search))
                return decodeURIComponent(name[1]);
        	}
    
    		function parseError(error) {
    			try {
    				var error = JSON.parse(error);
    				message = error.message;
    			} catch (e) {
    				message = error;
    			}
    			return message;
    		}
    					
        	function processfollow() {
    			var  blogname;
    			var follow = !profileisFollowing;
    			blogname = getParameter('blogname');
    
          // $("#apimessage").fadeTo(2500, 500).slideUp(1000, function(){
          //     $("#apimessage").alert('close');
          // });
    			if (!blogname) {
    				$("#apimessage").html("<center><div class=\"alert alert-dismissible alert-danger\" role=\"alert\"><button type=\"button\" class=\"close\" data-dismiss=\"alert\">×</button>"
    								+ Lang.getInstance().translate("You can't follow the Mainblog")
    								+ "<br>"
    								+ "</div></center>");
    				return 0;
    			}
    
    			{% if activeProfile is null %}
    				$("#apimessage").html("<center><div class=\"alert alert-dismissible alert-danger\" role=\"alert\"><button type=\"button\" class=\"close\" data-dismiss=\"alert\">×</button>"
    								+ Lang.getInstance().translate("This feature can only be used with an active profile.\nPlease choose a Profile first!")
    								+ "</div></center>");
    				return 0;
    			{%  endif %}
    
    			$.post(
    			"/index/followblog.html",
    			{
    				blogname: blogname,
    				follow: follow
    			}).done( function(data) {
    				if(data.type == 'youAlreadyFollowThisBlog'){
    					$("#apimessage").html("<center><div class=\"alert alert-dismissible alert-danger\" role=\"alert\"><button type=\"button\" class=\"close\" data-dismiss=\"alert\">×</button>" 
    										+ Lang.getInstance().translate("Blog follow not successful<br>You already follow this blog")
    										+ "</div></center>");
    				} else if (data.type == 'youCantFollowYourOwnProfiles'){
    					$("#apimessage").html("<center><div class=\"alert alert-dismissible alert-danger\" role=\"alert\"><button type=\"button\" class=\"close\" data-dismiss=\"alert\">×</button>" 
    										+ Lang.getInstance().translate("Blog follow not successful<br>You can't follow your own profiles")
    										+ "</div></center>");
    				} else if (data.type == 'YouFollowThisBlogNow'){
    					$("#apimessage").html("<div class=\"alert alert-dismissible alert-success\" role=\"alert\"><button type=\"button\" class=\"close\" data-dismiss=\"alert\">×</button>" 
    										+ Lang.getInstance().translate("You follow this blog now")
    										+ "<br>"
    										+ "</div>");
    				} else if (data.type == 'BlogFollowNotSuccessful'){
    					$("#apimessage").html("<center><div class=\"alert alert-dismissible alert-danger\" role=\"alert\"><button type=\"button\" class=\"close\" data-dismiss=\"alert\">×</button>" 
    										+ Lang.getInstance().translate("Blog follow not successful")
    										+ "<br>"
    										+ parseError(data.result)
    										+ "</div></center>");
    				} else if (data.type == 'unfollowSuccessful'){
    					$("#apimessage").html("<div class=\"alert alert-dismissible alert-success\" role=\"alert\"><button type=\"button\" class=\"close\" data-dismiss=\"alert\">×</button>" 
    										+ Lang.getInstance().translate("Unfollow successful")
    										+ "<br>"
    										+ "</div>");
    				} else if (data.type == 'blogUnfollowNotSuccessful'){
    					$("#apimessage").html("<center><div class=\"alert alert-dismissible alert-danger\" role=\"alert\"><button type=\"button\" class=\"close\" data-dismiss=\"alert\">×</button>" 
    										+ Lang.getInstance().translate("Blog unfollow not successful")
    										+ "<br>"
    										+ parseError(data.result)
    										+ "</div></center>");
    				}
    
    				if(data.hasOwnProperty('follower'))
    				{
    						$("#profFollower").html('');
    				}
    
    				if(data.hasOwnProperty('isFollowing'))
    				{
    					profileisFollowing = data.isFollowing;
    
    					if(data.isFollowing)
    					{
    						$("#divFollow").css("color", "#6467FF");
    					}
    					else
    					{
    						$("#divFollow").css("color", "");
    					}
    				}
    
    			}).fail( function(xhr, textStatus, errorThrown) {
    				$("#apimessage").html('<center><div class=\"alert alert-dismissible alert-danger\" role=\"alert\"><button type=\"button\" class=\"close\" data-dismiss=\"alert\">×</button>' 
    										+ Lang.getInstance().translate('Follow Error')
    										+ '<br>' 
    										+ Lang.getInstance().translate('Connection Error')
    										+ '<br>'
    										+ xhr.responseText + '</div></center>');
    			});
    
       		 }
    
    		   		 (function() {
    		    var v = document.getElementsByClassName("youtube-player");
    		    for (var n = 0; n < v.length; n++) {
    		        var p = document.createElement("div");
    		        p.innerHTML = labnolThumb(v[n].dataset.id);
    		        p.onclick = labnolIframe;
    		        v[n].appendChild(p);
    		    }
    		})();
    
    		function labnolThumb(id) {
    		    return '<img class="youtube-thumb" src="//i.ytimg.com/vi/' + id + '/hqdefault.jpg"><div class="play-button"></div>';
    		}
    
    		function labnolIframe() {
    		    var iframe = document.createElement("iframe");
    		    iframe.setAttribute("src", "//www.youtube.com/embed/" + this.parentNode.dataset.id + "?autoplay=1&autohide=2&border=0&wmode=opaque&enablejsapi=1&controls=0&showinfo=0");
    		    iframe.setAttribute("frameborder", "0");
    		    iframe.setAttribute("id", "youtube-iframe");
    		    this.parentNode.replaceChild(iframe, this);
    		}
    
    
    		function processDelete(signature) {
    
    			$.post(
    			"/index/deletepost.html",
    			{
    				signature: signature,
    			}).done( function(data) {
    				if(data.type == 'deleteError'){
    					$("#apimessage").html('<center><div class=\"alert alert-dismissible alert-danger\" role=\"alert\"><button type=\"button\" class=\"close\" data-dismiss=\"alert\">×</button>' 
    										+ Lang.getInstance().translate('Delete Error') + '<br>'
    										+ Lang.getInstance().translate(data.errordetail) + '</div></center>');
    				} else if (data.type == 'deleteSuccessful'){
    					$("#apimessage").html('<center><div class=\"alert alert-dismissible alert-success\" role=\"alert\"><button type=\"button\" class=\"close\" data-dismiss=\"alert\">×</button>' 
    										+ Lang.getInstance().translate('Delete successful') + '<br>'
    										+ '</div></center>');
    					setTimeout(function() { window.location.reload(); }, 1500);
    				}
    
    
    			}).fail( function(xhr, textStatus, errorThrown) {
    			
    				$("#apimessage").html('<center><div class=\"alert alert-dismissible alert-danger\" role=\"alert\"><button type=\"button\" class=\"close\" data-dismiss=\"alert\">×</button>' 
    										+ Lang.getInstance().translate('Delete Error') + '<br>'
    										+ Lang.getInstance().translate('Connection Error') + '<br>'
    										+ parseError(xhr.responseText) + '</div></center>');
    			});
    
    			return 0;
       		 }
    		function processCommentDelete(signature) {
    
    			$.post(
    			"/index/deletecomment.html",
    			{
    				signature: signature,
    			}).done( function(data) {
    				if(data.type == 'deleteError'){
    					$("#apimessage").html('<center><div class=\"alert alert-dismissible alert-danger\" role=\"alert\"><button type=\"button\" class=\"close\" data-dismiss=\"alert\">×</button>' 
    										+ Lang.getInstance().translate('Delete Error') + '<br>'
    										+ Lang.getInstance().translate(parseError(data.errordetail)) + '</div></center>');
    				} else if (data.type == 'deleteSuccessful'){
    					$("#apimessage").html('<center><div class=\"alert alert-dismissible alert-success\" role=\"alert\"><button type=\"button\" class=\"close\" data-dismiss=\"alert\">×</button>' 
    										+ Lang.getInstance().translate('Delete successful') + '<br>'
    										+ '</div></center>');
    					setTimeout(function() { window.location.reload(); }, 1500);
    				}
    
    
    			}).fail( function(xhr, textStatus, errorThrown) {
    				
    				$("#apimessage").html('<center><div class=\"alert alert-dismissible alert-danger\" role=\"alert\"><button type=\"button\" class=\"close\" data-dismiss=\"alert\">×</button>' 
    										+ Lang.getInstance().translate('Delete Error') + '<br>'
    										+ Lang.getInstance().translate('Connection Error') + '<br>'
    										+ parseError(xhr.responseText) + '</div></center>');
    			});
    
    			return 0;
       		 }
    
    
    		function processShare(signature, blogname) {
    
    			{% if activeProfile is null %}
    				$("#apimessage").html("<center><div class=\"alert alert-dismissible alert-danger\" role=\"alert\"><button type=\"button\" class=\"close\" data-dismiss=\"alert\">×</button>"
    									+ Lang.getInstance().translate("This feature can only be used with an active profile.\nPlease choose a Profile first!")
    									+ "</div></center>");
    				return 0;
    			{%  endif %}
    
    			$.post(
    			"/index/sharepost.html",
    			{
    				signature: signature,
    				blogname: blogname,
    			}).done( function(data) {
    				if(data.type == 'YouAlreadySharedThisPost'){
    					$("#apimessage").html('<center><div class="alert alert-dismissible alert-danger" role="alert"><button type=\"button\" class=\"close\" data-dismiss=\"alert\">×</button>' 
    										+ Lang.getInstance().translate('You already shared this post')
    										+ '<br></div></center>');
    				} else if (data.type == 'YouCantShareYourOwnPosts'){
    					$("#apimessage").html('<center><div class=\"alert alert-dismissible alert-danger\" role=\"alert\"><button type=\"button\" class=\"close\" data-dismiss=\"alert\">×</button>' 
    										+ Lang.getInstance().translate('Share not successful')
    										+ '<br>'
    										+ Lang.getInstance().translate('This Blogentry is already in your blog.')
    										+ '</div></center>');
    				} else if (data.type == 'ShareSuccessful'){
    					$("#apimessage").html('<center><div class=\"alert alert-dismissible alert-success\" role=\"alert\"><button type=\"button\" class=\"close\" data-dismiss=\"alert\">×</button>' 
    										+ Lang.getInstance().translate('Share successful')
    										+ '<br>'
    										+ '</div></center>');
    				} else if (data.type == 'ShareNotSuccessful'){
    					$("#apimessage").html('<center><div class=\"alert alert-dismissible alert-danger\" role=\"alert\"><button type=\"button\" class=\"close\" data-dismiss=\"alert\">×</button>' 
    										+ Lang.getInstance().translate('Share not successful')
    										+ '<br>'
    										+ parseError(data.result) + '</div></center>');
    				} else if (data.type == 'error'){
    					$("#apimessage").html('<center><div class=\"alert alert-dismissible alert-danger\" role=\"alert\"><button type=\"button\" class=\"close\" data-dismiss=\"alert\">×</button>' 
    										+ Lang.getInstance().translate('Share Error')
    										+ '<br>'
    										+ data.error + '</div></center>');
    				}else if (data.type == 'BlogIsDisabled'){
    					("#apimessage").html('<center><div class=\"alert alert-dismissible alert-danger\" role=\"alert\"><button type=\"button\" class=\"close\" data-dismiss=\"alert\">×</button>' 
    										+ Lang.getInstance().translate('Share not successful')
    										+ '<br>'
    										+ Lang.getInstance().translate('The Blog of your active profile is disabled!')
    										+ '</div></center>');
    				}
    
    
    			}).fail( function(xhr, textStatus, errorThrown) {
    				$("#apimessage").html('<center><div class=\"alert alert-dismissible alert-danger\" role=\"alert\"><button type=\"button\" class=\"close\" data-dismiss=\"alert\">×</button>' 
    										+ Lang.getInstance().translate('Share Error')
    										+ '<br>'
    										+ Lang.getInstance().translate('Connection Error')
    										+ '<br>'
    										+ parseError(xhr.responseText) + '</div></center>');
    			});
    
    			return 0;
       		 }
    
    
        	function processLike(signature, isLikeing) {
    			var blogname;
    			var like = !isLikeing;
    
    
    
    			{% if activeProfile is null %}
    				$("#apimessage").html("<center><div class=\"alert alert-dismissible alert-danger\" role=\"alert\"><button type=\"button\" class=\"close\" data-dismiss=\"alert\">×</button>"
    									+ Lang.getInstance().translate("This feature can only be used with an active profile.\nPlease choose a Profile first!")
    									+ "</div></center>");
    				return 0;
    			{%  endif %}
    
    			$.post(
    			"/index/likepost.html",
    			{
    				signature: signature,
    				like: like
    			}).done( function(data) {
    				if(data.type == 'YouAlreadyLikeThisPost'){
    					$("#apimessage").html('<center><div class="alert alert-dismissible alert-danger" role="alert"><button type=\"button\" class=\"close\" data-dismiss=\"alert\">×</button>'
    										+ Lang.getInstance().translate('You already like this post')
    										+ '<br></div></center>');
    				} else if (data.type == 'YouCantLikeYourOwnPosts'){
    					$("#apimessage").html('<center><div class=\"alert alert-dismissible alert-danger\" role=\"alert\"><button type=\"button\" class=\"close\" data-dismiss=\"alert\">×</button>'
    										+ Lang.getInstance().translate('Like not successful')
    										+ '<br>'
    										+ Lang.getInstance().translate('You can\'t like your own posts')
    										+ '</div></center>');
    				} else if (data.type == 'LikeSuccessful'){
    					$("#apimessage").html('<center><div class=\"alert alert-dismissible alert-success\" role=\"alert\"><button type=\"button\" class=\"close\" data-dismiss=\"alert\">×</button>'
    										+ Lang.getInstance().translate('Like successful')
    										+ '<br>'
    										+ '</div></center>');
    				} else if (data.type == 'LikeNotSuccessful'){
    					try {
    						var error = JSON.parse(data.result);
    						message = error.message;
    					} catch (e) {
    						message = data.result;
    					}
    
    					$("#apimessage").html('<center><div class=\"alert alert-dismissible alert-danger\" role=\"alert\"><button type=\"button\" class=\"close\" data-dismiss=\"alert\">×</button>' 
    										+ Lang.getInstance().translate('Like not successful')
    										+ '<br>'
    										+ message + '</div></center>');
    				} else if (data.type == 'LikeRemovedSuccessful'){
    
    					$("#apimessage").html('<center><div class=\"alert alert-dismissible alert-success\" role=\"alert\"><button type=\"button\" class=\"close\" data-dismiss=\"alert\">×</button>'
    										+ Lang.getInstance().translate('Like removed successful') 
    										+ '<br>'
    										+ '</div></center>');
    				} else if (data.type == 'LikeRemovedNotSuccessful'){
    					$("#apimessage").html('<center><div class=\"alert alert-dismissible alert-danger\" role=\"alert\"><button type=\"button\" class=\"close\" data-dismiss=\"alert\">×</button>'
    										+ Lang.getInstance().translate('Like remove not successful')
    										+ '<br>'
    										+ parseError(data.result)
    										+ '</div></center>');
    					$("#profLikes").html(data.newlikes);
    				} else if (data.type == 'error'){
    					$("#apimessage").html('<center><div class=\"alert alert-dismissible alert-danger\" role=\"alert\"><button type=\"button\" class=\"close\" data-dismiss=\"alert\">×</button>' 
    										+ Lang.getInstance().translate('Like Error')
    										+ '<br>'
    										+ parseError(data.error) + '</div></center>');
    				}
    
    				if(data.hasOwnProperty('likes'))
    				{
    					if(data.likes == 0)
    					{
    						$("#profLikes").html('');
    					}
    					else
    					{
    						$("#profLikes").html(data.likes);
    					}
    				}
    
    
    			}).fail( function(xhr, textStatus, errorThrown) {
    				$("#apimessage").html('<center><div class=\"alert alert-dismissible alert-danger\" role=\"alert\"><button type=\"button\" class=\"close\" data-dismiss=\"alert\">×</button>'
    										+ Lang.getInstance().translate('Like Error')
    										+ '<br>'
    										+ Lang.getInstance().translate('Connection Error')
    										+ '<br>'
    										+ xhr.responseText + '</div></center>');
    			});
    
    			return 0;
       		 }
    		 
    		 function showCommentForm(signature) {
    			$("#commentIframe").attr("src", "postblog.html?postid="+signature);
    			$("#commentModal").modal('show'); 
    		 }
    		 
    </script>
    <script type="text/javascript">
        $('ul.nav-tabs > li').removeClass('active');
        if (window.location.pathname === '/index/blogsearch.html') {
            $('ul.nav-tabs > li:nth-child(2)').addClass('active');
        } else {
            $('ul.nav-tabs > li:nth-child(1)').addClass('active');
        }
    
    
        var transformToAssocArray;
        transformToAssocArray = function(prmstr) {
            var i, params, prmarr, tmparr;
            params = {};
            prmarr = prmstr.split('&');
            i = 0;
            while (i < prmarr.length) {
                tmparr = prmarr[i].split('=');
                params[tmparr[0]] = tmparr[1];
                i++;
            }
            return params;
        };
        var getSearchParameters;
        getSearchParameters = function() {
            var prmstr;
            prmstr = decodeURIComponent(window.location.search.substr(1));
            if (prmstr != null && prmstr != '') {
                return transformToAssocArray(prmstr);
            } else {
                return {};
            }
        };
    
        $(document).ready(function() {
    
       		  $('#name').change(function() {
                $('ul.nav-tabs > li:nth-child(1) > a').attr('href', '/index/hashtag.html?hashtag=' + $('#name').val());
                $('ul.nav-tabs > li:nth-child(2) > a').attr('href', '/index/hashtag.html?hashtag=' + $('#name').val());
            });
            $('ul.nav-tabs > li:nth-child(1) > a').attr('href', '/index/hashtag.html?hashtag=' + $('#name').val());
            $('ul.nav-tabs > li:nth-child(2) > a').attr('href', '/index/hashtag.html?hashtag=' + $('#name').val());
    
            searchval = $('#name').val();
            $('#name').val(searchval);
    
              $('#button').click(function() {
    
                var url;
                url = void 0;
                searchval = $('#name').val();
                  if (window.location.pathname === '/index/hashtag.html') {
           		 	document.location.href = '/index/hashtag.html?hashtag=' + searchval;
           		 } else {
           		 	document.location.href = '/index/hashtag.html?hashtag=' + searchval;
            	}
            });
            $('#name').keypress(function(e) {
                if (e.which === 13) {
                    $('#button').trigger('click');
                }
            });
    
            var my_posts = $("[rel=tooltip]");
    
    		var size = $(window).width();
    
    		if(my_posts.length > 1)
    		{
    			$("ul.timeline li:odd").addClass("timeline-inverted");
    		}
    
    		for (i = 0; i < my_posts.length; i++) {
                the_post = $(my_posts[i]);
                if (the_post.hasClass('invert') && size >= 767) {
                    the_post.tooltip({
                        placement: 'left'
                    });
                    the_post.css("cursor", "pointer");
                } else {
                    the_post.tooltip({
                        placement: 'rigth'
                    });
                    the_post.css("cursor", "pointer");
                }
            }
            {% if hideprofile is not empty%}
          $(".tl-profile").hide();
          $(".timeline").css("padding-top","40px");
          {%endif%}
    
          {% if msg is not null %} $('html, body').animate({
            scrollTop: $("#{{msg}}").offset().top
        }, 2000);
        {%endif%}
    
    	  $('#name').val(getSearchParameters().hashtag);
            if (getSearchParameters().hashtag === void 0) {
                $('#name').val('');
            }
    
    
    
        });
    
        $(function () {
          $('[data-toggle="tooltip"]').tooltip()
        })
    
        </script>
        <script type="text/javascript">
        $(document).ready(function(){
        {% for blogpost in blogposts %}
        if (window.location.search === '?msg={{blogpost.getSignature()}}') {
          $('#{{blogpost.getSignature()}} > .timeline-panel').toggleClass("highlighted");
          $('#{{blogpost.getSignature()}} > .timeline-badge').toggleClass("highlighted");
        };
        if (window.location.search === '?blogname={{blogpost.nameOrCreator|escape(strategy="url_param")}}&msg={{blogpost.getSignature()}}') {
          $('#{{blogpost.getSignature()}} > .timeline-panel').toggleClass("highlighted");
          $('#{{blogpost.getSignature()}} > .timeline-badge').toggleClass("highlighted");
       };
        if (window.location.search === '?hashtag={{hashtag}}&msg={{blogpost.getSignature()}}') {
          $('#{{blogpost.getSignature()}} > .timeline-panel').toggleClass("highlighted");
          $('#{{blogpost.getSignature()}} > .timeline-badge').toggleClass("highlighted");
       };
        {% endfor %}
    	
    	Lang.getInstance().translateByClass();
      });
    
        </script>
    <script type="text/javascript">
    {% for blogpost in blogposts %}
        function changeTextarea{{blogpost.getSignature()}}( str ) {
            var textarea = document.getElementById('clipboard_textarea')
    
            textarea.value = str;
        }
    
        $('a').mouseout(function(){
           $('#clipboard_textarea').hide();
        });
        $('a').mouseover(function(){
        $('#clipboard_textarea').show();
        });
            $('#clipboard_textarea').mouseover(function(){
            $(this).show();
            });
    {% endfor %}
        </script>
    <script>
    
    </script>
      </body>
    </html>