Commit c83bbd92663685259d6336478d137a94d4acd0f3

Thomas de Grivel 2021-11-29T16:32:27

fix admin

diff --git a/lib/kmxgit_web/controllers/admin/organisation_controller.ex b/lib/kmxgit_web/controllers/admin/organisation_controller.ex
index 5830a12..6b84e5b 100644
--- a/lib/kmxgit_web/controllers/admin/organisation_controller.ex
+++ b/lib/kmxgit_web/controllers/admin/organisation_controller.ex
@@ -1,15 +1,16 @@
 defmodule KmxgitWeb.Admin.OrganisationController do
   use KmxgitWeb, :controller
 
+  alias Kmxgit.GitManager
   alias Kmxgit.OrganisationManager
   alias Kmxgit.Repo
   alias Kmxgit.SlugManager
   alias KmxgitWeb.ErrorView
 
   def index(conn, _params) do
-    organisations = OrganisationManager.list_organisations
+    orgs = OrganisationManager.list_organisations
     conn
-    |> assign(:organisations, organisations)
+    |> assign(:orgss, orgs)
     |> render("index.html")
   end
 
@@ -102,10 +103,10 @@ defmodule KmxgitWeb.Admin.OrganisationController do
           end) do
         {:ok, org1} ->
           conn
-          |> redirect(to: Routes.admin_organisation_path(conn, :show, org))
+          |> redirect(to: Routes.admin_organisation_path(conn, :show, org1))
         {:error, changeset} ->
           conn
-          |> assign(:action, Routes.admin_organisation_path(conn, :update, organisation))
+          |> assign(:action, Routes.admin_organisation_path(conn, :update, org))
           |> assign(:changeset, changeset)
           |> render("edit.html")
                     
diff --git a/lib/kmxgit_web/controllers/admin/user_controller.ex b/lib/kmxgit_web/controllers/admin/user_controller.ex
index 2b89ced..94f5116 100644
--- a/lib/kmxgit_web/controllers/admin/user_controller.ex
+++ b/lib/kmxgit_web/controllers/admin/user_controller.ex
@@ -1,6 +1,7 @@
 defmodule KmxgitWeb.Admin.UserController do
   use KmxgitWeb, :controller
 
+  alias Kmxgit.GitManager
   alias Kmxgit.UserManager
   alias KmxgitWeb.ErrorView
 
diff --git a/lib/kmxgit_web/templates/admin/organisation/index.html.heex b/lib/kmxgit_web/templates/admin/organisation/index.html.heex
index 800e554..9471e5d 100644
--- a/lib/kmxgit_web/templates/admin/organisation/index.html.heex
+++ b/lib/kmxgit_web/templates/admin/organisation/index.html.heex
@@ -1,5 +1,5 @@
 <div class="container-fluid">
-  <h1>Organisations</h1>
+  <h1><%= gettext "Organisations" %></h1>
 
   <table class="table admin-index">
     <tr>
@@ -7,7 +7,7 @@
       <th><%= gettext "Name" %></th>
       <th><%= gettext "Slug" %></th>
     </tr>
-    <%= Enum.map @organisations, fn(org) -> %>
+    <%= Enum.map @orgs, fn org -> %>
       <tr>
         <td><%= link org.id, to: Routes.admin_organisation_path(@conn, :show, org) %></td>
         <td><%= org.name %></td>