Commit Graph

693 Commits

Author SHA1 Message Date
Rocka
795035ff6c
template: admin: add id isso-root to comments wrapper
the admin page layout would be more neat
2018-06-09 19:15:34 +08:00
Rocka
a87815fcba
client: define an global object Isso, for loading comments dynamically 2018-06-09 18:58:08 +08:00
Pelle Nilsson
3e45ccb7e5 Fix whitespace issue 2018-06-03 19:59:05 +02:00
Pelle Nilsson
9b2a56e467 Introduce public-endpoint setting 2018-06-03 19:55:31 +02:00
Pelle Nilsson
717837b35a Correct hash in 'unsubscribe' API example 2018-05-10 20:59:27 +02:00
Pelle Nilsson
0063fd6e88 Make unsubscribe work with notifications for replies 2018-05-10 20:48:13 +02:00
Vincent Bernat
8e4f2ab1c7 feed: remove trailing / from base URL
This way, one can use "/" as base URL. This is only valid if we are
sure that URI should always have a leading "/". Is that the case?

Fix #437.
2018-05-07 21:16:48 +02:00
Benoît Latinier
2135743ea7
Merge branch 'master' into generic-importer 2018-05-07 21:12:55 +02:00
JuliusPC
729a65f177
Fix spelling of "E-Mail" → https://www.duden.de/rechtschreibung/E_Mail 2018-05-07 02:13:23 +02:00
Benoît Latinier
5e65e46b59
Merge pull request #426 from vincentbernat/fix/feedlink-append
embed: fix feed link creation on older browsers
2018-05-01 23:38:53 +02:00
Benoît Latinier
e745f326db
Merge pull request #428 from pozitron57/patch-2
Correct russian translation for "preview" button
2018-04-30 17:22:47 +02:00
Sergey Lisakov
530b541f68
Correct translation for "preview" button 2018-04-30 18:21:02 +03:00
Rocka
dda616eef3
i18n: fix zh_CN/TW translate of 'postbox-preview' 2018-04-29 23:54:57 +08:00
Pelle Nilsson
f6f61c547a Merge remote-tracking branch 'posativ/master' into reply_notification
Conflicts:
	isso/css/isso.css
	isso/ext/notifications.py
	isso/js/app/text/postbox.jade
	isso/views/comments.py
2018-04-29 14:48:13 +02:00
Vincent Bernat
311f65d52b embed: fix feed link creation on older browsers
When a browser doesn't support DOM manipulation convenience methods,
the addition of the feed link was triggering an error because elements
created by `$.new()` are regular elements, not elements from our own
mini-DOM implementation. Therefore, the `append()` method may be
absent. Use `appendChild()` instead.
2018-04-29 10:39:02 +02:00
Steffen Prince
7cdb47d875 Update renderer to match Misaka 2.0 API 2018-04-25 23:29:13 +02:00
Steffen Prince
c38851a6cd Update to misaka 2.0
Fixes #208
2018-04-25 23:19:27 +02:00
Benoît Latinier
94d031444d add: CONTRIBUTORS + pep8 2018-04-25 23:03:55 +02:00
Benoît Latinier
6da91d4ace
Merge branch 'master' into feature/gravatar-support 2018-04-25 22:45:45 +02:00
Benoît Latinier
3754ba7596
Merge pull request #414 from vincentbernat/fix/no-eval
jade: avoid using eval once compiled
2018-04-25 22:32:13 +02:00
Benoît Latinier
514c5d42b6
Merge pull request #422 from Lucas-C/master
Bugfix to support <a> elements in SVG diagrams - close #421
2018-04-25 22:26:27 +02:00
Benoît Latinier
ad6e868ba5
Merge pull request #416 from vincentbernat/feature/preview
js: add a preview button to see a rendered preview
2018-04-25 22:23:06 +02:00
Benoît Latinier
3d648c2d29
fix tests due to non predictive html rendering 2018-04-25 21:24:27 +02:00
Lucas Cimon
501bdc59bf Bugfix to support <a> elements in SVG diagrams - close #421 2018-04-25 10:55:37 +02:00
Vincent Bernat
b0264bc807 js: add a preview button to see a rendered preview
When the button is clicked, the /preview endpoint is used to render a
preview text. The preview is inserted and the preview button is
replaced by an edit button to go back to edit mode. Alternatively, the
use can click on the preview to edit.

Some small CSS modifications are done to accomodate the
modification. Also, the preview is wrapped into `.isso-common
.text-wrapper .text` to not make the CSS more complex.

