<commit_before>


<% if current_user.try(:person).try(:member?) -%>
    <div class="sysmo_gadget">

      <div class="header curved_top">
        Go to my <%= t('project') %>
      </div>
      <div class="contents curved_bottom">
        <div style="text-align: center">

            <input type=button id="my_project_button" class="gadget_button_menu" value="My <%= t('project') %>" onclick="javascript:myProjectClicked();"/>

            <ul id="my_project_menu" class='dynamic_menu with_smaller_shadow' style="display:none;">

                <% current_user.person.projects.each do |p| %>
                    <li style="border-bottom: 1px dotted grey;" class='dynamic_menu_li' onclick="javascript:location.href='<%= project_path(p) -%>';"><%= h(p.name) %></li>
                <% end %>
            </ul>

        </div>
      </div>
    </div>

    <script type="text/javascript">
        function myProjectClicked() {
        <% if current_user.person.projects.size==1 -%>
            location.href='<%= project_path(current_user.person.projects.first) -%>';
        <% else -%>
            toggleDynamicMenu('my_project_menu');
        <% end -%>
        }
    </script>

<% end -%><commit_msg>Arrow on My Project button is shown just when user has more than one projects<commit_after>


<% if current_user.try(:person).try(:member?) -%>
    <div class="sysmo_gadget">

      <div class="header curved_top">
        Go to my <%= t('project') %>
      </div>
      <div class="contents curved_bottom">
        <div style="text-align: center">

            <input type=button id="my_project_button" class="gadget_button" value="My <%= t('project') %>" onclick="javascript:myProjectClicked();"/>

            <ul id="my_project_menu" class='dynamic_menu with_smaller_shadow' style="display:none;">

                <% current_user.person.projects.each do |p| %>
                    <li style="border-bottom: 1px dotted grey;" class='dynamic_menu_li' onclick="javascript:location.href='<%= project_path(p) -%>';"><%= h(p.name) %></li>
                <% end %>
            </ul>

        </div>
      </div>
    </div>

    <script type="text/javascript">
        <% if current_user.person.projects.size>1 -%>
            $(document.getElementById("my_project_button")).classList.add('gadget_button_menu');
        <% end -%>
    </script>

    <script type="text/javascript">
        function myProjectClicked() {
        <% if current_user.person.projects.size==1 -%>
            location.href='<%= project_path(current_user.person.projects.first) -%>';
        <% else -%>
            toggleDynamicMenu('my_project_menu');
        <% end -%>
        }
    </script>

<% end -%>
{'fraction_non_alphanumeric': 0.1751117734724292, 'fraction_numerical': 0.0018628912071535022, 'mean_word_length': 2.5657370517928286, 'pattern_counts': {'":': 0, '<': 61, '<?xml version=': 0, '>': 62, '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': '4143617', 'n_tokens_mistral': 868, 'n_tokens_neox': 807, 'n_words': 145}