Browse Source

further removal of academicness

main
crunk 7 months ago
parent
commit
dca9666984
  1. 20
      verse/forms/uploadform.py
  2. 10
      verse/start.py
  3. 18
      verse/templates/filtermenu.html
  4. 2
      verse/templates/index.html

20
verse/forms/uploadform.py

@ -26,8 +26,8 @@ class UploadForm(FlaskForm):
"Name of your archive section:", "Name of your archive section:",
validators=[validators.InputRequired(), Length(2, 100), _distribusiname], validators=[validators.InputRequired(), Length(2, 100), _distribusiname],
) )
academicyear = SelectField( year = SelectField(
"Year", "Year:",
validate_choice=True, validate_choice=True,
coerce=str, coerce=str,
choices=[ choices=[
@ -44,7 +44,7 @@ class UploadForm(FlaskForm):
option_widget=None, option_widget=None,
validators=[DataRequired()] validators=[DataRequired()]
) )
term = SelectField( category = SelectField(
"Category:", "Category:",
validate_choice=True, validate_choice=True,
coerce=str, coerce=str,
@ -64,20 +64,6 @@ class UploadForm(FlaskForm):
validators=[validators.InputRequired(), Length(2, 500)], validators=[validators.InputRequired(), Length(2, 500)],
) )
course = SelectField(
u'Course:',
validate_choice=True,
coerce=str,
choices=[
('hacking', u'Autonomous - Hacking'),
('digitalcraft', u'Autonomous - Digital Craft'),
('criticalstudies', u'Autonomous - Critical Studies'),
('publicprivate', u'Autonomous - Public&Private'),
],
option_widget=None,
validators=[DataRequired()]
)
zipfile = FileField( zipfile = FileField(
"Upload your zip file with content here:", "Upload your zip file with content here:",
validators=[ validators=[

10
verse/start.py

@ -65,23 +65,21 @@ def index():
singledistribusi = { singledistribusi = {
"username": user.username, "username": user.username,
"publictheme": distribusi.publictheme, "publictheme": distribusi.publictheme,
"term": distribusi.term, "category": distribusi.term,
"course": distribusi.course, "course": distribusi.course,
"year": distribusi.year, "year": distribusi.year,
"tags": distribusi.tags.split(","), "tags": distribusi.tags.split(","),
} }
distribusisindex[distribusi.distribusiname] = singledistribusi distribusisindex[distribusi.distribusiname] = singledistribusi
years = uploadform.academicyear.choices years = uploadform.year.choices
terms = uploadform.term.choices categories = uploadform.category.choices
courses = uploadform.course.choices
adminuser = isadminuser() adminuser = isadminuser()
template = render_template( template = render_template(
"index.html", "index.html",
distribusisindex=distribusisindex, distribusisindex=distribusisindex,
years=years, years=years,
terms=terms, categories=categories,
courses=courses,
adminuser=adminuser, adminuser=adminuser,
) )
return template return template

18
verse/templates/filtermenu.html

@ -1,28 +1,20 @@
{% block menu %} {% block menu %}
<button onclick="filterSelection('all')" id="removefilter">Remove filter</button> <button onclick="filterSelection('all')" id="removefilter">Remove filter</button>
<div class="dropdown"> <div class="dropdown">
<button id="Academicyear" class="dropbtn">Academic year</button> <button id="Year" class="dropbtn">Year</button>
<div class="dropdown-content"> <div class="dropdown-content">
{% for year in years %} {% for year in years %}
<button type="button" name="button" onclick="filterSelection('{{ year[0] }}', '{{ year[1] }}', 'Academicyear')" >{{ year[1] }}</button> <button type="button" name="button" onclick="filterSelection('{{ year[0] }}', '{{ year[1] }}', 'Year')" >{{ year[1] }}</button>
{% endfor %} {% endfor %}
</div> </div>
</div> </div>
<div class="dropdown"> <div class="dropdown">
<button id="Term" class="dropbtn">Term</button> <button id="Category" class="dropbtn">Category</button>
<div class="dropdown-content"> <div class="dropdown-content">
{% for term in terms %} {% for category in categories %}
<button type="button" name="button" onclick="filterSelection('{{ term[0] }}', '{{ term[1] }}', 'Term')" >{{ term[1] }}</button> <button type="button" name="button" onclick="filterSelection('{{ category[0] }}', '{{ category[1] }}', 'Category')" >{{ category[1] }}</button>
{% endfor %} {% endfor %}
</div> </div>
</div> </div>
<div class="dropdown">
<button id="Course" class="dropbtn">Course</button>
<div class="dropdown-content">
{% for course in courses %}
<button type="button" name="button" onclick="filterSelection('{{ course[0] }}' , '{{ course[1] }}', 'Course')" >{{ course[1] }}</button>
{% endfor %}
</div>
</div>
<input id="tagsearch" type="text" placeholder="Search.."> <input id="tagsearch" type="text" placeholder="Search..">
{% endblock menu %} {% endblock menu %}

2
verse/templates/index.html

@ -53,7 +53,7 @@
{% include 'filtermenu.html' %} {% include 'filtermenu.html' %}
<ul id="distribusi-index"> <ul id="distribusi-index">
{% for name, distribusi in distribusisindex.items() %} {% for name, distribusi in distribusisindex.items() %}
<li class='distribusi filter {{ distribusi["term"] }} {{ distribusi["year"] }} {{ distribusi["course"] }}'> <li class='distribusi filter {{ distribusi["category"] }} {{ distribusi["year"] }} '>
<a href='stash/{{name}}/index.html'>{{distribusi["username"]}}:{{name}}</a> <a href='stash/{{name}}/index.html'>{{distribusi["username"]}}:{{name}}</a>
{% for tag in distribusi["tags"] %} {% for tag in distribusi["tags"] %}
<span class="tags">{{tag}}</span> <span class="tags">{{tag}}</span>

Loading…
Cancel
Save