2
0
Files
gitcaddy-server/templates/repo/settings/pages_content.tmpl
logikonline 5e165b97be feat(pages): add option to hide mobile releases from landing page
Add HideMobileReleases config option to hide Android and iOS releases from the downloads section on landing pages. Useful when mobile apps are distributed via app stores rather than direct downloads. Adds checkbox in Content settings and conditional rendering in all four page templates.
2026-03-16 01:22:52 -04:00

312 lines
17 KiB
Handlebars

{{template "repo/settings/layout_head" (dict "ctxData" . "pageClass" "repository settings pages")}}
<div class="user-main-content twelve wide column">
<h4 class="ui top attached header">{{ctx.Locale.Tr "repo.settings.pages.content"}}</h4>
<div class="ui attached segment">
<form class="ui form" method="post">
{{.CsrfTokenHtml}}
<h5 class="ui dividing header">{{ctx.Locale.Tr "repo.settings.pages.navigation"}}</h5>
<p class="help">{{ctx.Locale.Tr "repo.settings.pages.navigation_desc"}}</p>
<div class="inline field">
<div class="ui toggle checkbox">
<input type="checkbox" name="nav_show_docs" {{if .Config.Navigation.ShowDocs}}checked{{end}}>
<label>{{ctx.Locale.Tr "repo.settings.pages.nav_show_docs"}}</label>
</div>
</div>
<div class="inline field">
<div class="ui toggle checkbox">
<input type="checkbox" name="nav_show_api" {{if .Config.Navigation.ShowAPI}}checked{{end}}>
<label>{{ctx.Locale.Tr "repo.settings.pages.nav_show_api"}}</label>
</div>
</div>
<div class="inline field">
<div class="ui toggle checkbox">
<input type="checkbox" name="nav_show_repository" {{if .Config.Navigation.ShowRepository}}checked{{end}}>
<label>{{ctx.Locale.Tr "repo.settings.pages.nav_show_repository"}}</label>
</div>
</div>
<div class="inline field">
<div class="ui toggle checkbox">
<input type="checkbox" name="nav_show_releases" {{if .Config.Navigation.ShowReleases}}checked{{end}}>
<label>{{ctx.Locale.Tr "repo.settings.pages.nav_show_releases"}}</label>
</div>
</div>
<div class="inline field">
<div class="ui toggle checkbox">
<input type="checkbox" name="nav_show_issues" {{if .Config.Navigation.ShowIssues}}checked{{end}}>
<label>{{ctx.Locale.Tr "repo.settings.pages.nav_show_issues"}}</label>
</div>
</div>
<h5 class="ui dividing header">{{ctx.Locale.Tr "repo.settings.pages.public_releases"}}</h5>
<div class="inline field">
<div class="ui toggle checkbox">
<input type="checkbox" name="public_releases" {{if .Config.Advanced.PublicReleases}}checked{{end}}>
<label>{{ctx.Locale.Tr "repo.settings.pages.public_releases_desc"}}</label>
</div>
</div>
<div class="inline field">
<div class="ui toggle checkbox">
<input type="checkbox" name="hide_mobile_releases" {{if .Config.Advanced.HideMobileReleases}}checked{{end}}>
<label>{{ctx.Locale.Tr "repo.settings.pages.hide_mobile_releases_desc"}}</label>
</div>
</div>
<h5 class="ui dividing header">{{ctx.Locale.Tr "repo.settings.pages.blog_section"}}</h5>
<div class="inline field">
<div class="ui toggle checkbox">
<input type="checkbox" name="blog_enabled" {{if .Config.Blog.Enabled}}checked{{end}}>
<label>{{ctx.Locale.Tr "repo.settings.pages.blog_enabled_desc"}}</label>
</div>
</div>
<div class="field">
<label>{{ctx.Locale.Tr "repo.settings.pages.blog_headline"}}</label>
<input name="blog_headline" value="{{.Config.Blog.Headline}}" placeholder="Latest Posts">
</div>
<div class="field">
<label>{{ctx.Locale.Tr "repo.settings.pages.blog_subheadline"}}</label>
<input name="blog_subheadline" value="{{.Config.Blog.Subheadline}}" placeholder="Stay up to date with our latest news">
</div>
<div class="field">
<label>{{ctx.Locale.Tr "repo.settings.pages.blog_max_posts"}}</label>
<input name="blog_max_posts" type="number" min="1" max="12" value="{{if .Config.Blog.MaxPosts}}{{.Config.Blog.MaxPosts}}{{else}}3{{end}}">
</div>
<h5 class="ui dividing header">{{ctx.Locale.Tr "repo.settings.pages.gallery_section"}}</h5>
<div class="inline field">
<div class="ui toggle checkbox">
<input type="checkbox" name="gallery_enabled" {{if .Config.Gallery.Enabled}}checked{{end}}>
<label>{{ctx.Locale.Tr "repo.settings.pages.gallery_enabled_desc"}}</label>
</div>
</div>
<div class="field">
<label>{{ctx.Locale.Tr "repo.settings.pages.gallery_headline"}}</label>
<input name="gallery_headline" value="{{.Config.Gallery.Headline}}" placeholder="Gallery">
</div>
<div class="field">
<label>{{ctx.Locale.Tr "repo.settings.pages.gallery_subheadline"}}</label>
<input name="gallery_subheadline" value="{{.Config.Gallery.Subheadline}}" placeholder="Screenshots and visuals from the project">
</div>
<div class="two fields">
<div class="field">
<label>{{ctx.Locale.Tr "repo.settings.pages.gallery_max_images"}}</label>
<input name="gallery_max_images" type="number" min="1" max="24" value="{{if .Config.Gallery.MaxImages}}{{.Config.Gallery.MaxImages}}{{else}}6{{end}}">
</div>
<div class="field">
<label>{{ctx.Locale.Tr "repo.settings.pages.gallery_columns"}}</label>
<select name="gallery_columns" class="ui dropdown">
<option value="2" {{if eq .Config.Gallery.Columns 2}}selected{{end}}>2</option>
<option value="3" {{if or (eq .Config.Gallery.Columns 3) (eq .Config.Gallery.Columns 0)}}selected{{end}}>3</option>
<option value="4" {{if eq .Config.Gallery.Columns 4}}selected{{end}}>4</option>
</select>
</div>
</div>
<p class="help">{{ctx.Locale.Tr "repo.settings.pages.gallery_help_link"}}</p>
<h5 class="ui dividing header">{{ctx.Locale.Tr "repo.settings.pages.stats"}}</h5>
<div id="stats-container">
{{range $i, $stat := .Config.Stats}}
<div class="two fields stat-item">
<div class="field"><input name="stat_value_{{$i}}" value="{{$stat.Value}}" placeholder="10k+"></div>
<div class="field"><input name="stat_label_{{$i}}" value="{{$stat.Label}}" placeholder="Downloads"></div>
</div>
{{end}}
{{if not .Config.Stats}}
<div class="two fields stat-item">
<div class="field"><input name="stat_value_0" placeholder="10k+"></div>
<div class="field"><input name="stat_label_0" placeholder="Downloads"></div>
</div>
{{end}}
</div>
<button type="button" class="ui mini button" onclick="addStat()">+ Add Stat</button>
<h5 class="ui dividing header">{{ctx.Locale.Tr "repo.settings.pages.value_props"}}</h5>
<div id="valueprops-container">
{{range $i, $vp := .Config.ValueProps}}
<div class="fields valueprop-item">
<div class="four wide field"><input name="valueprop_title_{{$i}}" value="{{$vp.Title}}" placeholder="Title"></div>
<div class="eight wide field"><input name="valueprop_desc_{{$i}}" value="{{$vp.Description}}" placeholder="Description"></div>
<div class="four wide field">
<select name="valueprop_icon_{{$i}}" class="ui dropdown">
<option value="">Select Icon</option>
<option value="zap" {{if eq $vp.Icon "zap"}}selected{{end}}>⚡ Zap</option>
<option value="shield" {{if eq $vp.Icon "shield"}}selected{{end}}>🛡 Shield</option>
<option value="rocket" {{if eq $vp.Icon "rocket"}}selected{{end}}>🚀 Rocket</option>
<option value="check" {{if eq $vp.Icon "check"}}selected{{end}}>✓ Check</option>
<option value="star" {{if eq $vp.Icon "star"}}selected{{end}}>★ Star</option>
<option value="heart" {{if eq $vp.Icon "heart"}}selected{{end}}>♥ Heart</option>
<option value="lock" {{if eq $vp.Icon "lock"}}selected{{end}}>🔒 Lock</option>
<option value="globe" {{if eq $vp.Icon "globe"}}selected{{end}}>🌐 Globe</option>
<option value="clock" {{if eq $vp.Icon "clock"}}selected{{end}}>🕐 Clock</option>
<option value="gear" {{if eq $vp.Icon "gear"}}selected{{end}}>⚙ Gear</option>
<option value="code" {{if eq $vp.Icon "code"}}selected{{end}}>&lt;/&gt; Code</option>
<option value="terminal" {{if eq $vp.Icon "terminal"}}selected{{end}}>▶ Terminal</option>
<option value="package" {{if eq $vp.Icon "package"}}selected{{end}}>📦 Package</option>
<option value="database" {{if eq $vp.Icon "database"}}selected{{end}}>🗄 Database</option>
<option value="cloud" {{if eq $vp.Icon "cloud"}}selected{{end}}>☁ Cloud</option>
<option value="cpu" {{if eq $vp.Icon "cpu"}}selected{{end}}>💻 CPU</option>
<option value="graph" {{if eq $vp.Icon "graph"}}selected{{end}}>📈 Graph</option>
<option value="people" {{if eq $vp.Icon "people"}}selected{{end}}>👥 People</option>
<option value="tools" {{if eq $vp.Icon "tools"}}selected{{end}}>🔧 Tools</option>
<option value="light-bulb" {{if eq $vp.Icon "light-bulb"}}selected{{end}}>💡 Light Bulb</option>
</select>
</div>
</div>
{{end}}
{{if not .Config.ValueProps}}
<div class="fields valueprop-item">
<div class="four wide field"><input name="valueprop_title_0" placeholder="Title"></div>
<div class="eight wide field"><input name="valueprop_desc_0" placeholder="Description"></div>
<div class="four wide field">
<select name="valueprop_icon_0" class="ui dropdown">
<option value="">Select Icon</option>
<option value="zap">⚡ Zap</option>
<option value="shield">🛡 Shield</option>
<option value="rocket">🚀 Rocket</option>
<option value="check">✓ Check</option>
<option value="star">★ Star</option>
<option value="heart">♥ Heart</option>
<option value="lock">🔒 Lock</option>
<option value="globe">🌐 Globe</option>
<option value="clock">🕐 Clock</option>
<option value="gear">⚙ Gear</option>
<option value="code">&lt;/&gt; Code</option>
<option value="terminal">▶ Terminal</option>
<option value="package">📦 Package</option>
<option value="database">🗄 Database</option>
<option value="cloud">☁ Cloud</option>
<option value="cpu">💻 CPU</option>
<option value="graph">📈 Graph</option>
<option value="people">👥 People</option>
<option value="tools">🔧 Tools</option>
<option value="light-bulb">💡 Light Bulb</option>
</select>
</div>
</div>
{{end}}
</div>
<button type="button" class="ui mini button" onclick="addValueProp()">+ Add Value Prop</button>
<h5 class="ui dividing header">{{ctx.Locale.Tr "repo.settings.pages.features"}}</h5>
<div id="features-container">
{{range $i, $f := .Config.Features}}
<div class="fields feature-item">
<div class="four wide field"><input name="feature_title_{{$i}}" value="{{$f.Title}}" placeholder="Title"></div>
<div class="eight wide field"><input name="feature_desc_{{$i}}" value="{{$f.Description}}" placeholder="Description"></div>
<div class="four wide field">
<select name="feature_icon_{{$i}}" class="ui dropdown">
<option value="">Select Icon</option>
<option value="zap" {{if eq $f.Icon "zap"}}selected{{end}}>⚡ Zap</option>
<option value="shield" {{if eq $f.Icon "shield"}}selected{{end}}>🛡 Shield</option>
<option value="rocket" {{if eq $f.Icon "rocket"}}selected{{end}}>🚀 Rocket</option>
<option value="check" {{if eq $f.Icon "check"}}selected{{end}}>✓ Check</option>
<option value="star" {{if eq $f.Icon "star"}}selected{{end}}>★ Star</option>
<option value="heart" {{if eq $f.Icon "heart"}}selected{{end}}>♥ Heart</option>
<option value="lock" {{if eq $f.Icon "lock"}}selected{{end}}>🔒 Lock</option>
<option value="globe" {{if eq $f.Icon "globe"}}selected{{end}}>🌐 Globe</option>
<option value="clock" {{if eq $f.Icon "clock"}}selected{{end}}>🕐 Clock</option>
<option value="gear" {{if eq $f.Icon "gear"}}selected{{end}}>⚙ Gear</option>
<option value="code" {{if eq $f.Icon "code"}}selected{{end}}>&lt;/&gt; Code</option>
<option value="terminal" {{if eq $f.Icon "terminal"}}selected{{end}}>▶ Terminal</option>
<option value="package" {{if eq $f.Icon "package"}}selected{{end}}>📦 Package</option>
<option value="database" {{if eq $f.Icon "database"}}selected{{end}}>🗄 Database</option>
<option value="cloud" {{if eq $f.Icon "cloud"}}selected{{end}}>☁ Cloud</option>
<option value="cpu" {{if eq $f.Icon "cpu"}}selected{{end}}>💻 CPU</option>
<option value="graph" {{if eq $f.Icon "graph"}}selected{{end}}>📈 Graph</option>
<option value="people" {{if eq $f.Icon "people"}}selected{{end}}>👥 People</option>
<option value="tools" {{if eq $f.Icon "tools"}}selected{{end}}>🔧 Tools</option>
<option value="light-bulb" {{if eq $f.Icon "light-bulb"}}selected{{end}}>💡 Light Bulb</option>
</select>
</div>
</div>
{{end}}
{{if not .Config.Features}}
<div class="fields feature-item">
<div class="four wide field"><input name="feature_title_0" placeholder="Title"></div>
<div class="eight wide field"><input name="feature_desc_0" placeholder="Description"></div>
<div class="four wide field">
<select name="feature_icon_0" class="ui dropdown">
<option value="">Select Icon</option>
<option value="zap">⚡ Zap</option>
<option value="shield">🛡 Shield</option>
<option value="rocket">🚀 Rocket</option>
<option value="check">✓ Check</option>
<option value="star">★ Star</option>
<option value="heart">♥ Heart</option>
<option value="lock">🔒 Lock</option>
<option value="globe">🌐 Globe</option>
<option value="clock">🕐 Clock</option>
<option value="gear">⚙ Gear</option>
<option value="code">&lt;/&gt; Code</option>
<option value="terminal">▶ Terminal</option>
<option value="package">📦 Package</option>
<option value="database">🗄 Database</option>
<option value="cloud">☁ Cloud</option>
<option value="cpu">💻 CPU</option>
<option value="graph">📈 Graph</option>
<option value="people">👥 People</option>
<option value="tools">🔧 Tools</option>
<option value="light-bulb">💡 Light Bulb</option>
</select>
</div>
</div>
{{end}}
</div>
<button type="button" class="ui mini button" onclick="addFeature()">+ Add Feature</button>
<div class="field tw-mt-4">
<button class="ui primary button">{{ctx.Locale.Tr "save"}}</button>
</div>
</form>
</div>
</div>
<script>
const iconOptions = `
<option value="">Select Icon</option>
<option value="zap">⚡ Zap</option>
<option value="shield">🛡 Shield</option>
<option value="rocket">🚀 Rocket</option>
<option value="check">✓ Check</option>
<option value="star">★ Star</option>
<option value="heart">♥ Heart</option>
<option value="lock">🔒 Lock</option>
<option value="globe">🌐 Globe</option>
<option value="clock">🕐 Clock</option>
<option value="gear">⚙ Gear</option>
<option value="code">&lt;/&gt; Code</option>
<option value="terminal">▶ Terminal</option>
<option value="package">📦 Package</option>
<option value="database">🗄 Database</option>
<option value="cloud">☁ Cloud</option>
<option value="cpu">💻 CPU</option>
<option value="graph">📈 Graph</option>
<option value="people">👥 People</option>
<option value="tools">🔧 Tools</option>
<option value="light-bulb">💡 Light Bulb</option>
`;
let statCount = {{len .Config.Stats}};
let vpCount = {{len .Config.ValueProps}};
let featCount = {{len .Config.Features}};
if (statCount === 0) statCount = 1;
if (vpCount === 0) vpCount = 1;
if (featCount === 0) featCount = 1;
function addStat() {
const c = document.getElementById('stats-container');
c.insertAdjacentHTML('beforeend', `<div class="two fields stat-item"><div class="field"><input name="stat_value_${statCount}" placeholder="10k+"></div><div class="field"><input name="stat_label_${statCount}" placeholder="Downloads"></div></div>`);
statCount++;
}
function addValueProp() {
const c = document.getElementById('valueprops-container');
c.insertAdjacentHTML('beforeend', `<div class="fields valueprop-item"><div class="four wide field"><input name="valueprop_title_${vpCount}" placeholder="Title"></div><div class="eight wide field"><input name="valueprop_desc_${vpCount}" placeholder="Description"></div><div class="four wide field"><select name="valueprop_icon_${vpCount}" class="ui dropdown">${iconOptions}</select></div></div>`);
vpCount++;
}
function addFeature() {
const c = document.getElementById('features-container');
c.insertAdjacentHTML('beforeend', `<div class="fields feature-item"><div class="four wide field"><input name="feature_title_${featCount}" placeholder="Title"></div><div class="eight wide field"><input name="feature_desc_${featCount}" placeholder="Description"></div><div class="four wide field"><select name="feature_icon_${featCount}" class="ui dropdown">${iconOptions}</select></div></div>`);
featCount++;
}
</script>
{{template "repo/settings/layout_footer" .}}