When in preview mode, the background is stripped/greyish in case it's not easy
to make a difference between preview and not preview (due to
unformatted text). We avoid to modify borders/shadow boxes because it
would make the design "jumpy".
2018-04-25 08:17:17 +02:00
Benoît Latinier
55dac39bdd
Merge pull request #418 from vincentbernat/feature/nofollow-links
html: add nofollow/noopener to links
2018-04-24 23:28:53 +02:00
Benoît Latinier
b5c40bedf7
Merge pull request #419 from vincentbernat/feature/atom-feed
api: add /feed API to get an Atom feed for an URI
2018-04-24 21:56:09 +02:00
Vincent Bernat
01cf96eeb7 feed: ensure Markdown rendering is applied to feeds 2018-04-23 11:37:14 +02:00
Benoît Latinier
502747cb75
Merge pull request #411 from Rocket1184/hotfix/demo-and-admin-redirect
fix: admin and demo view redirect issue
2018-04-22 21:35:24 +02:00
Vincent Bernat
45f6b1eda3 feed: make /feed API call configurable server and client-side
On server-side, this can be enabled by providing a base URL to use to
build the full URL. Limit also becomes configurable. On client-side,
we need to add a switch to know whatever or not the additional link
can be displayed.
2018-04-22 16:55:06 +02:00
Vincent Bernat
bceb69518b js: put a link to Atom feed on top of the main postbox 2018-04-22 13:31:11 +02:00
Vincent Bernat
a89debbc9c api: add a simple test for /feed endpoint 2018-04-22 13:11:58 +02:00
Vincent Bernat
5c6e78b9c1 api: ensure /feed is easily cacheable by issuing etag/last-modified headers 2018-04-22 13:11:58 +02:00
Vincent Bernat
ebca06059a api: add /feed API to get an Atom feed for an URI
We need absolute URL at some places. We assume the first host
configured is the base of the URI we have.

Fix #81
2018-04-22 13:11:58 +02:00
Vincent Bernat
8d8f9c8c59 html: add nofollow/noopener to links
"nofollow" is a deterrent for spammers: they cannot put links and hope
to increase their SEO when all these links have the nofollow
relationship.

"noopener" is a security for links opening a new window. They ensure
the target cannot control us.

Fix #373
2018-04-21 14:30:02 +02:00
Vincent Bernat
fcf576dd08 css: remove CSS code for avatar in postbox
It has been removed in 0211322915.
2018-04-20 21:50:08 +02:00
Pelle Nilsson
36d4ceb2d9 Don't send notification when someone responds to his/her own comment 2018-04-19 20:48:13 +02:00
Facundo Batista
14195d3711 Used proper open and not check timing 2018-04-18 18:49:52 -03:00
Facundo Batista
3ee13ab9fc Removed debug line 2018-04-18 17:34:23 -03:00
Facundo Batista
be5792cb79 Merged master in 2018-04-18 16:03:19 -03:00
Facundo Batista
04b6d70b01 Added a generic way to migrate from a json file 2018-04-18 15:54:54 -03:00
Vincent Bernat
9618c0f3a3 jade: avoid using eval once compiled
Use of eval is handy when we need to automatically reload a
template. However, in production, this is slow and unsafe. Moreover,
when using CSP, we have to use 'unsafe-eval' which brings shame to
most of us. It appears use of eval() is not needed because the
template has already been translated to Javascript. We just need to
bind "jade" to its local scope.

So, we add an additional wrapper function binding "jade" to the local
scope. Moreover, when compiling the template, we add a flag to the
function to know it has already been compiled. In this case, we
execute it with "jade" in its scope. Otherwise, we keep using eval.

Quickly tested in both situations. Seem to work.

