Skip to content

Commit

Permalink
Merge pull request #255 from tushar5526/inbox
Browse files Browse the repository at this point in the history
Fixed #212
  • Loading branch information
kgashok authored Nov 16, 2022
2 parents 5f776d8 + 56e9dd4 commit 3c9dbdb
Show file tree
Hide file tree
Showing 6 changed files with 438 additions and 244 deletions.
9 changes: 6 additions & 3 deletions saythanks/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
from . import storage
from urllib.parse import quote
from lxml.html.clean import Cleaner
from markdown import markdown

cleaner = Cleaner()
cleaner.javascript = True
Expand Down Expand Up @@ -106,7 +107,8 @@ def inbox():

# Grab the inbox from the database.
inbox_db = storage.Inbox(profile['nickname'])

for i in inbox_db.notes:
print(i.body)
is_enabled = storage.Inbox.is_enabled(inbox_db.slug)

is_email_enabled = storage.Inbox.is_email_enabled(inbox_db.slug)
Expand Down Expand Up @@ -273,9 +275,10 @@ def submit_note(inbox):
note = inbox_db.submit_note(body=body, byline=byline)
return redirect(url_for('thanks'))
# Strip any HTML away.
body = Markup(body).striptags()

body = markdown(body)
body = remove_tags(body)
byline = Markup(request.form['byline']).striptags()

# Assert that the body has length.
if not body:
# Pretend that it was successful.
Expand Down
16 changes: 0 additions & 16 deletions saythanks/static/css/normalize.css
Original file line number Diff line number Diff line change
Expand Up @@ -409,19 +409,3 @@ optgroup {
font-weight: bold;
}

/* Tables
========================================================================== */

/**
* Remove most spacing between table cells.
*/

table {
border-collapse: collapse;
border-spacing: 0;
}

td,
th {
padding: 0;
}
150 changes: 83 additions & 67 deletions saythanks/static/css/saythanks.css
Original file line number Diff line number Diff line change
@@ -1,38 +1,38 @@
/* The Sun icon in the header should not have an underline */
@font-face {
/* HuiFont is a Japanese handwriting free font.
/* HuiFont is a Japanese handwriting free font.
http://hp.vector.co.jp/authors/VA039499/ */
font-family: 'SerendityFont';
src: url('/static/fonts/SerendityScript.woff2') format('woff2');
font-weight: normal;
font-style: normal;
/* HuiFont is a Japanese handwriting free font.
font-family: 'SerendityFont';
src: url('/static/fonts/SerendityScript.woff2') format('woff2');
font-weight: normal;
font-style: normal;

/* HuiFont is a Japanese handwriting free font.
http://hp.vector.co.jp/authors/VA039499/ */
/* font-family: 'HuiFont'; */
/* src: url('/static/fonts/HuiFont.woff2') format('woff2'); */
/* font-weight: normal; */
/* font-style: normal; */
/* font-family: 'HuiFont'; */
/* src: url('/static/fonts/HuiFont.woff2') format('woff2'); */
/* font-weight: normal; */
/* font-style: normal; */
}


:root{
--customfont: 'Annie Use Your Telescope', 'SerendityFont', cursive;
}
:root {
--customfont: 'Annie Use Your Telescope', 'SerendityFont', cursive;
}

h1 a {
text-decoration: none;
text-decoration: none;
}

.u-textcenter {
text-align: center;
}

button {
overflow: hidden!important;
overflow: hidden !important;
}

#badge-modal textarea{
#badge-modal textarea {
font-size: 13px;
}

Expand All @@ -44,96 +44,112 @@ button {
}

.note {
font-family: 'Annie Use Your Telescope', 'SerendityFont', cursive!important;
/*font-family: 'Annie Use Your Telescope', 'HuiFont', cursive!important; */
font-size: 2.35rem;
white-space: pre-wrap!important;
font-family: 'Annie Use Your Telescope', 'SerendityFont', cursive !important;
/*font-family: 'Annie Use Your Telescope', 'HuiFont', cursive!important; */
font-size: 2.35rem;
white-space: pre-wrap !important;
}

.notebodyfont {
font-family: var(--customfont);
font-size: 2.35rem;
white-space: pre-wrap!important;
font-family: var(--customfont);
font-size: 2.35rem;
overflow: hidden;
text-overflow: ellipsis;
}

.noteinput {
height: 6em;
height: 6em;
}


.button-primary {
background-color: #3ac025!important;
border-color: #3ac025!important;
background-color: #3ac025 !important;
border-color: #3ac025 !important;
}

a {
color: #3ac025!important;
color: #3ac025;
}

.green {
color: #3ac025!important;
color: #3ac025 !important;
}

.dark-green {
color: #208A13!important;
color: #208A13 !important;
}

#eve {
height: 5rem;
margin-top: 0.2em;
color: green;
height: 5rem;
margin-top: 0.2em;
color: green;
}

#eve-send {
height: 6rem;
margin-bottom: -4em;
color: green;
height: 6rem;
margin-bottom: -4em;
color: green;
}

.auth0-lock-name:after {
content: ' (for SayThanks.io)';
content: ' (for SayThanks.io)';
}

.no-color {
color:none!important;
color: none !important;
}

a.share {
text-decoration: none
text-decoration: none
}

.logoutLblPos{
position:relative;
}
.github-corner:hover .octo-arm {
animation: octocat-wave 560ms ease-in-out
}
.logoutLblPos {
position: relative;
}

@keyframes octocat-wave {
.github-corner:hover .octo-arm {
animation: octocat-wave 560ms ease-in-out
}

#share {}

0%,
100% {
transform: rotate(0)
}
#message {}

20%,
60% {
transform: rotate(-25deg)
}
#from {
width: 15%;
}

#timestamp {
}

40%,
80% {
transform: rotate(10deg)
}
@keyframes octocat-wave {

0%,
100% {
transform: rotate(0)
}

20%,
60% {
transform: rotate(-25deg)
}

40%,
80% {
transform: rotate(10deg)
}
}

@media (max-width:500px) {
.github-corner:hover .octo-arm {
animation: none
}
@media (max-width:500px) {
.github-corner:hover .octo-arm {
animation: none
}

.github-corner .octo-arm {
animation: octocat-wave 560ms ease-in-out
}
.github-corner .octo-arm {
animation: octocat-wave 560ms ease-in-out
}
.github-fork-ribbon:before { background-color: #333; }
}

.github-fork-ribbon:before {
background-color: #333;
}
Loading

0 comments on commit 3c9dbdb

Please sign in to comment.