This commit is contained in:
Caretaker0699 2024-08-15 19:42:27 +00:00
parent 7092402a2d
commit 46467fc797
6 changed files with 160 additions and 141 deletions

BIN
.docker-compose.yml.swp Normal file

Binary file not shown.

22
docker-compose.yml Normal file
View File

@ -0,0 +1,22 @@
networks:
gitea:
external: false
services:
server:
image: gitea/gitea:latest
container_name: gitea
environment:
- USER_UID=1000
- USER_GID=1000
restart: always
networks:
- gitea
volumes:
- ./gitea:/data
- /home/git/.ssh/:/data/git/.ssh
- /etc/timezone:/etc/timezone:ro
- /etc/localtime:/etc/localtime:ro
ports:
- "127.0.0.1:3000:3000"
- "2222:22"

View File

@ -13,8 +13,19 @@
{{template "base/footer_content" .}} {{template "base/footer_content" .}}
<!-- Third-party libraries -->
{{if .EnableCaptcha}}
{{if eq .CaptchaType "recaptcha"}}
<script src='{{URLJoin .RecaptchaURL "api.js"}}'></script>
{{end}}
{{if eq .CaptchaType "hcaptcha"}}
<script src='https://hcaptcha.com/1/api.js'></script>
{{end}}
{{if eq .CaptchaType "cfturnstile"}}
<script src='https://challenges.cloudflare.com/turnstile/v0/api.js'></script>
{{end}}
{{end}}
<script src="{{AssetUrlPrefix}}/js/index.js?v={{AssetVersion}}" onerror="alert('Failed to load asset files from ' + this.src + '. Please make sure the asset files can be accessed.')"></script> <script src="{{AssetUrlPrefix}}/js/index.js?v={{AssetVersion}}" onerror="alert('Failed to load asset files from ' + this.src + '. Please make sure the asset files can be accessed.')"></script>
{{template "custom/footer" .}}
{{template "custom/footer" .}}
</body> </body>
</html> </html>

View File

@ -1,32 +1,30 @@
<footer class="page-footer" role="group" aria-label="{{ctx.Locale.Tr "aria.footer"}}"> <footer class="page-footer" role="group" aria-label="{{ctx.Locale.Tr "aria.footer"}}">
<div class="left-links" role="contentinfo" aria-label="{{ctx.Locale.Tr "aria.footer.software"}}"> <div class="left-links" role="contentinfo" aria-label="{{ctx.Locale.Tr "aria.footer.software"}}">
{{if ShowFooterPoweredBy}} <a target="_blank" rel="noopener noreferrer" href="https://shilohcode.com">{{ctx.Locale.Tr "Brought to you by Shiloh"}}</a>
<a target="_blank" rel="noopener noreferrer" href="https://about.gitea.com">{{ctx.Locale.Tr "powered_by" "Gitea"}}</a> {{if (or .ShowFooterVersion .PageIsAdmin)}}
{{end}} {{ctx.Locale.Tr "version"}}:
{{if (or .ShowFooterVersion .PageIsAdmin)}} {{if .IsAdmin}}
{{ctx.Locale.Tr "version"}}: <a href="{{AppSubUrl}}/admin/config">{{AppVer}}</a>
{{if .IsAdmin}} {{else}}
<a href="{{AppSubUrl}}/admin/config">{{AppVer}}</a> {{AppVer}}
{{else}} {{end}}
{{AppVer}} {{end}}
{{end}} {{if and .TemplateLoadTimes ShowFooterTemplateLoadTime}}
{{end}} {{ctx.Locale.Tr "page"}}: <strong>{{LoadTimes .PageStartTime}}</strong>
{{if and .TemplateLoadTimes ShowFooterTemplateLoadTime}} {{ctx.Locale.Tr "template"}}{{if .TemplateName}} {{.TemplateName}}{{end}}: <strong>{{call .TemplateLoadTimes}}</strong>
{{ctx.Locale.Tr "page"}}: <strong>{{LoadTimes .PageStartTime}}</strong> {{end}}
{{ctx.Locale.Tr "template"}}{{if .TemplateName}} {{.TemplateName}}{{end}}: <strong>{{call .TemplateLoadTimes}}</strong> </div>
{{end}} <div class="right-links" role="group" aria-label="{{ctx.Locale.Tr "aria.footer.links"}}">
</div> <div class="ui dropdown upward language">
<div class="right-links" role="group" aria-label="{{ctx.Locale.Tr "aria.footer.links"}}"> <span>{{svg "octicon-globe"}} {{ctx.locale.LangName}}</span>
<div class="ui dropdown upward language"> <div class="menu language-menu">
<span class="flex-text-inline">{{svg "octicon-globe" 14}} {{ctx.Locale.LangName}}</span> {{range .AllLangs}}
<div class="menu language-menu"> <a lang="{{.Lang}}" data-url="{{AppSubUrl}}/?lang={{.Lang}}" class="item {{if eq ctx.locale.Lang .Lang}}active selected{{end}}">{{.Name}}</a>
{{range .AllLangs}} {{end}}
<a lang="{{.Lang}}" data-url="{{AppSubUrl}}/?lang={{.Lang}}" class="item {{if eq ctx.Locale.Lang .Lang}}active selected{{end}}">{{.Name}}</a> </div>
{{end}} </div>
</div> <a href="{{AssetUrlPrefix}}/licenses.txt">{{ctx.Locale.Tr "licenses"}}</a>
</div> {{if .EnableSwagger}}<a href="{{AppSubUrl}}/api/swagger">API</a>{{end}}
<a href="{{AssetUrlPrefix}}/licenses.txt">{{ctx.Locale.Tr "licenses"}}</a> {{template "custom/extra_links_footer" .}}
{{if .EnableSwagger}}<a href="{{AppSubUrl}}/api/swagger">API</a>{{end}} </div>
{{template "custom/extra_links_footer" .}}
</div>
</footer> </footer>

