Example #1
0
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'))
Example #2
0
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)
Example #3
0
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')
Example #4
0
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'))
Example #5
0
def home():
    posts, user, userBalance = Data()
    return render_template('Home.html', user=user)
Example #6
0
def transaction():
    posts, user, userBalance = Data()
    return render_template('Transaction.html', balance=userBalance, user=user)
Example #7
0
def posts():
    posts, user, userBalance = Data()
    print(posts)
    return render_template('posts.html', posts=posts, user=user)