104 lines
4.5 KiB
HTML
104 lines
4.5 KiB
HTML
{% extends 'base.html' %}
|
|
{% load static %}
|
|
|
|
{% block title %}Home - Packs Site{% endblock %}
|
|
|
|
{% block content %}
|
|
<div class="home-layout">
|
|
<div class="home-hero">
|
|
<div class="home-hero-inner">
|
|
<h1>Packs Site</h1>
|
|
<p>Hosted datapacks for the Needs Of Nature mod.</p>
|
|
<p class="home-hero-sub">Browse and download packs shared by the community. Upload your own once you have a creator account.</p>
|
|
<div class="home-hero-actions">
|
|
<a href="{% url 'library:browse' %}" class="btn btn-primary"><i class="fas fa-search"></i> Browse packs</a>
|
|
<a href="{% url 'library:my_projects' %}" class="btn btn-secondary"><i class="fas fa-folder-open"></i> My Projects</a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="home-placeholder">
|
|
<h2><i class="fas fa-bullhorn"></i> Announcements</h2>
|
|
<div class="announce-panel">
|
|
{% for a in announcements %}
|
|
<div class="announce-item{% if a.pk not in global_read_ids and user.is_authenticated %} announce-unread{% endif %}">
|
|
<a href="{% url 'announcements:detail' a.pk %}">{{ a.title }}</a>
|
|
<span class="announce-meta">{{ a.created_at|date:"M j" }}{% if a.comments_count %} · {{ a.comments_count }} comment{{ a.comments_count|pluralize }}{% endif %}</span>
|
|
</div>
|
|
{% empty %}
|
|
<p class="empty-hint">No announcements yet.</p>
|
|
{% endfor %}
|
|
</div>
|
|
{% if announcements_total > 4 %}
|
|
<a href="{% url 'announcements:list' %}" class="announce-more">View all ({{ announcements_total }}) <i class="fas fa-arrow-right"></i></a>
|
|
{% endif %}
|
|
|
|
{% if user.is_authenticated %}
|
|
<h2 class="announce-subhead"><i class="fas fa-bell"></i> For you
|
|
{% if unread_notifications %}<span class="announce-badge">{{ unread_notifications }}</span>{% endif %}
|
|
</h2>
|
|
<div class="announce-panel">
|
|
{% for n in notifications %}
|
|
<div class="announce-item{% if not n.read %} announce-unread{% endif %}">
|
|
<a href="{% url 'library:project_detail' n.project.slug %}">{{ n.text }}</a>
|
|
<span class="announce-meta">{{ n.created_at|timesince }} ago</span>
|
|
</div>
|
|
{% empty %}
|
|
<p class="empty-hint">Nothing new for you yet.</p>
|
|
{% endfor %}
|
|
</div>
|
|
<div class="announce-actions">
|
|
<a href="{% url 'announcements:personal' %}" class="announce-more">All your alerts <i class="fas fa-arrow-right"></i></a>
|
|
{% if unread_notifications %}
|
|
<form method="post" action="{% url 'announcements:mark_all_read' %}">
|
|
{% csrf_token %}
|
|
<button type="submit" class="link-btn">Mark all read</button>
|
|
</form>
|
|
{% endif %}
|
|
</div>
|
|
{% endif %}
|
|
</div>
|
|
|
|
<div class="home-stats">
|
|
<div class="stat-card">
|
|
<i class="fas fa-users"></i>
|
|
<span class="stat-value">{{ stats.creators }}</span>
|
|
<span class="stat-label">Creators</span>
|
|
</div>
|
|
<div class="stat-card">
|
|
<i class="fas fa-box-open"></i>
|
|
<span class="stat-value">{{ stats.packs }}</span>
|
|
<span class="stat-label">Packs</span>
|
|
</div>
|
|
<div class="stat-card">
|
|
<i class="fas fa-download"></i>
|
|
<span class="stat-value">{{ stats.downloads }}</span>
|
|
<span class="stat-label">Downloads</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="home-section">
|
|
<div class="home-section-header">
|
|
<h2>Latest packs</h2>
|
|
<a href="{% url 'library:browse' %}" class="home-section-link">View all <i class="fas fa-arrow-right"></i></a>
|
|
</div>
|
|
|
|
<div class="pack-grid">
|
|
{% for project in latest_projects %}
|
|
{% include 'library/_project_card.html' %}
|
|
{% empty %}
|
|
<div class="pack-card pack-card-empty">
|
|
<div class="pack-card-thumb">
|
|
<i class="fas fa-box-open"></i>
|
|
</div>
|
|
<div class="pack-card-body">
|
|
<h3>No packs yet</h3>
|
|
<p class="pack-card-desc">Be the first to share a pack.</p>
|
|
</div>
|
|
</div>
|
|
{% endfor %}
|
|
</div>
|
|
</div>
|
|
{% endblock %}
|