Template source: author_profile.html

{% extends 'base.html' %} {% load staticfiles crispy_forms_filters languages_tags i18n %} {% block body_id %}page-author{% endblock %} {% block meta %} <meta property="og:title" content="{{ author.full_name }}"> <meta property="og:url" content="https://{{ request.META.HTTP_HOST }}{{ author.get_absolute_url }}"> <meta property="og:image" content="https://{{ request.META.HTTP_HOST }}{{ author.avatar.get_author_large_url }}"/> <meta property="og:image:width" content="300"/> <meta property="og:image:height" content="300"/> {% if author.biography %} <meta property="og:description" content="{{ author.short_description }}"> {% endif %} {% endblock %} {% block content %} <main itemscope itemtype="//schema.org/ProfilePage"> <section class="title-content-page title-content-page-author"> <div class="container" itemprop="author" itemscope itemtype="//schema.org/Person"> <div class="author-avatar"> {% if author.avatar %} <img class="avatar" itemprop="image" src="{{ author.avatar.get_author_large_url }}" alt="{{ author.author }}"/> {% else %} <img class="avatar" src="{% static 'dist/images/avatar-default.jpg' %}" alt="{{ article.author }}"/> {% endif %} </div> <div class="author-info"> <div class="toolbar"> <h1 id="author-name" class="pull-left"> <span itemprop="name">{{ author.full_name }}</span> </h1> {% if current_author %} <div class="author-edit pull-right"> {% if is_member %} <a href="{% url 'member_profile' slug %}" class="btn btn-grey"> <i class="fa fa-pencil" aria-hidden="true"></i> {% trans 'Edit Profile' %} </a> {% else %} <a href="{% url 'profile' slug %}" class="btn btn-grey"> <i class="fa fa-pencil" aria-hidden="true"></i> {% trans 'Edit Profile' %} </a> <a href="/admin/publications/article/add/" class="btn btn-main"><i class="fa fa-plus" aria-hidden="true"></i>{% trans 'New Article' %}</a> {% endif %} </div> {% else %} {% if not is_member %} {% if user_following %} <div class="follow-author unfollow pull-right"> <a href="#" class="follow-btn" target="_blank" data-toggle="modal" data-target="#modal-follower-unfollow">{% trans 'Unfollow' %}</a> {% else %} <div class="follow-author pull-right"> <a href="#" class="follow-btn" target="_blank" data-toggle="modal" data-target="#modal-follower-follow">{% trans 'Follow' %}</a> {% endif %} <button class="follow-toggle" type="button" id="dropdownMenu1" data-toggle="#follow-dropdown"><i class="fa fa-ellipsis-v" aria-hidden="true"></i></button> <ul class="follow-dropdown dropdown-menu dropdown-menu-right" id="follow-dropdown"> {% if user_subscribed %} <li><a href="/subscribe/{{ author.slug }}"><i class="fa fa-envelope" aria-hidden="true"></i> {% trans 'Remove Email Notifications' %} </a></li> {% else %} <li><a href="/subscribe/{{ author.slug }}"><i class="fa fa-envelope" aria-hidden="true"></i> {% trans 'Get Email Notifications' %} </a></li> {% endif %} </ul> </div> {% endif %} {% endif %} </div> <div class="author-social"> <button id="share-fb" class="btn btn-default btn-fb"><i class="fa fa-facebook" aria-hidden="true"></i> {% trans "Share" %} </button> <button class="btn btn-default google_contacts btn-mail"><i class="fa fa-envelope" aria-hidden="true"></i> {% trans "Share" %} </button> <!-- <button class="btn btn-default outlook_contacts">{% trans 'Get Outlook Contacts' %}</button> --> <a href=" {% if author.twitter_link %}{{ author.twitter_link }}{% else %}https://twitter.com/mytrending{% endif %}" class="author-twitter btn btn-grey" target="_blank"> <i class="fa fa-twitter" aria-hidden="true"></i> </a> <a href=" {% if author.facebook_link %}{{ author.facebook_link }}{% else %}https://www.facebook.com/Mytrendingstories-1537454709805166/{% endif %}" class="author-facebook btn btn-grey" target="_blank"> <i class="fa fa-facebook" aria-hidden="true"></i> </a> </div> <div class="author-description"> <div class="author-info-intro"> {% if author.biography %} <div class="author-desc"> {{ author.biography_safe }} </div> {% elif author.short_desc %} <div class="author-desc"> {{ author.short_desc_safe }} </div> {% endif %} </div> </div> </div> </div> </section> <section id="followers" class="sectionpadding lightgreybg text-left"> <div class="container"> <div class="row"> {% if not is_member %} <div class="col-md-6"> <h3 class="author-article-title">{% trans 'Followers' %}</h3> {% if not author.followers.all %} {% if current_author %} <div class="empty-message"> <i class="fa fa-info" aria-hidden="true"></i> {% trans 'Follow authors by visiting their profile and clicking the "Follow" button.' %} </div> {% else %} <div class="empty-message"> <i class="fa fa-info" aria-hidden="true"></i> {% trans 'There are currently no followers.' %} </div> {% endif %} {% endif %} <ul class="avatar-list list-unstyled text-left"> {% for follower in author.followers.all|slice:":20" %} {# If the user is a member or author, object is returned #} {% with auth=follower.is_author mem=follower.is_member %} {# if user is a member #} {% if mem %} {% if follower.member.avatar %} <li class="avatar-single"><a href="{{ follower.member.get_absolute_url }}" data-toggle="tooltip" data-placement="bottom" title="{{ follower.full_name }}"> <img itemprop="image" src="{{ follower.member.avatar.get_author_large_url }}" alt="{{ follower.full_name }}"></a></li> {% else %} <li class="avatar-single"><a href="{{ follower.author.get_absolute_url }}" data-toggle="tooltip" data-placement="bottom" title="{{ follower.full_name }}"> <img itemprop="image" src="{% static 'dist/images/avatar-default.jpg' %}" alt="{{ follower.full_name }}"></a></li> {% endif %} {# if user is an author #} {% elif auth %} {% if auth.avatar %} <li class="avatar-single"><a href="{{ follower.author.get_absolute_url }}" data-toggle="tooltip" data-placement="bottom" title="{{ follower.full_name }}"> <img itemprop="image" src="{{ follower.author.avatar.get_author_large_url }}" alt="{{ follower.full_name }}"></a></li> {% else %} <li class="avatar-single"><a href="{{ auth.get_absolute_url }}" data-toggle="tooltip" data-placement="bottom" title="{{ follower.full_name }}"> <img itemprop="image" src="{% static 'dist/images/avatar-default.jpg' %}" alt="{{ follower.full_name }}"></a></li> {% endif %} {% else %} <li class="avatar-single"><a href="#" data-toggle="tooltip" data-placement="bottom" title="{{ follower.full_name }}"> <img itemprop="image" src="{% static 'dist/images/avatar-default.jpg' %}" alt="{{ follower.full_name }}"></a></li> {% endif %} {% endwith %} {% endfor %} {% if author.followers.all|length >= 20 %} <li class="avatar-single avatar-more"> <a role="button" data-toggle="collapse" data-parent="#accordion" href="#collapseFollowers" aria-expanded="" aria-controls="collapseFollowers"> <i class="fa fa-plus followers"></i>{{ author.followers.count|add:"-20" }} </a> </li> {% endif %} </ul> {% if author.followers.all|length >= 20 %} <div class="panel-group" id="accordion" role="tablist" aria-multiselectable="true"> <div id="collapseFollowers" class="panel-collapse collapse" role="tabpanel" aria-labelledby="headingOne"> <ul class="avatar-list list-unstyled text-left"> {% for follower in author.followers.all|slice:"13:" %} {# If the user is a member or author, object is returned #} {% with auth=follower.is_author mem=follower.is_member %} {# if user is a member #} {% if mem %} {% if follower.avatar %} <li class="avatar-single"><a href="{{ follower.get_absolute_url }}" data-toggle="tooltip" data-placement="bottom" title="{{ follower.full_name }}"> <img itemprop="image" src="{{ follower.avatar.get_author_large_url }}" alt="{{ follower.full_name }}"></a></li> {% else %} <li class="avatar-single"><a href="{{ follower.get_absolute_url }}" data-toggle="tooltip" data-placement="bottom" title="{{ follower.full_name }}"> <img itemprop="image" src="{% static 'dist/images/avatar-default.jpg' %}" alt="{{ follower.full_name }}"></a></li> {% endif %} {# if user is an author #} {% elif auth %} {% if auth.avatar %} <li class="avatar-single"><a href="{{ auth.get_absolute_url }}" data-toggle="tooltip" data-placement="bottom" title="{{ follower.full_name }}"> <img itemprop="image" src="{{ auth.avatar.get_author_large_url }}" alt="{{ follower.full_name }}"></a></li> {% else %} <li class="avatar-single"><a href="{{ auth.get_absolute_url }}" data-toggle="tooltip" data-placement="bottom" title="{{ follower.full_name }}"> <img itemprop="image" src="{% static 'dist/images/avatar-default.jpg' %}" alt="{{ follower.full_name }}"></a></li> {% endif %} {% else %} <li class="avatar-single"><a href="#" data-toggle="tooltip" data-placement="bottom" title="{{ follower.full_name }}"> <img itemprop="image" src="{% static 'dist/images/avatar-default.jpg' %}" alt="{{ follower.full_name }}"></a></li> {% endif %} {% endwith %} {% endfor %} </ul> </div> </div> {% endif %} </div> {% endif %} {% if is_member %} <div class="col-md-12 text-center"> {% else %} <div class="col-md-6"> {% endif %} <h3 class="author-article-title">{% trans 'Following' %}</h3> {% if not followings %} {% if current_author %} <div class="empty-message"> <i class="fa fa-info" aria-hidden="true"></i> {% trans 'You currently do not have any followers.' %} </div> {% else %} <div class="empty-message"> <i class="fa fa-info" aria-hidden="true"></i> {% trans 'This user is currently not following anyone.' %} </div> {% endif %} {% endif %} {% if is_member %} <ul class="avatar-list list-unstyled text-center"> {% else %} <ul class="avatar-list list-unstyled text-left"> {% endif %} {% for following in followings|slice:":20" %} {% if following.avatar %} <li class="avatar-single"><a href="{{ following.get_absolute_url }}" data-toggle="tooltip" data-placement="bottom" title="{{ following.full_name }}"> <img itemprop="image" src="{{ following.avatar.get_author_large_url }}" alt="{{ following.full_name }}"></a></li> {% else %} <li class="avatar-single"><a href="{{ following.get_absolute_url }}" data-toggle="tooltip" data-placement="bottom" title="{{ following.full_name }}"> <img itemprop="image" src="{% static 'dist/images/avatar-default.jpg' %}" alt="{{ following.full_name }}"></a></li> {% endif %} {% endfor %} {% if followings|length >= 20 %} <li class="avatar-single avatar-more"> <a role="button" data-toggle="collapse" data-parent="#accordion2" href="#collapseFollowers2" aria-expanded="" aria-controls="collapseFollower2"> <i class="fa fa-plus"></i> </a> </li> {% endif %} </ul> {% if followings|length >= 20 %} <div class="panel-group" id="accordion2" role="tablist" aria-multiselectable="true"> <div id="collapseFollowers2" class="panel-collapse collapse" role="tabpanel"> {% if is_member %} <ul class="avatar-list list-unstyled text-center"> {% else %} <ul class="avatar-list list-unstyled text-left"> {% endif %} {% for following in followings|slice:"20:" %} {% if following.avatar %} <li class="avatar-single"><a href="{{ following.get_absolute_url }}" data-toggle="tooltip" data-placement="bottom" title="{{ following.full_name }}"> <img itemprop="image" src="{{ following.avatar.get_author_large_url }}" alt="{{ following.full_name }}"></a></li> {% else %} <li class="avatar-single"><a href="{{ following.get_absolute_url }}" data-toggle="tooltip" data-placement="bottom" title="{{ following.full_name }}"> <img itemprop="image" src="{% static 'dist/images/avatar-default.jpg' %}" alt="{{ following.full_name }}"></a></li> {% endif %} {% endfor %} </ul> </div> </div> {% endif %} </div> </div> </section> <section id="author-page"> <div class="mainbg"> <div class="container"> <ul class="nav nav-tabs profile-tabs text-center" role="tablist"> <li class="pull-right profile-lang"> {% language_filter %} </li> {% if not is_member %} <li role="presentation" class="active tab-single"> <a href="#articles" aria-controls="articles" role="tab" data-toggle="tab"><i class="fa fa-user" aria-hidden="true"></i> {% if current_author %} {% trans 'My Articles' %} {% else %} {% blocktrans with author=author.first_name %} Articles {% endblocktrans %} {% endif %} </a> </li> <li role="presentation" class="tab-single"> <a href="#videos" aria-controls="videos" role="tab" data-toggle="tab"><i class="fa fa-video-camera" aria-hidden="true"></i> {% if current_author %} {% trans 'My Videos' %} {% else %} {% blocktrans with author=author.first_name %} Videos {% endblocktrans %} {% endif %} </a> </li> <li role="presentation" class="tab-single"> {% elif is_member %} <li role="presentation" class="active tab-single"> {% endif %} <a href="#feed" aria-controls="feed" role="tab" data-toggle="tab"><i class="fa fa-newspaper-o" aria-hidden="true"></i> {% if current_author %} {% trans 'My Feed' %} {% else %} {% blocktrans with author=author.first_name %} Feed {% endblocktrans %} {% endif %} </a> </li> {% if current_author and request.user.is_author %} <li role="presentation" class="tab-single"> <a href="#drafts" aria-controls="drafts" role="tab" data-toggle="tab"><i class="fa fa-file-o" aria-hidden="true"></i>{% trans 'My Drafts' %}</a> </li> {% endif %} </ul> </div> </div> <div class="tab-content sectionpadding"> {% if not is_member %} <div role="tabpanel" class="tab-pane active" id="articles"> <div class="container-fluid"> {% if not author_published_articles %} {% if current_author %} <div class="empty-message text-center"> <i class="fa fa-info" aria-hidden="true"></i> {% trans 'You currently have no articles. To create an article, click the "New Article" button.' %} </div> {% else %} <div class="empty-message text-center"> <i class="fa fa-info" aria-hidden="true"></i> {% trans "This author currently doesn't have any articles. Please check back later." %} </div> {% endif %} {% endif %} <div class="row"> {% for article in author_published_articles %} <div class="col col-sm-15"> {% if article.get_city_category %} {% include '_article_card.html' with city_category=article.get_city_category %} {% else %} {% include '_article_card.html' %} {% endif %} </div> {% endfor %} </div> </div> </div> <div role="tabpanel" class="tab-pane" id="videos"> <div class="container-fluid"> {% if not author_videos %} {% if current_author %} <div class="empty-message text-center"> <i class="fa fa-info" aria-hidden="true"></i> {% trans 'You currently do not have any videos.' %} </div> {% else %} <div class="empty-message text-center"> <i class="fa fa-info" aria-hidden="true"></i> {% trans "This author currently doesn't have any videos. Please check back later." %} </div> {% endif %} {% endif %} <div class="row"> {% for video in author_videos %} <div class="col col-sm-15"> {% if video.get_city_category %} {% include '_video_card.html' with city_category=video.get_city_category %} {% else %} {% include '_video_card.html' %} {% endif %} </div> {% endfor %} </div> </div> </div> {% endif %} {% if is_member %} <div role="tabpanel" class="tab-pane active" id="feed"> {% else %} <div role="tabpanel" class="tab-pane" id="feed"> {% endif %} <div class="container-fluid"> {% if not author_feed %} {% if current_author %} <div class="empty-message text-center"> <i class="fa fa-info" aria-hidden="true"></i> {% trans 'Your feed is empty. To add articles to your feed, you may follow authors by visiting their profile and clicking the "Follow" button.' %} </div> {% else %} <div class="empty-message text-center"> <i class="fa fa-info" aria-hidden="true"></i> {% trans 'This feed is currently empty. Please check back later.' %} </div> {% endif %} {% endif %} <div class="row"> {% for feed_object in author_feed %} {% if feed_object.get_type == 'Article' %} {% with article=feed_object %} <div class="col col-sm-15"> {% if article.get_city_category %} {% include '_article_card.html' with city_category=article.get_city_category %} {% else %} {% include '_article_card.html' %} {% endif %} </div> {% endwith %} {% elif feed_object.get_type == 'Video' %} {% with video=feed_object %} <div class="col col-sm-15"> {% if feed_object.get_city_category %} {% include '_video_card.html' with city_category=feed_object.get_city_category %} {% else %} {% include '_video_card.html' %} {% endif %} </div> {% endwith %} {% endif %} {% endfor %} {# {% for video in author_feed_videos %}#} {# <div class="col col-sm-15">#} {# {% if video.get_city_category %}#} {# {% include '_video_card.html' with city_category=article.get_city_category %}#} {# {% else %}#} {# {% include '_video_card.html' %}#} {# {% endif %}#} {# </div>#} {# {% endfor %}#} </div> </div> </div> {% if current_author %} <div role="tabpanel" class="tab-pane" id="drafts"> <div class="container-fluid"> {% if not author_draft_articles %} <div class="empty-message text-center"> <i class="fa fa-info" aria-hidden="true"></i> {% trans 'You currently have no drafts. To create an article, click the "New Article" button.' %} </div> {% endif %} <div class="row"> {% for article in author_draft_articles %} <div class="col col-sm-15"> {% if article.get_city_category %} {% include '_article_card.html' with city_category=article.get_city_category %} {% else %} {% include '_article_card.html' %} {% endif %} </div> {% endfor %} </div> </div> </div> {% endif %} </div> </section> </main> {% include 'facebook_auth/auth_js.html' %} {% endblock %} {% block extra_js %} {{ block.super }} <script src="//js.live.net/v5.0/wl.js"></script> <script src="//apis.google.com/js/client.js" async defer></script> <script type="text/javascript" src="{% static "ckeditor/ckeditor/ckeditor.js" %}"></script> <script type="text/javascript" src="{% static "ckeditor/ckeditor-init.js" %}"></script> <script type="text/javascript"> $('.panel-collapse').on('show.bs.collapse', function () { $('.avatar-more i').removeClass("fa-plus").addClass("fa-minus"); }); $('.panel-collapse').on('hide.bs.collapse', function () { $('.avatar-more i').removeClass("fa-minus").addClass("fa-plus"); }); </script> {% endblock %} {% block extra_modals %} {% include '_modal-google-contacts.html' %} {% endblock %}