<style>
    .box, .box-row, .box-cell { overflow: visible !important; -webkit-mask-image: none !important; }
    .page-messages-container > .box-row > .box-cell { display: block !important; }
    .page-messages-label {
      width: 8px;
      height: 8px;
      display: block;
      border-radius: 999px;
      float: left;
      margin-top: 6px;
      margin-right: 12px;
    }
    html[dir="rtl"] .page-messages-label {
      float: right;
      margin-left: 12px;
      margin-right: 0;
    }
    #page-messages-aside-nav {
      max-height: 0;
      overflow: hidden;
      -webkit-transition: max-height .3s;
      transition: max-height .3s;
    }
    #page-messages-aside-nav.show { max-height: 2000px; }
    @media (min-width: 768px) {
      .page-messages-container > .box-row > .box-cell {
        display: table-cell !important;
        padding-top: 15px;
      }
      .page-messages-aside { width: 200px; }
      .page-messages-content { padding-left: 20px; }
      html[dir="rtl"] .page-messages-content {
        padding-left: 0;
        padding-right: 20px;
      }
      #page-messages-aside-nav { max-height: none !important; }
     .page-messages-wide-buttons .btn { width: 60px; }
    }
    .page-messages-item-label {
      vertical-align: text-bottom;
    }
</style>
<div class="col-md-12">

	<form action="{S_PRIVMSGS_ACTION}" method="post" name="post" onsubmit="if(checkForm(this)){ dis_submit_btn(); }else{ return false; }">
	{S_HIDDEN_FIELDS}

	<div class="page-messages-container box m-a-0 bg-transparent position-static">
      <div class="box-row">

        <div class="page-messages-aside box-cell valign-top">
          <div class="clearfix">

            <div class="box-container">
              <div class="box-row">
                <!-- IF REPLY_PM_IMG --><div class="box-cell">{REPLY_PM}</div><!-- ENDIF -->
                <div class="box-cell p-l-3 hidden-md hidden-lg hidden-xl" style="width: 60px;"><button type="button" class="btn btn-block btn-outline btn-outline-colorless p-x-0" id="page-messages-aside-nav-toggle"><i class="fa fa-bars"></i></button></div>
              </div>
            </div>

            <div class="m-t-3" id="page-messages-aside-nav">
              <div class="list-group m-b-1">
                {INBOX}
                {OUTBOX}
                {SENTBOX}
                {SAVEBOX}
              </div>

              <div class="m-t-3 visible-xs visible-sm"></div>
            </div>

          </div>
        </div>

        <hr class="page-wide-block m-t-0 visible-xs visible-sm">

        <div class="page-messages-content box-cell valign-top">
          <div class="panel">
            <div class="panel-title">
              <a href="#" class="pull-xs-left m-r-1 text-muted font-size-14"><i class="fa fa-star"></i></a>
              {POST_SUBJECT}
            </div>

            <hr class="m-y-0">

            <div class="panel-body p-y-1 clearfix">
              <div class="btn-toolbar page-messages-wide-buttons pull-left" role="toolbar">
                <div class="btn-group">
                  <button type="submit" name="save" class="btn"><i class="fa fa fa-file-text-o" title="{L_SAVE_MESSAGE}" data-toggle="tooltip"></i></button>
                  <button type="submit" name="delete" class="btn"><i class="fa fa-trash-o" title="{L_DELETE_MESSAGE}" data-toggle="tooltip"></i></button>
				</div>
              </div>
			  <div class="btn-toolbar pull-right" role="toolbar">
                <div class="btn-group">
                  {QUOTE_PM} {EDIT_PM}
                </div>
              </div>

            </div>

            <hr class="m-y-0">

            <div class="panel-body p-y-1 clearfix">
              <div class="box m-a-0 valign-middle">
                <div class="box-cell col-md-8">
                  <div class="box-container">
                    <div class="box-row">
                      <div class="box-cell" style="width: 40px;">
                        <img src="data/avatars/gallery/noavatar.png" alt="" class="border-round" style="width: 100%;">
                      </div>
                      <div class="box-cell p-l-2">
                        <div class="font-size-14">{FROM_USER}</div>
                        <div class="font-size-12 text-muted"></div>
                      </div>
                    </div>
                  </div>
                </div>
                <div class="box-cell text-muted col-md-4 text-md-right">

                  <div class="m-t-2 visible-xs visible-sm"></div>

                  {POST_DATE}
                </div>
              </div>
            </div>

            <hr class="m-y-0">

            <div class="panel-body font-size-14">
              <div class="post_wrap"><div class="post_body">{PM_MESSAGE}</div></div>
			</div>

            <hr class="m-y-0">

	</form>

            <div class="panel-body">
              <!-- IF QUICK_REPLY -->
				<script type="text/javascript">
				ajax.callback.posts = function(data){
					$('#view_message').show();
						$('.view-message').html(data.message_html);
						initPostBBCode('.view-message');
							var maxH   = screen.height - 490;
						$('.view-message').css({ maxHeight: maxH });
				};
				</script>
				<form action="{S_PRIVMSGS_ACTION}" method="post" name="post" onsubmit="if(checkForm(this)){ dis_submit_btn(); }else{ return false; }">
				{S_HIDDEN_FIELDS}
					
					<b>{L_TO}:</b>
					<input type="text" name="username" size="18" maxlength="25" style="max-width:300px" class="form-control" value="{MESSAGE_FROM}" />
					
					<b>{L_SUBJECT}:</b>
					<input type="text" name="subject" size="50" maxlength="60" style="max-width:300px" class="form-control m-b-1" value="{QR_SUBJECT}" />
					
					<div id="view_message" style="display:none;">
						<div class="tLeft view-message"></div>
					</div>
					<div class="quick_reply_box bCenter">
						<!-- INCLUDE posting_editor.tpl -->
					</div>
					
				</form>
				<!-- ENDIF / QUICK_REPLY -->
            </div>
		   </div>
        </div>
      </div>
    </div>
	<script>
	$(function () {
		$('#page-messages-aside-nav-toggle').on('click', function() {
			$(this)[
				$('#page-messages-aside-nav').toggleClass('show').hasClass('show') ? 'addClass' : 'removeClass'
			]('active');
		});
	});
	</script>
</div>