Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
W
website
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Gruppo Ask
website
Commits
031ee228
Commit
031ee228
authored
Sep 22, 2012
by
Giuseppe Terrasi
Browse files
Options
Browse Files
Download
Plain Diff
merge from lp:~giuseppeterrasi/ubuntu-it-ask/sync-with-upstream sync with upstream rev 1277
parents
ad1a5116
734a9031
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
25 additions
and
10 deletions
+25
-10
forum/skins/default/media/js/wmd/showdown.js
forum/skins/default/media/js/wmd/showdown.js
+4
-1
forum/skins/default/media/js/wmd/wmd.js
forum/skins/default/media/js/wmd/wmd.js
+6
-1
forum/templatetags/email_tags.py
forum/templatetags/email_tags.py
+1
-1
forum/utils/mail.py
forum/utils/mail.py
+14
-7
No files found.
forum/skins/default/media/js/wmd/showdown.js
View file @
031ee228
...
@@ -167,6 +167,9 @@ this.makeHtml = function(text) {
...
@@ -167,6 +167,9 @@ this.makeHtml = function(text) {
// attacklab: Restore tildes
// attacklab: Restore tildes
text
=
text
.
replace
(
/~T/g
,
"
~
"
);
text
=
text
.
replace
(
/~T/g
,
"
~
"
);
text
=
text
.
replace
(
/</g
,
"
<
"
);
text
=
text
.
replace
(
/&gt;/g
,
"
>
"
);
return
text
;
return
text
;
}
}
...
...
forum/skins/default/media/js/wmd/wmd.js
View file @
031ee228
...
@@ -28,8 +28,13 @@ function ajaxFileUpload(imageUrl)
...
@@ -28,8 +28,13 @@ function ajaxFileUpload(imageUrl)
if
(
error
!=
''
){
if
(
error
!=
''
){
alert
(
error
);
alert
(
error
);
}
else
{
}
else
{
if
(
fileURL
==
''
){
alert
(
"
There was an internal server error uploading your file.
\n
Permission denied.
"
);
}
else
{
imageUrl
.
attr
(
'
value
'
,
appUrl
+
fileURL
);
imageUrl
.
attr
(
'
value
'
,
appUrl
+
fileURL
);
}
}
}
},
},
error
:
function
(
data
,
status
,
e
)
error
:
function
(
data
,
status
,
e
)
...
...
forum/templatetags/email_tags.py
View file @
031ee228
...
@@ -20,7 +20,7 @@ class MultiUserMailMessage(template.Node):
...
@@ -20,7 +20,7 @@ class MultiUserMailMessage(template.Node):
self
.
nodelist
.
render
(
context
)
self
.
nodelist
.
render
(
context
)
messages
.
append
((
recipient
,
context
[
'subject'
],
context
[
'htmlcontent'
],
context
[
'textcontent'
],
context
[
'embeddedmedia'
]))
messages
.
append
((
recipient
,
context
[
'subject'
],
context
[
'htmlcontent'
],
context
[
'textcontent'
],
context
[
'embeddedmedia'
]))
create_and_send_mail_messages
(
messages
)
create_and_send_mail_messages
(
messages
,
sender_data
=
context
[
'sender'
],
reply_to
=
context
[
'reply_to'
]
)
@
register
.
tag
@
register
.
tag
def
email
(
parser
,
token
):
def
email
(
parser
,
token
):
...
...
forum/utils/mail.py
View file @
031ee228
...
@@ -24,9 +24,9 @@ from forum.context import application_settings
...
@@ -24,9 +24,9 @@ from forum.context import application_settings
from
forum.utils.html2text
import
HTML2Text
from
forum.utils.html2text
import
HTML2Text
from
threading
import
Thread
from
threading
import
Thread
def
send_template_email
(
recipients
,
template
,
context
):
def
send_template_email
(
recipients
,
template
,
context
,
sender
=
None
,
reply_to
=
None
):
t
=
loader
.
get_template
(
template
)
t
=
loader
.
get_template
(
template
)
context
.
update
(
dict
(
recipients
=
recipients
,
settings
=
settings
))
context
.
update
(
dict
(
recipients
=
recipients
,
settings
=
settings
,
sender
=
sender
,
reply_to
=
reply_to
))
t
.
render
(
Context
(
context
))
t
.
render
(
Context
(
context
))
def
create_connection
():
def
create_connection
():
...
@@ -44,16 +44,23 @@ def create_connection():
...
@@ -44,16 +44,23 @@ def create_connection():
return
connection
return
connection
def
create_and_send_mail_messages
(
messages
):
def
create_and_send_mail_messages
(
messages
,
sender_data
=
None
,
reply_to
=
None
):
if
not
settings
.
EMAIL_HOST
:
if
not
settings
.
EMAIL_HOST
:
return
return
sender
=
Header
(
unicode
(
settings
.
APP_SHORT_NAME
),
'utf-8'
)
sender
=
Header
(
unicode
(
settings
.
APP_SHORT_NAME
),
'utf-8'
)
if
sender_data
==
None
:
sender
.
append
(
'<%s>'
%
unicode
(
settings
.
DEFAULT_FROM_EMAIL
))
sender
.
append
(
'<%s>'
%
unicode
(
settings
.
DEFAULT_FROM_EMAIL
))
sender
=
u'%s <%s>'
%
(
unicode
(
settings
.
APP_SHORT_NAME
),
unicode
(
settings
.
DEFAULT_FROM_EMAIL
))
sender
=
u'%s <%s>'
%
(
unicode
(
settings
.
APP_SHORT_NAME
),
unicode
(
settings
.
DEFAULT_FROM_EMAIL
))
else
:
sender
.
append
(
'<%s>'
%
unicode
(
sender_data
[
'email'
]))
sender
=
u'%s <%s>'
%
(
unicode
(
sender_data
[
'name'
]),
unicode
(
sender_data
[
'email'
]))
if
reply_to
==
None
:
reply_to
=
unicode
(
settings
.
DEFAULT_REPLY_TO_EMAIL
)
reply_to
=
unicode
(
settings
.
DEFAULT_REPLY_TO_EMAIL
)
else
:
reply_to
=
unicode
(
reply_to
)
try
:
try
:
connection
=
None
connection
=
None
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment