...
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
# Actix MVC App
|
||||
# Zanzibar Autonomous Zone
|
||||
|
||||
A Rust web application built with Actix Web, Tera templates, and Bootstrap 5.3.5, following the MVC (Model-View-Controller) architectural pattern.
|
||||
Convenience, Safety and Privacy
|
||||
|
||||
## Features
|
||||
|
||||
@@ -42,8 +42,8 @@ actix_mvc_app/
|
||||
|
||||
1. Clone the repository:
|
||||
```
|
||||
git clone https://github.com/yourusername/actix_mvc_app.git
|
||||
cd actix_mvc_app
|
||||
git clone https://github.com/yourusername/zanzibar-autonomous-zone.git
|
||||
cd zanzibar-autonomous-zone
|
||||
```
|
||||
|
||||
2. Build the project:
|
||||
|
@@ -1,14 +1,14 @@
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% block title %}About - Actix MVC App{% endblock %}
|
||||
{% block title %}About - Zanzibar Autonomous Zone{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<h1 class="card-title">About Actix MVC App</h1>
|
||||
<p class="card-text">This is a sample application demonstrating how to build a web application using Rust with an MVC architecture.</p>
|
||||
<h1 class="card-title">About Zanzibar Autonomous Zone</h1>
|
||||
<p class="card-text">Convenience, Safety and Privacy</p>
|
||||
|
||||
<h2 class="mt-4">Technology Stack</h2>
|
||||
<div class="row">
|
||||
|
@@ -3,31 +3,51 @@
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>{% block title %}Actix MVC App{% endblock %}</title>
|
||||
<title>{% block title %}Zanzibar Autonomous Zone{% endblock %}</title>
|
||||
<link rel="stylesheet" href="/static/css/bootstrap.min.css">
|
||||
<link rel="stylesheet" href="https://unpkg.com/unpoly@3.7.2/unpoly.min.css">
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.1/font/bootstrap-icons.css">
|
||||
<style>
|
||||
/* Minimal custom CSS that can't be achieved with Bootstrap classes */
|
||||
body {
|
||||
padding-top: 50px; /* Height of the fixed header */
|
||||
}
|
||||
|
||||
.header {
|
||||
height: 50px;
|
||||
position: fixed;
|
||||
top: 0;
|
||||
width: 100%;
|
||||
z-index: 1030;
|
||||
}
|
||||
|
||||
.footer {
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
}
|
||||
|
||||
@media (min-width: 768px) {
|
||||
.sidebar {
|
||||
width: 280px;
|
||||
width: 240px;
|
||||
position: fixed;
|
||||
height: 100vh;
|
||||
height: calc(100vh - 90px); /* Subtract header and footer height */
|
||||
top: 50px; /* Position below header */
|
||||
}
|
||||
.main-content {
|
||||
margin-left: 280px;
|
||||
margin-left: 240px;
|
||||
min-height: calc(100vh - 90px);
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 767.98px) {
|
||||
.sidebar {
|
||||
width: 280px;
|
||||
width: 240px;
|
||||
position: fixed;
|
||||
height: 100vh;
|
||||
left: -280px;
|
||||
height: calc(100vh - 90px);
|
||||
top: 50px;
|
||||
left: -240px;
|
||||
transition: left 0.3s ease;
|
||||
z-index: 1030;
|
||||
z-index: 1020;
|
||||
}
|
||||
.sidebar.show {
|
||||
left: 0;
|
||||
@@ -36,13 +56,51 @@
|
||||
</style>
|
||||
{% block extra_css %}{% endblock %}
|
||||
</head>
|
||||
<body class="d-flex flex-column min-vh-100">
|
||||
<!-- Sidebar -->
|
||||
<div class="sidebar bg-light shadow-sm border-end" id="sidebar">
|
||||
<div class="bg-dark text-white p-3">
|
||||
<h3 class="mb-0">Actix MVC App</h3>
|
||||
<body>
|
||||
<!-- Header - Full Width -->
|
||||
<header class="header bg-dark text-white">
|
||||
<div class="container-fluid d-flex justify-content-between align-items-center h-100">
|
||||
<div class="d-flex align-items-center">
|
||||
<button class="navbar-toggler d-md-none me-2" type="button" id="sidebarToggle" aria-label="Toggle navigation">
|
||||
<i class="bi bi-list text-white"></i>
|
||||
</button>
|
||||
<h5 class="mb-0">Zanzibar Autonomous Zone</h5>
|
||||
</div>
|
||||
<div>
|
||||
<ul class="navbar-nav flex-row">
|
||||
{% if user and user.id %}
|
||||
<li class="nav-item dropdown">
|
||||
<a class="nav-link dropdown-toggle text-white" href="#" id="navbarDropdown" role="button" data-bs-toggle="dropdown" aria-expanded="false">
|
||||
<i class="bi bi-person-circle"></i> {{ user.name }}
|
||||
</a>
|
||||
<ul class="dropdown-menu dropdown-menu-end" aria-labelledby="navbarDropdown">
|
||||
<li><a class="dropdown-item" href="/tickets/new">New Ticket</a></li>
|
||||
<li><a class="dropdown-item" href="/my-tickets">My Tickets</a></li>
|
||||
<li><a class="dropdown-item" href="/governance/my-votes">My Votes</a></li>
|
||||
{% if user.role == "Admin" %}
|
||||
<li><a class="dropdown-item" href="/admin">Admin Panel</a></li>
|
||||
{% endif %}
|
||||
<li><hr class="dropdown-divider"></li>
|
||||
<li><a class="dropdown-item" href="/logout">Logout</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
{% else %}
|
||||
<li class="nav-item me-2">
|
||||
<a class="nav-link text-white {% if active_page == 'login' %}active{% endif %}" href="/login">Login</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link text-white {% if active_page == 'register' %}active{% endif %}" href="/register">Register</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="py-3">
|
||||
</header>
|
||||
|
||||
<div class="d-flex">
|
||||
<!-- Sidebar -->
|
||||
<div class="sidebar bg-light shadow-sm border-end" id="sidebar">
|
||||
<div class="py-2">
|
||||
<ul class="nav flex-column">
|
||||
<li class="nav-item">
|
||||
<a class="nav-link d-flex align-items-center ps-3 py-2 {% if active_page == 'home' %}active fw-bold border-start border-4 border-primary bg-light{% endif %}" href="/">
|
||||
@@ -93,67 +151,29 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Main Content -->
|
||||
<div class="main-content d-flex flex-column min-vh-100">
|
||||
<!-- Top Navbar -->
|
||||
<nav class="navbar navbar-dark bg-dark">
|
||||
<div class="container-fluid">
|
||||
<button class="navbar-toggler d-md-none" type="button" id="sidebarToggle" aria-label="Toggle navigation">
|
||||
<i class="bi bi-list"></i>
|
||||
</button>
|
||||
<a class="navbar-brand d-md-none" href="/">Actix MVC App</a>
|
||||
<div class="ms-auto">
|
||||
<ul class="navbar-nav flex-row">
|
||||
{% if user and user.id %}
|
||||
<li class="nav-item dropdown">
|
||||
<a class="nav-link dropdown-toggle text-white" href="#" id="navbarDropdown" role="button" data-bs-toggle="dropdown" aria-expanded="false">
|
||||
<i class="bi bi-person-circle"></i> {{ user.name }}
|
||||
</a>
|
||||
<ul class="dropdown-menu dropdown-menu-end" aria-labelledby="navbarDropdown">
|
||||
<li><a class="dropdown-item" href="/tickets/new">New Ticket</a></li>
|
||||
<li><a class="dropdown-item" href="/my-tickets">My Tickets</a></li>
|
||||
<li><a class="dropdown-item" href="/governance/my-votes">My Votes</a></li>
|
||||
{% if user.role == "Admin" %}
|
||||
<li><a class="dropdown-item" href="/admin">Admin Panel</a></li>
|
||||
{% endif %}
|
||||
<li><hr class="dropdown-divider"></li>
|
||||
<li><a class="dropdown-item" href="/logout">Logout</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
{% else %}
|
||||
<li class="nav-item me-2">
|
||||
<a class="nav-link text-white {% if active_page == 'login' %}active{% endif %}" href="/login">Login</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link text-white {% if active_page == 'register' %}active{% endif %}" href="/register">Register</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
<!-- Page Content -->
|
||||
<main class="container py-4 flex-grow-1">
|
||||
<!-- Main Content -->
|
||||
<div class="main-content">
|
||||
<!-- Page Content -->
|
||||
<main class="container py-3">
|
||||
{% block content %}{% endblock %}
|
||||
</main>
|
||||
|
||||
<!-- Footer -->
|
||||
<footer class="bg-dark text-white py-4 mt-auto">
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<h5>Actix MVC App</h5>
|
||||
<p>A Rust web application using Actix Web, Tera templates, and Bootstrap.</p>
|
||||
</div>
|
||||
<div class="col-md-6 text-md-end">
|
||||
<p>© {{ now(year=true) }} Actix MVC App. All rights reserved.</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
</main>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Footer - Full Width -->
|
||||
<footer class="footer bg-dark text-white mt-auto">
|
||||
<div class="container-fluid d-flex justify-content-between align-items-center">
|
||||
<div>
|
||||
<span>Convenience, Safety and Privacy</span>
|
||||
</div>
|
||||
<div>
|
||||
<span>© {{ now(year=true) }} Zanzibar Autonomous Zone. All rights reserved.</span>
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
<script src="/static/js/bootstrap.bundle.min.js"></script>
|
||||
<script src="https://unpkg.com/unpoly@3.7.2/unpoly.min.js"></script>
|
||||
<script src="https://unpkg.com/unpoly@3.7.2/unpoly-bootstrap5.min.js"></script>
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% block title %}Contact - Actix MVC App{% endblock %}
|
||||
{% block title %}Contact - Zanzibar Autonomous Zone{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="row">
|
||||
@@ -45,7 +45,7 @@
|
||||
<div class="card mb-3">
|
||||
<div class="card-body">
|
||||
<h5 class="card-title">GitHub</h5>
|
||||
<p class="card-text">github.com/example/actix-mvc-app</p>
|
||||
<p class="card-text">github.com/example/zanzibar-autonomous-zone</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@@ -1,14 +1,14 @@
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% block title %}Home - Actix MVC App{% endblock %}
|
||||
{% block title %}Home - Zanzibar Autonomous Zone{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<h1 class="card-title">Welcome to Actix MVC App</h1>
|
||||
<p class="card-text">This is a Rust web application built with:</p>
|
||||
<h1 class="card-title">Welcome to Zanzibar Autonomous Zone</h1>
|
||||
<p class="card-text">Convenience, Safety and Privacy</p>
|
||||
<ul class="list-group list-group-flush mb-4">
|
||||
<li class="list-group-item">Actix Web - A powerful, pragmatic, and extremely fast web framework for Rust</li>
|
||||
<li class="list-group-item">Tera Templates - A template engine inspired by Jinja2 and Django templates</li>
|
||||
|
Reference in New Issue
Block a user