Timeouts: Add modal for forbidden actions.
commit9c653b4c6b314bc1d6a0aefdcdc5d3dacbc840d1
authorMatt Lee <matt@reddit.com>
Sun, 16 Aug 2015 19:29:25 +0000 (16 15:29 -0400)
committerxiongchiamiov <xiong.chiamiov@gmail.com>
Thu, 12 Nov 2015 23:39:17 +0000 (12 15:39 -0800)
treef1e1861665b2897b2b47f5b84cedcfa840622d36
parent90671431754e7afb49b4c13436b77cf07a9b0bc2
Timeouts: Add modal for forbidden actions.

Works similarly to the 'login-required' modal.  Links that perform actions that are
forbidden when 'in timeout' are given the 'access-required' class, which triggers
the modal if the current user is in timeout.  Some links additionally needed to have
their default click handlers edited to exit early in this case (e.g. the ynbutton's toggle function).
20 files changed:
r2/r2/lib/js.py
r2/r2/lib/pages/pages.py
r2/r2/lib/template_helpers.py
r2/r2/models/subreddit.py
r2/r2/public/static/js/action-forms.js
r2/r2/public/static/js/base.js
r2/r2/public/static/js/flair.js
r2/r2/public/static/js/gold.js
r2/r2/public/static/js/reddit.js
r2/r2/public/static/js/timeouts.js [new file with mode: 0644]
r2/r2/public/static/js/voting.js
r2/r2/templates/intimeoutinterstitial.html [copied from r2/r2/templates/sidecontentbox.html with 58% similarity]
r2/r2/templates/printable.html
r2/r2/templates/printablebuttons.html
r2/r2/templates/profilebar.html
r2/r2/templates/reddit.html
r2/r2/templates/redditheader.html
r2/r2/templates/sidebox.html
r2/r2/templates/sidecontentbox.html
r2/r2/templates/wrappeduser.html