View File

@ -4,44 +4,36 @@
{{end}} {{end}}
<nav id="navbar" aria-label="{{ctx.Locale.Tr "aria.navbar"}}"> <nav id="navbar" aria-label="{{ctx.Locale.Tr "aria.navbar"}}">
<div class="navbar-left"> <div class="navbar-left ui secondary menu">
<!-- the logo --> <!-- the logo -->
<a class="item" id="navbar-logo" href="{{AppSubUrl}}/" aria-label="{{if .IsSigned}}{{ctx.Locale.Tr "dashboard"}}{{else}}{{ctx.Locale.Tr "home"}}{{end}}"> <a class="item" id="navbar-logo" href="{{AppSubUrl}}/" aria-label="{{if .IsSigned}}{{ctx.Locale.Tr "dashboard"}}{{else}}{{ctx.Locale.Tr "home"}}{{end}}">
<img width="30" height="30" src="{{AssetUrlPrefix}}/img/logo.svg" alt="{{ctx.Locale.Tr "logo"}}" aria-hidden="true"> <img width="30" height="30" src="{{AssetUrlPrefix}}/img/logo.svg" alt="{{ctx.Locale.Tr "logo"}}" aria-hidden="true">
</a> </a>
<!-- mobile right menu, it must be here because in mobile view, each item is a flex column, the first item is a full row column --> <!-- mobile right menu, it must be here because in mobile view, each item is a flex column, the first item is a full row column -->
<div class="ui secondary menu item navbar-mobile-right only-mobile"> <div class="ui secondary menu item navbar-mobile-right">
{{if and .IsSigned EnableTimetracking .ActiveStopwatch}}
<a id="mobile-stopwatch-icon" class="active-stopwatch item tw-mx-0" href="{{.ActiveStopwatch.IssueLink}}" title="{{ctx.Locale.Tr "active_stopwatch"}}" data-seconds="{{.ActiveStopwatch.Seconds}}">
<div class="tw-relative">
{{svg "octicon-stopwatch"}}
<span class="header-stopwatch-dot"></span>
</div>
</a>
{{end}}
{{if .IsSigned}} {{if .IsSigned}}
<a id="mobile-notifications-icon" class="item tw-w-auto tw-p-2" href="{{AppSubUrl}}/notifications" data-tooltip-content="{{ctx.Locale.Tr "notifications"}}" aria-label="{{ctx.Locale.Tr "notifications"}}"> <a id="mobile-notifications-icon" class="item gt-w-auto gt-p-3" href="{{AppSubUrl}}/notifications" data-tooltip-content="{{ctx.Locale.Tr "notifications"}}" aria-label="{{ctx.Locale.Tr "notifications"}}">
<div class="tw-relative"> <div class="gt-relative">
{{svg "octicon-bell"}} {{svg "octicon-bell"}}
<span class="notification_count{{if not $notificationUnreadCount}} tw-hidden{{end}}">{{$notificationUnreadCount}}</span> <span class="notification_count{{if not $notificationUnreadCount}} gt-hidden{{end}}">{{$notificationUnreadCount}}</span>
</div> </div>
</a> </a>
{{end}} {{end}}
<button class="item tw-w-auto ui icon mini button tw-p-2 tw-m-0" id="navbar-expand-toggle" aria-label="{{ctx.Locale.Tr "home.nav_menu"}}">{{svg "octicon-three-bars"}}</button> <button class="item gt-w-auto ui icon mini button gt-p-3 gt-m-0" id="navbar-expand-toggle">{{svg "octicon-three-bars"}}</button>
</div> </div>
<!-- navbar links non-mobile --> <!-- navbar links non-mobile -->
{{if and .IsSigned .MustChangePassword}} {{if and .IsSigned .MustChangePassword}}
{{/* No links */}} {{/* No links */}}
{{else if .IsSigned}} {{else if .IsSigned}}
{{if not ctx.Consts.RepoUnitTypeIssues.UnitGlobalDisabled}} {{if not .UnitIssuesGlobalDisabled}}
<a class="item{{if .PageIsIssues}} active{{end}}" href="{{AppSubUrl}}/issues">{{ctx.Locale.Tr "issues"}}</a> <a class="item{{if .PageIsIssues}} active{{end}}" href="{{AppSubUrl}}/issues">{{ctx.Locale.Tr "issues"}}</a>
{{end}} {{end}}
{{if not ctx.Consts.RepoUnitTypePullRequests.UnitGlobalDisabled}} {{if not .UnitPullsGlobalDisabled}}
<a class="item{{if .PageIsPulls}} active{{end}}" href="{{AppSubUrl}}/pulls">{{ctx.Locale.Tr "pull_requests"}}</a> <a class="item{{if .PageIsPulls}} active{{end}}" href="{{AppSubUrl}}/pulls">{{ctx.Locale.Tr "pull_requests"}}</a>
{{end}} {{end}}
{{if not (and ctx.Consts.RepoUnitTypeIssues.UnitGlobalDisabled ctx.Consts.RepoUnitTypePullRequests.UnitGlobalDisabled)}} {{if not (and .UnitIssuesGlobalDisabled .UnitPullsGlobalDisabled)}}
{{if .ShowMilestonesDashboardPage}} {{if .ShowMilestonesDashboardPage}}
<a class="item{{if .PageIsMilestonesDashboard}} active{{end}}" href="{{AppSubUrl}}/milestones">{{ctx.Locale.Tr "milestones"}}</a> <a class="item{{if .PageIsMilestonesDashboard}} active{{end}}" href="{{AppSubUrl}}/milestones">{{ctx.Locale.Tr "milestones"}}</a>
{{end}} {{end}}
@ -61,12 +53,12 @@
</div> </div>
<!-- the full dropdown menus --> <!-- the full dropdown menus -->
<div class="navbar-right"> <div class="navbar-right ui secondary menu">
{{if and .IsSigned .MustChangePassword}} {{if and .IsSigned .MustChangePassword}}
<div class="ui dropdown jump item" data-tooltip-content="{{ctx.Locale.Tr "user_profile_and_more"}}"> <div class="ui dropdown jump item" data-tooltip-content="{{ctx.Locale.Tr "user_profile_and_more"}}">
<span class="text tw-flex tw-items-center"> <span class="text gt-df gt-ac">
{{ctx.AvatarUtils.Avatar .SignedUser 24 "tw-mr-1"}} {{ctx.AvatarUtils.Avatar .SignedUser 24 "gt-mr-2"}}
<span class="only-mobile tw-ml-2">{{.SignedUser.Name}}</span> <span class="mobile-only gt-ml-3">{{.SignedUser.Name}}</span>
<span class="not-mobile">{{svg "octicon-triangle-down"}}</span> <span class="not-mobile">{{svg "octicon-triangle-down"}}</span>
</span> </span>
<div class="menu user-menu"> <div class="menu user-menu">
@ -82,27 +74,55 @@
</div><!-- end content avatar menu --> </div><!-- end content avatar menu -->
</div><!-- end dropdown avatar menu --> </div><!-- end dropdown avatar menu -->
{{else if .IsSigned}} {{else if .IsSigned}}
{{if and EnableTimetracking .ActiveStopwatch}} {{if EnableTimetracking}}
<a class="item not-mobile active-stopwatch tw-mx-0" href="{{.ActiveStopwatch.IssueLink}}" title="{{ctx.Locale.Tr "active_stopwatch"}}" data-seconds="{{.ActiveStopwatch.Seconds}}"> <a class="active-stopwatch-trigger item gt-mx-0{{if not .ActiveStopwatch}} gt-hidden{{end}}" href="{{.ActiveStopwatch.IssueLink}}" title="{{ctx.Locale.Tr "active_stopwatch"}}">
<div class="tw-relative"> <div class="gt-relative">
{{svg "octicon-stopwatch"}} {{svg "octicon-stopwatch"}}
<span class="header-stopwatch-dot"></span> <span class="header-stopwatch-dot"></span>
</div> </div>
<span class="mobile-only gt-ml-3">{{ctx.Locale.Tr "active_stopwatch"}}</span>
</a> </a>
<div class="active-stopwatch-popup item tippy-target gt-p-3">
<div class="gt-df gt-ac">
<a class="stopwatch-link gt-df gt-ac" href="{{.ActiveStopwatch.IssueLink}}">
{{svg "octicon-issue-opened" 16 "gt-mr-3"}}
<span class="stopwatch-issue">{{.ActiveStopwatch.RepoSlug}}#{{.ActiveStopwatch.IssueIndex}}</span>
<span class="ui primary label stopwatch-time gt-my-0 gt-mx-4" data-seconds="{{.ActiveStopwatch.Seconds}}">
{{if .ActiveStopwatch}}{{Sec2Time .ActiveStopwatch.Seconds}}{{end}}
</span>
</a>
<form class="stopwatch-commit" method="post" action="{{.ActiveStopwatch.IssueLink}}/times/stopwatch/toggle">
{{.CsrfTokenHtml}}
<button
type="submit"
class="ui button mini compact basic icon"
data-tooltip-content="{{ctx.Locale.Tr "repo.issues.stop_tracking"}}"
>{{svg "octicon-square-fill"}}</button>
</form>
<form class="stopwatch-cancel" method="post" action="{{.ActiveStopwatch.IssueLink}}/times/stopwatch/cancel">
{{.CsrfTokenHtml}}
<button
type="submit"
class="ui button mini compact basic icon"
data-tooltip-content="{{ctx.Locale.Tr "repo.issues.cancel_tracking"}}"
>{{svg "octicon-trash"}}</button>
</form>
</div>
</div>
{{end}} {{end}}
<a class="item not-mobile tw-mx-0" href="{{AppSubUrl}}/notifications" data-tooltip-content="{{ctx.Locale.Tr "notifications"}}" aria-label="{{ctx.Locale.Tr "notifications"}}"> <a class="item not-mobile gt-mx-0" href="{{AppSubUrl}}/notifications" data-tooltip-content="{{ctx.Locale.Tr "notifications"}}" aria-label="{{ctx.Locale.Tr "notifications"}}">
<div class="tw-relative"> <div class="gt-relative">
{{svg "octicon-bell"}} {{svg "octicon-bell"}}
<span class="notification_count{{if not $notificationUnreadCount}} tw-hidden{{end}}">{{$notificationUnreadCount}}</span> <span class="notification_count{{if not $notificationUnreadCount}} gt-hidden{{end}}">{{$notificationUnreadCount}}</span>
</div> </div>
</a> </a>
<div class="ui dropdown jump item tw-mx-0 tw-pr-2" data-tooltip-content="{{ctx.Locale.Tr "create_new"}}"> <div class="ui dropdown jump item gt-mx-0 gt-pr-3" data-tooltip-content="{{ctx.Locale.Tr "create_new"}}">
<span class="text"> <span class="text">
{{svg "octicon-plus"}} {{svg "octicon-plus"}}
<span class="not-mobile">{{svg "octicon-triangle-down"}}</span> <span class="not-mobile">{{svg "octicon-triangle-down"}}</span>
<span class="only-mobile">{{ctx.Locale.Tr "create_new"}}</span> <span class="mobile-only">{{ctx.Locale.Tr "create_new"}}</span>
</span> </span>
<div class="menu"> <div class="menu">
<a class="item" href="{{AppSubUrl}}/repo/create"> <a class="item" href="{{AppSubUrl}}/repo/create">
@ -121,10 +141,10 @@
</div><!-- end content create new menu --> </div><!-- end content create new menu -->
</div><!-- end dropdown menu create new --> </div><!-- end dropdown menu create new -->
<div class="ui dropdown jump item tw-mx-0 tw-pr-2" data-tooltip-content="{{ctx.Locale.Tr "user_profile_and_more"}}"> <div class="ui dropdown jump item gt-mx-0 gt-pr-3" data-tooltip-content="{{ctx.Locale.Tr "user_profile_and_more"}}">
<span class="text tw-flex tw-items-center"> <span class="text gt-df gt-ac">
{{ctx.AvatarUtils.Avatar .SignedUser 24 "tw-mr-1"}} {{ctx.AvatarUtils.Avatar .SignedUser 24 "gt-mr-2"}}
<span class="only-mobile tw-ml-2">{{.SignedUser.Name}}</span> <span class="mobile-only gt-ml-3">{{.SignedUser.Name}}</span>
<span class="not-mobile">{{svg "octicon-triangle-down"}}</span> <span class="not-mobile">{{svg "octicon-triangle-down"}}</span>
</span> </span>
<div class="menu user-menu"> <div class="menu user-menu">
@ -182,33 +202,4 @@
</a> </a>
{{end}} {{end}}
</div><!-- end full right menu --> </div><!-- end full right menu -->
{{if and .IsSigned EnableTimetracking .ActiveStopwatch}}
<div class="active-stopwatch-popup tippy-target">
<div class="tw-flex tw-items-center tw-gap-2 tw-p-3">
<a class="stopwatch-link tw-flex tw-items-center tw-gap-2 muted" href="{{.ActiveStopwatch.IssueLink}}">
{{svg "octicon-issue-opened" 16}}
<span class="stopwatch-issue">{{.ActiveStopwatch.RepoSlug}}#{{.ActiveStopwatch.IssueIndex}}</span>
</a>
<div class="tw-flex tw-gap-1">
<form class="stopwatch-commit" method="post" action="{{.ActiveStopwatch.IssueLink}}/times/stopwatch/toggle">
{{.CsrfTokenHtml}}
<button
type="submit"
class="ui button mini compact basic icon tw-mr-0"
data-tooltip-content="{{ctx.Locale.Tr "repo.issues.stop_tracking"}}"
>{{svg "octicon-square-fill"}}</button>
</form>
<form class="stopwatch-cancel" method="post" action="{{.ActiveStopwatch.IssueLink}}/times/stopwatch/cancel">
{{.CsrfTokenHtml}}
<button
type="submit"
class="ui button mini compact basic icon tw-mr-0"
data-tooltip-content="{{ctx.Locale.Tr "repo.issues.cancel_tracking"}}"
>{{svg "octicon-trash"}}</button>
</form>
</div>
</div>
</div>
{{end}}
</nav> </nav>

