|
|
@@ -9,6 +9,7 @@ from . import dispatch
|
|
|
from app.lib import clean_file as cf, tools
|
|
|
from app.lib import collector
|
|
|
from app.lib import stripe
|
|
|
+from app.lib import searcher
|
|
|
|
|
|
from .forms import UPForm, PicForm, CAForm, BidForm, WalletForm, SearchForm
|
|
|
|
|
|
@@ -172,22 +173,27 @@ def create():
|
|
|
@dashboards.route('/search', methods=['GET', 'POST'])
|
|
|
@login_required
|
|
|
def search():
|
|
|
- ##:
|
|
|
seform = SearchForm()
|
|
|
|
|
|
- ##BUG: this may need to be on every view function for it to work...
|
|
|
- if seform.validate_on_submit():
|
|
|
- searchterm = seform.searchterm.data
|
|
|
- if searchterm:
|
|
|
- search_result = collector.search_art_objn(searchterm)
|
|
|
- if search_result:
|
|
|
- return render_template('search.html', user = current_user, seform = seform, sr = search_result)
|
|
|
- search_result = collector.search_art_objc(searchterm)
|
|
|
- if search_result:
|
|
|
- return render_template('search.html', user = current_user, seform = seform, sr = search_result)
|
|
|
-
|
|
|
+ se_r = searcher.searcher(seform)
|
|
|
+ #print(f'DEBUG (dash) se_r: {se_r}')##
|
|
|
+ sr = searcher.shammer(se_r)
|
|
|
+ #print(f'DEBUG (dash) sr: {sr}')##
|
|
|
+
|
|
|
+ # getting user's focus
|
|
|
+ if request.method == "POST":
|
|
|
+ focus_item = request.form.get('focus_but')
|
|
|
+ if focus_item and collector.check_art_listing(focus_item):
|
|
|
+ u_dbcall = User.query.filter_by(id=current_user.id).first()
|
|
|
+ u_dbcall.focus = focus_item
|
|
|
+ db.session.commit()
|
|
|
+ return redirect(url_for('dashboards.detail'))
|
|
|
+ elif focus_item and not collector.check_art_listing(focus_item):
|
|
|
+ # else if there's a click but no listing, don't do anything
|
|
|
+ flash('Auction page not available to items not for sale!', category='error')
|
|
|
|
|
|
- return render_template('search.html', user = current_user, seform = seform)
|
|
|
+
|
|
|
+ return render_template('search.html', user = current_user, seform = seform, sr = sr)
|
|
|
|
|
|
@dashboards.route('/detail', methods=['GET', 'POST'])
|
|
|
@login_required
|
|
|
@@ -279,3 +285,8 @@ def hashchain():
|
|
|
seform = SearchForm()
|
|
|
|
|
|
return render_template('hash.html', user = current_user, hashchain = hashchain, txlist = txlist, seform = seform)
|
|
|
+
|
|
|
+@dashboards.route('/about', methods=['GET'])
|
|
|
+def about():
|
|
|
+ seform = SearchForm()
|
|
|
+ return render_template('about.html', user = current_user, seform = seform)
|