<commit_before><%
  jammit_css :login
  @headers = false
  @body_classes << "modal"
  content_for :page_title, t(:page_title, "Register %{email}", :email => @communication_channel.path)
%>

<div id="modal-box-top"></div>
<div id='modal-box-arbitrary-size'>
  <div style="margin: 20px 10px 0">
    <h2><%= t 'titles.welcome_aboard', "Welcome aboard!" %></h2>
    <% if @current_user && @current_user != @communication_channel.user %>
      <h4><%= t 'titles.merge_self', "Merge With Your Current User" %></h4>
      <p><%= if @course
            t('details.merge_self_course', "The invitation for %{course} is for %{user1}, but you are currently logged in as %{user2}. You can combine these two accounts together and accept the invitation by clicking 'Merge'.",
             :course => @course.name, :user1 => @communication_channel.user.name, :user2 => @current_user.name)
          else
            t('details.merge_self', "The e-mail address %{email} is currently associated with %{user1}, but you are currently logged in as %{user2}. You can merge these two accounts together by clicking 'Merge'.",
              :email => @communication_channel.path, :user1 => @communication_channel.user.name, :user2 => @current_user.name)
          end
          %>
      </p>
      <a href="<%= registration_confirmation_path(@communication_channel.confirmation_code, :enrollment => @enrollment.uuid, :merge => 'self') %>" class="button"><%= t('buttons.merge', "Merge") %></a>
      <div style="clear: both;"></div>
    <% end %>
    <% if @communication_channel.user.registered?  %>
      <% # if the user is registered, it's safe to assume that @current_user == @communication_channel.user, because the only way to get to #confirm with an enrollment is a redirect from CoursesController#enrollment_invitation that makes sure you are logged in, then send sends you to confirm with a cc for the enrollment's user %>
      <% if @communication_channel.unconfirmed? %>
        <h4><%= t 'titles.confirm', "Confirm E-mail Address" %></h4>
        <p><%= t('details.confirm', "Confirm %{email} belongs to %{user} by clicking 'Confirm'.", :email => @communication_channel.path, :user => @communication_channel.user.name) %>
          <a href="<%= registration_confirmation_path(@communication_channel.confirmation_code, :confirm => 1) %>" class="button"><%= t 'buttons.confirm', "Confirm" %></a>
        </p>
        <div style="clear: both;"></div>
      <% elsif @enrollment.try(:invited?) %>
        <h4><%= t 'titles.transfer_enrollment', "Transfer Enrollment" %></h4>
        <p><%= t('details.transfer', "Alternatively, you can simply accept the invitation as %{user} by clicking 'Transfer Enrollment'.", :user => @current_user.name) %></p>
        <a href="<%= registration_confirmation_path(@communication_channel.confirmation_code, :enrollment => @enrollment.uuid, :transfer_enrollment => 1) %>" class="button"><%= t('buttons.transfer_enrollment', "Transfer Enrollment") %></a>
        <h4><%= t 'titles.accept_enrollment', "Accept Enrollment" %></h4>
        <p><%= t('details.accept_logout', "In order to accept this enrollment for %{user}, you will need to log out and log in as that user.", :user => @enrollment.user.name) %></p>
        <a href="<%= login_url(:enrollment => @enrollment.uuid, :re_login => 1) %>" class="button"><%= t('buttons.relogin', "Re-login") %></a>
        <div style="clear: both;"></div>
      <% end %>
    <% end %><commit_msg>fix rendering of registration page for merges when there is no enrollment<commit_after><%
  jammit_css :login
  @headers = false
  @body_classes << "modal"
  content_for :page_title, t(:page_title, "Register %{email}", :email => @communication_channel.path)
%>

<div id="modal-box-top"></div>
<div id='modal-box-arbitrary-size'>
  <div style="margin: 20px 10px 0">
    <h2><%= t 'titles.welcome_aboard', "Welcome aboard!" %></h2>
    <% if @current_user && @current_user != @communication_channel.user %>
      <h4><%= t 'titles.merge_self', "Merge With Your Current User" %></h4>
      <p><%= if @course
            t('details.merge_self_course', "The invitation for %{course} is for %{user1}, but you are currently logged in as %{user2}. You can combine these two accounts together and accept the invitation by clicking 'Merge'.",
             :course => @course.name, :user1 => @communication_channel.user.name, :user2 => @current_user.name)
          else
            t('details.merge_self', "The e-mail address %{email} is currently associated with %{user1}, but you are currently logged in as %{user2}. You can merge these two accounts together by clicking 'Merge'.",
              :email => @communication_channel.path, :user1 => @communication_channel.user.name, :user2 => @current_user.name)
          end
          %>
      </p>
      <a href="<%= registration_confirmation_path(@communication_channel.confirmation_code, :enrollment => @enrollment.try(:uuid), :merge => 'self') %>" class="button"><%= t('buttons.merge', "Merge") %></a>
      <div style="clear: both;"></div>
    <% end %>
    <% if @communication_channel.user.registered?  %>
      <% # if the user is registered, it's safe to assume that @current_user == @communication_channel.user, because the only way to get to #confirm with an enrollment is a redirect from CoursesController#enrollment_invitation that makes sure you are logged in, then send sends you to confirm with a cc for the enrollment's user %>
      <% if @communication_channel.unconfirmed? %>
        <h4><%= t 'titles.confirm', "Confirm E-mail Address" %></h4>
        <p><%= t('details.confirm', "Confirm %{email} belongs to %{user} by clicking 'Confirm'.", :email => @communication_channel.path, :user => @communication_channel.user.name) %>
          <a href="<%= registration_confirmation_path(@communication_channel.confirmation_code, :confirm => 1) %>" class="button"><%= t 'buttons.confirm', "Confirm" %></a>
        </p>
        <div style="clear: both;"></div>
      <% elsif @enrollment.try(:invited?) %>
        <h4><%= t 'titles.transfer_enrollment', "Transfer Enrollment" %></h4>
        <p><%= t('details.transfer', "Alternatively, you can simply accept the invitation as %{user} by clicking 'Transfer Enrollment'.", :user => @current_user.name) %></p>
        <a href="<%= registration_confirmation_path(@communication_channel.confirmation_code, :enrollment => @enrollment.uuid, :transfer_enrollment => 1) %>" class="button"><%= t('buttons.transfer_enrollment', "Transfer Enrollment") %></a>
        <h4><%= t 'titles.accept_enrollment', "Accept Enrollment" %></h4>
        <p><%= t('details.accept_logout', "In order to accept this enrollment for %{user}, you will need to log out and log in as that user.", :user => @enrollment.user.name) %></p>
        <a href="<%= login_url(:enrollment => @enrollment.uuid, :re_login => 1) %>" class="button"><%= t('buttons.relogin', "Re-login") %></a>
        <div style="clear: both;"></div>
      <% end %>
    <% end %>
{'fraction_non_alphanumeric': 0.17049039288786924, 'fraction_numerical': 0.007456266131344996, 'mean_word_length': 4.02521613832853, 'pattern_counts': {'":': 0, '<': 131, '<?xml version=': 0, '>': 163, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7551392', 'n_tokens_mistral': 2209, 'n_tokens_neox': 2094, 'n_words': 619}