<$mt:SetVar name="body_class" value="mt-profile-view"$>
<$mt:SetVar name="system_template" value="1"$>
<$mt:SetVar name="page_layout" value="layout-wt"$>
<mt:IfBlog>
    <$mt:SetVar name="sidebar" value="1"$>
    <mt:setvarblock name="blog_name"><$mt:BlogName encode_html="1"$></mt:setvarblock>
    <mt:SetVarBlock name="page_title">User Profile</mt:SetVarBlock>
    <mt:SetVarBlock name="title"><mt:if name="blog_id"><$mt:var name="blog_name"$>: </mt:if><$mt:GetVar name="page_title"$>: <$mt:AuthorDisplayName encode_html="1"$></mt:SetVarBlock>
<mt:else>
    <mt:setvarblock name="blog_name">Blog Name</mt:setvarblock>
    <mt:SetVarBlock name="page_title">User Profile</mt:SetVarBlock>
    <mt:SetVarBlock name="title"><mt:if name="blog_id"><$mt:var name="blog_name"$>: </mt:if><$mt:GetVar name="page_title"$>: <$mt:AuthorDisplayName encode_html="1"$></mt:SetVarBlock>
</mt:IfBlog>
<mt:SetVarBlock name="html_head">
<link type="application/atom+xml" rel="alternate" title="Recent Actions from <$mt:AuthorDisplayName encode_html="1"$>" href="<$MTCGIPath$><$MTCommunityScript$>?__mode=feed&amp;_type=actions&amp;blog_id=<$mt:BlogID$>&amp;id=<$mt:AuthorID$>" />
<link type="application/rss+xml" rel="alternate" title="Recent Actions from <$mt:AuthorDisplayName encode_html="1"$>" href="<$MTCGIPath$><$MTCommunityScript$>?__mode=feed&amp;_type=actions&amp;blog_id=<$mt:BlogID$>&amp;id=<$mt:AuthorID$>&amp;rss=1" />
<link type="application/atom+xml" rel="alternate" title="Recent Entries from <$mt:AuthorDisplayName encode_html="1"$>" href="<$MTCGIPath$><$MTCommunityScript$>?__mode=feed&amp;_type=posts&amp;blog_id=<$mt:BlogID$>&amp;id=<$mt:AuthorID$>" />
<link type="application/rss+xml" rel="alternate" title="Recent Entries from <$mt:AuthorDisplayName encode_html="1"$>" href="<$MTCGIPath$><$MTCommunityScript$>?__mode=feed&amp;_type=posts&amp;blog_id=<$mt:BlogID$>&amp;id=<$mt:AuthorID$>&amp;rss=1" />
<link type="application/atom+xml" rel="alternate" title="Comments from <$mt:AuthorDisplayName encode_html="1"$>" href="<$MTCGIPath$><$MTCommunityScript$>?__mode=feed&amp;_type=comments&amp;blog_id=<$mt:BlogID$>&amp;id=<$mt:AuthorID$>" />
<link type="application/rss+xml" rel="alternate" title="Comments from <$mt:AuthorDisplayName encode_html="1"$>" href="<$MTCGIPath$><$MTCommunityScript$>?__mode=feed&amp;_type=comments&amp;blog_id=<$mt:BlogID$>&amp;id=<$mt:AuthorID$>&amp;rss=1" />
<link type="application/atom+xml" rel="alternate" title="Responses to Comments from <$mt:AuthorDisplayName encode_html="1"$>" href="<$MTCGIPath$><$MTCommunityScript$>?__mode=feed&amp;_type=replies&amp;blog_id=<$mt:BlogID$>&amp;id=<$mt:AuthorID$>" />
<link type="application/rss+xml" rel="alternate" title="Responses to Comments from <$mt:AuthorDisplayName encode_html="1"$>" href="<$MTCGIPath$><$MTCommunityScript$>?__mode=feed&amp;_type=replies&amp;blog_id=<$mt:BlogID$>&amp;id=<$mt:AuthorID$>&amp;rss=1" />
<script type="text/javascript">
<!--
function edit_profile_loggedin(loggedin, eid) {
    if (loggedin)
        loggedin = user_id == <$MTAuthorID$>;
    conditional_block(loggedin, eid);
    if (loggedin) {
        var a = document.getElementById('edit_profile_link');
        a.href = '<$MTCGIPath$><$MTCommunityScript$>?__mode=edit&return_to=' + encodeURIComponent(document.URL);
    }
}
function relations(following, followed) {
    conditional_block(followed, 'followed_<$MTAuthorID$>');
    conditional_block(following, 'following_<$MTAuthorID$>');
}
//-->
</script>
</mt:SetVarBlock>

