def mail():
    client = Person()
    try:
        if request.method == 'POST':
            mess = {
                "name": request.form['name'],
                "email": request.form['email'],
                "content": request.form['text']
            }

            message_box = Messages()

            message_box.send_message(mess)
            # print(mess)
    except Exception as e:
        print(e)
        pass
    td = TimeDate()
    timeleft = td.get_lefttime()
    return render_template("home.html",
                           name=client.name,
                           resume=client.resume,
                           image=client.image_file,
                           about=client.about,
                           skills=client.skills,
                           projects=client.projects,
                           user=True,
                           timeleft=timeleft)
Example #2
0
def del_messages():
    try:
        message_box = Messages()
        message_box.reset_message()
    except:
        pass
    return render_template('login.html')
def del_messages():
    try:
        message_box = Messages()
        message_box.reset_message()
        return render_template('admin.html')
    except Exception as e:
        print(e)
        pass
    return render_template('login.html')
Example #4
0
def reset():
    try:
        client = Person()
        client.reset_all()
        message = Messages()
        message.reset_message()
        return render_template('signin.html')
    except:
        pass
def home():
    try:
        client = Person()
        if client.first_time_login():
            return render_template('signin.html')
        td = TimeDate()
        print(td.passtime())
        if (td.passtime()):
            client.reset_all()
            message = Messages()
            message.reset_message()
            return render_template('signin.html')
        timeleft = td.get_lefttime()
        print(timeleft)
        if request.method == 'POST':
            return render_template("home.html",
                                   name=client.name,
                                   resume=client.resume,
                                   image=client.image_file,
                                   about=client.about,
                                   skills=client.skills,
                                   projects=client.projects,
                                   user=True,
                                   timeleft=timeleft)
        else:
            return render_template("home.html",
                                   name=client.name,
                                   resume=client.resume,
                                   image=client.image_file,
                                   about=client.about,
                                   skills=client.skills,
                                   projects=client.projects,
                                   user=True,
                                   timeleft=timeleft)

    except Exception as e:
        print(e)
        pass
    return render_template('signin.html')
def load_messages():
    try:
        message_box = Messages()
        messages = [
            message_box.message[mess]
            for mess in range(min(len(message_box.message), 100))
        ]

        return render_template('admin.html', messages=messages)
    except Exception as e:
        print(e)
        pass
    return render_template('login.html')