def PostTipped(): try: if request.method == 'POST': userid = int(request.form['userid']) tipPost(userid) posts, user, userBalance = Data() flash('Post tipped !', 'success') return redirect(url_for('posts')) except Exception: flash('Post was not monetized', 'danger') return redirect(url_for('posts'))
def home(): iceboxList, emergencyList, inprogressList, testingList, completeList, user = Data( ) return render_template('index.html', iceboxList=iceboxList, emergencyList=emergencyList, inprogressList=inprogressList, testingList=testingList, completeList=completeList, user=user)
def paytoreceiver(): try: if request.method == 'POST': receiver = request.form.get('receiver') money = request.form.get('money') moneyTransfer(receiver, money) posts, user, userBalance = Data() flash('Ether transfered sussesfully !', 'success') return redirect('transaction') except Exception as e: flash('Transaction Failed ', 'danger') return redirect('transaction')
def uploadPost(): try: if request.method == 'POST': userpost = request.form['userpost'] userImage = request.form['InputFile'] print(userImage) if userImage: ipfsHash = addFile(userImage)['Hash'] else: ipfsHash = '' createPost(userpost, ipfsHash) posts, user, userBalance = Data() flash('Post uploaded sussesfully !', 'success') return redirect(url_for('posts')) except Exception as e: print(e) flash('Post was not uploaded', 'danger') return redirect(url_for('posts'))
def home(): posts, user, userBalance = Data() return render_template('Home.html', user=user)
def transaction(): posts, user, userBalance = Data() return render_template('Transaction.html', balance=userBalance, user=user)
def posts(): posts, user, userBalance = Data() print(posts) return render_template('posts.html', posts=posts, user=user)