<$mt:Include module="Header"$>

<$MTInclude module="Userpic" userpic_type="profile" userpic_size="90"$>

<h1 id="page-title"><$mt:AuthorDisplayName encode_html="1"$></h1>

<MTIfLoggedIn script="edit_profile_loggedin" element_id="edit_profile">
<p><a id="edit_profile_link" href="#">Edit Profile</a></p>
<MTElse>
<p class="edit-relation">
    <span id="following-status"></span>
    <MTAuthorIfFollowing script="0">
    You are following <MTAuthorDisplayName>. <MTAuthorUnfollowLink text="Unfollow">
    <MTElse>
    <MTAuthorFollowLink text="Follow">
    </MTAuthorIfFollowing>
&nbsp;</p>

    <mt:ignore>
        <MTAuthorIfFollowed script="0">
<p>You are followed by <MTAuthorDisplayName>.</p>
        <MTElse>
<p>You are not followed by <MTAuthorDisplayName>.</p>
        </MTAuthorIfFollowed>
    </mt:ignore>

    <mt:setvarblock name="html_body_footer" append="1">
    <script type="text/javascript" src="<$MTCGIPath$><$MTCommunityScript$>?__mode=relations_js&author_id=<MTAuthorID>"></script>
    </mt:setvarblock>
</MTIfLoggedIn>

<ul id="profile-data">
<mt:ifnonempty tag="MTAuthorURL">
    <li><strong>Website:</strong> <a href="<$mt:AuthorURL encode_html="1"$>" target="_blank"><$mt:AuthorURL regex_replace="/^\w+:\/\//","" encode_html="1"$></a></li>
</mt:ifnonempty>
<mt:loop name="field_loop">
<mt:if name="type" eq="datetime">
    <mt:if name="value"><li><strong><$mt:var name="name" escape="html"$>:</strong> <$mt:var name="field_value"$></li></mt:if>
<mt:else>
    <mt:if name="value"><li><strong><$mt:var name="name" escape="html"$>:</strong> <$mt:var name="field_value" escape="html"$></li></mt:if>
</mt:if>
</mt:loop>
</ul>

<ul id="tabs"> 
    <li><a href="#profile-recent-actions" class="active" onclick="switchTabs('tabs',this)">Recent Actions</a></li> 
    <li><a href="#profile-comment-threads" class="" onclick="switchTabs('tabs',this)">Comment Threads</a></li> 
</ul>

<div id="profile-recent-actions" class="tab_content"> 
    <h3 class="tab_content_label">Recent Actions</h3>

<mt:Actions namespace="community_pack_recommend" include_blogs="all" sort_order="descend" lastn="30">
    <mt:ActionsHeader>
    <ul class="recent-actions">
    </mt:ActionsHeader>
    <mt:ActionsEntry>
        <li class="entry icon-entry">
            Posted <a href="<$mt:EntryLink>"><$mt:EntryTitle encode_html="1"$></a> to <a href="<$MTEntryBlogURL$>" class="icon-blog"><$MTEntryBlogName$></a>
            <div class="excerpt"><$MTEntryExcerpt$></div>
        </li>
    </mt:ActionsEntry>
    <mt:ActionsComment>
        <li class="comment icon-comment">
            Commented on <mt:CommentEntry><a href="<$mt:CommentLink$>"><$mt:EntryTitle encode_html="1"$></a></mt:CommentEntry>
            <div class="excerpt"><$mt:CommentBody words="40"$>...</div>
        </li>
    </mt:ActionsComment>
    <mt:ActionsFavorite>
        <li class="favorite icon-favorite">
            Favorited <a href="<$mt:EntryLink$>"><$mt:EntryTitle encode_html="1"$></a> on <a href="<$MTEntryBlogURL$>" class="icon-blog"><$MTEntryBlogName$></a>
        </li>
    </mt:ActionsFavorite>
    <mt:ActionsFooter>
    </ul>
    </mt:ActionsFooter>
