Template source: profile.html

  {% extends "base.html" %}
{% load compress staticfiles i18n %}
{% load embed_video_tags %}
{% load get_favorites_count %}
{% load get_favorited_artists %}
{% load number_of_collabs_and_artworks %}
{% load thumbnail %}
{% comment %}{% block gradient %}{% endblock %}{% endcomment %}

{% block page_title %}
  {{ user.get_full_name }}
{% endblock %}

{% block meta_og_title %}{{ user.get_full_name }}{% endblock %}
{% block meta_og_url %}{% if request.is_secure %}https://{% else %}http://{% endif %}{{ request.get_host }}{% url 'profile:my_profile' user.id %}{% endblock %}

{% block meta_og_description %}
  {% if initial_expertises %}
    {% for expertise in initial_expertises %}
      {{ expertise }}{% if not forloop.last %},{% endif %}
    {% endfor %}
  {% endif %}
{% endblock %}

{% block meta_og_image %}
  {% if request.is_secure %}https://{% else %}http://{% endif %}{{ request.get_host }}{% if not user.socialaccount_set.all.0.get_avatar_url %}{% if user.profile_thumbnail %}{{ user.profile_thumbnail.url }}{% else %}{% static 'images/person.jpg' %}{% endif %}{% else %}{{ user.socialaccount_set.all.0.get_avatar_url }}{% endif %}
{% endblock %}

