Commit Graph

693 Commits

Author SHA1 Message Date
Martin Zimmermann
5449b0cea4 add route for comment activation 2013-11-21 10:17:42 +01:00
Martin Zimmermann
63a7df1099 translate deletion and activation links 2013-11-21 10:17:29 +01:00
Martin Zimmermann
598b08bd1c add russian translation
http://docs.translatehouse.org/projects/localization-guide/en/latest/l10n/pluralforms.html
2013-11-18 11:00:33 +01:00
Martin Zimmermann
8196f3f465 remove unnecessary imports 2013-11-17 15:49:25 +01:00
Martin Zimmermann
17aa3e6fc5 use english text for mail notifications 2013-11-17 15:44:40 +01:00
Martin Zimmermann
b9158a660c move SocketHTTPServer to isso/wsgi.py 2013-11-17 11:57:41 +01:00
Martin Zimmermann
9c94e66702 add fr.js to i18n module, appendum to #38 2013-11-17 11:28:24 +01:00
Martin Zimmermann
aeb7c35d8f override useragent's language with data-isso-lang 2013-11-17 11:27:48 +01:00
Martin Zimmermann
2e9c21db15 add X-Origin to GET requests, so isso.dispatch works on a single host 2013-11-17 11:16:46 +01:00
Martin Zimmermann
b21e216b06 mv app/fancy to /app/lib/fancy 2013-11-16 23:41:52 +01:00
Martin Zimmermann
edafc5f88f client configuration for reply-to-self
also: move data-isso-* configuration to app/config
2013-11-16 22:21:00 +01:00
Martin Zimmermann
64c0d770c6 remove edit and remove buttons when comment is marked as deleted 2013-11-16 21:42:11 +01:00
Martin Zimmermann
519112a8fc add some documentation 2013-11-16 21:41:54 +01:00
Martin Zimmermann
320cb7313f upgrade notifications for old configuration values 2013-11-16 20:54:21 +01:00
Martin Zimmermann
2446e6ac6a Merge pull request #38 from sploinga/master
French translation
2013-11-16 11:36:56 -08:00
Sploinga
5a20a4a4bf French translation 2013-11-16 20:32:21 +01:00
Martin Zimmermann
5e7ee3dffd use <link> tag to extract the relative post url, fixes #37
The <id> tag does not necessarily contains the full URL, but also
relative URLs:

    <id>http://example.com/foo/bar.html</id>
    <id>/foo/bar.html</id>
    <id>foo/bar.html</id>
2013-11-16 20:30:48 +01:00
Martin Zimmermann
0be3c69e1d Merge branch 'fix/spam-guard' 2013-11-13 21:30:23 +01:00
Martin Zimmermann
d4e7ee134d add option reply-to-self, defaults to false 2013-11-13 21:20:32 +01:00
Martin Zimmermann
9f2062a900 fix #35
Also add an option `direct-reply` to control the number of comments
on a thread without referencing a child (to avoid a simple while loop
that `curl -XPOST ...` the url).

Defaults to 3, that means a /24 (or /48 for IPv6) address can only post
3 direct responses on a thread at all.
2013-11-13 20:42:56 +01:00
Martin Zimmermann
5cbda11158 Merge branch 'fix/bloomfilter' 2013-11-13 20:08:08 +01:00
Martin Zimmermann
6178e93348 add database migration
Clear voters bloomfilter and initialize with an (almost) empty one.
2013-11-13 20:07:23 +01:00
Martin Zimmermann
58645ca945 do not reference bytearray in a method definition, fixes #5
This is a severe issue which makes the current voters bloomfilter
completely useless. Functions are first-class objects in Python, which
lead to interesting "issues" like:

    >>> def foo(x=[]):
    ...     x.append(1)
    ...     print x
    ...

    >>> foo()
    [1]

    >>> foo()
    [1, 1]

For Isso, this means the bloomfilter, which is usually only initialized
with the author's IP address, is now initialized with pretty much all
ip addresses from previous authors, thus makes it impossible for the
author to vote on other's people comments.
2013-11-13 20:07:18 +01:00
Martin Zimmermann
dfed955f23 Merge branch 'feature/migration' 2013-11-11 12:10:42 +01:00
Martin Zimmermann
d4f2123b58 Merge branch 'tmp/refactorization'
Conflicts:
	isso/utils/__init__.py
