Edit

kmx.io/kmxgit/lib/kmxgit_web/templates/organisation/show.html.heex

Branch :

  • lib/kmxgit_web/templates/organisation/show.html.heex
  • <div class="container-fluid">
      <div class="row">
        <div class="col col-12">
          <h1><%= @org.name || @org.slug_ %></h1>
          <%= if Organisation.owner?(@org, @current_user) do %>
            <%= link gettext("New repository"),
                to: Routes.repository_path(@conn, :new, @org.slug_),
                class: "btn btn-primary" %>
            <%= link gettext("Edit"),
                to: Routes.organisation_path(@conn, :edit, @org.slug_),
                class: "btn btn-primary" %>
          <% end %>
        </div>
      </div>
    
      <div class="row">
        <div class="col col-12 col-md-7">
          <p>
            <ul class="list-group">
              <li class="list-group-item bg-h">
                <h2><%= gettext "Repositories" %></h2>
              </li>
              <%= for repo <- @repos do %>
                <li class="list-group-item">
                  <%= link to: Routes.repository_path(@conn, :show, @org.slug_, Repository.splat(repo)) do %>
                    <%= if repo.public_access do %>
                      <i class="fa fa-code-fork"></i>
                    <% else %>
                      <i class="fa fa-lock"></i>
                    <% end %>
                    <%= Repository.full_slug(repo) %>
                  <% end %>
                </li>
              <% end %>
            </ul>
          </p>
        </div>
        <div class="col col-12 col-md-4">
          <p>
            <ul class="list-group">
              <li class="list-group-item bg-h">
                <h2><%= gettext "Properties" %></h2>
              </li>
              <li class="list-group-item">
                <table class="table properties">
                  <tr>
                    <th><%= gettext "Name" %></th>
                    <td><%= @org.name %></td>
                  </tr>
                  <tr>
                    <th><%= gettext "Slug" %></th>
                    <td><%= @org.slug_ %></td>
                  </tr>
                  <tr>
                    <th><%= gettext "Description" %></th>
                    <td>
                      <%= if @org.description do %>
                        <%= raw Markdown.to_html!(@org.description) %>
                      <% end %>
                    </td>
                  </tr>
                  <tr>
                    <th>
                      <%= gettext "Users" %><br/>
                      <%= if Organisation.owner?(@org, @current_user) do %>
                        <%= link "-",
                        to: Routes.organisation_path(@conn, :remove_user, @org.slug_),
                        class: "btn btn-danger btn-sm" %>
                        <%= link "+",
                        to: Routes.organisation_path(@conn, :add_user, @org.slug_),
                        class: "btn btn-primary btn-sm" %>
                      <% end %>
                    </th>
                    <td>
                      <%= for user <- @org.users do %>
                        <%= render(KmxgitWeb.UserView, "avatar.html", conn: @conn, user: user, email: user.email, size: 48, title: User.login(user), class: "") %>
                      <% end %>
                    </td>
                  </tr>
                </table>
              </li>
            </ul>
          </p>
        </div>
      </div>
    </div>