{% block content %}
    <!-- Start Profile -->        
    {% if user %}
        {% get_number_of_artworks user.id as number_of_artworks %}
        <div class="profile_wrapper">
          <div class="container small_screen_nopadding">
            <div class="col-md-12 nopadding">
                  {% if can_edit %}       
                    <a  data-target="#bgModal" data-toggle="modal" style="padding:2px 15px" class="btn btn-default custom_btn main_bg blur_bg_image" type="button"> Settings </a>
                    {% include "partials/profiles/_update_background_form.html" %}
                  {% endif %}
            </div>
            <div class="clearfix"></div>
            <div class="profile row blur_bg_image">
                  <div class="container nopadding" style="margin-left: 0;">
                    <div class="col-md-12 mobile_user_name">
                      <h1>{{ user.get_full_name }} 
                          {% if can_edit %}
                            <a title = "Update your basic information" href="#" class="" data-toggle="modal" data-target="#basic_user_info" > 
                              <i class="fa fa-pencil edit_profile"> </i> 
                            </a>
                          {% endif %}
                        </h1>
                    </div>
                    <div class="col-md-3 col-sm-3 col-xs-6">                        
                        <div class="row">
                          <div class="profile_pic">
                            {% if can_edit %}
                              <a class="edit_profile_pic" href="#" data-toggle="modal" data-target="#profile_pic_modal">
                                <i class="fa fa-camera"></i>
                              </a>
                              {% include "partials/profiles/_add_profile_picture.html" %}
                            {% endif %}
                            <a id="profile_id_{{ user.id }}" class="gallery_image">
                              <span class="item"
                                data-src="
                                {% if not user.socialaccount_set.all.0.get_avatar_url %}
                                  {% if user.profile_thumbnail %}
                                    {{ user.profile_thumbnail.url }}
                                  {% else %}
                                    {% static 'images/person.jpg' %}
                                  {% endif %}
                                {% else %}
                                  {{ user.socialaccount_set.all.0.get_avatar_url }}
                                {% endif %}
                              " data-sub-html="">
                                <img class="img-responsive single-img" src="
                                {% if not user.socialaccount_set.all.0.get_avatar_url %}
                                  {% if user.profile_thumbnail %}
                                    {{ user.profile_thumbnail.url }}
                                  {% else %}
                                    {% static 'images/person.jpg' %}
                                  {% endif %}
                                {% else %}
                                  {{ user.socialaccount_set.all.0.get_avatar_url }}
                                {% endif %}"                              
                                data-gallery-src="   {% if not user.socialaccount_set.all.0.get_avatar_url %}
                                  {% if user.profile_thumbnail %}
                                    {{ user.profile_thumbnail.url }}
                                  {% else %}
                                    {% static 'images/person.jpg' %}
                                  {% endif %}
                                {% else %}
                                  {{ user.socialaccount_set.all.0.get_avatar_url }}
                                {% endif %}">
                              </span>                              
                          </a>
                        </div>                            
                      </div>
                    </div>
                    <div class="col-md-6 col-sm-6 col-xs-6 profile_about">
                      <div class="">
                        <h1>{{ user.get_full_name }} 
                          {% if can_edit %}
                            <a title = "Update your basic information" href="#" class="" data-toggle="modal" data-target="#basic_user_info" > 
                              <i class="fa fa-pencil edit_profile"> </i> 
                            </a>
                          {% endif %}
                        </h1>
                        {% if can_edit %}
                          {% include "partials/profiles/_add_basic_info.html" %}
                        {% endif %}

                        <div class="expertiselist ">
                          {% if can_edit %}
                            {% include "partials/profiles/_add_expertises_form.html" %}
                          {% endif %}
                          {% if initial_expertises %}
                              <ul class="">
                                {% for expertise in initial_expertises %}
                                    <li>{{ expertise }}{% if not forloop.last %},{% endif %}</li>
                                {% endfor %}
                              </ul> 
                              {% if can_edit %}                       
                                <a class="" href="" data-target="#expertiseModal" data-toggle="modal"> 
                                  <i class="fa fa-pencil edit_profile"> </i> 
                                </a>
                              {% endif %}
                          {% else %}
                              {% if can_edit %}
                              <a data-target="#expertiseModal" data-toggle="modal" class="btn btn-default custom_btn" type="button"> Add your Expertise </a>
                              {% endif %}
                          {% endif %}
                        </div>

                        <div class="user_city">
                          <span>
                            <i class="fa fa-map-marker"></i>
                            {% if user.city %} 
                             {{ user.city }} 
                            {% else %}
                              City
                            {% endif %}                             
                          </span>
                        </div>                        
                        <!-- Modal -->
                        {% include "partials/profiles/_add_userlinks_form.html" %}
                      </div>
                        <!-- Button trigger modal -->

                      <div class="clearfix"></div>
                      <div class="user_about_wrapper">
                        {% if user.about %}
                          {% if can_edit %}
                            <a href="#" class="" data-toggle="modal" data-target="#about_modal"> 
                              <i class="fa fa-pencil edit_profile"></i> 
                            </a>  
                          {% endif %}                              
                        {% else %}
                          {% if can_edit %}
                            <a data-target="#about_modal" data-toggle="modal" style="padding:5px 20px"
                             class="btn btn-default custom_btn" type="button"> Add about yourself </a>
                          {% endif %}
                        {% endif %}
                        <p class="user_about_full" style="display: none;">{{ user.about }}</p>
                        <p class="user_about">{{ user.about|truncatechars:200 }}</p>
                        {% if user.about|length > 200 %}
                          <span class="user_about_slide_down">
                            <a href="#">Read more</a>
                        </span>
                        {% endif %}
                        {% include "partials/profiles/_add_about.html" %}
                      </div>
                    </div>
                    <div class="col-md-3 col-sm-3 col-xs-6 profile_right_site_bar">
                      {% comment %}
                      {% get_favorited_artists_by_user user.id as has_artist_favorited %}
                      {% if not request.user.id == user.id %}
                        <a class="make_artist_favorites" href="{% url 'profile:make-artist-favorites' user.pk %}">  
                          {% csrf_token %}    
                          {% if has_artist_favorited %}
                            <img src="{% static 'images/icons/star.png' %}">
                          {% else %}
                            <img src="{% static 'images/icons/empty-star.png' %}">
                          {% endif %}           
                        </a>
                      {% endif %}
                      {% endcomment %}

                      <!-- Share artist button with Jbox popup -->
                  <div class="share">
                    <div class="icons-item">
                      <a id="messaging" data-user-id ="{{ user.id }}" class="user_messaging single_user" href="{% url 'messaging:inbox' %}" title="Messages"><img src="{% static 'images/message.png' %}"></a>
                      <a id="messaging" class="btn btn-info btn-lg user_url_modal_btn share-button" data-url="{% if request.is_secure %}https://{% else %}http://{% endif %}{{ request.get_host }}{% url 'profile:my_profile' user.id %}" title="Share"><img src="{% static 'images/share.png' %}"></a>

                       {% get_favorited_artists_by_user user.id as has_artist_favorited %}
                        {% if not request.user.id == user.id %}
                          <a class="make_artist_favorites" href="{% url 'profile:make-artist-favorites' user.pk %}" title="Favourite">
                            {% csrf_token %}    
                          {% if has_artist_favorited %}
                            <img src="{% static 'images/icons/star.png' %}">
                          {% else %}
                            <img src="{% static 'images/icons/empty-star.png' %}">
                          {% endif %}           
                        </a>
                      {% endif %}
                       {% if request.user.is_authenticated and user.id == request.user.id %}
                       <a id="invite_new_user" href="javascript:void(0)" title="Invite"><img src="{% static 'images/add-friends.png' %}" alt="icon">
                       </a>
                         {% endif %}
                      </div>
                  </div>
               
                    </div>
                    <div class="col-sm-9 main-responsive-section-ad">
                       <div class=" profile_about responsive-change">
                      <div class="">
                        <h1>{{ user.get_full_name }} 
                          {% if can_edit %}
                            <a title = "Update your basic information" href="#" class="" data-toggle="modal" data-target="#basic_user_info" > 
                              <i class="fa fa-pencil edit_profile"> </i> 
                            </a>
                          {% endif %}
                        </h1>
                        {% if can_edit %}
                          {% include "partials/profiles/_add_basic_info.html" %}
                        {% endif %}

                        <div class="expertiselist ">
                          {% if can_edit %}
                            {% include "partials/profiles/_add_expertises_form.html" %}
                          {% endif %}
                          {% if initial_expertises %}
                              <ul class="">
                                {% for expertise in initial_expertises %}
                                    <li>{{ expertise }}{% if not forloop.last %},{% endif %}</li>
                                {% endfor %}
                              </ul> 
                              {% if can_edit %}                       
                                <a class="" href="" data-target="#expertiseModal" data-toggle="modal"> 
                                  <i class="fa fa-pencil edit_profile"> </i> 
                                </a>
                              {% endif %}
                          {% else %}
                              {% if can_edit %}
                              <a data-target="#expertiseModal" data-toggle="modal" class="btn btn-default custom_btn" type="button"> Add your Expertise </a>
                              {% endif %}
                          {% endif %}
                        </div>

                        <div class="user_city">
                          <span>
                            <i class="fa fa-map-marker"></i>
                            {% if user.city %} 
                             {{ user.city }} 
                            {% else %}
                              City
                            {% endif %}                             
                          </span>
                        </div>                        
                        <!-- Modal -->
                        {% include "partials/profiles/_add_userlinks_form.html" %}
                      </div>
                        <!-- Button trigger modal -->

                      <div class="clearfix"></div>
                      <div class="user_about_wrapper">
                        {% if user.about %}
                          {% if can_edit %}
                            <a href="#" class="" data-toggle="modal" data-target="#about_modal"> 
                              <i class="fa fa-pencil edit_profile"></i> 
                            </a>  
                          {% endif %}                              
                        {% else %}
                          {% if can_edit %}
                            <a data-target="#about_modal" data-toggle="modal" style="padding:5px 20px"
                             class="btn btn-default custom_btn" type="button"> Add about yourself </a>
                          {% endif %}
                        {% endif %}
                        <p class="user_about_full" style="display: none;">{{ user.about }}</p>
                        <p class="user_about">{{ user.about|truncatechars:200 }}</p>
                        {% if user.about|length > 200 %}
                          <span class="user_about_slide_down">
                            <a href="#">Read more</a>
                        </span>
                        {% endif %}
                        {% include "partials/profiles/_add_about.html" %}
                      </div>
                    </div>
                    <div class="profile_right_site_bar responsive-change-sec">
                      {% get_favorited_artists_by_user user.id as has_artist_favorited %}
                      {% if not request.user.id == user.id %}
                        <a class="make_artist_favorites" href="{% url 'profile:make-artist-favorites' user.pk %}">  
                          {% csrf_token %}    
                          {% if has_artist_favorited %}
                           
                          {% else %}
                            
                          {% endif %}           
                        </a>
                      {% endif %}

                      <!-- Share artist button with Jbox popup -->
                  <div class="share">
                    <div class="icons-item">
                      <a id="messaging" data-user-id ="{{ user.id }}" class="user_messaging single_user" href="{% url 'messaging:inbox' %}" title="Messages"><img src="{% static 'images/message.png' %}"></a>
                      <a id="messaging" class="btn btn-info btn-lg user_url_modal_btn share-button" data-url="{% if request.is_secure %}https://{% else %}http://{% endif %}{{ request.get_host }}{% url 'profile:my_profile' user.id %}" title="Share"><img src="{% static 'images/share.png' %}"></a>
                      <!--  <a id="favourite-user" href="javascript:void(0)" title="Favourite"><img src="{% static 'images/favorite.png' %}"></a> -->
                      {% get_favorited_artists_by_user user.id as has_artist_favorited %}
                        {% if not request.user.id == user.id %}
                          <a class="make_artist_favorites" href="{% url 'profile:make-artist-favorites' user.pk %}" title="Favourite">
                            {% csrf_token %}    
                          {% if has_artist_favorited %}
                            <img src="{% static 'images/icons/star.png' %}">
                          {% else %}
                            <img src="{% static 'images/icons/empty-star.png' %}">
                          {% endif %}           
                        </a>
                      {% endif %}

                       <a id="send_invite" href="javascript:void(0)" title="Invite"><img src="{% static 'images/add-friends.png' %}" alt="icon"></a>
                      </div>
                  </div>
               
                    </div>
                    </div>
            </div>
          </div>
        </div>
    <!-- End Profile -->
  <div id="inviteModal" class="modal fade invite-modal-bg" role="dialog">
  <div class="modal-dialog">

    <!-- Modal content-->
    <div class="Invite-Friends-Col invite-heading"><h3>Invite Friends & Collaborators</h3></div>
    <div class="modal-content invite-modal-new-content invite-mdal-view">
      <div class="modal-body modol_1">
        <div class="search_messages" id="hideform">
          <form id="invite_form" method="POST" action="{% url 'send_invitation' %}">
            {% csrf_token %}
            <div class="form-group">
              <input type="hidden" name="inviteuser" id="invite_user"  value="{{user.id}}">
            </div>
            <div class="row">
              <div class="col-6 col-sm-10 blaenks_1">
                <div class="form-group">
                    <label for="email"><b>Enter Email</b></label>
                    <input type="email" name="email" id="id_email" class="form-control form-input validate-email" placeholder="" required>
                    <!-- <h2 id="error" style="display:none; font-weight: bold; color: red;">Please enter your E-mail</h2> -->
                    <div><h2 class="error_msg" id="error">Please enter your E-mail</h2></div>
                    <div><h2 class="error_msg" id="emailfailed">Invitation already sent on this Email.</h2></div>
                    <div><h2 class="success_msg" id="success_invite">Invitation send successfully.</h2></div>
                </div>
              </div>
              <div class="col-6 col-sm-2">
                <div class="invite invite-button">
                  <p><button class="button invite-btn">invite</button></p>
                </div>
              </div>
            </div>
            <div class="row">
              <div class="col-sm-12 Grab grab-data">
                 Grab this link and send it to your friends! If they use this <br>
            link to sign in, your numbers grow.
              </div>
            </div>
            <div class="row">
              <div class="form-group">
                 <div class="col-sm-10 blaenks">
                  <input type="text" name="link" id="invite_link" value="{{ inviter_url }}" class="form-control validate-email invite-link form-input" readonly="">
                    </div>
                   <div class="col-sm-2 copy">
                <p><button type="button" class="button copy-link-btn" id="copy_invite_link">Copy link</button></p>
                </div>
               </div> 
            </div> 
          </form>
        </div>
        <div class="row">
          <div class="col-xs-12 col-sm-5 col-md-5 invite_p invite-detail-work">
           <p>not yet signed in</p>
            {% for mail in pending_users %}
              <div class="media">
                <div class="media-body">
                  <h4 class="media-heading">{{mail}}</h4>
                </div>
              </div>
           {% endfor %}
          </div>
          <div class="col-xs-12 col-sm-5 col-md-5 invite_p invite-detail-work2">
           
            <p>signed in</p>
            {% for user_data in users_list %} 
            <div class="media">
              <div class="media-left">
                {% if user_data.pic %}
                <a href="{% if request.is_secure %}https://{% else %}http://{% endif %}{{ request.get_host }}{% url 'profile:my_profile' user_data.user_id %}"><img src="{{ user_data.pic|thumbnail_url:'artwork_cover_tiny' }}" class="media-object"></a>
                
                {% else %}
                <a href="{% if request.is_secure %}https://{% else %}http://{% endif %}{{ request.get_host }}{% url 'profile:my_profile' user_data.user_id %}"><img src="{% static 'images/artwork-icon.jpg' %}" class="media-object"></a>
                {% endif %}
              </div>
              <div class="media-body">
                <a href="{% if request.is_secure %}https://{% else %}http://{% endif %}{{ request.get_host }}{% url 'profile:my_profile' user_data.user_id %}"><h4 class="media-heading-accept">{{ user_data.first }} {{ user_data.last }}</h4></a>
              </div>
            </div>
            {% endfor %}
            </div>
          </div>
    {% comment %}
          <div class="row">
            <div class="col-xs-4 col-sm-4 invite-count">
              <h1>{{ get_all_invites }}</h1>
              <p>invited</p>
            </div>
            <div class="col-xs-4 col-sm-4 invite-count">
              <h1>{{ get_pending_invites }}</h1>
              <p>pending</p>
            </div>
            <div class="col-xs-4 col-sm-4 invite-count">
              <h1>{{ get_accepted_invites }} </h1>
              <p>signed in</p>
            </div>
          </div>

         <div class="row">
           <div class="col-sm-12">
               <p class="invite-paragraph">1. Take part in the compitition to win Native Instruments Traktor... sony camera/iphone gimbal</p>
                 <p class="invite-paragraph">2. Download this free ebook</p>
                 <p class="invite-paragraph">3. View this video of the cheating workshop video </p>
                 <p class="invite-paragraph">4. Take part in 1 Day Blaenks Workshop of your choice in Berlin.</p>
                 <p class="invite-paragraph">5. Have your profile shown on the landing page for 1 Day.</p>
                 <p class="invite-paragraph">6. Promote one of your Artworks on the landing page for 1 day.</p>
                 <p class="invite-paragraph">7. We do an interview with you.</p>
                 <p class="invite-paragraph">-Gutschein plugin NI</p> 
           </div>
         </div>
         {% endcomment %}
      </div>
    </div>

  </div>
  <button data-dismiss="modal" id="closebutton" style="padding:5px 20px" class="btn btn-default custom_btn cancel_btn" type="button">
    <span class="glyphicon glyphicon-remove" aria-hidden="true"></span>
  </button>
