Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enchancement done : redirect to compose from contacts along with the … #27

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified database/clouduse.sqlt
Binary file not shown.
Binary file modified database/localuse.sqlt
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
13 changes: 10 additions & 3 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,16 @@ def dashbord():
else:
return redirect(url_for("invalses"))

@main.route("/makemail/<receiver>", methods=["GET", "POST"])
@main.route("/makemail/", methods=["GET", "POST"])
def makemail(erorcode=""):
def makemail(erorcode="",receiver=""):
print (" # "*20,request.url)
if 'username' in session:
username = session['username']


if request.method == "POST":
print ("#"*5,"here")
receiver = request.form["receiver"]
subjtext = request.form["subjtext"]
conttext = request.form["conttext"]
Expand All @@ -44,7 +49,9 @@ def makemail(erorcode=""):
else:
erorcode = "mailsucc"
libr_makemail.sendmail(subjtext, conttext, username, receiver)
return render_template("makemail.html", username=username, versinfo=versinfo, erorlist=erorlist, erorcode=erorcode)


return render_template("makemail.html", username=username,receiver=receiver, versinfo=versinfo, erorlist=erorlist, erorcode=erorcode)
else:
return redirect(url_for("invalses"))

Expand Down Expand Up @@ -314,4 +321,4 @@ def makeacnt(erorcode = ""):
return render_template("makeacnt.html", versinfo=versinfo, erorlist=erorlist, erorcode=erorcode)

if __name__ == "__main__":
main.run(port=9696, host="0.0.0.0")
main.run()
2 changes: 1 addition & 1 deletion templates/contacts.html
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ <h3 class="headelem">Saved contacts</h3>
<tbody>
{% for indx in savedone %}
<tr>
<td class="headelem">{{ indx.username }}</td>
<td class="headelem"><a href="{{ url_for('makemail',receiver=indx.username) }}">{{ indx.username }}</a></td>
<td class="normelem"><a href="{{ url_for("viewuser", parauser="exst", usercont=indx.username) }}">{{ indx.fullname }}</a></td>
</tr>
{% endfor %}
Expand Down
7 changes: 6 additions & 1 deletion templates/makemail.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,12 @@
<div class="uk-margin">
<label class="uk-form-label headelem" for="form-horizontal-text">RECIPIENT</label>
<div class="uk-form-controls">
<input class="uk-input normelem uk-form-small" id="form-horizontal-text" type="text" name="receiver" placeholder="Add the username of the receiver" />
{% if receiver!="" %}
<input class="uk-input normelem uk-form-small" id="form-horizontal-text" type="text" name="receiver" value="{{ receiver }}" placeholder="Add the username of the receiver" readonly/>
{% else %}

<input class="uk-input normelem uk-form-small" id="form-horizontal-text" type="text" name="receiver" placeholder="Add the username of the receiver" />
{% endif %}
</div>
</div>
<div class="uk-margin">
Expand Down