-
-
Notifications
You must be signed in to change notification settings - Fork 190
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
GH-2254 Landing page based on stub data
- Loading branch information
Showing
24 changed files
with
264 additions
and
36 deletions.
There are no files selected for viewing
File renamed without changes.
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
38 changes: 36 additions & 2 deletions
38
reposilite-backend/src/main/kotlin/com/reposilite/ui/views/IndexView.kt
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 | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,42 @@ | ||
package com.reposilite.ui.views | ||
|
||
class IndexView( | ||
data class IndexView( | ||
val title: String, | ||
val description: String, | ||
val logo: String, | ||
val website: String, | ||
) | ||
val highlightedProjects: List<Project>, | ||
val repositories: List<Repository>, | ||
val browsedRepository: BrowsedRepository? = null, | ||
) { | ||
data class Project( | ||
val name: String, | ||
val description: String, | ||
val routes: List<Route> | ||
) { | ||
fun getSupportedPackages(): Set<String> = routes.map { it.repository.type }.toSet() | ||
} | ||
data class Route( | ||
val repository: Repository, | ||
val path: String, | ||
) | ||
data class Repository( | ||
val name: String, | ||
val type: String | ||
) | ||
data class BrowsedRepository( | ||
val name: String, | ||
val files: List<Entry> | ||
) { | ||
interface Entry | ||
|
||
data class File( | ||
val name: String, | ||
val size: String, | ||
) : Entry | ||
|
||
data class Directory( | ||
val name: String, | ||
) : Entry | ||
} | ||
} |
Empty file.
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 | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../../../reposilite-test/workspace/ui |
This file was deleted.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
11 changes: 5 additions & 6 deletions
11
...rc/main/resources/ui/component/Header.jte → ...te-test/workspace/ui/component/Header.jte
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 | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,119 @@ | ||
@import com.reposilite.ui.views.IndexView | ||
@import com.reposilite.ui.views.IndexView.Project | ||
|
||
@param com.reposilite.ui.views.IndexView view | ||
|
||
<!DOCTYPE html> | ||
<html lang="en"> | ||
@template.component.Head(title = "Reposilite") | ||
|
||
<body class="min-h-full text-black dark:text-white min-w-full bg-zinc-100 dark:bg-zinc-900"> | ||
@template.component.Header(title = view.getTitle()) | ||
|
||
<main class="container mx-auto"> | ||
<div class="flex"> | ||
<div class="w-32"> | ||
<img alt="Logo" src="${view.getLogo()}" class="rounded-full border-2 border-zinc-200 dark:border-zinc-500" /> | ||
</div> | ||
<div class="flex flex-col pl-6 justify-center"> | ||
<h1>${view.getDescription()}</h1> | ||
<p class="flex pt-3"> | ||
@template.lib.icons.GlobeIcon() | ||
<a href="${view.getWebsite()}" class="text-zinc-500 px-2"> | ||
${view.getWebsite()} | ||
</a> | ||
</p> | ||
</div> | ||
</div> | ||
<div class="flex justify-between flex-wrap w-full pt-12 gap-2"> | ||
@for(Project project : view.getHighlightedProjects()) | ||
<div class="flex flex-1 flex-col justify-between border rounded-md border-white shadow-sm dark:border-zinc-700 min-w-1/3 max-w-1/3 px-4 pt-3 pb-4 bg-white dark:bg-zinc-800"> | ||
<div class="flex-col"> | ||
<h2 class="font-bold">${project.getName()}</h2> | ||
<p class="text-wrap break-normal text-sm pt-1">${project.getDescription()}</p> | ||
</div> | ||
<div class="flex pt-3 gap-2"> | ||
@for(String packageName : project.getSupportedPackages()) | ||
<p class="text-sm"> | ||
@if(packageName.equals("Generic")) | ||
<span class="px-3 py-0.5 bg-zinc-500 text-black rounded-full">Generic</span> | ||
@elseif(packageName.equals("Maven")) | ||
<span class="px-3 py-0.5 bg-orange-500 text-black rounded-full">Maven</span> | ||
@elseif(packageName.equals("Docker")) | ||
<span class="px-3 py-0.5 bg-blue-500 text-black rounded-full">Docker</span> | ||
@elseif(packageName.equals("NPM")) | ||
<span class="px-3 py-0.5 bg-yellow-500 text-black rounded-full">NPM</span> | ||
@endif | ||
</p> | ||
@endfor | ||
</div> | ||
</div> | ||
@endfor | ||
</div> | ||
<div class="py-12"> | ||
<hr class="border-zinc-200 dark:border-zinc-700" /> | ||
</div> | ||
<div class="flex"> | ||
<div class="flex flex-col gap-2"> | ||
@for(IndexView.Repository repository : view.getRepositories()) | ||
<div class="flex flex-1 bg-white dark:bg-zinc-800 rounded-md items-center min-w-44"> | ||
<div class=" | ||
@if(repository.getType().equals("Generic")) | ||
bg-zinc-500 | ||
@elseif(repository.getType().equals("Maven")) | ||
bg-orange-500 | ||
@elseif(repository.getType().equals("Docker")) | ||
bg-blue-500 | ||
@elseif(repository.getType().equals("NPM")) | ||
bg-yellow-500 | ||
@endif | ||
w-1 h-full"> | ||
</div> | ||
<a href="/${repository.getName()}" class="h-full w-full"> | ||
<div class="flex justify-between h-full w-full"> | ||
<p class="px-5 py-3 text-sm font-bold">${repository.getName().toUpperCase()}</p> | ||
<div class="w-2 h-full | ||
@if(view.getBrowsedRepository() != null && repository.getName().equals(view.getBrowsedRepository().getName())) | ||
bg-white dark:bg-zinc-800 | ||
@else | ||
bg-zinc-100 dark:bg-zinc-900 | ||
@endif | ||
"></div> | ||
</div> | ||
</a> | ||
</div> | ||
@endfor | ||
</div> | ||
<div class="flex flex-col w-full"> | ||
@if (view.getBrowsedRepository() == null) | ||
<input class="w-full bg-white dark:bg-zinc-800 rounded-sm py-2.5 px-3" placeholder="🔍 Search" /> | ||
@else | ||
<div class="bg-white dark:bg-zinc-800 w-fit px-4 py-2 rounded-md min-w-44"> | ||
@for(IndexView.BrowsedRepository.Entry entry : view.getBrowsedRepository().getFiles()) | ||
@if (entry instanceof IndexView.BrowsedRepository.Directory directory) | ||
<div class="py-1 flex items-center gap-3"> | ||
<div class="bg-yellow-300 w-2 h-2 mt-0.5 rounded-full"></div> | ||
<p>${directory.getName()}</p> | ||
</div> | ||
@elseif (entry instanceof IndexView.BrowsedRepository.File file) | ||
<div class="py-1 flex items-center gap-3"> | ||
<div class="bg-white w-2 h-2 mt-0.5 rounded-full"></div> | ||
<p>${file.getName()}</p> | ||
</div> | ||
@endif | ||
@endfor | ||
</div> | ||
@endif | ||
</div> | ||
</div> | ||
|
||
<%-- <button hx-post="/clicked" hx-swap="innerHTML">--%> | ||
<%-- Click me--%> | ||
<%-- </button>--%> | ||
|
||
<%-- @template.component.Foo()--%> | ||
</main> | ||
|
||
@template.component.Footer() | ||
</body> | ||
</html> |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions
6
...src/main/resources/ui/lib/fonts/Inter.jte → ...ite-test/workspace/ui/lib/fonts/Inter.jte
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 | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
<link rel="stylesheet" href="https://rsms.me/inter/inter.css"> | ||
|
||
<style> | ||
* { | ||
font-family: 'Inter', sans-serif; | ||
} | ||
/** {*/ | ||
/* font-family: 'Inter', sans-serif;*/ | ||
/*}*/ | ||
</style> |
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 | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<style> | ||
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:ital,wght@0,100..800;1,100..800&family=Open+Sans:ital,wght@0,300..800;1,300..800&display=swap'); | ||
* { | ||
font-family: 'Open Sans', sans-serif; | ||
} | ||
.open-sans-500 { | ||
font-family: "Open Sans", sans-serif; | ||
font-optical-sizing: auto; | ||
font-weight: 500; | ||
font-style: normal; | ||
font-variation-settings: | ||
"wdth" 100; | ||
} | ||
</style> |
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 | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<!-- Source: https://heroicons.dev/ --> | ||
<svg | ||
class="w-6 h-6" | ||
fill="none" | ||
stroke="currentColor" | ||
viewBox="0 0 24 24" | ||
xmlns="http://www.w3.org/2000/svg" | ||
> | ||
<path | ||
stroke-linecap="round" | ||
stroke-linejoin="round" | ||
stroke-width="2" | ||
d="M3.055 11H5a2 2 0 012 2v1a2 2 0 002 2 2 2 0 012 2v2.945M8 3.935V5.5A2.5 2.5 0 0010.5 8h.5a2 2 0 012 2 2 2 0 104 0 2 2 0 012-2h1.064M15 20.488V18a2 2 0 012-2h3.064M21 12a9 9 0 11-18 0 9 9 0 0118 0z" | ||
/> | ||
</svg> |
File renamed without changes.
File renamed without changes.