</div>
    {% endif %}

    <div id="artwork_items" class="video_wrapper">
        <div class="container" style="margin: 0 auto;">
          <div class="profile_artwork_info_wrapper blur_bg_image">
            <span class="artwork_add_sort_title_wrapper {% if number_of_artworks %}active{% endif %}">
              <a href="#" class="profile_artwork_info_artwork_show">
                <h2 class="artwork-title">                
                  Artworks<span>{{ number_of_artworks }}</span>       
                </h2>
              </a>
                {% if request.user.is_authenticated and user.id == request.user.id %}
                <span class="{% if number_of_artworks < 1 %}upload_artwork_button{% endif %}">            
                  <a href="#" data-form="{% if request.user.is_authenticated %}{% url 'artwork:artwork-add' request.user.id %}{% endif %}" class="btn btn-default custom_btn update_artwork add_artwork" type="button" title="Add Artwork">
                    {% if number_of_artworks %}
                      <img src="{% static 'images/icons/pluse.png' %}">
                    {% else %}
                      Upload Artwork
                  </a>
                {% endif %} 

                  <div style="float: left; margin-top: 30px; display: none;" class="mini-spinner mini-spinner-add">&nbsp;</div>
                  
                  {% if request.user.collaborated.all %}
                    <a id="sort_portfolio" class="btn btn-default custom_btn show_artwork" title="Sort Portfolio" data-form="{% url 'artwork:artwork-sort' request.user.id %}">
                      <img src="{% static 'images/icons/sort-icon.png' %}">
                    </a>  
                  {% endif %}
                </span>
                {% endif %}
            </span>

            <span class="count_collab_fav_wrapper">
              {% get_number_of_collaborators user.id as number_of_collborators %}
                {% if number_of_collborators %}
                  <h2 class="count_collaborator">
                    <a href="#" data-form="{% url 'profile:collab_name' user.id %}">
                      Collaborators<span>{{ number_of_collborators }}  </span>
                    </a>
                  </h2>
                {% endif %}
            </span>
            <span class="count_collab_fav_wrapper count_active_collab_wrapper {% if not number_of_artworks %}active{% endif %}">
              <h2 class="count_favorites">
                {% get_number_of_favorites user.id as number_of_favorites %}
                <a id="count_favorites_active" {% if not number_of_artworks %}class="count_favorites_active"{% endif %} href="#" data-form="{% url 'profile:favorite' user.id %}">
                  Favorites
                  <span>{{ number_of_favorites }}</span>
                </a>
              </h2>
            </span>
          </div>

          <div style="float: left; margin-top: 30px;" class="mini-spinner mini-spinner-sort">&nbsp;</div>&#8203;
          
          <div id="sort_portfolio_modal" class="modal fade" data-backdrop="static" data-keyboard="false" style="display: none; padding: 5px;">            
          </div>

          <div id="artwork_popup_modal" class="modal fade" data-backdrop="static" data-keyboard="false" style="display: none; padding: 5px; overflow: auto;">            
          </div>

        <!-- Modal -->
          <div class="modal hide protofolio-modal" id="portfolioModal" data-backdrop="static" data-keyboard="false">
            <!-- Ajax Upload add and edit artwork form -->
          </div>        
      </div>
        {% include "partials/_spinner.html" %}
        <!-- Ajax load Artwork -->
        <section class="profile_user_collab_list_wrapper">
          <!-- Ajax load collab list -->
        </section>
        <section class="profile_user_favorites_wrapper">
          <!-- Ajax load collab list -->
        </section>
        {% include "partials/artwork/_artwork_items.html" with artworks=artworks %}

    </div>
    