Fix #274.
2018-04-17 22:54:22 +02:00
Pelle Nilsson
22a36bdb7c Support notifications also for replies 2018-04-15 19:42:31 +02:00
Pelle Nilsson
da6bb0cec7 Fix faulty check for parent comment 2018-04-15 19:26:44 +02:00
Rocka
30fef390f5
fix: admin and demo view redirect issue 2018-04-05 23:10:46 +08:00
Rocka
4e2d2dfb20
i18n: add space between number and CJK character 2018-04-05 22:46:17 +08:00
Yuchen Pei
73c7933548 A quick dirty fix of #401 (#406)
Fix URL in moderation mails if isso runs in a sub-URL (closes #401 )
2018-04-02 23:02:45 +02:00
Cimon Lucas (LCM)
361c596bf2 Adding support for ISSO_CORS_ORIGIN env variable to allow defining wildcard CORS origins 2018-04-02 09:40:34 +02:00
Pelle Nilsson
c9045f5b1f Implement opt-out for email notifications 2018-02-21 21:39:35 +01:00
Pelle Nilsson
bc4bc55025 Include link to comment in email notifications 2018-02-20 20:03:52 +01:00
Pelle Nilsson
2e85ec653f Make SMTP connections thread safe 2018-02-18 16:48:08 +01:00
Pelle Nilsson
107b9be003 Add notification column to database if needed 2018-02-18 14:00:18 +01:00
Pelle Nilsson
c30873e8a2 Merge remote-tracking branch 'tsileo/reply_notification' into reply_notification
Conflicts:
	isso/css/isso.scss
	isso/db/comments.py
	isso/ext/notifications.py
	isso/js/app/i18n/fr.js
	isso/js/app/isso.js
	isso/js/app/text/postbox.html
	isso/views/comments.py
2018-02-18 13:58:33 +01:00
cclauss
7f55c81e08 autopep8 the code and then flake8 2018-02-08 22:46:14 +01:00
Jelmer Vernooij
2cc564eeca
Merge pull request #380 from cclauss/drop-support-for-python-2.6-and-3.3
Drop support for python 2.6 and 3.3
2018-01-31 12:42:41 +00:00
Martin Schenck
6ccebce041 Improved German translation 2018-01-28 19:52:46 +01:00
cclauss
b569b19a7f compat.py passes pyflakes test
Drop support for Python 2.6 and 3.3
2018-01-25 15:03:12 +01:00
Benoît Latinier
2b56963f31 fix pyflakes error, make travis happy 2018-01-20 23:03:08 +01:00
Benoît Latinier
d2b573a4d5
Merge pull request #256 from blatinier/issue-10/admin-interface
Add a basic admin interface (Fix issue #10)
There are more to add in the interface but it's a good start.
2017-11-27 22:55:53 +01:00
Jelmer Vernooij
ea3507910f
Merge pull request #354 from mpchadwick/feature/comment-placeholder-color
Darken placeholder text
2017-11-22 22:11:56 +00:00
Max Chadwick
3efe0c86d9 Put hu into correct alphabetical order 2017-11-21 21:34:06 -05:00
Max Chadwick
be26948fff Use <label>s rather than placeholders 2017-11-21 21:03:00 -05:00
Max Chadwick
9ab23c0908 Fix hungarian translation 2017-11-21 20:50:14 -05:00
Max Chadwick
21983a61b6 Darken placeholder text
Previously color contrast was insufficient per WCAG AA
2017-11-20 22:15:09 -05:00
Peter Guthy
02eaffea21 Added hungarian translation 2017-10-31 13:47:49 +01:00
Martin Zimmermann
650c6cf126 Merge pull request #341 from macedigital/fix-identicon-hash-size
Fix: Truncate key-length when generating identicons
2017-08-17 11:27:59 +02:00
Martin Zimmermann
6a60f831b0 remove unused variable 2017-08-17 10:42:36 +02:00
Martin Zimmermann
9b0e3d29fe revert incorrect removal of the internal server startup CLI 2017-08-17 10:37:28 +02:00
Matthias Adler
43623f349b
Fix: Truncate key-length when generating identicons
Hex-digits with character count above 17 cannot be safely converted to an Integer, see [MAX_SAFE_INTEGER](https://medium.com/the-node-js-collection/javascripts-number-type-8d59199db1b6#53cd).

Therefore, when long keys (e.g. 32 characters) are passed into `generateIdenticon()`, and the modulus of 2^18 is performed, the result is 0 all the time. This means, the identicon will render as an empty svg image.

Here is a proof-of-concept (run in any modern browser):

```js
const key = '841b625dcf75413ff3ed5137a81ff1c3';
const int = parseInt(key, 16);
const hash = int % Math.pow(2, 18);
// throws, due to floating point conversion / integer overflow
console.assert(258499 === hash, "Modulus for 'hash' should be != 0");

const int2 = parseInt(key.substr(-16), 16);
const hash2 = int2 % Math.pow(2, 18);
// works as expected
console.assert(258048 === hash2, "Modulus 'hash2' should be != 0");
```

Truncating the passed in argument to a maximum of 16 characters solves the issue.

As a sidenote, the same code in Python will work correctly:

```python
key = '841b625dcf75413ff3ed5137a81ff1c3'
int = int(key, 16)
hash = int % pow(2, 18)
assert 258499 == hash
```
2017-08-06 17:06:20 +02:00
Martin Zimmermann
c72946dc14 Run travis tests with python 3.5 & python 3.6 2017-07-30 22:38:12 +02:00
Martin Zimmermann
e3a8d0b93d fix db test with incorrect SQL id, that happened work with pre-3.6 dicts before 2017-07-30 22:22:52 +02:00
Jelmer Vernooij
39debdb011
Fix flakes errors. 2017-07-29 13:06:40 +00:00
Jelmer Vernooij
8c33a84dd3 Merge pull request #253 from jGleitz/apidoc
Update API documentation.
2017-07-23 21:46:43 +00:00
Shengbin Meng
2f7d6aa09b Merge branch 'master' into patch-1 2017-07-21 11:44:26 +08:00
Jelmer Vernooij
71bda25568 Merge pull request #312 from pellenilsson/fix-require-email
Fix require-email setting
2017-07-17 21:03:56 +00:00
Jelmer Vernooij
c8e4e74514 Merge pull request #335 from philipcmonk/time
Display only complete units of time
2017-07-17 20:51:47 +00:00
Jelmer Vernooij
afbcb6413e
Add da entry to i18n.js. 2017-07-17 20:49:56 +00:00
Jelmer Vernooij
6006cd9e82
Merge Danish translation from https://github.com/MadsRC/isso 2017-07-17 20:47:58 +00:00
Philip Monk
26f0e06e78 display only complete units of time
fixes #283
2017-07-15 18:20:02 -07:00
Jelmer Vernooij
616c61ea88 Merge pull request #291 from ivegotasthma/ivegotasthma-patch-1
fix: add missing i18n entry
2017-07-15 16:45:53 +00:00
Jeremy Tan
b14b1b51a9 validate->activate 2017-04-23 13:45:25 +02:00
Benoît Latinier
84381f4f48 add: link to the thread 2017-04-23 13:45:25 +02:00
Benoît Latinier
2adb779fef add: edit author/email/website/message 2017-04-23 13:45:25 +02:00
Benoît Latinier
e3fddf4ae8 add: orders in administration 2017-04-23 13:45:24 +02:00
Benoît Latinier
3212bf762f fix 500 error on pagination 2017-04-23 13:45:24 +02:00
Benoît Latinier
0b6a0e4d5f add: group by thread 2017-04-23 13:45:24 +02:00
Benoît Latinier
1516f56cbd fix: cursor pointer on links delete/validate 2017-04-23 13:45:24 +02:00
Benoît Latinier
7a79746f73 add: show author email 2017-04-23 13:45:24 +02:00
Benoît Latinier
0a93c866ff Add a basic admin interface (Fix issue #10)
Add a basic admin interface (Fix issue #10)

wip again

still wip

fix login page
2017-04-23 13:45:24 +02:00
benjhess
e9eebf58e3 Refactored comments unittest to work with optional gravatar feature 2017-04-02 19:48:36 +00:00
benjhess
cbd4d90cb7 Added optional gravatar support 2017-04-02 21:13:06 +02:00
Shengbin Meng
a9500e29dd Add language "zh" as alias of "zh_CN" 2017-03-28 21:56:07 +08:00
Shengbin Meng
4b7a32afac Make the Chinese translations actually work
Before this change, the user must configure `lang="zh"` to use the CN version (neither `lang="zh_CN"` nor `lang="zh_TW"` works).
2017-03-28 21:35:51 +08:00
Pelle Nilsson
45a481daeb Fix require-email setting, #308 2017-03-19 18:42:03 +01:00
Morris Jobke
f33ca31320
Highlight links by underline in comments
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2017-02-02 11:35:38 -06:00
Mads R. Havmand
cd460ef152 Danish translation 2017-01-07 19:02:00 +01:00
ivegotasthma
09b69feae9 fix: add missing i18n entry
Fixes an indexing error a user gets when he tries to make the language of isso to `bg`
2016-12-17 22:42:07 +01:00
Martin Zimmermann
5e7f010241 add persian to i18n 2016-10-12 09:32:59 +02:00
Aidin Gharibnavaz
5bd7de084f Adding Persian translation. 2016-10-07 19:56:19 +03:30
Martin Zimmermann
eeb091974d add bulgarian translation to i18n.js, #272 2016-09-20 22:16:00 +02:00