Skip to content
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
20 changes: 20 additions & 0 deletions app/helpers/home_helper.rb
Original file line number Diff line number Diff line change
@@ -1,2 +1,22 @@
module HomeHelper
def crud_label(key)
case key
when "create"
"<i class='fa fa-plus'></i>".html_safe
when "update"
"<i class='fa fa-pen'></i>".html_safe
when "destroy"
"<i class='fa fa-trash'></i>".html_safe
end
end

def model_label(model)
case model
when "Course"
"<i class='fa fa-graduation-cap'></i>".html_safe
when "Lesson"
"<i class='fa fa-tasks'></i>".html_safe
end
end

Check failure on line 21 in app/helpers/home_helper.rb

View workflow job for this annotation

GitHub Actions / lint

Layout/EmptyLinesAroundModuleBody: Extra empty line detected at module body end.
end
3 changes: 3 additions & 0 deletions app/views/home/activity.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
-# = activity.id
= activity.created_at.strftime( "%d-%m-%Y %H:%m")
(#{time_ago_in_words(activity.created_at)})
= model_label(activity.trackable_type)
= activity.trackable_type
-# = activity.trackable_id
- if activity.trackable_type == 'Lesson'
Expand All @@ -24,6 +25,8 @@
- else
= link_to activity.trackable, activity.trackable
= activity.key
= crud_label(activity.key.match(/\.(.*)/)[1])
-# = activity.key.match(/\.(.*)/)[1]
-# = activity.owner
by
= link_to activity.owner, user_path(activity.owner)
Expand Down
Loading