<commit_before><div class="update">
  <% if can?(:update, @profile) %>
    <label><%=  t('avatar.profile_change') %></label>
    <%= render partial: 'profiles/avatar_edit' %>

    <%= form_for(profile_subject, :url => [profile_subject]) do |f| %>

      <%= f.label t('actor.name'), :class => "name-required"  %><!--span>*</span-->
      <%= f.text_field :name, :class => "required", :maxlength => 50 %>

      <%= f.label t('profile.occupation.label'), :class => "text" %>
      <%= f.select(:occupation, options_for_select([[t('profile.occupation.options.select'), 0], [t('profile.occupation.options.teacher'), 1],[t('profile.occupation.options.scientist'),2], [t('profile.occupation.options.other'),3]], profile_subject.occupation)) %>
             
          <%= f.label t('profile.organization'), :class => "text" %>
          <%= f.text_field :organization, :class => "input_settings" %>

          <%= f.label t('profile.website'), :class => "text" %>
          <%= f.url_field :website, :class => "input_settings" %>

          <div class="birthday">
          <%= f.label t('profile.' + profile_subject.class.to_s.downcase + '.birthday'), :class => "text" %>
          <%= date_select "user", "birthday", :order => [:day, :month, :year], :end_year => Date.today.year, :start_year => (Date.today.year - 100), :prompt => {:day => 'Day', :month => 'Month', :year => 'Year'} %>
          </div>
          <%= f.label t('profile.city'), :class => "text" %>
          <%= f.text_field :city, :class => "input_settings" %>

          <%= f.label t('profile.country'), :class => "text" %>
          <%= f.text_field :country, :class => "input_settings" %>
       
          <%= f.label :description, t("profile.#{ profile_subject.class.to_s.downcase }.about") %>
          <%= f.text_area :description, :maxlength => 500, :rows => 2 %>

          <!--TAGS-->
          <!-- Tags preloaded -->
          <% @tags = ActivityObject.tag_counts(:limit => 100, :order => "count desc")%>
          <ul id="preloadTagList" style="display:none">
          <%@tags.each do |tag| %>
            <li>
              <%=tag.name%>
            </li>
          <%end%>
          </ul>

          <!-- User tags -->
          <%@user_tags = profile_subject.tags%>
          <ul id="preloadUserTagList" style="display:none">
            <%@user_tags.each do |tag| %>
              <li><%=tag.name%></li>
            <%end%>
          </ul>

          <%= f.label t('activerecord.attributes.user.tag') %>
          <div class="tagBoxNew">
            <ul class="tagList"></ul>
          </div>
          <%= f.hidden_field :tag_list, :class => "form_tag", :id => "input_tag_list", :placeholder => t('devise.tags') %>

          <!--p>
            <%= t('required') %>
          </p-->

          <div class="actions">
          <%= f.submit t('button.update'), "data-loading-text" => t('button.sending') %>
          <%=link_to t('hide'), "#", :id=>"hide_profile_form", :class=>"btn btn-primary"%>
          </div>
        <% end %>



        <%= javascript_tag do %>
          $('#user_description').val("<%= profile_subject.description %>");
        <% end %>

        <%= content_for :javascript do %>
          $(document).ready(function() {
            var tagList = $(".tagList");
            var tags = [];

            //Load tags
            $.each($("#preloadTagList li"), function(index, element) {
               tags.push($(element).html());
            });

            if ($(tagList).children().length == 0){
              $.each($("#preloadUserTagList li"), function(index, element) {
                $(tagList).append("<li>" + $(element).html() + "</li>")
              });
            } 
            
            $(tagList).tagit({tagSource:tags, sortable:true, maxLength:15, maxTags:8 , 
              watermarkAllowMessage: '<%=t('document.tags.areasOfInterestMessage')%>', watermarkDenyMessage: '<%=t('document.tags.limitMessage')%>' ,
              tagsChanged:function (tag, action) {
                //Check if the element popped is a suggestion
                if(action=="popped"){
                  $.each($(".tagit-suggestions li"), function(index, element) {
                    if($(element).html()==tag){
                      $(element).show();
                    }
                  });
                }
              } 
            });

            //Allow suggestions
            $(".tagit-suggestions li").on("click", function(){
              var result = $(".tagit").tagit('add', $(this).html() );
              if(result==true){
                $(this).hide();
              }
            });

            //Fill tag_list hidden input before send
             var button = $("input[type='submit'][name='commit']");
              $(button).click(function(event) {

               $(this).button('loading');
               $("#hide_profile_form").hide();

               var tagList = $(".tagList");
               $("#input_tag_list").val(Vish.Utils.convertToTagsArray($(tagList).tagit("tags")));
               return true;
             });

             $("#hide_profile_form").click(function(){
                $(".update").hide("slow");
                $(".briefing").show("slow");
             });

          });
          <% end %>

  <% end %>        
