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
Hide 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) {
// attacklab: Restore tildes
text
=
text
.
replace
(
/~T/g
,
"
~
"
);
text
=
text
.
replace
(
/</g
,
"
<
"
);
text
=
text
.
replace
(
/&gt;/g
,
"
>
"
);
return
text
;
}
...
...
@@ -1328,4 +1331,4 @@ var Showdown = Attacklab.showdown;
// If anyone's interested, tell the world that this file's been loaded
if
(
Attacklab
.
fileLoaded
)
{
Attacklab
.
fileLoaded
(
"
showdown.js
"
);
}
\ No newline at end of file
}
forum/skins/default/media/js/wmd/wmd.js
View file @
031ee228
...
...
@@ -28,7 +28,12 @@ function ajaxFileUpload(imageUrl)
if
(
error
!=
''
){
alert
(
error
);
}
else
{
imageUrl
.
attr
(
'
value
'
,
appUrl
+
fileURL
);
if
(
fileURL
==
''
){
alert
(
"
There was an internal server error uploading your file.
\n
Permission denied.
"
);
}
else
{
imageUrl
.
attr
(
'
value
'
,
appUrl
+
fileURL
);
}
}
},
...
...
forum/templatetags/email_tags.py
View file @
031ee228
...
...
@@ -20,7 +20,7 @@ class MultiUserMailMessage(template.Node):
self
.
nodelist
.
render
(
context
)
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
def
email
(
parser
,
token
):
...
...
forum/utils/mail.py
View file @
031ee228
...
...
@@ -24,9 +24,9 @@ from forum.context import application_settings
from
forum.utils.html2text
import
HTML2Text
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
)
context
.
update
(
dict
(
recipients
=
recipients
,
settings
=
settings
))
context
.
update
(
dict
(
recipients
=
recipients
,
settings
=
settings
,
sender
=
sender
,
reply_to
=
reply_to
))
t
.
render
(
Context
(
context
))
def
create_connection
():
...
...
@@ -44,16 +44,23 @@ def create_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
:
return
sender
=
Header
(
unicode
(
settings
.
APP_SHORT_NAME
),
'utf-8'
)
sender
.
append
(
'<%s>'
%
unicode
(
settings
.
DEFAULT_FROM_EMAIL
))
sender
=
u'%s <%s>'
%
(
unicode
(
settings
.
APP_SHORT_NAME
),
unicode
(
settings
.
DEFAULT_FROM_EMAIL
))
reply_to
=
unicode
(
settings
.
DEFAULT_REPLY_TO_EMAIL
)
if
sender_data
==
None
:
sender
.
append
(
'<%s>'
%
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
)
else
:
reply_to
=
unicode
(
reply_to
)
try
:
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