fixing some merge conflicts.
This commit is contained in:
commit
77adaffb58
|
@ -107,7 +107,6 @@ def load_example_sponsors():
|
|||
from example_data import ExampleDataLoader
|
||||
ExampleDataLoader().load_sponsors()
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
# run our standalone gevent server
|
||||
app.run(port=4200)
|
||||
|
|
|
@ -51,15 +51,16 @@ def update_selected_user(user, selected_user):
|
|||
return db_selected_user
|
||||
|
||||
|
||||
def render_study_template(studies):
|
||||
def render_study_template(studies, uva_id):
|
||||
table = StudyTable(studies)
|
||||
users = []
|
||||
[users.append(study.NETBADGEID) for study in studies if study.NETBADGEID not in users]
|
||||
[users.append(study.NETBADGEID) for study in db.session.query(Study).all() if study.NETBADGEID not in users]
|
||||
return render_template(
|
||||
'index.html',
|
||||
table=table,
|
||||
base_href=BASE_HREF,
|
||||
users=users
|
||||
users=users,
|
||||
selected_user=uva_id
|
||||
)
|
||||
|
||||
def _update_study(study, form):
|
||||
|
|
|
@ -36,7 +36,7 @@ def user_studies(uva_id):
|
|||
studies = db.session.query(Study).filter(Study.NETBADGEID == uva_id).order_by(Study.DATE_MODIFIED.desc()).all()
|
||||
current_user = get_current_user(request)
|
||||
update_selected_user(current_user, uva_id)
|
||||
return render_study_template(studies)
|
||||
return render_study_template(studies, uva_id)
|
||||
|
||||
|
||||
@app.route('/new_study', methods=['GET', 'POST'])
|
||||
|
|
|
@ -20,10 +20,10 @@
|
|||
<label>Only Show Studies for: </label>
|
||||
<select name="uva_id" id="uva_id" onchange="selectStudies()">
|
||||
<option value="">Select User</option>
|
||||
<option value="all">All Users</option>
|
||||
<option value="all" {% if selected_user=='all' %}selected{% endif %}>All Users</option>
|
||||
{% if users %}
|
||||
{% for user in users %}
|
||||
<option value="{{ user }}">{{ user }}</option>
|
||||
<option value="{{ user }}" {% if selected_user==user %}selected{% endif %}>{{ user }}</option>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
</select>
|
||||
|
|
Loading…
Reference in New Issue