</div><commit_msg>Fixed tags in Users bug<commit_after><div class="update">
  <% if can?(:update, @profile) %>
    <label><%=  t('avatar.profile_change') %></label>
    <%= render partial: 'profiles/avatar_edit' %>

    <%= form_for(profile_subject, :url => [profile_subject]) do |f| %>

      <%= f.label t('actor.name'), :class => "name-required"  %><!--span>*</span-->
      <%= f.text_field :name, :class => "required", :maxlength => 50 %>

      <%= f.label t('profile.occupation.label'), :class => "text" %>
      <%= f.select(:occupation, options_for_select([[t('profile.occupation.options.select'), 0], [t('profile.occupation.options.teacher'), 1],[t('profile.occupation.options.scientist'),2], [t('profile.occupation.options.other'),3]], profile_subject.occupation)) %>
             
          <%= f.label t('profile.organization'), :class => "text" %>
          <%= f.text_field :organization, :class => "input_settings" %>

          <%= f.label t('profile.website'), :class => "text" %>
          <%= f.url_field :website, :class => "input_settings" %>

          <div class="birthday">
          <%= f.label t('profile.' + profile_subject.class.to_s.downcase + '.birthday'), :class => "text" %>
          <%= date_select "user", "birthday", :order => [:day, :month, :year], :end_year => Date.today.year, :start_year => (Date.today.year - 100), :prompt => {:day => 'Day', :month => 'Month', :year => 'Year'} %>
          </div>
          <%= f.label t('profile.city'), :class => "text" %>
          <%= f.text_field :city, :class => "input_settings" %>

          <%= f.label t('profile.country'), :class => "text" %>
          <%= f.text_field :country, :class => "input_settings" %>
       
          <%= f.label :description, t("profile.#{ profile_subject.class.to_s.downcase }.about") %>
          <%= f.text_area :description, :maxlength => 500, :rows => 2 %>

          <!--TAGS-->
          <!-- Tags preloaded -->
          <% @tags = ActivityObject.tag_counts(:limit => 100, :order => "count desc")%>
          <ul id="preloadTagList" style="display:none">
          <%@tags.each do |tag| %>
            <li>
              <%=tag.name%>
            </li>
          <%end%>
          </ul>

          <!-- User tags -->
          <%@user_tags = profile_subject.tags%>
          <ul id="preloadUserTagList" style="display:none">
            <%@user_tags.each do |tag| %>
              <li><%=tag.name%></li>
            <%end%>
          </ul>

          <%= f.label t('activerecord.attributes.user.tag') %>
          <div class="tagBoxNew">
            <ul class="tagList"></ul>
          </div>
          <%= f.hidden_field :tag_list, :class => "form_tag", :id => "input_tag_list", :placeholder => t('devise.tags') %>

          <!--p>
            <%= t('required') %>
          </p-->

          <div class="actions">
          <%= f.submit t('button.update'), "data-loading-text" => t('button.sending') %>
          <%=link_to t('hide'), "#", :id=>"hide_profile_form", :class=>"btn btn-primary"%>
          </div>
        <% end %>



        <%= javascript_tag do %>
          $('#user_description').val("<%= profile_subject.description %>");
        <% end %>

        <%= content_for :javascript do %>
          $(document).ready(function() {
            var tagList = $(".tagList");
            var tags = [];

            //Load tags
            $.each($("#preloadTagList li"), function(index, element) {
               tags.push($(element).html());
            });

            if ($(tagList).children().length == 0){
              $.each($("#preloadUserTagList li"), function(index, element) {
                $(tagList).append("<li>" + $(element).html() + "</li>")
              });
            } 
            
            $(tagList).tagit({tagSource:tags, sortable:true, maxLength:15, maxTags:8 , 
              watermarkAllowMessage: '<%=t('document.tags.areasOfInterestMessage')%>', watermarkDenyMessage: '<%=t('document.tags.limitMessage')%>' ,
              tagsChanged:function (tag, action) {
                //Check if the element popped is a suggestion
                if(action=="popped"){
                  $.each($(".tagit-suggestions li"), function(index, element) {
                    if($(element).html()==tag){
                      $(element).show();
                    }
                  });
                }
              } 
            });

            //Allow suggestions
            $(".tagit-suggestions li").on("click", function(){
              var result = $(".tagit").tagit('add', $(this).html() );
              if(result==true){
                $(this).hide();
              }
            });

            //Fill tag_list hidden input before send
             var button = $("input[type='submit'][name='commit']");
              $(button).click(function(event) {

               $(this).button('loading');
               $("#hide_profile_form").hide();

               var tagList = $(".tagList")[1];
               $("#input_tag_list").val(Vish.Utils.convertToTagsArray($(tagList).tagit("tags")));
               return true;
             });

             $("#hide_profile_form").click(function(){
                $(".update").hide("slow");
                $(".briefing").show("slow");
             });

          });
          <% end %>

  <% end %>        
</div>
{'fraction_non_alphanumeric': 0.20748139074719685, 'fraction_numerical': 0.003863186657872421, 'mean_word_length': 1.9167353668590272, 'pattern_counts': {'":': 0, '<': 145, '<?xml version=': 0, '>': 207, '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': '2358059', 'n_tokens_mistral': 3341, 'n_tokens_neox': 3058, 'n_words': 533}