<%! from django.utils.translation import ugettext as _ %>
<%namespace name='static' file='../static_content.html'/>
<%block name="js_extra">
  <%static:js group='certificates_wv'/>
  <script type="text/javascript">
    $(document).ready(function() {
      $.ajaxSetup({
        headers: {
          'X-CSRFToken': $.cookie('csrftoken')
        },
        dataType: 'json'
      });
      $(".action-linkedin-profile").click(function() {
        var data = {
          user_id: '${accomplishment_user_id}',
          course_id: $(this).data('course-id'),
          enrollment_mode: $(this).data('certificate-mode'),
          certificate_id: '${certificate_id_number}',
          certificate_url: window.location.href,
          social_network: 'LinkedIn'
        };
        Logger.log('edx.certificate.shared', data);
      });
    });
  </script>
</%block>

<div class="wrapper-banner wrapper-banner-user">
    <section class="banner banner-user">
        <div class="message message-block message-notice">
            <h2 class="message-title hd-5 emphasized">${accomplishment_banner_opening}</h2>
            <div class="wrapper-copy-and-actions">
                <p class="message-copy copy copy-base emphasized">${accomplishment_banner_congrats}</p>
                <div class="message-actions">
                    <h3 class="sr-only">${_("Take this with you:")}</h3>

                    %if badge:
                    <button class="action action-share-mozillaopenbadges btn btn-overlay btn-small">
                        <img class="icon icon-mozillaopenbadges" src="/static/certificates/images/ico-mozillaopenbadges.png" alt="Mozilla Open Badges Backpack">
                        ${_("Add to Mozilla Backpack")}
                    </button>
                    %endif

                    <button class="action action-print btn btn-overlay btn-small" id="action-print-view">
                        <i class="icon fa fa-print" aria-hidden="true"></i>
                        ${_("Print Certificate")}
                    </button>
                %if linked_in_url:
                    <a class="action-linkedin-profile" target="_blank" href="${linked_in_url}"
                        title="${_('Add to LinkedIn Profile')}"
                        data-course-id="${course_id}"
                        data-certificate-mode="${course_mode}">
                        <img class="action-linkedin-profile-img"
                            src="${static.url('images/linkedin_add_to_profile.png')}"
                            alt="${_('Add to LinkedIn Profile')}" />
                    </a>
                %endif
                </div>
            </div>
        </div>
    </section>
</div>