<commit_before><%
#--
#   Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies)
#   Copyright (C) 2007, 2008 <NAME> <<EMAIL>>
#   Copyright (C) 2008 <NAME> <<EMAIL>>
#   Copyright (C) 2008 <NAME> <<EMAIL>>
#   Copyright (C) 2008 <NAME> <<EMAIL>>
#   Copyright (C) 2008 <NAME> <<EMAIL>>
#   Copyright (C) 2009 <NAME> <<EMAIL>>
#
#   This program is free software: you can redistribute it and/or modify
#   it under the terms of the GNU Affero General Public License as published by
#   the Free Software Foundation, either version 3 of the License, or
#   (at your option) any later version.
#
#   This program is distributed in the hope that it will be useful,
#   but WITHOUT ANY WARRANTY; without even the implied warranty of
#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#   GNU Affero General Public License for more details.
#
#   You should have received a copy of the GNU Affero General Public License
#   along with this program.  If not, see <http://www.gnu.org/licenses/>.
#++
%>

<% @page_title = h(@user.login) -%>
<%= breadcrumbs_from(@user) -%>

<div class="with_divider">
  <div id="left">
    <div class="user-profile">
      <%= link_to(avatar(@user, { :size => 64 }), @user, {:class => "avatar"}) %>
      <div class="profile-data">
        <h1>~<%= link_to h(@user.login), @user -%></h1>

        <ul class="details">
          <% unless @user.fullname.blank? %>
            <li><%= h(@user.fullname) -%></li>
          <% end %>
          <% if @user.public_email? -%>
          <li class="email">
            <%= mail_to(@user.email, mangled_mail(@user.email), :encode => "javascript") -%>
          </li>
          <% end -%>
          <% if @user.url %>
          <li><a rel="me" href="<%=h @user.url -%>"><%=h @user.url -%></a></li>
          <% end -%>
          <li>
            <%= t("views.users.member_for") %>
            <%= t("views.users.about", :about => time_ago_in_words(@user.created_at)) %>
          </li>
        </ul>
      </div>

      <ul class="buttons">
        <% if !is_current_user?(@user) -%>
        <li class="new_email">
          <%= white_button_link_to(t("views.users.send_user_msg", :username=>h(@user.login)),
                new_message_path(:to => @user.login), :class => "new_email") -%>
        </li>
        <% end -%>
        <% if is_current_user?(@user)  -%>
        <li>
          <%= white_button_link_to(t("views.keys.manage_ssh_keys"),
            user_keys_path(current_user), :class => "key") -%>
        </li>
        <li>
          <%= white_button_link_to(t("views.aliases.manage_aliases"),
                user_aliases_path(current_user), :class => "alias") -%>
        </li>
        <li>
          <%= white_button_link_to(t("views.users.edit_action"), edit_user_url,
                :class => "edit_account") -%>
        </li>
        <li>
          <%= white_button_link_to(t("views.users.chg_passwd_action"), password_user_path,
                :class => "edit_account_password") -%>
        </li>
        <% end -%>
      </ul>
      <div class="clear"></div>
    </div>

    <% unless @events.empty? -%>
      <h2><%= t("views.site.dashboard.activities") -%>
        <%= feed_icon @atom_auto_discovery_url %></h2>
      <%= render :partial => "events/events", :locals => { :events => @events } -%>
    <% end -%>
  </div>

  <div id="right">
    <% pull_box("Open merge requests for you") do %>
      <ul>
        <% @user.review_repositories_with_open_merge_request_count.each do |repo| %>
          <li>
            <%= link_to(repo.url_path + ": " + repo.open_merge_request_count,
                 repo_owner_path(repo, [repo.project, repo, :merge_requests])) %>
          </li>
        <% end %>
      </ul>
    <% end if show_merge_request_count_for_user?(@user) %>

    <% pull_box(t("views.site.dashboard.projects")) do -%>
      <% if is_current_user?(@user) -%>
        <%= white_button_link_to(t("views.projects.create_new"), new_project_path, {
              :id => "new-project-button"}) %>
      <% end -%>
      <ul class="with_icons">
      <% @projects.each do |project| -%>
        <li class="project"><%= link_to h(project.title), project -%></li>
      <% end -%>
      </ul>
    <% end -%>

    <% pull_box(t("views.site.dashboard.repositories")) do -%>
    <% if @repositories.blank? -%>
      <p class="hint">
      <% if is_current_user?(@user) -%>
        You currently don't have any repository clones. You can clone
        a repository you wish to contribute to, by going to a
        repository overview page and click the "Clone on Gitorious"
        link in the sidebar.
      <% else -%>
        <%=h @user.title -%> currently doesn't have any repository clones
      <% end -%>
      </p>
    <% else -%>
      <ul class="with_icons">
        <% @repositories.each do |repo| -%>
          <li class="repository">
            <%= link_to h("#{repo.project.slug}/#{repo.name}"), repo_owner_path(repo, [repo.project, repo]) -%>
          </li>
        <% end -%>
      </ul>
    <% end -%>
    <% end -%>
  </div>
  <div class="clear"></div>