{% endblock %}

{% block extra_js %}  
    {% compress js %}

      <script src="{% static 'js/imagesloaded.js' %}"></script>
      <script src="{% static 'js/masonry.min.js' %}"></script>
      <script src="{% static 'js/simple-gallery.js' %}"></script>     
      <script src="{% static 'js/artwork.js' %}"></script>
    {% endcompress %}
    <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery.form/4.2.2/jquery.form.js"></script>
    <script>      
      {% if user %} 
        var listArtworksURL = "{% url 'artwork:artwork-list' user.id %}";
        var profileUserCollabListURL = "{% url 'profile:collab_name' user.id %}";
        var profileUserFavoritesListtURL = "{% url 'profile:favorite' user.id %}";
      {% endif %}

function myFunction() {
  var copyText = document.getElementById("link");
  copyText.select();
  document.execCommand("copy");
  alert("Link is successfully Copied ");
}

$("#invite_new_user").click(function(){ 
  $('#inviteModal').modal('show');
});

$("#send_invite").click(function(){ 
  $('#inviteModal').modal('show');
});

$('#invite_form').ajaxForm(function(response) {

  JSON.stringify(response);
  if(response['status']== true) {
    // $("#invite_form").hide();
    $("#emailfailed").hide()
    $("#error").hide()
    $("#success_invite").show();
    }

  else{ 
      $("#success_invite").hide();
      $("#error").hide();
      $("#emailfailed").html(response['msg']);
      $("#emailfailed").show();
      
    }
 });
