Edit

kmx.io/kmxgit/lib/kmxgit_web/templates/repository/form.html.heex

Branch :

  • lib/kmxgit_web/templates/repository/form.html.heex
  • <%= form_for @changeset, @action, fn f -> %>
      <%= if @changeset.action do %>
        <div class="alert alert-danger">
          <p>Invalid parameters</p>
        </div>
      <% end %>
    
      <div class="mb-3">
        <%= label f, :slug, class: "form-label" %>
        <%= text_input f, :slug, class: "form-control" %>
        <%= error_tag f, :slug %>
      </div>
    
      <div class="mb-3 form-check">
        <%= checkbox f, :public_access, class: "form-check-input" %>
        <%= label f, :public_access, gettext("Public access ?"), class: "form-check-label" %>
        <%= error_tag f, :public_access %>
      </div>
    
      <div class="mb-3">
        <%= label f, :description, class: "form-label" %>
        <%= textarea f, :description, class: "form-control" %>
        <%= render LayoutView, "markdown_enabled.html" %>
        <%= error_tag f, :description %>
      </div>
    
      <%= if @conn.assigns[:current_repository] do %>
        <div class="mb-3">
          <%= label f, :deploy_keys, gettext("Deploy keys (read-only)"), class: "form-label" %>
          <%= textarea f, :deploy_keys, class: "form-control" %>
          <%= error_tag f, :deploy_keys %>
        </div>
      <% end %>
    
      <%= if @conn.assigns[:current_repository] do %>
        <div class="mb-3">
          <%= label f, :owner_slug, gettext("Change owner ⚠"), class: "form-label" %>
          <%= text_input f, :owner_slug, class: "form-control" %>
          <%= error_tag f, :owner_slug %>
        </div>
      <% end %>
    
      <div class="mb-3">
        <%= if @conn.assigns[:current_repository] do %>
          <%= link gettext("Cancel"),
              to: Routes.repository_path(@conn, :show, Repository.owner_slug(@current_repository), Repository.splat(@current_repository)),
              class: "btn btn-secondary" %>
          <%= link gettext("Delete repository"),
              to: Routes.repository_path(@conn, :delete, Repository.owner_slug(@current_repository), Repository.splat(@current_repository)),
              method: :delete,
              class: "btn btn-danger",
              data: [confirm: gettext("Are you sure you want to delete the repository %{repo} ?", repo: Repository.full_slug(@current_repository))] %>
        <% else %>
          <%= link gettext("Cancel"),
              to: Routes.slug_path(@conn, :show, @owner.slug_),
              class: "btn btn-secondary" %>
        <% end %>
        <%= submit gettext("Submit"), class: "btn btn-primary" %>
      </div>
    
    <% end %>