forked from TheOdinProject/theodinproject
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feature: Rename Tracks to Paths (TheOdinProject#1404)
Because: * It is a friendier name for this concept.
- Loading branch information
1 parent
cbc0034
commit 0146ac2
Showing
37 changed files
with
206 additions
and
205 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 5 additions & 5 deletions
10
app/assets/stylesheets/tracks.scss → app/assets/stylesheets/paths.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
class PathsController < ApplicationController | ||
def show | ||
@path = Path.friendly.find(params[:id]) | ||
@courses = decorated_courses | ||
@user = current_user | ||
end | ||
|
||
def index | ||
@paths = Path.all | ||
end | ||
|
||
private | ||
|
||
def decorated_courses | ||
@path.courses.map { |course| CourseDecorator.new(course) } | ||
end | ||
end |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
module Users | ||
class PathsController < ApplicationController | ||
before_action :authenticate_user! | ||
|
||
def create | ||
current_user.update_attributes!(path_id: path_id) | ||
redirect_to path | ||
end | ||
|
||
private | ||
|
||
def path_id | ||
params.fetch(:path_id) | ||
end | ||
|
||
def path | ||
Path.find(path_id) | ||
end | ||
end | ||
end |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
class PathCourse < ApplicationRecord | ||
belongs_to :path | ||
belongs_to :course | ||
|
||
validates :position, :course_id, :path_id, presence: true | ||
end |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<div class="curriculum-background"> | ||
<div class="container paths-index"> | ||
<h1 class="text-center camel light">Learning Paths</h1> | ||
<h2 class="text-center"> | ||
Select from our available learning paths below | ||
</h2> | ||
<p class="text-center">Paths are our way of offering multiple paths through our curriculum.</p> | ||
<p class="text-center"> | ||
You can change your path at any time, and your progress will not be lost. Many of our paths share the same fundamental lessons, so any progress you've made on any shared courses or lessons will transfer between paths.</p> | ||
|
||
|
||
<% @paths.each do |path| %> | ||
<div class="card-main path-card"> | ||
<div class="path-card-title"> | ||
<h1><%=path.title%></h1> | ||
<%= link_to "View path", path_url(path), class:"button button--secondary" %> | ||
</div> | ||
<p><%= path.description%></p> | ||
</div> | ||
<% end %> | ||
</div> | ||
</div> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<div class="container"> | ||
<h1 class="text-center camel light curriculum-title"><%= @path.title %></h1> | ||
<p class="text-center path-description"><%= @path.description %></p> | ||
|
||
|
||
<% @courses.each do |course| %> | ||
<%= render 'courses/course_card', course: course %> | ||
<% end %> | ||
|
||
<% if user_signed_in? %> | ||
<%if current_user.path == @path %> | ||
<p class="text-center path-description"> | ||
You are currently enrolled in this path. | ||
</p> | ||
<% else %> | ||
<p class="text-center path-description"> | ||
<%= link_to 'Select This Path', users_paths_url(path_id: @path.id), remote: true, method: :post, class: 'button button--primary' %> | ||
</p> | ||
<% end %> | ||
<% else %> | ||
<p class="text-center path-description"> | ||
<%= render 'shared/bottom_cta', | ||
button: sign_in_or_view_curriculum_button, | ||
heading: 'Start learning for free now!', | ||
sub_heading: '' | ||
%> | ||
</p> | ||
<% end %> | ||
<p class="text-center path-description">You are viewing the <%= @path.title %> path. To view all available paths <%= link_to 'click here', paths_url %></p> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.