2
0
Files
gitcaddy-server/templates/explore/blogs.tmpl
logikonline 7b34e295eb feat(secrets): add secret promotion between scopes
Adds ability to promote secrets from repository to organization scope, or from repository/organization to global scope. Includes conflict detection to prevent duplicate names at target scope, permission checks (org owner for repo→org, system admin for →global), and UI buttons with confirmation dialogs. Implements MoveSecret model method and PerformSecretsPromote handler.
2026-02-01 21:39:45 -05:00

254 lines
5.9 KiB
Handlebars

{{template "base/head" .}}
<div role="main" aria-label="{{.Title}}" class="page-content explore blogs">
{{template "explore/navbar" .}}
<div class="ui container">
{{if .FeaturedPost}}
<div class="blog-featured">
<a href="{{.FeaturedPost.Repo.Link}}/blog/{{.FeaturedPost.ID}}" class="blog-featured-link">
{{if .FeaturedPost.FeaturedImage}}
<div class="blog-featured-image">
<img src="{{.FeaturedPost.FeaturedImage.DownloadURL}}" alt="{{.FeaturedPost.Title}}">
</div>
{{end}}
<div class="blog-featured-content">
<h2 class="blog-featured-title">{{.FeaturedPost.Title}}</h2>
{{if .FeaturedPost.Subtitle}}
<p class="blog-featured-subtitle">{{.FeaturedPost.Subtitle}}</p>
{{end}}
<div class="blog-featured-meta">
{{if .FeaturedPost.Author}}
<img class="blog-avatar" src="{{.FeaturedPost.Author.AvatarLink ctx}}" alt="{{.FeaturedPost.Author.Name}}">
<span class="blog-author">{{.FeaturedPost.Author.DisplayName}}</span>
<span class="blog-meta-sep">&middot;</span>
{{end}}
{{if .FeaturedPost.Repo}}
<a href="{{.FeaturedPost.Repo.Link}}" class="blog-repo-link">{{.FeaturedPost.Repo.FullName}}</a>
<span class="blog-meta-sep">&middot;</span>
{{end}}
<span class="blog-date">{{DateUtils.TimeSince .FeaturedPost.PublishedUnix}}</span>
</div>
</div>
</a>
</div>
{{end}}
{{if .Posts}}
<div class="blog-grid">
{{range .Posts}}
<a href="{{.Repo.Link}}/blog/{{.ID}}" class="blog-tile">
{{if .FeaturedImage}}
<div class="blog-tile-image">
<img src="{{.FeaturedImage.DownloadURL}}" alt="{{.Title}}" loading="lazy">
</div>
{{else}}
<div class="blog-tile-image blog-tile-image-placeholder">
{{svg "octicon-note" 32}}
</div>
{{end}}
<div class="blog-tile-content">
<h3 class="blog-tile-title">{{.Title}}</h3>
{{if .Subtitle}}
<p class="blog-tile-subtitle">{{.Subtitle}}</p>
{{end}}
<div class="blog-tile-meta">
{{if .Author}}
<img class="blog-avatar-sm" src="{{.Author.AvatarLink ctx}}" alt="{{.Author.Name}}">
<span>{{.Author.DisplayName}}</span>
<span class="blog-meta-sep">&middot;</span>
{{end}}
{{if .Repo}}
<span>{{.Repo.FullName}}</span>
<span class="blog-meta-sep">&middot;</span>
{{end}}
<span>{{DateUtils.TimeSince .PublishedUnix}}</span>
</div>
</div>
</a>
{{end}}
</div>
{{end}}
{{if and (not .FeaturedPost) (not .Posts)}}
<div class="empty-placeholder">
{{svg "octicon-note" 48}}
<h2>{{ctx.Locale.Tr "repo.blog.no_posts"}}</h2>
</div>
{{end}}
{{template "base/paginate" .}}
</div>
</div>
<style>
.blog-featured {
margin-bottom: 24px;
}
.blog-featured-link {
display: flex;
gap: 24px;
padding: 20px;
border-radius: 12px;
border: 1px solid var(--color-secondary-alpha-40);
background: var(--color-box-body);
color: var(--color-text);
text-decoration: none;
transition: border-color 0.15s, box-shadow 0.15s;
}
.blog-featured-link:hover {
border-color: var(--color-primary-alpha-60);
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
color: var(--color-text);
text-decoration: none;
}
.blog-featured-image {
flex-shrink: 0;
width: 320px;
height: 200px;
border-radius: 8px;
overflow: hidden;
background: var(--color-secondary-alpha-20);
}
.blog-featured-image img {
width: 100%;
height: 100%;
object-fit: cover;
}
.blog-featured-content {
flex: 1;
display: flex;
flex-direction: column;
justify-content: center;
min-width: 0;
}
.blog-featured-title {
font-size: 24px;
font-weight: 700;
line-height: 1.3;
margin: 0 0 8px;
}
.blog-featured-subtitle {
font-size: 15px;
color: var(--color-text-light);
margin: 0 0 16px;
line-height: 1.5;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
overflow: hidden;
}
.blog-featured-meta {
display: flex;
align-items: center;
gap: 6px;
font-size: 13px;
color: var(--color-text-light);
}
.blog-avatar {
width: 24px;
height: 24px;
border-radius: 50%;
}
.blog-avatar-sm {
width: 18px;
height: 18px;
border-radius: 50%;
}
.blog-repo-link {
color: var(--color-primary);
text-decoration: none;
}
.blog-repo-link:hover {
text-decoration: underline;
}
.blog-meta-sep {
color: var(--color-text-light-3);
}
.blog-date {
color: var(--color-text-light);
}
.blog-grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
gap: 20px;
margin-bottom: 24px;
}
.blog-tile {
display: flex;
flex-direction: column;
border-radius: 10px;
border: 1px solid var(--color-secondary-alpha-40);
background: var(--color-box-body);
color: var(--color-text);
text-decoration: none;
overflow: hidden;
transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}
.blog-tile:hover {
border-color: var(--color-primary-alpha-60);
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
transform: translateY(-2px);
color: var(--color-text);
text-decoration: none;
}
.blog-tile-image {
width: 100%;
height: 180px;
overflow: hidden;
background: var(--color-secondary-alpha-20);
}
.blog-tile-image img {
width: 100%;
height: 100%;
object-fit: cover;
}
.blog-tile-image-placeholder {
display: flex;
align-items: center;
justify-content: center;
color: var(--color-text-light-3);
}
.blog-tile-content {
padding: 16px;
flex: 1;
display: flex;
flex-direction: column;
}
.blog-tile-title {
font-size: 16px;
font-weight: 600;
line-height: 1.3;
margin: 0 0 4px;
}
.blog-tile-subtitle {
font-size: 13px;
color: var(--color-text-light);
margin: 0 0 12px;
line-height: 1.4;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
overflow: hidden;
}
.blog-tile-meta {
display: flex;
align-items: center;
gap: 5px;
font-size: 12px;
color: var(--color-text-light);
margin-top: auto;
}
@media (max-width: 768px) {
.blog-featured-link {
flex-direction: column;
}
.blog-featured-image {
width: 100%;
height: 180px;
}
.blog-grid {
grid-template-columns: 1fr;
}
}
</style>
{{template "base/footer" .}}