updated to modul etichete
This commit is contained in:
@@ -12,8 +12,8 @@ def create_app():
|
||||
|
||||
db.init_app(app)
|
||||
|
||||
from .routes import bp
|
||||
app.register_blueprint(bp)
|
||||
from app.routes import bp as main_bp
|
||||
app.register_blueprint(main_bp, url_prefix='/')
|
||||
|
||||
# Add 'now' function to Jinja2 globals
|
||||
app.jinja_env.globals['now'] = datetime.now
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@@ -332,4 +332,11 @@ def get_report_data():
|
||||
data["error"] = "Error fetching report data."
|
||||
|
||||
print("Data being returned:", data)
|
||||
return jsonify(data)
|
||||
return jsonify(data)
|
||||
|
||||
@bp.route('/etichete')
|
||||
def etichete():
|
||||
if 'role' not in session or session['role'] not in ['superadmin', 'etichete']:
|
||||
flash('Access denied: Etichete users only.')
|
||||
return redirect(url_for('main.dashboard'))
|
||||
return render_template('main_page_etichete.html')
|
||||
@@ -7,16 +7,29 @@ document.addEventListener('DOMContentLoaded', () => {
|
||||
const themeToggleButton = document.getElementById('theme-toggle');
|
||||
const body = document.body;
|
||||
|
||||
// Helper function to update the theme toggle button text
|
||||
function updateThemeToggleButtonText() {
|
||||
if (body.classList.contains('dark-mode')) {
|
||||
themeToggleButton.textContent = 'Change to Light Mode';
|
||||
} else {
|
||||
themeToggleButton.textContent = 'Change to Dark Mode';
|
||||
}
|
||||
}
|
||||
|
||||
// Check and apply the saved theme from localStorage
|
||||
const savedTheme = localStorage.getItem('theme');
|
||||
if (savedTheme) {
|
||||
body.classList.toggle('dark-mode', savedTheme === 'dark');
|
||||
}
|
||||
|
||||
// Update the button text based on the current theme
|
||||
updateThemeToggleButtonText();
|
||||
|
||||
// Toggle the theme on button click
|
||||
themeToggleButton.addEventListener('click', () => {
|
||||
const isDarkMode = body.classList.toggle('dark-mode');
|
||||
localStorage.setItem('theme', isDarkMode ? 'dark' : 'light');
|
||||
updateThemeToggleButtonText(); // Update the button text after toggling
|
||||
});
|
||||
|
||||
// Helper function to format dates
|
||||
@@ -145,4 +158,11 @@ document.addEventListener('DOMContentLoaded', () => {
|
||||
alert('Exporting current report as PDF...');
|
||||
// Add logic to export the current report as PDF
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
});
|
||||
@@ -18,16 +18,24 @@
|
||||
<a href="{{ url_for('main.quality') }}" class="btn">Lansare modul calitate</a>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="dashboard-card">
|
||||
<h3>Accesare modul magazie</h3>
|
||||
<p>Modul pentru managementul magaziei</p>
|
||||
<a href="{{ url_for('main.warehouse') }}" class="btn">Lansare modul Magazie</a>
|
||||
</div>
|
||||
<!-- New Card: Accesare modul Etichete -->
|
||||
<div class="dashboard-card">
|
||||
<h3>Accesare modul Etichete</h3>
|
||||
<p>Modul pentru gestionarea etichetelor.</p>
|
||||
<a href="{{ url_for('main.etichete') }}" class="btn">Lansare modul Etichete</a>
|
||||
</div>
|
||||
|
||||
<div class="dashboard-card">
|
||||
<h3>Manage Settings</h3>
|
||||
<p>Access and manage application settings.</p>
|
||||
<a href="{{ url_for('main.settings') }}" class="btn">Access Settings Page</a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
{% endblock %}
|
||||
10
py_app/app/templates/main_page_etichete.html
Normal file
10
py_app/app/templates/main_page_etichete.html
Normal file
@@ -0,0 +1,10 @@
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% block title %}Modul Etichete{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="etichete-container">
|
||||
<h1>Modul Etichete</h1>
|
||||
<p>Aceasta este pagina pentru gestionarea etichetelor.</p>
|
||||
</div>
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user