2013-11-11 12:10:29 +01:00
Martin Zimmermann
6e85c54a2e refactor views and introduce an API for notifications
Keep Isso modular, not monolithic. Make it easy to integrate a
web interface or add XMPP notifications.

This refactorization includes minor bugfixes and changes:

* CORS middleware did not work properly due to wrong unit tests
* more type checks on JSON input
* new detection for origin and public url, closes #28
* new activation and delete url (no redirect for old urls, but you can
  convert the old urls: copy hash after `/activate/` (or delete) and
  open `/id/<id of comment>/activate/<hash>`
* move crypto.py to utils/

With this commit, SMTP is no longer automatically configured: add
`notify = smtp` to the `[general]` section to use SMTP.
2013-11-11 12:09:19 +01:00
Martin Zimmermann
162fe78aa6 ask to continue import if DB is not empty 2013-11-11 12:02:49 +01:00
Martin Zimmermann
5ca3137ddd add --dry-run option to import command 2013-11-11 11:57:31 +01:00
Martin Zimmermann
a8cd418b5e remove website todo, not a high priority 2013-11-11 11:45:12 +01:00
Martin Zimmermann
850b2b4bfb set mode to 4 (deleted) when isDeleted is true 2013-11-11 11:44:32 +01:00
Martin Zimmermann
8c0af3b10f show orphan comments after Disqus import (if any)
An orphan comment is exported by Disqus but its thread id is
non-existent (probably deleted, moved). Usually from the earlier
days (or WordPress migration).

It is not possible to get the thread without manual intervention (
aka SQLite insertions).
2013-11-11 11:34:13 +01:00
Federico Ceratto
68be70af24 Support Python2 ipaddr library. 2013-11-09 15:32:25 +00:00
Martin Zimmermann
a442b8e0ee remove dead code 2013-11-08 19:03:08 +01:00
Martin Zimmermann
ab5d907172 move comments.requires to views package 2013-11-08 19:00:01 +01:00
Martin Zimmermann
1174259b27 mv comment -> comments 2013-11-08 18:55:02 +01:00
Martin Zimmermann
ac8d987392 don't monkeypatch if uwsgi is available 2013-11-06 18:10:09 +01:00
Martin Zimmermann
6f3a2d8072 add an option to prevent Isso from appending the default CSS, closes #29 2013-11-06 17:46:04 +01:00
Martin Zimmermann
c06c11aeca api.js parses custom data attributes for client configuration, part of #29
All data-attributes beginning with `data-isso-` are stored in
`api.config` (without leading data-isso-). Isso tries to parse
the values with JSON (e.g. `-isso-foo="false"` returns false)
and falls back for a simple string value.
2013-11-06 17:39:14 +01:00
Martin Zimmermann
4bb6e91f61 Isso can now listen on unix domain sockets, closes #25
This also changes the server configuration from `host` and `port`
to `listen = http://localhost:8080`.
2013-11-06 16:55:14 +01:00
Martin Zimmermann
6374d8a9e1 fix application profiling 2013-11-05 23:36:52 +01:00
Martin Zimmermann
0a247a7927 data-isso-prefix is now ony data-isso 2013-11-05 23:35:38 +01:00
Martin Zimmermann
33fb15e241 rename data-prefix to data-isso 2013-11-05 14:25:43 +01:00
Martin Zimmermann
af6695e935 lowercase MiddleWare and fix TypeError in Headers 2013-11-05 14:03:46 +01:00
Martin Zimmermann
4950e7dd4d add unittest for CORS headers 2013-11-05 13:08:21 +01:00
Martin Zimmermann
aa6665c8f0 fix endpoint detection when using require.js 2013-11-05 12:44:31 +01:00
Martin Zimmermann
8d1171df29 improve request decoding and json parsing 2013-11-05 12:44:16 +01:00
Martin Zimmermann
6691810316 handle cross-origin cookies with a custom header X-Set-Cookie, fix #24
Cookies set from a different domain can not be read by JS executed in
the current domain. As a workaround, Isso sends both a Set-Cookie and
X-Set-Cookie header. The former is used by the browser to make the
HTTP request to the API, the latter is read by `embed.min.js` to
determine if a comment can be edited or deleted.

When a comment is deleted, the server sends an expired cookies in
Set-Cookie and X-Set-Cookie.
2013-11-05 12:36:29 +01:00
Martin Zimmermann
05c8b571e2 requirejs-text now uses CORS XHR requests to static files 2013-11-05 01:11:53 +01:00
Martin Zimmermann
6126f0ec6f add CORS middleware to add CORS header to *all* requests 2013-11-05 01:11:28 +01:00
Martin Zimmermann
e14a04ab6c support for werkzeug 0.8 (Python2-only) 2013-11-04 01:13:29 +01:00
Martin Zimmermann
312578457b uwsgi can only cache bytes 2013-11-03 18:55:23 +01:00
Martin Zimmermann
cc2ac11850 inline CSS 2013-11-03 18:55:23 +01:00
Martin Zimmermann
d8a254c304 fix api endpoint detection 2013-11-03 18:55:20 +01:00
Martin Zimmermann
d59fc2ef8e handle OPTIONS request and return CORS headers 2013-11-03 15:18:04 +01:00
Martin Zimmermann
c581e0f05a cache email hash on comment creation 2013-11-03 12:39:51 +01:00
Martin Zimmermann
c567758d81 limit email length to 254 to avoid hash-DDoS 2013-11-03 12:35:33 +01:00
Martin Zimmermann
0473afe2db add profiling option to server configuration 2013-11-03 12:32:38 +01:00
Martin Zimmermann
3c193bef27 request remote_addr only when using the comment form 2013-11-02 18:41:00 +01:00
Martin Zimmermann
7e73986667 remove trailing slash from API endpoint, appendum to 8da9d0b 2013-11-02 18:39:40 +01:00
Martin Zimmermann
375b32a151 Merge branch 'feature/data-attributes' 2013-11-02 18:28:42 +01:00
Martin Zimmermann
8da9d0b13b override API location with data-prefix="..." 2013-11-02 18:26:33 +01:00
Martin Zimmermann
0d07515c18 override HTML title parsing with a data-title="... attribute
If you don't use a <h1> to markup your post's title (but h2), it
is no longer possible to reliable detect the site's title.

E.g. you have a single page with only one <h1> and that's the
*real* title of that page. But on the other hand, it is also
possible, that the <h1> tag is just your website's name and the
actual post title is marked up in <h2>.
2013-11-02 18:21:27 +01:00
Martin Zimmermann
fa496669e2 use lowercase [smtp] as written in the docs 2013-11-02 17:38:01 +01:00
Martin Zimmermann
54413dfcf3 add copyright header to embed.js (and it's MIT not BSD) 2013-11-02 15:31:17 +01:00
Martin Zimmermann
c5d52721c4 use cache.delete a) with an actual key and b) only on delete 2013-11-01 17:02:08 +01:00
Martin Zimmermann
2b7d263735 only create a reply box when needed
Previously this led to unnecessary object creation which impacted the
rendering time (on my machine 200 comments -> 1200ms) just to create
the postbox per comment (just the object initialization)).
2013-11-01 15:25:44 +01:00
Martin Zimmermann
cac4694f43 cache PBKDF2 hash, closes #18
Markdown conversion is not the reason for 2s per 100 comments response,
the hash function is. When using the email/remote_addr from cache, the
response time is pretty fast.

