Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add admin page to list all available projects in DB
See #39
- Loading branch information
Showing
7 changed files
with
62 additions
and
2 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
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 | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -1 +1,11 @@ | |||
p Here will be all projects! | h2 All projects | ||
|
|||
table.table.table-hover | |||
tr | |||
th Project name | |||
th Since | |||
- projects.each do |project| | |||
tr | |||
td = link_to_github(project) | |||
td = project.created_at.strftime('%d %B %Y') | |||
|
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 | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -1,5 +1,9 @@ | |||
module Admin::Views::Projects | module Admin::Views::Projects | ||
class Index | class Index | ||
include Admin::View | include Admin::View | ||
|
|||
def link_to_github(project) | |||
link_to project.name, "https://github.com/hanami/#{project.name}" | |||
end | |||
end | end | ||
end | end |
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 | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -1,2 +1,5 @@ | |||
class ProjectRepository < Hanami::Repository | class ProjectRepository < Hanami::Repository | ||
def sorted | |||
projects.order { name.asc } | |||
end | |||
end | end |
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