Template w javascript

function commentsTemplate(commentId,commentAuthor,publishedAt,comment_content,comment_author_url,comment_author_email_md5){
    var img=Avatar(comment_author_email_md5);
    var url='';
    comment_author_url != null && comment_author_url.length > 1 ? url =comment_author_url : url ='';
    var comments=`<article id=${commentId}>
        <div class="col-lg-12 text-left pd-zero">
            <div class="panel panel-white post panel-shadow">
                <header>
                    <div class="post-heading">
                        <div class="pull-left image">
                            <img src="${img}" class="img-circle avatar" alt="user profile image">
                        </div>
                        <div class="pull-left meta">
                            <div class="title h5">
                                <a class="text-capitalize" href="${url}" target="_blank"><b>${commentAuthor}</b></a>
                            </div>
                            <h6 class="text-muted time">${publishedAt}</h6>
                        </div>
                    </div>
                </header>
                <div class="post-description">
                    <p style="">${comment_content}</p>
                    <button class="test btn btn-primary" name="subject" type="submit"  onclick="postReply(${commentId})" data-toggle="modal" data-target=".myModalHorizontal">ODPOWIEDZ</button>
                </div>
            </div>
        </div>
    </article>`;
    return comments;
}
Komentarze wyłączone