Skip to content

Commit

Permalink
Merge pull request #26 from dalvarez2596/lesson-70
Browse files Browse the repository at this point in the history
Added title for pages
  • Loading branch information
dalvarez2596 authored Oct 30, 2024
2 parents eebd82f + 89b9863 commit 793e648
Show file tree
Hide file tree
Showing 15 changed files with 88 additions and 7 deletions.
2 changes: 1 addition & 1 deletion app/models/course.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,6 @@ def self.levels
end

include PublicActivity::Model
# tracked
tracked owner: Proc.new { |controller, model| controller.current_user }
# tracked
end
2 changes: 1 addition & 1 deletion app/models/lesson.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions app/views/courses/edit.html.haml
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
-content_for :title do
E-learning
\|
Editing
= @course.title

.card
.card-header
%h3
Expand Down
5 changes: 5 additions & 0 deletions app/views/courses/index.html.haml
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
- content_for :title do
E-learning
\|
All courses

%h3.text-center
Courses
.badge.bg-info
Expand Down
5 changes: 5 additions & 0 deletions app/views/courses/new.html.haml
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
-content_for :title do
E-learning
\|
New course

.card
.card-header
%h3
Expand Down
5 changes: 5 additions & 0 deletions app/views/courses/show.html.haml
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
- content_for :title do
E-learning
\|
= @course.title

= link_to 'Courses', courses_path
\/
= link_to @course.title, course_path(@course)
Expand Down
8 changes: 7 additions & 1 deletion app/views/home/activity.html.haml
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
-content_for :title do
E-learning
\|
Activity

%h3.text-center
Activities
.badge.bg-info
Expand All @@ -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
5 changes: 5 additions & 0 deletions app/views/home/index.html.haml
Original file line number Diff line number Diff line change
@@ -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
Expand Down
3 changes: 2 additions & 1 deletion app/views/layouts/application.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 9 additions & 0 deletions app/views/lessons/edit.html.haml
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
8 changes: 8 additions & 0 deletions app/views/lessons/new.html.haml
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
9 changes: 9 additions & 0 deletions app/views/lessons/show.html.haml
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
6 changes: 6 additions & 0 deletions app/views/users/edit.html.haml
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
-content_for :title do
E-learning
\|
Editing
= @user.username

.card
.card-header
Editing roles for
Expand Down
17 changes: 14 additions & 3 deletions app/views/users/index.html.haml
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
-content_for :title do
E-learning
\|
All users

%h3.text-center
Users
.badge.bg-info
Expand Down Expand Up @@ -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
Expand All @@ -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'
5 changes: 5 additions & 0 deletions app/views/users/show.html.haml
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@
-content_for :title do
E-learning
\|
= @user.username

= render 'users/user', user: @user

0 comments on commit 793e648

Please sign in to comment.