View File

@ -1,51 +1,48 @@
{{template "base/head" .}} {{template "base/head" .}}
<div role="main" aria-label="{{if .IsSigned}}{{ctx.Locale.Tr "dashboard"}}{{else}}{{ctx.Locale.Tr "home"}}{{end}}" class="page-content home"> <div role="main" aria-label="{{if .IsSigned}}{{ctx.Locale.Tr "dashboard"}}{{else}}{{ctx.Locale.Tr "home"}}{{end}}" class="page-content home">
<div class="tw-mb-8 tw-px-8"> <div class="gt-mb-5 gt-px-5">
<div class="center"> <div class="center">
<img class="logo" width="220" height="220" src="{{AssetUrlPrefix}}/img/logo.svg" alt="{{ctx.Locale.Tr "logo"}}"> <img class="logo" width="220" height="220" src="{{AssetUrlPrefix}}/img/logo.svg" alt="{{.locale.Tr "logo"}}">
<div class="hero"> <div class="hero">
<h1 class="ui icon header title"> <h1 class="ui icon header title">
{{AppName}} {{AppName}}
</h1> </h1>
<h2>{{ctx.Locale.Tr "startpage.app_desc"}}</h2> <h2>Code with Conviction</h2>
</div> <p>
</div> GitHaven is a free, open-source, and secure git service hosted by
</div> <a href="https://shilohcode.com" rel="noopener noreferrer" target="_blank">
<div class="ui stackable middle very relaxed page grid"> <span>Shiloh</span>
<div class="eight wide center column"> </a>.
<h1 class="hero ui icon header"> </p>
{{svg "octicon-flame"}} {{ctx.Locale.Tr "startpage.install"}} <!-- Sign-in and Register Buttons -->
</h1> <div class="sign-buttons">
<p class="large"> <a href="/user/login?redirect_to=%2f" class="ui primary button">{{ctx.Locale.Tr "sign_in"}}</a>
{{ctx.Locale.Tr "startpage.install_desc"}} <a href="/user/sign_up" class="ui secondary button">{{ctx.Locale.Tr "sign_up"}}</a>
</p> <a href="/explore/repos" class="ui tertiary button">{{ctx.Locale.Tr "Explore"}}</a>
</div> </div>
<div class="eight wide center column"> </div>
<h1 class="hero ui icon header"> </div>
{{svg "octicon-device-desktop"}} {{ctx.Locale.Tr "startpage.platform"}} </div>
</h1> <div class="ui stackable middle very relaxed page grid">
<p class="large"> <div class="eight wide center column">
{{ctx.Locale.Tr "startpage.platform_desc"}} <h2 class="large">{{ctx.Locale.Tr "Unrestricted Collaboration"}}</h2>
</p> <p class="medium">{{ctx.Locale.Tr "Express your faith and collaborate with like-minded developers."}}</p>
</div> </div>
</div> <div class="eight wide center column">
<div class="ui stackable middle very relaxed page grid"> <h2 class="large">{{ctx.Locale.Tr "Robust Version Control"}}</h2>
<div class="eight wide center column"> <p class="medium">{{ctx.Locale.Tr "Enjoy seamless and reliable version control for your projects."}}</p>
<h1 class="hero ui icon header"> </div>
{{svg "octicon-rocket"}} {{ctx.Locale.Tr "startpage.lightweight"}} </div>
</h1> <div class="ui stackable middle very relaxed page grid">
<p class="large"> <div class="eight wide center column">
{{ctx.Locale.Tr "startpage.lightweight_desc"}} <h2 class="large">{{ctx.Locale.Tr "Easy Migration"}}</h2>
</p> <p class="medium">{{ctx.Locale.Tr "Effortlessly transition from platforms like GitHub and GitLab to GitHaven."}}</p>
</div> </div>
<div class="eight wide center column"> <div class="eight wide center column">
<h1 class="hero ui icon header"> <h2 class="large">{{ctx.Locale.Tr "Integration Made Easy"}}</h2>
{{svg "octicon-code"}} {{ctx.Locale.Tr "startpage.license"}} <p class="medium">{{ctx.Locale.Tr "GitHaven seamlessly integrates with popular development workflows."}}</p>
</h1> </div>
<p class="large"> </div>
{{ctx.Locale.Tr "startpage.license_desc"}}
</p>
</div>
</div>
</div> </div>
{{template "base/footer" .}} {{template "base/footer" .}}