v0.11.0 - Added a block so no bins can be counted until a master file has been uploaded.
This commit is contained in:
6
app.py
6
app.py
@@ -17,7 +17,7 @@ from blueprints.data_imports import data_imports_bp
|
||||
from blueprints.users import users_bp
|
||||
from blueprints.sessions import sessions_bp
|
||||
from blueprints.admin_locations import admin_locations_bp
|
||||
from blueprints.counting import counting_bp # Add this import
|
||||
from blueprints.counting import counting_bp
|
||||
from utils import login_required
|
||||
|
||||
# Register Blueprints
|
||||
@@ -25,7 +25,7 @@ app.register_blueprint(data_imports_bp)
|
||||
app.register_blueprint(users_bp)
|
||||
app.register_blueprint(sessions_bp)
|
||||
app.register_blueprint(admin_locations_bp)
|
||||
app.register_blueprint(counting_bp) # Add this registration
|
||||
app.register_blueprint(counting_bp)
|
||||
|
||||
# V1.0: Use environment variable for production, fallback to demo key for development
|
||||
app.secret_key = os.environ.get('SCANLOOK_SECRET_KEY', 'scanlook-demo-key-replace-for-production')
|
||||
@@ -36,7 +36,7 @@ app.config['PERMANENT_SESSION_LIFETIME'] = timedelta(hours=1)
|
||||
|
||||
|
||||
# 1. Define the version
|
||||
APP_VERSION = '0.10.0'
|
||||
APP_VERSION = '0.11.0'
|
||||
|
||||
# 2. Inject it into all templates automatically
|
||||
@app.context_processor
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@@ -79,6 +79,9 @@ def start_bin_count(session_id):
|
||||
if not sess:
|
||||
flash('Session not found or archived', 'warning')
|
||||
return redirect(url_for('dashboard'))
|
||||
if not sess['master_baseline_timestamp']:
|
||||
flash('Master File not uploaded. Please upload it before starting bins.', 'warning')
|
||||
return redirect(url_for('counting.my_counts', session_id=session_id))
|
||||
|
||||
location_name = request.form.get('location_name', '').strip().upper()
|
||||
|
||||
@@ -144,6 +147,9 @@ def count_location(session_id, location_count_id):
|
||||
if not sess:
|
||||
flash('Session not found or archived', 'warning')
|
||||
return redirect(url_for('dashboard'))
|
||||
if not sess['master_baseline_timestamp']:
|
||||
flash('Master File not uploaded. Please upload it before starting bins.', 'warning')
|
||||
return redirect(url_for('counting.my_counts', session_id=session_id))
|
||||
|
||||
location = query_db('''
|
||||
SELECT * FROM LocationCounts
|
||||
|
||||
@@ -9,10 +9,19 @@
|
||||
<a href="{{ url_for('dashboard') }}" class="breadcrumb">← Back to Dashboard</a>
|
||||
<h1 class="page-title">My Active Counts</h1>
|
||||
<p class="page-subtitle">{{ count_session.session_name }}</p>
|
||||
{% if not count_session.master_baseline_timestamp %}
|
||||
<p class="page-subtitle">Master File not uploaded yet. Please contact an admin before starting bins.</p>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% if count_session.master_baseline_timestamp %}
|
||||
<button class="btn btn-primary" onclick="showStartBinModal()">
|
||||
<span class="btn-icon">+</span> Start New Bin
|
||||
</button>
|
||||
{% else %}
|
||||
<button class="btn btn-primary" disabled title="Upload a Master File to start bins">
|
||||
<span class="btn-icon">+</span> Start New Bin
|
||||
</button>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<!-- Active Bins -->
|
||||
|
||||
Reference in New Issue
Block a user