<mt:else>
    <p class="note">No recent actions.</p>

</mt:Actions>

<img src="<$MTStaticWebPath$>images/status_icons/feed.gif" alt="Subscribe to feed" /> <a href="<$MTCGIPath$><$MTCommunityScript$>?__mode=feed&amp;_type=actions&amp;blog_id=<$mt:BlogID$>&amp;id=<$mt:AuthorID$>">Recent Actions from <$mt:AuthorDisplayName encode_html="1"$></a></p>
</div>

<div id="profile-comment-threads" class="tab_content hidden"> 
    <h3 class="tab_content_label">Comment Threads</h3>

<mt:AuthorCommentResponses lastn="5">  
    <mt:CommentsHeader>  
    <ul class="recent-actions">  
    </mt:CommentsHeader> 
        <li class="comment icon-comment">
            <a href="<mt:var name="profile_view_url" encode_html="1"><$MTCommenterID$>"><$mt:CommenterName$></a> commented on 
                <mt:CommentEntry><a href="<$mt:CommentLink$>"><$mt:EntryTitle encode_html="1"$></a></mt:CommentEntry>
            <div class="excerpt"><$mt:CommentBody words="100"$>...</div>
    <mt:CommentsFooter> 
    </ul> 
    </mt:CommentsFooter>  
<mt:else> 
    <p class="note">No responses to comments.</p> 
</mt:AuthorCommentResponses>  
<img src="<$MTStaticWebPath$>images/status_icons/feed.gif" alt="Subscribe to feed" /> <a href="<$MTCGIPath$><$MTCommunityScript$>?__mode=feed&_type=replies&blog_id=<$mt:BlogID$>&id=<$mt:AuthorID$>">Responses to Comments from <$mt:AuthorDisplayName encode_html="1"$></a></p>

</div>

<mt:setvarblock name="beta_sidebar">
<div class="widget-following widget">
    <h3 class="widget-header">Following</h3>
    <div class="widget-content">
<mt:AuthorFollowing>
    <mt:if name="__first__">
        <ul class="user-listing">
    </mt:if>
            <li class="pkg">
                <$MTInclude module="Userpic" userpic_size="36" userpic_type="userlist"$>
                <a href="<mt:var name="profile_view_url" encode_html="1"><$MTAuthorID$>" class="user-name"><mt:AuthorDisplayName /></a>
                <a href="<mt:AuthorURL />" class="user-url"><mt:AuthorURL regex_replace="/^\w+:\/\//","" /></a>
            </li>
    <mt:if name="__last__">
        </ul>
    </mt:if>
<mt:else>
    <p class="note">Not following anyone</p>
</mt:AuthorFollowing>
    </div>
</div>
<MTIfLoggedIn script="edit_profile_loggedin" element_id="following_me">
    <div class="widget-followers widget">
        <h3 class="widget-header">Followers</h3>
        <div class="widget-content">
    <mt:AuthorFollowers>
        <mt:if name="__first__">
            <ul class="user-listing">
        </mt:if>
                <li class="pkg">
                    <$MTInclude module="Userpic" userpic_size="36" userpic_type="userlist"$>
                    <a href="<mt:var name="profile_view_url" encode_html="1"><$MTAuthorID$>" class="user-name"><mt:AuthorDisplayName /></a>
                    <a href="<mt:AuthorURL />" class="user-url"><mt:AuthorURL regex_replace="/^\w+:\/\//","" /></a>
                </li>
        <mt:if name="__last__">
            </ul>
        </mt:if>
    <mt:else>
        <p class="note">Not being followed</p>
    </mt:AuthorFollowers>
        </div>
    </div>
</MTIfLoggedIn>
</mt:setvarblock>

<$mt:Include module="Footer"$>