* when uWSGI is available, use their caching framework

* for multi-threaded environment (the default), use a simple cache
  shipped with werkzeug
2013-11-01 15:08:16 +01:00
Martin Zimmermann
74ab58167e replace abort(code) with proper exceptions and refactor request dispatch 2013-11-01 12:46:51 +01:00
Martin Zimmermann
2794734258 remove Jinja2 dependency 2013-11-01 12:26:39 +01:00
Martin Zimmermann
dea4c88162 remove admin interface fragments 2013-10-31 17:14:32 +01:00
Martin Zimmermann
2cac3f0567 detect Isso API endpoint when using *.dev.js script 2013-10-31 12:33:19 +01:00
Martin Zimmermann
e08e7be464 remove stale threads after all comments have been deleted 2013-10-31 11:08:00 +01:00
Martin Zimmermann
a658021f7e fix unittest for 1358fac and extend internal documentation 2013-10-31 10:44:46 +01:00
Martin Zimmermann
1358fac258 fix empty thread title due premature HTTP connection closing 2013-10-30 19:41:41 +01:00
Martin Zimmermann
55b6b283b8 use uWSGIs locking 2013-10-30 10:52:06 +01:00
Martin Zimmermann
9a8e0b524e build notify mail with first hostname 2013-10-30 10:06:28 +01:00
Martin Zimmermann
0c7a4e44f9 disable werkzeug connection log 2013-10-30 10:06:09 +01:00
Martin Zimmermann
1518bae5ba IE10 does not support classList on SVG elements m( 2013-10-30 00:24:32 +01:00
Martin Zimmermann
32f83160d6 config.js is not necessary in post.html 2013-10-29 23:12:44 +01:00
Martin Zimmermann
5689143c4a remove button no longer resets after 1.5s, part of #17 2013-10-29 18:46:08 +01:00
Martin Zimmermann
bbccfe9def include post.html in snapshot release and remove old css 2013-10-29 17:17:52 +01:00
Martin Zimmermann
876dd402a6 remove bootstrap 2013-10-29 17:07:25 +01:00
Martin Zimmermann
84da660ca9 update sample post 2013-10-29 17:06:46 +01:00
Martin Zimmermann
c3b6e0319e use SVG to render identicon so the browser can auto-resize the image
Temporary fix for websites with small width, where the identicon
overlaps with the textarea field.
2013-10-29 16:58:38 +01:00
Martin Zimmermann
b672dae624 allow multiple hosts, e.g. HTTP and HTTPS sites 2013-10-29 12:22:13 +01:00
Martin Zimmermann
cb40c7ca42 improve doctests and refactor title extraction 2013-10-29 12:01:45 +01:00
Martin Zimmermann
89b1ca8846 doctests for utils.anonymize(remote_addr) 2013-10-27 13:58:50 +01:00
Martin Zimmermann
527b349fbe use python's logging module 2013-10-27 13:40:18 +01:00
Martin Zimmermann
11293a504b utils.parse now returns a triple (host, port, ssl) 2013-10-27 12:48:34 +01:00
Martin Zimmermann
acbf42f89d fix SMTP connectivity test, appendum to a8d0670 2013-10-27 12:47:48 +01:00
Martin Zimmermann
94b1fef28e rewrite CONFIGURATION.md in reST and extend document 2013-10-27 12:44:59 +01:00
Martin Zimmermann
2db98d0d34 move http utils in separate module 2013-10-24 14:38:43 +02:00
Martin Zimmermann
48b4c9f9a5 purge comments in moderation queue after given time, closes #13 2013-10-24 14:38:40 +02:00
Martin Zimmermann
a8d0670db7 fix PEP-8 minors 2013-10-24 11:56:48 +02:00
Martin Zimmermann
4f5b247ed1 delete comments via mail 2013-10-21 17:40:03 +02:00
Martin Zimmermann
5b52cbdfa6 skip empty Disqus threads 2013-10-19 12:45:10 +02:00
Martin Zimmermann
66ade6df14 remove semantic article, header and footer tags to avoid CSS collisions 2013-10-19 11:38:16 +02:00
Martin Zimmermann
b691579bad test if #isso-thread exists 2013-10-13 23:33:06 +02:00
Martin Zimmermann
5d0cad4272 use proper email header encoding 2013-10-13 15:52:50 +02:00
Martin Zimmermann
e8d62e5db1 fix import regression from 11246f5 2013-10-13 15:34:26 +02:00
Martin Zimmermann
a2c3ecb131 remove behave.js 2013-10-13 15:06:43 +02:00
Martin Zimmermann
11246f51dc support for moderated comments, part of #13
* add moderated = true to your configuration (defaults to false)
* comment activation via email to the Isso owner
2013-10-13 15:02:42 +02:00
Martin Zimmermann
79f8c1157e show N days ago instead of previous week 2013-10-13 12:58:48 +02:00
Martin Zimmermann
61a486d2ea support for Python 3.3 2013-10-09 16:33:49 +02:00
Martin Zimmermann
f9133b984e use configparser backport to support python2.6 again 2013-10-09 15:49:12 +02:00
Martin Zimmermann
988d2032c5 replace blank identicon with ghosts 2013-10-09 15:33:31 +02:00
Martin Zimmermann
2557c02117 Merge branch 'feature/spam-guard' 2013-10-06 19:55:44 +02:00
Martin Zimmermann
1034d5016e document app/dom.js 2013-10-06 19:55:18 +02:00
Martin Zimmermann
8967fd733e hide reply button when it is not possible to reply 2013-10-06 19:46:04 +02:00
Martin Zimmermann
ab618ad898 add basic spam protection 2013-10-06 18:37:05 +02:00
Martin Zimmermann
6eab8ad5ca support for uWSGI
* naive uWSGI fallback which spawns one thread per request and
  one thread per mail notification
* uWSGI backend which utilize queues and spooling to handle
  simultanous requests and mail notifications

This also fixes a bug where N concurrent POSTs on a new topic
failed for N-1 requests (db integrity error).
2013-10-06 15:36:38 +02:00
Martin Zimmermann
9ce965440a toggle next state, when submit was succesful 2013-10-04 18:00:17 +02:00
Martin Zimmermann
0abb8ed658 remove edit and remove buttons when cookie is gone 2013-10-04 18:00:13 +02:00
Martin Zimmermann
0b8cac7f18 implement comment editing 2013-10-03 18:56:36 +02:00
Martin Zimmermann
6242d243c9 update cookie after editing a comment 2013-10-03 18:12:59 +02:00
Martin Zimmermann
75f172f4ae textarea auto resize 2013-10-03 14:17:09 +02:00
Martin Zimmermann
80e8ce7e25 more i18n 2013-10-03 13:50:30 +02:00
Martin Zimmermann
57a16acff4 use promise lib correctly 2013-10-03 13:50:30 +02:00
Martin Zimmermann
e4f9b53668 minor CSS improvement to input and submit fields 2013-10-03 13:50:27 +02:00
Martin Zimmermann
2f6f4bc338 stylesheet injection 2013-10-02 16:18:55 +02:00
Martin Zimmermann
de25af5467 exclude svgs from count.min.js 2013-10-02 16:18:35 +02:00
Martin Zimmermann
fd18ea9eab split i18n messages 2013-10-02 16:17:25 +02:00
Martin Zimmermann
ef463eb517 API endpoint detection for count.min.js 2013-10-02 16:16:08 +02:00
Martin Zimmermann
a7cc1cdf4d move scss to isso/css/ 2013-10-02 16:15:43 +02:00
Martin Zimmermann
b1e33bdce5 split 3rd-party packages to vendor and components
Then, use bower to fetch components and put libraries not
available as (web) component into vendor/.

Move crypto parts and identicon generation modules into app/lib.
2013-10-02 14:26:06 +02:00
Martin Zimmermann
b36e2fdb28 COMMIT ALL THE THINGS
* refactor JS (a lot)
* use a CSS framework (neat/bourbon), because CSS is hard
* up/downvote comments
* cleaner HTML
* HTML inclusion in JS
* SVG icons for reference, up and downvote
* basic i18n: english and german supported ootb
* lazy (because slow) client-side identicon generation (preview ability)
* removed website input field for no particular reason
* remove HTML.js in favour of a homebrew DOM manipulation tool
2013-10-01 14:47:01 +02:00
Martin Zimmermann
4f03b3faf9 re-license to MIT 2013-09-19 18:44:40 +02:00
Martin Zimmermann
560e73cc0a rewrite db backend 2013-09-19 18:44:37 +02:00
Martin Zimmermann
52f64dd26f improve url exists detection for new comment threads 2013-09-13 19:52:53 +02:00
Martin Zimmermann
30fa254023 connect to SMTP on-demand 2013-09-13 19:51:56 +02:00
Martin Zimmermann
98ab6d205a anonymize IP if passed as ::ffff.1.2.3.4 correctly 2013-09-13 18:30:51 +02:00
Martin Zimmermann
88a7d40bea send null instead of the empty string 2013-09-13 18:24:24 +02:00
Martin Zimmermann
b744e2fe39 use SSL for https:// 2013-09-13 18:12:32 +02:00
Martin Zimmermann
3eeb686d5f update stylesheet link 2013-09-13 16:15:14 +02:00
Martin Zimmermann
2ee47bd902 return 404 when creating a comment for a non-existing URI 2013-09-13 16:14:13 +02:00
Martin Zimmermann
021b672ee2 use only first 3 bytes from an IPv6 address 2013-09-13 16:13:45 +02:00
Martin Zimmermann
7ed5d6461e add ProxyFix WSGI middleware for real IP and remove dead code 2013-09-13 16:13:08 +02:00
Martin Zimmermann
adb3d40c03 send notification for new comments
This commit also introduces a new db which maps path to thread title.
The title is read by parsing the HTML for a related <h1> tag using
`html5lib`.

You can set up SMTP in your configuration (here the defaults):

    [SMTP]
    host = localhost
    port = 465
    ssl = on
    username =
    password =
    recipient =
    sender =

In short, by default Isso uses a local SMTP server using SSL without
any authentication. An email is send on comment creation to "recipient"
from "Ich schrei sonst <sender>".

This commit also uses a simple ANSI colorization module from my static
blog compiler project.

On server startup, Isso will connect to the SMTP server and fall back to
a null mailer. It also tries to connect to your website, so if that
doesn't work, you probably can't comment on your website either.
2013-09-13 15:21:18 +02:00
Martin Zimmermann
9edd34d079 fix typos 2013-09-12 19:20:31 +02:00
Martin Zimmermann
0f7516edb4 always announce CORS, fix 3218e16 2013-09-12 19:10:38 +02:00
Martin Zimmermann
27022af1e6 update README, added docs/API.md draft 2013-09-12 19:10:03 +02:00
Martin Zimmermann
5759513fcd remove old stuff and trim output from utils.heading 2013-09-12 17:28:44 +02:00
Martin Zimmermann
27ba6d795f extend utils.ago to handle dates beyond 31 days 2013-09-12 17:28:13 +02:00
Martin Zimmermann
63f03e1111 disqus import now sets the comment creation date correctly 2013-09-12 17:27:16 +02:00
Martin Zimmermann
3218e16532 add CORS support
Isso can now run on a separate domain such as comments.example.org
and still serve for blog.example.org using CORS.
2013-09-12 17:26:10 +02:00
Martin Zimmermann
45d4e18aef new /count?uri=path and count.js
A separate (minified) JS to load only the comment count for each
`<a href="...#isso-thread">...</a>` link. If there are no comments,
return a 404, otherwise return the number JSON formatted.

To built `count.ks`, run `r.js -o build.count.js`.
2013-09-12 17:22:37 +02:00
Martin Zimmermann
1105e3e016 don't shrink textarea on blur 2013-09-12 12:28:53 +02:00
Martin Zimmermann
10c65561ed mv /client to /js 2013-09-12 11:46:09 +02:00
Martin Zimmermann
83f7c0201f use almond.js for single file output 2013-09-09 14:44:04 +02:00
Martin Zimmermann
88b77ffa2d show markdown by default 2013-09-09 14:14:27 +02:00
Martin Zimmermann
b65b86d664 fix german utils.ago strings 2013-09-09 14:14:10 +02:00
Martin Zimmermann
9484a8fa6f add heading 'Kommentieren' etc. 2013-09-09 14:13:34 +02:00
Martin Zimmermann
18ebf6f95a disable threading, use processes 2013-09-09 14:13:05 +02:00
Martin Zimmermann
3037f5926d clean imports and remove old code 2013-09-09 13:37:57 +02:00
Martin Zimmermann
56ea90d7e0 JavaScript Identicons (awww), closes #8 2013-09-09 13:27:35 +02:00
Martin Zimmermann
bebda530b6 clear comment that still has references 2013-09-09 13:24:47 +02:00
Martin Zimmermann
413fb0c9a6 automatically update time(ago) every minute 2013-09-09 13:24:03 +02:00
Martin Zimmermann
fa277c98c1 disable scrollIntoView 2013-09-09 13:23:18 +02:00
Martin Zimmermann
20f82dcfcd fix disqus import 2013-09-08 17:37:26 +02:00
Martin Zimmermann
aecab5cf01 scoll into view 2013-09-08 17:24:54 +02:00
Martin Zimmermann
f0c1574c15 remove stale comments from DB, closes #9 2013-09-08 17:21:33 +02:00
Martin Zimmermann
f1ffe444bc don't remove root msg box on submit, but clear fields 2013-09-08 14:17:46 +02:00
Martin Zimmermann
449c838be3 REMOTE_ADDR is not unicode 2013-09-08 14:13:17 +02:00
Martin Zimmermann
5cad8fb8b5 clean db interface and comment model 2013-09-08 13:02:25 +02:00
Martin Zimmermann
c7ee35423b implement db backend for votes/likes #5 2013-09-06 17:19:25 +02:00
Martin Zimmermann
11c6e4d720 remove email column 2013-09-06 15:56:43 +02:00
Martin Zimmermann
59706815e7 add comment.hash to recognize user by email or ip fallback
also: fixed test_comment json.dumps(json.loads(json.dumps(...)))
madness.
2013-09-05 23:09:56 +02:00
Martin Zimmermann
35926037a6 fix tests 2013-09-05 21:13:33 +02:00
Martin Zimmermann
f6271e5cf6 commit work in progress
completely revamp JS client because JS sucks^W^W^W to feature AMD,
require.js, promises and HTML.js.

The comment listing is now more like Disqus and for now comment
retrieval, comment creation and deletion works. Form validation is
rudimentary implemented as well.

replaced Mako with Jinja2 (because... I forgot.), admin interface will
use Bootstrap™ but is not functional yet.

features a progress indicator in case you're sqlite db performs *really*
bad
2013-09-05 19:31:18 +02:00
Martin Zimmermann
7e6fa0438b use argparse and configparser 2013-09-03 13:40:40 +02:00
Martin Zimmermann
2d075f867a move code around™ 2013-09-03 12:15:43 +02:00
Martin Zimmermann
cb20f159fb add bootstrap 2.3.2 2013-09-02 14:58:07 +02:00
Martin Zimmermann
dd4ba9263a refactor all the things (use werkzeug instead of NIH to handle WSGI)
Also: use ?uri=%2Fpath%2F as path indicator.
2013-09-02 14:44:53 +02:00
Martin Zimmermann
76d6d46521 add progress bar to migration 2013-09-02 14:22:08 +02:00
Martin Zimmermann
57fa577e54 whatever I made there 2013-09-01 23:40:55 +02:00
posativ
26c74cb521 admin.js now used isso.js as API
JS is a horrible language. The more you try to modularize and DRY
it, the greater the LoC grows...
2012-12-17 00:06:46 +01:00
posativ
261f2fe18e introduce namespaces for JS and trying to escape the pyramid of doom 2012-12-16 23:29:07 +01:00
posativ
525a2828c5 fix Makefile and move utilities to js/utils.js 2012-12-16 20:29:18 +01:00
posativ
a753045f8b some documentation and move login to /admin/ 2012-12-16 19:54:56 +01:00
posativ
588a8c306b approved comments now move to recent comments 2012-12-16 18:13:03 +01:00
posativ
65c2fce636 better admin 'theme', 304 Not Modified support and minor improvements 2012-12-16 17:59:20 +01:00
posativ
eaaf1f4653 moar syntactic sugar 2012-12-16 13:38:24 +01:00
posativ
8e2e90ed4e add threaded WSGI server mixin to check URL existence on same host :> 2012-12-16 00:46:20 +01:00
posativ
63b990838d fix tests 2012-12-16 00:31:55 +01:00
posativ
a4514e1f91 rewrite using NIH 2012-12-16 00:14:30 +01:00
posativ
440787ff67 fix Augenkrebs in dashboard 2012-10-28 00:57:31 +02:00
posativ
28162d7ca9 edit comment works when comment is still pending 2012-10-28 00:50:09 +02:00
posativ
2e1831f609 show pending status, add some css 2012-10-28 00:39:23 +02:00
posativ
1bafe193ad approve comments 2012-10-28 00:39:22 +02:00
posativ
23232d4f0e fix admin.js 2012-10-28 00:39:22 +02:00
posativ
5d15ab0ea3 use highly sophisticated '2 weeks ago' dates including microformats 2012-10-28 00:39:20 +02:00
posativ
c7d4b5a071 use promise.js -> less code, less indentation, 2 kb less framework 2012-10-25 23:26:20 +02:00
posativ
6f4b02ab12 show deleted comments when they are referenced 2012-10-25 20:45:22 +02:00
posativ
35310300ac add 'edit comment' functionality. Use with care. 2012-10-25 20:09:12 +02:00
posativ
b4708fb284 modify can return plain text and marked up content 2012-10-25 20:08:28 +02:00
posativ
db32d1c7f0 refactor JS and add YUI compression. 2012-10-25 16:20:50 +02:00
posativ
66cc7911f5 limit to 20 by default 2012-10-24 23:56:52 +02:00
posativ
6bb7b8c8d9 admin interface can delete comments :> 2012-10-24 23:22:39 +02:00
posativ
15ead12683 I can't still remember what ASC and DESC means 2012-10-24 20:38:39 +02:00
posativ
7420e6a130 add path to comment class 2012-10-24 20:38:07 +02:00
posativ
05b77f99fe add db.recent(mode, limit) method 2012-10-24 20:09:22 +02:00
posativ
2bfbad39ca begin dashboard using mako templates 2012-10-24 19:53:56 +02:00
posativ
39899dda81 /comment/ -> /1.0/ 2012-10-23 21:09:51 +02:00
posativ
ac6d88f61e isso import FILE can import Disqus export 2012-10-23 20:36:43 +02:00
posativ
ecd4c6b120 fix an edge case, where mallory can delete comments by bo 2012-10-23 16:40:30 +02:00
posativ
3459b7b9ee delete comment works for non-referenced comments now 2012-10-22 00:44:22 +02:00
posativ
d9a9eaf8c5 zero-fill date and add cookie recognition 2012-10-22 00:12:05 +02:00
posativ
10b1b1b470 use unique cookie name 2012-10-21 23:40:47 +02:00
posativ
ae96122ea1 fix issues caused by @moschlar 2012-10-21 23:30:40 +02:00
posativ
d2bc2537a1 remove limit, introduced unnecessary complexity 2012-10-21 22:37:39 +02:00
posativ
3b197c4c3c close form after reply 2012-10-21 22:34:48 +02:00
posativ
d6e4312e47 threaded comments :> 2012-10-21 22:26:05 +02:00
posativ
eee2e43588 refactor and re-indentation 2012-10-21 21:57:36 +02:00
posativ
63f3d6ff2f add date formatting and link to website 2012-10-21 21:05:56 +02:00
posativ
a15338209b basic XSS protection m) 2012-10-21 11:47:57 +02:00
posativ
443eb2bbe1 fix tests 2012-10-21 09:51:32 +02:00
posativ
487d76ba61 add API for different markup languages 2012-10-20 18:12:02 +02:00
posativ
9aeed1a47e client-side draft using qwery, bean, bonzo and domReady 2012-10-20 17:57:01 +02:00
posativ
efa334de39 markdown support (using misaka) 2012-10-20 17:55:29 +02:00
posativ
d30c3c059b sort in chronological order 2012-10-19 21:12:56 +02:00
posativ
f2eff22ff7 circumvent CGI 1.1 specs (PATH_INFO is quoted) 2012-10-19 18:58:55 +02:00
posativ
3cb623e7c2 check if url exists before creating a comment 2012-10-18 16:16:36 +02:00
posativ
2c8c97b2a8 add db.activate function and use UNIX-style permission bits for normal/activated/deleted comments 2012-10-18 15:41:12 +02:00
posativ
f1fb80f5ef add license decoration 2012-10-18 15:05:54 +02:00
posativ
05336728f4 use itsdangerous 2012-10-17 22:43:51 +02:00
posativ
759b304cb5 refactor configuration variables 2012-10-17 18:32:53 +02:00
posativ
27801eef26 delete only when not referenced 2012-10-17 12:22:52 +02:00
posativ
af8fcdab19 most database operations now return Comment object 2012-10-17 12:00:11 +02:00
posativ
3d398341a3 update database requirements 2012-10-17 11:42:21 +02:00
posativ
e2198ed74a add update and delete views 2012-10-17 11:06:26 +02:00
posativ
1b2b4da490 fix db update 2012-10-17 10:56:43 +02:00
posativ
27007547bb return 404 if none found 2012-10-16 22:56:21 +02:00
posativ
5d23bff409 clean json fuckup and add create and get views 2012-10-16 22:52:02 +02:00
posativ
8301f0af78 replace db.initialize with db.__init__ 2012-10-16 21:30:30 +02:00
posativ
98c4b6ccb2 move Comment class to isso.models 2012-10-16 21:07:29 +02:00
posativ
36add653a7 change modified timestamp after update 2012-10-16 21:04:20 +02:00
posativ
633b0bee33 add update, get and delete methods to SQLite adapter 2012-10-16 21:00:10 +02:00
posativ
48cff63d4c add Comment.fromjson and update table definitions 2012-10-16 20:20:59 +02:00
posativ
3bb830e86c add mode for comments (normal, pending, deleted) 2012-10-16 19:42:51 +02:00
posativ
54548d4bd5 docs and input sanitization 2012-10-16 19:32:55 +02:00
posativ
1199424a2b add basic SQLite adapter + tests 2012-10-16 19:11:59 +02:00
posativ
0333f7efb0 first tests and general code layout 2012-10-16 16:18:07 +02:00
posativ
7d905ed4ea initial commit 2012-10-16 15:45:02 +02:00