</div><commit_msg>Add back the team memberships list to the ~user page<commit_after><%
#--
#   Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies)
#   Copyright (C) 2007, 2008 <NAME> <<EMAIL>>
#   Copyright (C) 2008 <NAME> <<EMAIL>>
#   Copyright (C) 2008 <NAME> <<EMAIL>>
#   Copyright (C) 2008 <NAME> <<EMAIL>>
#   Copyright (C) 2008 <NAME> <<EMAIL>>
#   Copyright (C) 2009 <NAME> <<EMAIL>>
#
#   This program is free software: you can redistribute it and/or modify
#   it under the terms of the GNU Affero General Public License as published by
#   the Free Software Foundation, either version 3 of the License, or
#   (at your option) any later version.
#
#   This program is distributed in the hope that it will be useful,
#   but WITHOUT ANY WARRANTY; without even the implied warranty of
#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#   GNU Affero General Public License for more details.
#
#   You should have received a copy of the GNU Affero General Public License
#   along with this program.  If not, see <http://www.gnu.org/licenses/>.
#++
%>

<% @page_title = h(@user.login) -%>
<%= breadcrumbs_from(@user) -%>

<div class="with_divider">
  <div id="left">
    <div class="user-profile">
      <%= link_to(avatar(@user, { :size => 64 }), @user, {:class => "avatar"}) %>
      <div class="profile-data">
        <h1>~<%= link_to h(@user.login), @user -%></h1>

        <ul class="details">
          <% unless @user.fullname.blank? %>
            <li><%= h(@user.fullname) -%></li>
          <% end %>
          <% if @user.public_email? -%>
          <li class="email">
            <%= mail_to(@user.email, mangled_mail(@user.email), :encode => "javascript") -%>
          </li>
          <% end -%>
          <% if @user.url %>
          <li><a rel="me" href="<%=h @user.url -%>"><%=h @user.url -%></a></li>
          <% end -%>
          <li>
            <%= t("views.users.member_for") %>
            <%= time_ago_in_words(@user.created_at) %>
          </li>
        </ul>
      </div>

      <ul class="buttons">
        <% if !is_current_user?(@user) -%>
        <li class="new_email">
          <%= white_button_link_to(t("views.users.send_user_msg", :username=>h(@user.login)),
                new_message_path(:to => @user.login), :class => "new_email") -%>
        </li>
        <% end -%>
        <% if is_current_user?(@user)  -%>
        <li>
          <%= white_button_link_to(t("views.keys.manage_ssh_keys"),
            user_keys_path(current_user), :class => "key") -%>
        </li>
        <li>
          <%= white_button_link_to(t("views.aliases.manage_aliases"),
                user_aliases_path(current_user), :class => "alias") -%>
        </li>
        <li>
          <%= white_button_link_to(t("views.users.edit_action"), edit_user_url,
                :class => "edit_account") -%>
        </li>
        <li>
          <%= white_button_link_to(t("views.users.chg_passwd_action"), password_user_path,
                :class => "edit_account_password") -%>
        </li>
        <% end -%>
      </ul>
      <div class="clear"></div>
    </div>

    <% unless @events.empty? -%>
      <h2><%= t("views.site.dashboard.activities") -%>
        <%= feed_icon @atom_auto_discovery_url %></h2>
      <%= render :partial => "events/events", :locals => { :events => @events } -%>
    <% end -%>
  </div>

  <div id="right">
    <% pull_box("Open merge requests for you") do %>
      <ul>
        <% @user.review_repositories_with_open_merge_request_count.each do |repo| %>
          <li>
            <%= link_to(repo.url_path + ": " + repo.open_merge_request_count,
                 repo_owner_path(repo, [repo.project, repo, :merge_requests])) %>
          </li>
        <% end %>
      </ul>
    <% end if show_merge_request_count_for_user?(@user) %>

    <% pull_box(t("views.site.dashboard.projects")) do -%>
      <% if is_current_user?(@user) -%>
        <%= white_button_link_to(t("views.projects.create_new"), new_project_path, {
              :id => "new-project-button"}) %>
      <% end -%>
      <ul class="with_icons">
      <% @projects.each do |project| -%>
        <li class="project"><%= link_to h(project.title), project -%></li>
      <% end -%>
      </ul>
    <% end -%>

    <% pull_box(t("views.site.dashboard.repositories")) do -%>
    <% if @repositories.blank? -%>
      <p class="hint">
      <% if is_current_user?(@user) -%>
        You currently don't have any repository clones. You can clone
        a repository you wish to contribute to, by going to a
        repository overview page and click the "Clone on Gitorious"
        link in the sidebar.
      <% else -%>
        <%=h @user.title -%> currently doesn't have any repository clones
      <% end -%>
      </p>
    <% else -%>
      <ul class="with_icons">
        <% @repositories.each do |repo| -%>
          <li class="repository">
            <%= link_to h("#{repo.project.slug}/#{repo.name}"), repo_owner_path(repo, [repo.project, repo]) -%>
          </li>
        <% end -%>
      </ul>
    <% end -%>
    <% end -%>

    <% pull_box("Team memberships") do -%>
      <ul>
      <% @user.groups.each do |group| -%>
        <li style="clear:left">
          <span style="float:left; padding: 2px 10px 2px 2px">
            <%= image_tag(group.avatar.url(:thumb), :alt => "Avatar", :width => "16") %>
          </span>
          <%= link_to h(group.name), group_path(group) -%>
        </li>
      <% end -%>
      </ul>
    <% end unless @user.groups.blank? -%>

  </div>
  <div class="clear"></div>
</div>
{'fraction_non_alphanumeric': 0.1831408992771989, 'fraction_numerical': 0.00797897305923214, 'mean_word_length': 2.3117811625738267, 'pattern_counts': {'":': 2, '<': 277, '<?xml version=': 0, '>': 308, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '5082548', 'n_tokens_mistral': 3802, 'n_tokens_neox': 3538, 'n_words': 803}