Skip to content

Commit

Permalink
Renamed dashboard to summary
Browse files Browse the repository at this point in the history
  • Loading branch information
laszlokardinal committed Aug 28, 2017
1 parent e84bce6 commit f2c817e
Show file tree
Hide file tree
Showing 14 changed files with 16 additions and 16 deletions.
4 changes: 2 additions & 2 deletions lib/course_planner/permissions.ex
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ defimpl Canada.Can, for: CoursePlanner.User do
alias CoursePlannerWeb.{
AttendanceController,
CalendarController,
DashboardController,
SummaryController,
OfferedCourseController,
PageController,
ScheduleController,
Expand All @@ -29,7 +29,7 @@ defimpl Canada.Can, for: CoursePlanner.User do
when action in [:index, :show, :grab, :drop], do: true

def can?(_user, _action, CalendarController), do: true
def can?(_user, _action, DashboardController), do: true
def can?(_user, _action, SummaryController), do: true
def can?(_user, _action, PageController), do: true
def can?(_user, _action, ScheduleController), do: true

Expand Down
2 changes: 1 addition & 1 deletion lib/course_planner_web/controllers/page_controller.ex
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ defmodule CoursePlannerWeb.PageController do
def index(conn, _params) do
conn
|> put_status(301)
|> redirect(to: dashboard_path(conn, :show))
|> redirect(to: summary_path(conn, :show))
end
end
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
defmodule CoursePlannerWeb.DashboardController do
defmodule CoursePlannerWeb.SummaryController do
@moduledoc false
use CoursePlannerWeb, :controller

Expand Down
2 changes: 1 addition & 1 deletion lib/course_planner_web/controllers/user_controller.ex
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ defmodule CoursePlannerWeb.UserController do
else
conn
|> put_flash(:info, "Your profile has been updated successfully.")
|> redirect(to: dashboard_path(conn, :show))
|> redirect(to: summary_path(conn, :show))
end
{:error, changeset} ->
render(conn, "edit.html", user: user, changeset: changeset)
Expand Down
2 changes: 1 addition & 1 deletion lib/course_planner_web/router.ex
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ defmodule CoursePlannerWeb.Router do

get "/", PageController, :index

resources "/dashboard", DashboardController, only: [:show], singleton: true
resources "/summary", SummaryController, only: [:show], singleton: true
resources "/schedule", ScheduleController, only: [:show], singleton: true

resources "/users", UserController, except: [:create, :new]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<%= CoursePlannerWeb.SharedView.navbar "Course Planner" do %>
<%= CoursePlannerWeb.SharedView.navbar_item "Dashboard", @conn, dashboard_path(@conn, :show) %>
<%= CoursePlannerWeb.SharedView.navbar_item "Summary", @conn, summary_path(@conn, :show) %>
<%= CoursePlannerWeb.SharedView.navbar_item "Calendar", @conn, schedule_path(@conn, :show) %>
<%= CoursePlannerWeb.SharedView.navbar_separator %>
<%= CoursePlannerWeb.SharedView.navbar_item "Coordinators", @conn, coordinator_path(@conn, :index) %>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<%= CoursePlannerWeb.SharedView.navbar "Course Planner" do %>
<%= CoursePlannerWeb.SharedView.navbar_item "Dashboard", @conn, dashboard_path(@conn, :show) %>
<%= CoursePlannerWeb.SharedView.navbar_item "Summary", @conn, summary_path(@conn, :show) %>
<%= CoursePlannerWeb.SharedView.navbar_item "Calendar", @conn, schedule_path(@conn, :show) %>
<%= CoursePlannerWeb.SharedView.navbar_separator %>
<%= CoursePlannerWeb.SharedView.navbar_item "Offered Courses", @conn, offered_course_path(@conn, :index) %>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<%= CoursePlannerWeb.SharedView.navbar "Course Planner" do %>
<%= CoursePlannerWeb.SharedView.navbar_item "Dashboard", @conn, dashboard_path(@conn, :show) %>
<%= CoursePlannerWeb.SharedView.navbar_item "Summary", @conn, summary_path(@conn, :show) %>
<%= CoursePlannerWeb.SharedView.navbar_item "Calendar", @conn, schedule_path(@conn, :show) %>
<%= CoursePlannerWeb.SharedView.navbar_separator %>
<%= CoursePlannerWeb.SharedView.navbar_item "Offered Courses", @conn, offered_course_path(@conn, :index) %>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<%= CoursePlannerWeb.SharedView.navbar "Course Planner" do %>
<%= CoursePlannerWeb.SharedView.navbar_item "Dashboard", @conn, dashboard_path(@conn, :show) %>
<%= CoursePlannerWeb.SharedView.navbar_item "Summary", @conn, summary_path(@conn, :show) %>
<%= CoursePlannerWeb.SharedView.navbar_item "Calendar", @conn, schedule_path(@conn, :show) %>
<%= CoursePlannerWeb.SharedView.navbar_separator %>
<%= CoursePlannerWeb.SharedView.navbar_item "Tasks", @conn, task_path(@conn, :index) %>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
defmodule CoursePlannerWeb.DashboardView do
defmodule CoursePlannerWeb.SummaryView do
@moduledoc false
use CoursePlannerWeb, :view
end
2 changes: 1 addition & 1 deletion test/controllers/page_controller_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ defmodule CoursePlanner.PageControllerTest do

test "GET /", %{conn: conn} do
conn = get conn, "/"
assert redirected_to(conn, 301) == dashboard_path(conn, :show)
assert redirected_to(conn, 301) == summary_path(conn, :show)
end
end
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
defmodule CoursePlanner.DashboardControllerTest do
defmodule CoursePlanner.SummaryControllerTest do
use CoursePlannerWeb.ConnCase

import CoursePlanner.Factory
Expand All @@ -12,8 +12,8 @@ defmodule CoursePlanner.DashboardControllerTest do
{:ok, conn: conn}
end

test "GET /dashboard", %{conn: conn} do
conn = get conn, dashboard_path(conn, :show)
test "GET /summary", %{conn: conn} do
conn = get conn, summary_path(conn, :show)
assert html_response(conn, 200) =~ "Welcome to Phoenix"
end
end
2 changes: 1 addition & 1 deletion test/controllers/user_controller_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ defmodule CoursePlanner.UserControllerTest do
|> assign(:current_user, user)

conn = put user_conn, user_path(user_conn, :update, user), %{"user" => %{"email" => "foo@bar.com"}}
assert redirected_to(conn) == dashboard_path(conn, :show)
assert redirected_to(conn) == summary_path(conn, :show)
assert Repo.get_by(User, email: "foo@bar.com")
end

Expand Down

0 comments on commit f2c817e

Please sign in to comment.