$("#closebutton").click(function(){
    // window.location.reload(1);
    $("#invite_form")[0].reset(); 
    $("#emailfailed").hide()
    $("#success_invite").hide();
 });  
      (function($){        
          $(document).ready(function(){
                var gallery_selector = "#profile_id_{{ user.id }}";
                $(gallery_selector).lightGallery({
                  'closable':false,
                  'download':false,
                  'share':false,
                });

                $("#collab_popup").on('click' , '#list_of_collab' , function(ev){
                  ev.preventDefault(); // prevent navigation
                  var url = $(this).data("form"); // get the contact form url         
                  $(this).parent('#collab_popup').find('.mini-spinner-collab').show();
                  $("#list_of_collab_modal").load(url, function() { // load the url into the modal
                      $(this).removeClass('hide');
                      $(this).addClass('fade in');              
                      $(this).modal('show'); // display the modal on url load
                      $(this).parent('#collab_popup').find('.mini-spinner-collab').hide();
                      
                  });
                  return false; // prevent the click propagation
                });
                
                // Start Profile artwork info tabs
                $("#artwork_items").on('click' , '.artwork_add_sort_title_wrapper .profile_artwork_info_artwork_show' , function(ev){
                    ev.preventDefault();
                    $(this).parents('.profile_artwork_info_wrapper').find(".count_collab_fav_wrapper").removeClass('active');
                    $(this).parents('.profile_artwork_info_wrapper').find(".artwork_add_sort_title_wrapper").addClass('active');
                    $('#artwork_items .profile_user_collab_list_wrapper').hide();
                    $('#artwork_items .profile_user_favorites_wrapper').hide();
                    $('#artwork_items .video_overlay').show();
                });

                $("#artwork_items").on('click' , '.count_collab_fav_wrapper' , function(ev){
                  $(this).parent('.profile_artwork_info_wrapper').find(".artwork_add_sort_title_wrapper").removeClass('active');
                  $(this).parent('.profile_artwork_info_wrapper').find(".count_collab_fav_wrapper").removeClass('active');
                  $(this).addClass('active');                  
                });

                $("#artwork_items").on('click' , '.count_collaborator a' , function(ev){
                  ev.preventDefault();
                  $.ajax({

                    type: "get",
                    url: profileUserCollabListURL,

                    beforeSend : function() {
                      $('#artwork_items .spinner_contant').show();
                    },
                    success : function(data) {
                      $('#artwork_items .profile_user_collab_list_wrapper').html(data);
                      $('#artwork_items .video_overlay').hide();
                      $('#artwork_items .profile_user_favorites_wrapper').hide();
                      $('#artwork_items .spinner_contant').hide();
                      $('#artwork_items .profile_user_collab_list_wrapper').show();
                    },
                  });
                });

                $("#artwork_items").on('click' , '.count_favorites a' , function(ev){
                  ev.preventDefault();
                  $.ajax({
                    type: "get",
                    url: profileUserFavoritesListtURL,

                    beforeSend : function() {
                      $('#artwork_items .spinner_contant').show();
                    },
                    success : function(data) {
                      $('#artwork_items .profile_user_favorites_wrapper').html(data);
                      $('#artwork_items .video_overlay').hide();
                      $('#artwork_items .spinner_contant').hide();
                      $('#artwork_items .profile_user_collab_list_wrapper').hide();
                      $('#artwork_items .profile_user_favorites_wrapper').show();
                    },
                  });
                });
                if ($('#count_favorites_active').hasClass("count_favorites_active")) {
                  $("#count_favorites_active").trigger('click');
                }

          });

      })(jQuery);

function copyToClipboard(text) {

   var textArea = document.createElement( "textarea" );
   textArea.value = text;
   document.body.appendChild( textArea );

   textArea.select();

   try {
      var successful = document.execCommand( 'copy' );
      var msg = successful ? 'successful' : 'unsuccessful';
      console.log('Copying text command was ' + msg);
   } catch (err) {
      console.log('Oops, unable to copy');
   }

   document.body.removeChild( textArea );
}
$('#copy_invite_link').click( function()
 {
     var clipboardText = "";
     clipboardText = $('#invite_link').val();
     copyToClipboard(clipboardText);
 });
    </script> 
{% endblock %}