|
|
@ -10,10 +10,10 @@ from .froms import NewProjectForm, LoginForm, RegistrationForm, EmptyForm |
|
|
|
@app.route('/index', methods=['GET', 'POST']) |
|
|
|
@app.route('/index', methods=['GET', 'POST']) |
|
|
|
def index(): |
|
|
|
def index(): |
|
|
|
if current_user.is_authenticated: |
|
|
|
if current_user.is_authenticated: |
|
|
|
project_names = Project.list_names() |
|
|
|
projects = current_user.projects |
|
|
|
else: |
|
|
|
else: |
|
|
|
project_names = None |
|
|
|
projects = None |
|
|
|
return render_template('index.html', project_names=project_names) |
|
|
|
return render_template('index.html', projects=projects) |
|
|
|
|
|
|
|
|
|
|
|
@app.route('/login', methods=['GET', 'POST']) |
|
|
|
@app.route('/login', methods=['GET', 'POST']) |
|
|
|
def login(): |
|
|
|
def login(): |
|
|
@ -72,4 +72,4 @@ def project_delete_files(project_name): |
|
|
|
project = Project.first_or_404(name=project_name) |
|
|
|
project = Project.first_or_404(name=project_name) |
|
|
|
result = project.delete_files() |
|
|
|
result = project.delete_files() |
|
|
|
flash_result(result) |
|
|
|
flash_result(result) |
|
|
|
return redirect(url_for('project_dashboard', project_name=project.name)) |
|
|
|
return redirect(url_for('project_dashboard', project_name=project.name)) |
|
|
|