Exemplo n.º 1
0
def index():
    search_form = SearchForm()
    form1 = ResumeForm()
    form2 = CoverLetterForm()
    delete_form = DeleteForm()
    page = request.args.get('page', 1, type=int)
    if request.method == 'POST' and search_form.validate():
        postings = search_form.filter_query().paginate(page, current_app.config['POSTS_PER_PAGE'], False)
        if postings.total == 0:
            flash('No postings found in your search.')
        resumes = Resume.query.order_by(Resume.id)
        cover_letters = CoverLetter.query.order_by(CoverLetter.id)
        next_url = url_for('main.index', page=postings.next_num) if postings.has_next else None
        prev_url = url_for('main.index', page=postings.prev_num) if postings.has_prev else None
    else:
        postings = JobPosting.query.order_by(JobPosting.id).paginate(page, current_app.config['POSTS_PER_PAGE'], False)
        resumes = Resume.query.order_by(Resume.id)  # noqa
        cover_letters = CoverLetter.query.order_by(CoverLetter.id)  # noqa
        next_url = url_for('main.index', page=postings.next_num) if postings.has_next else None
        prev_url = url_for('main.index', page=postings.prev_num) if postings.has_prev else None
    return render_template('index.html', title='Home', postings=postings.items, resumes=resumes,
                           cover_letters=cover_letters,
                           form1=form1, form2=form2, search_form=search_form, delete_form=delete_form,
                           next_url=next_url,
                           prev_url=prev_url)  # noqa
Exemplo n.º 2
0
def chartsearch():  # we can both request and send data to/from the page.
    form = SearchForm(request.form)
    if request.method == "POST" and form.validate():
        session['search_song'] = form.song.data
        session['search_filters'] = form.filters.data
        session['search_scoremodifier'] = form.scoremodifier.data
        session['search_score'] = form.score.data
        session['search_exscoremodifier'] = form.exscoremodifier.data
        session['search_exscore'] = form.score.data
        session['search_stagepass'] = form.stagepass.data
        session['search_platform'] = form.platform.data
        session['search_perfect'] = form.perfect.data
        session['search_great'] = form.great.data
        session['search_good'] = form.good.data
        session['search_bad'] = form.bad.data
        session['search_miss'] = form.miss.data
        session['search_maxcombo'] = form.maxcombo.data
        #scrollspeed
        #autovelocity
        session['noteskin'] = form.noteskin.data
        #gamemix
        #gameversion
        session['ranked'] = form.ranked.data
        session['judgement'] = form.judgement.data
        #tournamentid
        return redirect(url_for('main.search_results'))
    return render_template("search.html",
                           form=form,
                           songdata=raw_songdata,
                           int_to_mods=int_to_mods,
                           modlist_to_modstr=modlist_to_modstr,
                           int_to_noteskin=int_to_noteskin)
Exemplo n.º 3
0
def search():                                   # we can both request and send data to/from the page.
    form = SearchForm(request.form)
    if request.method == "POST" and form.validate():
        session['song_search'] = form.song.data
        session['filters'] = form.filters.data
        session['length'] = form.length.data
        return redirect(url_for('main.search_results'))
    return render_template("search.html", form=form)
Exemplo n.º 4
0
def assets():
    form = SearchForm()
    if form.submit3.data and form.validate():
        md5 = form.md5.data
        return redirect(url_for('main.results', md5=md5))
    return render_template('main/admin.html', title='Check Asset', form=form)