diff --git a/app/models/course.rb b/app/models/course.rb index f883902..610936a 100644 --- a/app/models/course.rb +++ b/app/models/course.rb @@ -43,6 +43,6 @@ def self.levels end include PublicActivity::Model - # tracked tracked owner: Proc.new { |controller, model| controller.current_user } + # tracked end diff --git a/app/models/lesson.rb b/app/models/lesson.rb index 46b639c..c6e458b 100644 --- a/app/models/lesson.rb +++ b/app/models/lesson.rb @@ -8,8 +8,8 @@ class Lesson < ApplicationRecord friendly_id :title, use: :slugged include PublicActivity::Model - # tracked tracked owner: Proc.new { |controller, model| controller.current_user } + # tracked def to_s title diff --git a/app/views/courses/edit.html.haml b/app/views/courses/edit.html.haml index cdba9ad..20433d0 100644 --- a/app/views/courses/edit.html.haml +++ b/app/views/courses/edit.html.haml @@ -1,3 +1,9 @@ +-content_for :title do + E-learning + \| + Editing + = @course.title + .card .card-header %h3 diff --git a/app/views/courses/index.html.haml b/app/views/courses/index.html.haml index df0dfc2..4d7e838 100644 --- a/app/views/courses/index.html.haml +++ b/app/views/courses/index.html.haml @@ -1,3 +1,8 @@ +- content_for :title do + E-learning + \| + All courses + %h3.text-center Courses .badge.bg-info diff --git a/app/views/courses/new.html.haml b/app/views/courses/new.html.haml index 9bd4aea..6481a90 100644 --- a/app/views/courses/new.html.haml +++ b/app/views/courses/new.html.haml @@ -1,3 +1,8 @@ +-content_for :title do + E-learning + \| + New course + .card .card-header %h3 diff --git a/app/views/courses/show.html.haml b/app/views/courses/show.html.haml index 32e49e7..a60a8f8 100644 --- a/app/views/courses/show.html.haml +++ b/app/views/courses/show.html.haml @@ -1,3 +1,8 @@ +- content_for :title do + E-learning + \| + = @course.title + = link_to 'Courses', courses_path \/ = link_to @course.title, course_path(@course) diff --git a/app/views/home/activity.html.haml b/app/views/home/activity.html.haml index 7921e0d..677f1a8 100644 --- a/app/views/home/activity.html.haml +++ b/app/views/home/activity.html.haml @@ -1,3 +1,8 @@ +-content_for :title do + E-learning + \| + Activity + %h3.text-center Activities .badge.bg-info @@ -9,7 +14,8 @@ = activity.id = activity.trackable_type = activity.trackable_id - = link_to activity.trackable, activity.trackable + - lesson = Lesson.find_by(id: activity.trackable_id) if activity.trackable_type == 'Lesson' + = link_to activity.trackable, lesson ? course_lesson_path(lesson.course, lesson): activity.trackable = activity.key = activity.parameters = activity.owner \ No newline at end of file diff --git a/app/views/home/index.html.haml b/app/views/home/index.html.haml index b5c558c..3342362 100644 --- a/app/views/home/index.html.haml +++ b/app/views/home/index.html.haml @@ -1,3 +1,8 @@ +-content_for :title do + E-learning + \| + Online platform to learn + .p-5.mb-4.bg-body-tertiary.rounded-3 .container-fluid.py-5 .display-5.fw-bold diff --git a/app/views/layouts/application.html.haml b/app/views/layouts/application.html.haml index e67af84..3f4aace 100644 --- a/app/views/layouts/application.html.haml +++ b/app/views/layouts/application.html.haml @@ -2,7 +2,8 @@ %html %head %meta{:content => "text/html; charset=UTF-8", "http-equiv" => "Content-Type"}/ - %title= content_for(:title) || "Ruby Gems Bootcamp" + %title + = content_for?(:title) ? yield(:title) : "E-learning" %meta{:content => "width=device-width,initial-scale=1", :name => "viewport"}/ %meta{:content => "yes", :name => "apple-mobile-web-app-capable"}/ = csrf_meta_tags diff --git a/app/views/lessons/edit.html.haml b/app/views/lessons/edit.html.haml index 52142e2..31b4db8 100644 --- a/app/views/lessons/edit.html.haml +++ b/app/views/lessons/edit.html.haml @@ -1,3 +1,12 @@ +-content_for :title do + E-learning + \/ + Course + = @course.title + \/ + Editing lesson + = @lesson.title + = link_to 'Courses', courses_path \/ = link_to @lesson.course.title, course_path(@course) diff --git a/app/views/lessons/new.html.haml b/app/views/lessons/new.html.haml index 060dd44..8abc7c7 100644 --- a/app/views/lessons/new.html.haml +++ b/app/views/lessons/new.html.haml @@ -1,3 +1,11 @@ +-content_for :title do + E-learning + \/ + Course + = @course.title + \/ + New lesson + = link_to 'Courses', courses_path \/ = link_to @course.title, course_path(@course) diff --git a/app/views/lessons/show.html.haml b/app/views/lessons/show.html.haml index cce019f..9ee429e 100644 --- a/app/views/lessons/show.html.haml +++ b/app/views/lessons/show.html.haml @@ -1,3 +1,12 @@ +-content_for :title do + E-learning + \/ + Course + = @course.title + \/ + Lesson + = @lesson.title + = link_to 'Courses', courses_path \/ = link_to @lesson.course.title, course_path(@course) diff --git a/app/views/users/edit.html.haml b/app/views/users/edit.html.haml index c54ecf0..33ba2cb 100644 --- a/app/views/users/edit.html.haml +++ b/app/views/users/edit.html.haml @@ -1,3 +1,9 @@ +-content_for :title do + E-learning + \| + Editing + = @user.username + .card .card-header Editing roles for diff --git a/app/views/users/index.html.haml b/app/views/users/index.html.haml index c79f183..c559629 100644 --- a/app/views/users/index.html.haml +++ b/app/views/users/index.html.haml @@ -1,3 +1,8 @@ +-content_for :title do + E-learning + \| + All users + %h3.text-center Users .badge.bg-info @@ -34,10 +39,16 @@ %th Confirmed? %th Roles %tbody + - @users.each do |user| %tr %td= user.id - %td= user.email + %td + - if user.online? + .text-success.fa.fa-user + - else + .text-danger.fa.fa-user + = link_to user.email, user_path(user) %td= user.created_at %td= user.sign_in_count %td= user.current_sign_in_at @@ -49,6 +60,6 @@ - user.roles.each do |role| .badge.bg-info = role.name - - if policy(user).edit? - = link_to 'Edit roles', edit_user_path(user), class: 'btn btn-sm btn-warning' + -# - if policy(user).edit? + -# = link_to 'Edit roles', edit_user_path(user), class: 'btn btn-sm btn-warning' diff --git a/app/views/users/show.html.haml b/app/views/users/show.html.haml index bbdb8d7..319e95d 100644 --- a/app/views/users/show.html.haml +++ b/app/views/users/show.html.haml @@ -1 +1,6 @@ +-content_for :title do + E-learning + \| + = @user.username + = render 'users/user', user: @user