Skip to content
Draft
Changes from 1 commit
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
074d8cd
Add slug field for chapters
banta Apr 3, 2023
75322ba
Use slug to retrieve a chapter
banta Apr 3, 2023
93a2fbb
Update slug if the chapter name has changed
banta Apr 3, 2023
3456de5
Make slug to be readable only
banta Apr 3, 2023
51ebab2
Use slug to grt a chapter
banta Apr 3, 2023
044baa6
Add 'ActiveStorage::SetCurrent' to allow images to be retrieved from …
banta Apr 3, 2023
0c12424
Style the chapters page
banta Apr 3, 2023
66bc655
Merge branch 'learning_materials' into main
banta Apr 28, 2023
c268f90
Add email address link to request addition of materials
banta Apr 28, 2023
4a06d09
Merge branch 'main' into chapter-page
banta Apr 30, 2023
5e4c1e1
remove edit and delete from chapters index
Kihara-Kamotho May 2, 2023
55867a2
Delete IDE generated files
Kihara-Kamotho May 2, 2023
41ac233
Merge remote-tracking branch 'Kihara-Kamotho/chapter-page' into chapt…
banta May 2, 2023
c7d2f29
Delete unused code
Kihara-Kamotho May 2, 2023
31f1f89
Add active storage hero image to chapter
Kihara-Kamotho May 3, 2023
fb64a44
Add a chapter hero image location design
Kihara-Kamotho May 3, 2023
991329a
Merge remote-tracking branch 'Kihara-Kamotho/chapter-page' into chapt…
banta May 3, 2023
6d82a0f
Add hero image placeholder to chapter
Kihara-Kamotho May 3, 2023
125f2b5
Merge remote-tracking branch 'Kihara-Kamotho/chapter-page' into chapt…
banta May 3, 2023
d5af853
To improve: Add a static map for chapter
banta May 3, 2023
0f9746c
Merge remote-tracking branch 'banta/chapter-page' into chapter-page
Kihara-Kamotho May 3, 2023
209c988
Update Google map iframe code
banta May 3, 2023
458d282
Merge remote-tracking branch 'banta/chapter-page' into chapter-page
Kihara-Kamotho May 3, 2023
2103d6d
add method to encode the chapter location
Kihara-Kamotho May 3, 2023
c4d7177
Add dynamic location to the map
Kihara-Kamotho May 3, 2023
653ab74
Add col leader to users chapter table
Kihara-Kamotho May 3, 2023
5cfc053
Add find by chapter method to users chapter
Kihara-Kamotho May 3, 2023
e7de540
Add chapter leaders to chapter view
Kihara-Kamotho May 3, 2023
707d85c
Add chapter location to map
Kihara-Kamotho May 4, 2023
3c943c7
Moved chapter description and leaders
Kihara-Kamotho May 4, 2023
e2f349a
Added chapter leader card to chapters helper
Kihara-Kamotho May 4, 2023
989d446
Merge remote-tracking branch 'Kihara-Kamotho/chapter-page' into chapt…
banta May 5, 2023
cb75974
Schema changed
banta May 24, 2023
943fb20
Add css styles that will be used used in different pages
banta May 28, 2023
422cf89
Load the updated design for a chapter show page
banta May 28, 2023
87d381f
Update chapter show page UI
banta May 28, 2023
e401d31
Merge remote-tracking branch 'banta/chapter-page' into chapter-page
banta May 28, 2023
a771a77
Add a slug field under fixtures
banta Jun 14, 2023
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
Prev Previous commit
Next Next commit
Added chapter leader card to chapters helper
Used to render chapter leader on the chapter show page
  • Loading branch information
Kihara-Kamotho committed May 4, 2023
commit e2f349a73ee5a1d358784a2c45d9a101ac9e4dc7
15 changes: 15 additions & 0 deletions app/helpers/chapters_helper.rb
Original file line number Diff line number Diff line change
@@ -1,2 +1,17 @@
module ChaptersHelper
def chapter_leader_card(chapter)
leader = UsersChapter.find_by(chapter_id: chapter.id, leader: true).user
image_tag = image_tag("https://github.com/#{leader.github_username}.png", size: "207x97")
name = UsersChapter.find_by_chapter(chapter.id)

content_tag(:div, class: "bg-gray-100 rounded-md shadow-md overflow-hidden inline-block") do
content_tag(:div, class: "h-48") do
image_tag
end +
content_tag(:div, class: "bg-gray-200 px-4 py-2 my-4") do
content_tag(:p, name, class: "text-gray-800 font-bold") +
content_tag(:p, leader.github_username)
end
end
end
end