Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use new phoenix controller #3979

Merged
merged 1 commit into from
Nov 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/sanbase_web/controllers/custom_admin_controller.ex
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ defmodule SanbaseWeb.CustomAdminController do
use SanbaseWeb, :controller

def index(conn, _params) do
render(conn, "index.html",
render(conn, :index,
search_value: "",
routes: [
{"Users", ~p"/admin2/users"},
Expand Down
21 changes: 3 additions & 18 deletions lib/sanbase_web/sanbase_web.ex
Original file line number Diff line number Diff line change
Expand Up @@ -41,31 +41,16 @@ defmodule SanbaseWeb do

def controller do
quote do
use Phoenix.Controller, namespace: SanbaseWeb
use Phoenix.Controller,
formats: [:html, :json],
layouts: [html: SanbaseWeb.Layouts]

import Plug.Conn
import SanbaseWeb.Gettext
import Phoenix.LiveView.Controller

alias SanbaseWeb.Router.Helpers, as: Routes
unquote(verified_routes())
end
end

# In order to migrate to the new controller we need to rework /admin2 and /admin2/reports
# def controller do
# quote do
# use Phoenix.Controller,
# formats: [:html, :json],
# layouts: [html: SanbaseWeb.Layouts]

# import Plug.Conn
# import SanbaseWeb.Gettext

# unquote(verified_routes())
# end
# end

def live_view do
quote do
use Phoenix.LiveView,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
</div>
<%= for {name, path} <- @routes do %>
<nav class="mt-10">
<%= link name, to: path, class: "flex items-center px-6 py-2 mt-4 duration-200 border-l-4 border-gray-900 text-gray-500 hover:bg-gray-600 hover:bg-opacity-25 hover:text-gray-100" %></span>
<span><%= link name, to: path, class: "flex items-center px-6 py-2 mt-4 duration-200 border-l-4 border-gray-900 text-gray-500 hover:bg-gray-600 hover:bg-opacity-25 hover:text-gray-100" %></span>
</nav>
<% end %>
</div>
Expand Down
3 changes: 3 additions & 0 deletions lib/sanbase_web/views/custom_admin_html.ex
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
defmodule SanbaseWeb.CustomAdminHTML do
use SanbaseWeb, :view
end
3 changes: 0 additions & 3 deletions lib/sanbase_web/views/custom_admin_view.ex

This file was deleted.

3 changes: 0 additions & 3 deletions lib/sanbase_web/views/custom_plan.ex

This file was deleted.

3 changes: 3 additions & 0 deletions lib/sanbase_web/views/custom_plan_html.ex
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
defmodule SanbaseWeb.CustomPlanHTML do
use SanbaseWeb, :view
end
3 changes: 3 additions & 0 deletions lib/sanbase_web/views/report_html.ex
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
defmodule SanbaseWeb.ReportHTML do
use SanbaseWeb, :view
end
3 changes: 0 additions & 3 deletions lib/sanbase_web/views/report_view.ex

This file was deleted.

3 changes: 3 additions & 0 deletions lib/sanbase_web/views/sheets_template_html.ex
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
defmodule SanbaseWeb.SheetsTemplateHTML do
use SanbaseWeb, :view
end
3 changes: 0 additions & 3 deletions lib/sanbase_web/views/sheets_template_view.ex

This file was deleted.

3 changes: 0 additions & 3 deletions lib/sanbase_web/views/user_view.ex

This file was deleted.

3 changes: 3 additions & 0 deletions lib/sanbase_web/views/user_view_html.ex
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
defmodule SanbaseWeb.UserHTML do
use SanbaseWeb, :view
end
3 changes: 0 additions & 3 deletions lib/sanbase_web/views/webinar.ex

This file was deleted.

3 changes: 3 additions & 0 deletions lib/sanbase_web/views/webinar_html.ex
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
defmodule SanbaseWeb.WebinarHTML do
use SanbaseWeb, :view
end