Commit 270bbc7d authored by Sacha's avatar Sacha
Browse files

fixes error notifications, cleans up account page in light of new issue...

fixes error notifications, cleans up account page in light of new issue reporter for all 2PITAU projects, & minor design changes.
parent 62329327
......@@ -23,6 +23,7 @@ import time
import db
import forms
from digest import digest
from error import UsageError
ANON_UNAME = 'bourbaki@illinois.edu'
......@@ -52,15 +53,9 @@ def handle_404(error):
@application.errorhandler(500)
def handle_500(error):
app.logger.exception(error)
import twilio
from twilio.rest import TwilioRestClient
from flask import jsonify
from error import UsageError
client = TwilioRestClient(TWILIO_SID, TWILIO_AUTH_TOKEN)
client.messages.create(body='problem on Linode: %s' % repr(error),
to=ADMIN_PHONE,
from_='+19085437718')
application.logger.exception(error)
from send_mail import send_mail
send_mail('500', repr(error))
raise UsageError('our-fault', status_code=500)
......
APP_NAME = 'CONTROVERSY'
DB_HOST = 'localhost'
DB_PORT = 3306
DB_NAME = 'controversy'
......@@ -5,17 +6,17 @@ DB_PASSWORD = 'pwd' # probably REQUIRED change
DB_USER = 'root' # maybe REQUIRED change
MONGO_PORT = 27017
SECRET_KEY = '23jlvafi23josdnnaDFASs' # should change if deployed publically
TWITTER_KEYS = ['twitter api'] # REQUIRED change. If you train, you'll need a few more key/secret pairs
TWITTER_KEYS = ['', '', ''] # REQUIRED change. If you train, you'll need a few more key/secret pairs
TWITTER_SECRETS = ['twitter api secret'] # REQUIRED change
NYT_ARTICLE_SEARCH_KEY = 'nyt article search key' # REQUIRED change
NYT_COMMUNITY_KEYS = ['nyt community api key'] # REQUIRED change
NYT_UA = 'Mozilla/5.0' # optional change
REDIS_HOST = 'localhost'
REDIS_PORT = '6378'
TWILIO_SID = 'twilio key' # optional change
TWILIO_AUTH_TOKEN = 'twilio auth key' # optional change
ADMIN_PHONE = '+1911' # optional change
ADMIN_EMAIL = 'you@riseup.net' # change
CAPTCHA_PUBLIC = 'reCAPTCHA key' # optional change
CAPTCHA_PRIVATE = 'reCAPTCHA secret key' # optional change
TOR_PW = 'PW_FOR_TOR' # change if scraper is blacklisted
SMTP_BOT_SENDER = 'likely-no-reply@2pitau.org' # change
SMTP_BOT_SENDER_PW = 'password' # change
DEBUG = True # should change if deployed publically
......@@ -15,7 +15,8 @@ sr = redis.StrictRedis(host=REDIS_HOST, port=REDIS_PORT)
def perform(keyword, training=False):
"""Provide ``keyword`` for content retrieval, scoring.
"""
articles = article_search(keyword, training=training)
articles = article_search(repr(keyword), training=training)
print('=================> (%s)' % repr(keyword))
if len(articles) == 0:
raise UsageError('no-articles', status_code=200)
......
......@@ -6,7 +6,6 @@ requests_oauthlib
oauthlib==0.7.2
redis
flask
twilio
textblob
flask-wtf
nltk
......
from config import SMTP_BOT_SENDER, SMTP_BOT_SENDER_PW, ADMIN_EMAIL, APP_NAME
import smtplib
from email.mime.text import MIMEText
SMTP_SERVER = 'smtp.2pitau.org'
SMTP_PORT = 587
def send_mail(subj, body):
msg = MIMEText('''%s
(you're receiving this from a 2PITAU mailbot.
Forward this message---and provide your address---to
postmaster@2pitau.org to unsubscribe.)''' % body)
msg['Subject'] = '[%s] %s' % (APP_NAME, subj)
msg['From'] = SMTP_BOT_SENDER
msg['To'] = ADMIN_EMAIL
smtp = smtplib.SMTP(SMTP_SERVER, SMTP_PORT)
smtp.login(msg['From'], SMTP_BOT_SENDER_PW)
ret = True
try:
smtp.sendmail(msg['From'], msg['To'], msg.as_string())
except:
ret = False
finally:
smtp.quit()
return ret
This diff is collapsed.
......@@ -3,28 +3,30 @@
@import 'alert';
main { padding: 4em 1em; }
ul {
margin: 10px 10px 4em 10px;
list-style: square;
li { margin-left: 20px; }
p {
float: right;
text-align: right; }
margin: 10px 10px 4em 10px;
list-style: square;
li { margin-left: 20px; }
p {
float: right;
text-align: right;
}
}
h2 {
border-bottom: 1px dashed $grey;
padding: 5px;
font-variant: small-caps;
font-weight: 400; }
border-bottom: 1px dashed $grey;
padding: 5px;
font-variant: small-caps;
font-weight: 400;
}
ul.issues_list {
list-style: none;
list-style: none;
}
form {
padding: 5px;
border: 1px solid #e9e9e9;
display: inline-block;
#bug b { color: $mad; }
input { color: $warn; }
padding: 5px;
border: 1px solid #e9e9e9;
display: inline-block;
#bug b { color: $mad; }
input { color: $warn; }
}
@media (max-width: 650px) {
input { display: block; }
input { display: block; }
}
This diff is collapsed.
html,ul,body,header,input,span,form{margin:0;padding:0;border:0;font-size:100%;font:inherit;vertical-align:baseline;-webkit-text-size-adjust:100%}body{font-family:"Libre Baskerville","Palatino","Garamond",serif;font-variant-numeric:slashed-zero;text-rendering:optimizeLegibility;font-size:.9em;word-wrap:break-word}.logo,h1,h2,h3,h4,h5{font-family:"Linux Biolinum","Zapf Humanist 601","Optima","Nunito Sans",sans-serif}.collective_logo{padding:2px;font-weight:bold}.collective_logo:hover{color:#fff;background:#ed0000;text-decoration:none;border:none}input,.sans{font-family:"Nunito Sans","Calibri",sans-serif}.logo,h1,h2,h3,h4,h5{font-weight:700 !important}h1,h2,h3,h4,h5{text-transform:uppercase}h1{font-size:130%}h2{font-size:110%}h3{font-size:90%}h4{font-size:75%}h5{font-size:60%}input{outline:0;box-shadow:none;-webkit-tap-highlight-color:transparent}img{max-width:100%;height:auto;margin:auto}a{-webkit-tap-highlight-color:transparent;text-decoration:none;color:inherit;border-bottom:1px dotted;line-height:130%;word-wrap:break-word}a:hover,a:active{color:#ed0000;border-bottom:1px solid;text-decoration:none}input.field{padding:6px 12px;color:#555;border-bottom:1px dashed #d9d9d9;-webkit-border-radius:1px;-moz-border-radius:1px;-ms-border-radius:1px;border-radius:1px;margin:0 auto;margin-bottom:5px;height:20px;width:70%;text-align:center}input[type=submit],a.btn{cursor:pointer;min-width:100px;height:40px;color:#333;padding:4px;outline:0;border-radius:0;-webkit-appearance:none;-webkit-transition:all .15s ease-in-out 0s;-moz-transition:all .15s ease-in-out 0s;-ms-transition:all .15s ease-in-out 0s;transition:all .15s ease-in-out 0s;background-color:#e9e9e9;border:1px solid #c3c3c3}input[type=submit]:hover,a.btn:hover{border-color:#a3a3a3}input[type=submit]:focus,input[type=submit]:active,a.btn:focus,a.btn:active{outline:0}input[type=submit]:active,a.btn:active{-webkit-box-shadow:inset 0 3px 5px rgba(0,0,0,.125);box-shadow:inset 0 3px 5px rgba(0,0,0,.125)}input[type=submit].small,a.btn.small{height:auto}a.btn{padding:.5px;min-width:0;max-height:500px;font-size:.75em;background:#fff;border-radius:2px;vertical-align:middle}input::-moz-focus-inner{border:0}footer{margin:5em 0 .5em 0;width:95%;color:#b0b0b0;font-size:12px;text-align:center}footer p{padding-top:10px;line-height:150%}div#message,div#error{position:fixed;line-height:1.3;font-size:90%;overflow:hidden;padding:3px;top:0;background-color:#a3a3a3;color:#fff;text-align:center;width:100%}div#message a,div#error a{color:#fff}div#error{background-color:#edb43a}.ns{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none}::selection{background:#fff49b}::-moz-selection{background:#fff49b}@media(max-width: 400px){div#error,div#message{font-size:smaller;opacity:.9}}ul#tweets,ul#articles{list-style:none}ul#tweets li,ul#articles li{page-break-inside:avoid;-webkit-column-break-inside:avoid;-moz-column-break-inside:avoid;-ms-column-break-inside:avoid;column-break-inside:avoid;break-inside:avoid-column}ul#tweets li div.tweet,ul#articles li div.article{background-color:#fff;border:2px solid #efefef;font-size:14px;-webkit-border-radius:2px;-moz-border-radius:2px;-ms-border-radius:2px;border-radius:2px}ul#articles{-webkit-column-gap:10px;-moz-column-gap:10px;column-gap:10px;-webkit-column-width:350px;-moz-column-width:350px;column-width:350px}ul#articles li{width:100%;margin-bottom:2em}ul#articles li div.article p{padding:5px}ul#articles li div.article a.title{padding:3px 5px 5px 5px;margin-top:5px;margin-bottom:2px;font-size:28px;display:block;border-bottom:none}ul#articles li div.article a.title:hover{color:#000}ul#articles li div.article p.url{margin:0;padding:0;border-top:1px solid #ddd;font-style:italic;text-align:right;background:#eee}ul#articles li div.article p.url a{padding:5px 0;width:100%;display:block;border-bottom:none}ul#articles li div.article p.url a:after{padding-right:5px;content:"read →"}ul#articles li div.article img{width:100%}ul#tweets{margin-top:2em;-webkit-column-width:150px;-moz-column-width:150px;column-width:150px;-webkit-column-gap:5px;-moz-column-gap:5px;column-gap:5px}ul#tweets li{width:100%;margin-bottom:5px}ul#tweets li div.tweet{padding:2px;overflow:hidden}ul#tweets li div.tweet a{color:inherit;text-decoration:none}ul#tweets li div.mad{border:2px solid #f90101}ul#tweets li div.happy{border:2px solid #00933b}footer{display:none}header{z-index:1;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;cursor:default;width:100%;height:55px;line-height:55px;background:#fff;border-bottom:1px solid #efefef;position:fixed}header a{-webkit-touch-callout:none}header > div{padding:0 15px 0 5px;display:inline}header > div a:not(.sans){font-size:12px}header > div > a.mini{display:none}header > div h1{text-align:left;display:inline;font-size:1.2em}header > div span#subtitle{opacity:.4;padding-left:5px;font-size:smaller;font-style:italic}header > div .sans{font-size:14px}header > div span#right-header{font-size:12px;float:right;padding-right:10px}header > div span#article_title{font-style:italic}header > div form{display:inline}header > div > form input{padding:6px 12px;line-height:1.5;-webkit-border-radius:2px;-moz-border-radius:2px;-ms-border-radius:2px;border-radius:2px;border-bottom:1px solid #d9d9d9;margin:0 auto;height:20px;width:30%}header input[type=text].top_loading{background:url("../img/loading.gif") no-repeat;background-position:98% 50%;background-size:20px 20px}header#sub{height:25px;line-height:25px;background:#ffecec;overflow:auto;white-space:nowrap;overflow-y:hidden;color:#ed0000;border-bottom:1px solid #efefef;position:fixed;top:56px;min-width:100%;text-align:center;font-size:smaller;font-style:italic}main{padding:4em 1em}main input.loading{background:url("../img/loading.gif") no-repeat;background-size:20px 20px;padding:10px 10px 10px 36px;background-position:10% 50%}main > form{margin-bottom:10px;text-align:center}main > form input[type=text]{margin-bottom:10px;width:275px;border-bottom:1px solid #d9d9d9}main div.featured_keywords{display:table;padding-bottom:1em;margin:0 auto}main div.featured_keywords dl.left{float:left;width:50%}main div.featured_keywords dl.right{float:right;width:50%}main div.featured_keywords dt{float:left;width:7.5em;padding:1ex .5em 0 .5em;text-align:right;font-weight:bold}main div.featured_keywords dd{margin:0 0 0 8.5em;padding:1ex .5em;text-align:left;border-left:1px solid #888}main div.featured_keywords dd span{white-space:nowrap}main ul.details{-webkit-column-break-inside:avoid;-moz-column-break-inside:avoid;-ms-column-break-inside:avoid;column-break-inside:avoid;list-style:none;margin:0 0 10px 0;padding:0}main ul.details li{display:inline}main ul.details li > span{line-height:30px;-webkit-border-radius:2px;-moz-border-radius:2px;-ms-border-radius:2px;border-radius:2px;border:1px solid #d9d9d9;padding:2px}main article{text-align:justify;line-height:150%}main article a:hover,main article a:active,main article a{border-bottom:none;color:#fff;background-color:#d53f3f}main article a{text-decoration:none;font-weight:700}main article a:hover,main article a:active{background-color:#bf3636}main article + p{-webkit-transition:all .3s ease-in-out 0s;-moz-transition:all .3s ease-in-out 0s;-ms-transition:all .3s ease-in-out 0s;transition:all .3s ease-in-out 0s;opacity:.6}main article + p img{width:20px;vertical-align:bottom}main article + p:hover{opacity:1}main mark{line-height:25px;color:#ed0000;background:#ffecec;-webkit-border-radius:2px;-moz-border-radius:2px;-ms-border-radius:2px;border-radius:2px;padding:2px}main .disabled{cursor:not-allowed;background-color:#f9f9f9}main .disabled:active{color:#fff;background-color:#edb43a}span.danger{color:#fff;background-color:#d43f3a;padding:2px;-webkit-border-radius:2px;-moz-border-radius:2px;-ms-border-radius:2px;border-radius:2px}figcaption{margin:10px 0 10px 0}@media(max-width: 700px){header#sub{font-size:12px;top:41px}.non-essentials{display:none}header{height:40px;line-height:40px}header h1{font-size:.7em}}@media(max-width: 620px){main div.featured_keywords dt{writing-mode:vertical-rl}}@media(max-width: 520px){main div.featured_keywords dl.left,main div.featured_keywords dl.right{float:none}span.danger{display:block}input[type=text].top_loading{height:40px}}@media(max-width: 415px){header > div > a.mini{display:inline}header > div > a.lg{display:none}}/*# sourceMappingURL=home.css.map */
html,ul,body,header,input,span,form{margin:0;padding:0;border:0;font-size:100%;font:inherit;vertical-align:baseline;-webkit-text-size-adjust:100%}body{font-family:"Libre Baskerville","Palatino","Garamond",serif;font-variant-numeric:slashed-zero;text-rendering:optimizeLegibility;font-size:.9em;word-wrap:break-word}.logo,h1,h2,h3,h4,h5{font-family:"Linux Biolinum","Zapf Humanist 601","Optima","Nunito Sans",sans-serif}.collective_logo{padding:2px;font-weight:bold}.collective_logo:hover{color:#fff;background:#ed0000;text-decoration:none;border:none}input,.sans{font-family:"Nunito Sans","Calibri",sans-serif}.logo,h1,h2,h3,h4,h5{font-weight:700 !important}h1,h2,h3,h4,h5{text-transform:uppercase}h1{font-size:130%}h2{font-size:110%}h3{font-size:90%}h4{font-size:75%}h5{font-size:60%}input{outline:0;box-shadow:none;-webkit-tap-highlight-color:transparent}img{max-width:100%;height:auto;margin:auto}a{-webkit-tap-highlight-color:transparent;text-decoration:none;color:inherit;border-bottom:1px dotted;line-height:130%;word-wrap:break-word}a:hover,a:active{color:#ed0000;border-bottom:1px solid;text-decoration:none}input.field{padding:6px 12px;color:#555;border-bottom:1px dashed #d9d9d9;-webkit-border-radius:1px;-moz-border-radius:1px;-ms-border-radius:1px;border-radius:1px;margin:0 auto;margin-bottom:5px;height:20px;width:70%;text-align:center}input[type=submit],a.btn{cursor:pointer;min-width:100px;height:40px;color:#333;padding:4px;outline:0;border-radius:0;-webkit-appearance:none;-webkit-transition:all .15s ease-in-out 0s;-moz-transition:all .15s ease-in-out 0s;-ms-transition:all .15s ease-in-out 0s;transition:all .15s ease-in-out 0s;background-color:#e9e9e9;border:1px solid #c3c3c3}input[type=submit]:hover,a.btn:hover{border-color:#a3a3a3}input[type=submit]:focus,input[type=submit]:active,a.btn:focus,a.btn:active{outline:0}input[type=submit]:active,a.btn:active{-webkit-box-shadow:inset 0 3px 5px rgba(0,0,0,.125);box-shadow:inset 0 3px 5px rgba(0,0,0,.125)}input[type=submit].small,a.btn.small{height:auto}a.btn{padding:.5px;min-width:0;max-height:500px;font-size:.75em;background:#fff;border-radius:2px;vertical-align:middle}input::-moz-focus-inner{border:0}footer{margin:5em 0 .5em 0;width:95%;color:#b0b0b0;font-size:12px;text-align:center}footer p{padding-top:10px;line-height:150%}div#message,div#error{position:fixed;line-height:1.3;font-size:90%;overflow:hidden;padding:3px;top:0;background-color:#a3a3a3;color:#fff;text-align:center;width:100%}div#message a,div#error a{color:#fff}div#error{background-color:#edb43a}.ns{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none}::selection{background:#fff49b}::-moz-selection{background:#fff49b}@media(max-width: 400px){div#error,div#message{font-size:smaller;opacity:.9}}ul#tweets,ul#articles{list-style:none}ul#tweets li,ul#articles li{page-break-inside:avoid;-webkit-column-break-inside:avoid;-moz-column-break-inside:avoid;-ms-column-break-inside:avoid;column-break-inside:avoid;break-inside:avoid-column}ul#tweets li div.tweet,ul#articles li div.article{background-color:#fff;border:2px solid #efefef;font-size:14px;-webkit-border-radius:2px;-moz-border-radius:2px;-ms-border-radius:2px;border-radius:2px}ul#articles{-webkit-column-gap:10px;-moz-column-gap:10px;column-gap:10px;-webkit-column-width:350px;-moz-column-width:350px;column-width:350px}ul#articles li{width:100%;margin-bottom:2em}ul#articles li div.article p{padding:5px}ul#articles li div.article a.title{padding:3px 5px 5px 5px;margin-top:5px;margin-bottom:2px;font-size:28px;display:block;border-bottom:none}ul#articles li div.article a.title:hover{color:#000}ul#articles li div.article p.url{margin:0;padding:0;border-top:1px solid #ddd;font-style:italic;text-align:right;background:#eee}ul#articles li div.article p.url a{padding:5px 0;width:100%;display:block;border-bottom:none}ul#articles li div.article p.url a:after{padding-right:5px;content:"read →"}ul#articles li div.article img{width:100%}ul#tweets{margin-top:2em;-webkit-column-width:150px;-moz-column-width:150px;column-width:150px;-webkit-column-gap:5px;-moz-column-gap:5px;column-gap:5px}ul#tweets li{width:100%;margin-bottom:5px}ul#tweets li div.tweet{padding:2px;overflow:hidden}ul#tweets li div.tweet a{color:inherit;text-decoration:none}ul#tweets li div.mad{border:2px solid #f90101}ul#tweets li div.happy{border:2px solid #00933b}footer{display:none}header{z-index:1;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;cursor:default;width:100%;height:55px;line-height:55px;background:#fff;border-bottom:1px solid #efefef;position:fixed}header a{-webkit-touch-callout:none}header > div{padding:0 15px 0 5px;display:inline}header > div a:not(.sans){font-size:12px}header > div > a.mini{display:none}header > div h1{text-align:left;display:inline;font-size:1.2em}header > div span#subtitle{color:#888;padding-left:5px;font-size:smaller;font-style:italic}header > div .sans{font-size:14px}header > div span#right-header{font-size:12px;float:right;padding-right:10px}header > div span#article_title{font-style:italic}header > div form{display:inline}header > div > form input{padding:6px 12px;line-height:1.5;-webkit-border-radius:2px;-moz-border-radius:2px;-ms-border-radius:2px;border-radius:2px;border-bottom:1px solid #d9d9d9;margin:0 auto;height:20px;width:30%}header input[type=text].top_loading{background:url("../img/loading.gif") no-repeat;background-position:98% 50%;background-size:20px 20px}header#sub{height:25px;line-height:25px;overflow:auto;white-space:nowrap;overflow-y:hidden;position:fixed;top:56px;min-width:100%;text-align:center;font-size:12px;font-style:italic;border-bottom:1px dashed #efefef;color:#888}main{padding:4em 1em}main input.loading{background:url("../img/loading.gif") no-repeat;background-size:20px 20px;padding:10px 10px 10px 36px;background-position:10% 50%}main > form{margin-bottom:10px;text-align:center}main > form input[type=text]{margin-bottom:10px;width:275px;border-bottom:1px solid #d9d9d9}main div.featured_keywords{display:table;padding-bottom:1em;margin:0 auto}main div.featured_keywords dl.left{float:left;width:50%}main div.featured_keywords dl.right{float:right;width:50%}main div.featured_keywords dt{float:left;width:7.5em;padding:1ex .5em 0 .5em;text-align:right;font-weight:bold}main div.featured_keywords dd{margin:0 0 0 8.5em;padding:1ex .5em;text-align:left;border-left:1px solid #888}main div.featured_keywords dd span{white-space:nowrap}main ul.details{-webkit-column-break-inside:avoid;-moz-column-break-inside:avoid;-ms-column-break-inside:avoid;column-break-inside:avoid;list-style:none;margin:0 0 10px 0;padding:0}main ul.details li{display:inline}main ul.details li > span{line-height:30px;-webkit-border-radius:2px;-moz-border-radius:2px;-ms-border-radius:2px;border-radius:2px;border:1px solid #d9d9d9;padding:2px}main article{text-align:justify;line-height:150%}main article a:hover,main article a:active,main article a{border-bottom:none;color:#fff;background-color:#d53f3f}main article a{text-decoration:none;font-weight:700}main article a:hover,main article a:active{background-color:#bf3636}main article + p{-webkit-transition:all .3s ease-in-out 0s;-moz-transition:all .3s ease-in-out 0s;-ms-transition:all .3s ease-in-out 0s;transition:all .3s ease-in-out 0s;opacity:.6}main article + p img{width:20px;vertical-align:bottom}main article + p:hover{opacity:1}main mark{line-height:25px;color:#ed0000;background:#ffecec;-webkit-border-radius:2px;-moz-border-radius:2px;-ms-border-radius:2px;border-radius:2px;padding:2px}main .disabled{cursor:not-allowed;background-color:#f9f9f9}main .disabled:active{color:#fff;background-color:#edb43a}span.danger{color:#fff;background-color:#d43f3a;padding:2px;-webkit-border-radius:2px;-moz-border-radius:2px;-ms-border-radius:2px;border-radius:2px}figcaption{margin:10px 0 10px 0}@media(max-width: 700px){header#sub{font-size:10px;top:41px}.non-essentials{display:none}header{height:40px;line-height:40px}header h1{font-size:.7em}}@media(max-width: 620px){main div.featured_keywords dt{writing-mode:vertical-rl}}@media(max-width: 520px){main div.featured_keywords dl.left,main div.featured_keywords dl.right{float:none}span.danger{display:block}input[type=text].top_loading{height:40px}}@media(max-width: 415px){header > div > a.mini{display:inline}header > div > a.lg{display:none}}/*# sourceMappingURL=home.css.map */
......@@ -28,7 +28,7 @@ header {
font-size: 1.2em;
}
span#subtitle {
opacity: 0.4;
color: #888;
padding-left: 5px;
font-size: smaller;
font-style: italic;
......@@ -65,18 +65,17 @@ header {
header#sub {
height: $subheader_height;
line-height: $subheader_height;
background: $mark_bg;
overflow: auto;
white-space: nowrap;
overflow-y: hidden;
color: $mark_txt;
border-bottom: 1px solid #efefef;
position: fixed;
top: $header_height + 1;
min-width: 100%;
text-align: center;
font-size: smaller;
font-size: 12px;
font-style: italic;
border-bottom: 1px dashed #efefef;
color: #888;
}
main {
......@@ -165,14 +164,14 @@ main {
}
// NYT copyright
article + p {
@include transition(.3s);
article + p {
@include transition(.3s);
img {
width: 20px;
vertical-align: bottom;
}
opacity: 0.6;
} article+p:hover { opacity: 1.0; }
opacity: 0.6;
} article+p:hover { opacity: 1.0; }
mark {
line-height: 25px;
......@@ -199,7 +198,7 @@ span.danger {
figcaption { margin:10px 0 10px 0; }
@media (max-width: 700px) {
header#sub {
font-size: 12px;
font-size: 10px;
top: $mobile_header_height + 1;
}
.non-essentials { display: none; }
......
@import'bootstrap.min.css';body{font-family:"Verdana",sans-serif;border-top:10px solid #d9d9d9;padding-top:10px}blockquote{font-size:16px}blockquote.good{background-color:#dff0d8;border-left:5px solid #3c763d}blockquote.bad{background-color:#f2dede;border-left:5px solid #a94442}.col-md-3{color:#ddd;background-color:rgba(245,245,245,.3)}div#full_article{font-size:16px}div#full_article span{cursor:pointer}div#full_article span.controversial{color:#bada55;background-color:#800}#copyright{margin-bottom:14em}.btn{font-weight:700}#full_article{text-align:justify}#bot_bar{position:fixed;z-index:1;bottom:0}#bot_bar .col-md-12{padding:8px;background-color:#eee;margin-top:8px;text-align:right;height:61px}#bot_bar .col-md-12 .pull-left{padding:8px}#bot_bar .col-md-12 .pull-left input[type=text]{width:230px;font-size:smaller;height:30px;vertical-align:middle}#error{display:none}@media(max-height: 400px){#bot_bar{position:relative}}@media(min-width: 1200px){#bot_bar{width:1170px}}@media(min-width: 992px){#bot_bar{width:970}}@media(min-width: 768px){#bot_bar{width:750}}/*# sourceMappingURL=highlight.css.map */
@import'bootstrap.min.css';body{font-family:"Verdana",sans-serif;border-top:10px solid #d9d9d9;padding-top:10px}blockquote{font-size:16px}blockquote.good{background-color:#dff0d8;border-left:5px solid #3c763d}blockquote.bad{background-color:#f2dede;border-left:5px solid #a94442}.col-md-3{color:#ddd;background-color:rgba(245,245,245,.3)}div#full_article{font-size:16px}div#full_article span{cursor:pointer}div#full_article span.controversial{color:#bada55;background-color:#800}#copyright{margin-bottom:14em}.btn{font-weight:700}#full_article{text-align:justify}#bot_bar{position:fixed;z-index:1;bottom:0}#bot_bar .col-md-12{padding:8px;background-color:#eee;margin-top:8px;text-align:right;height:61px}#bot_bar .col-md-12 .pull-left{padding:8px}#bot_bar .col-md-12 .pull-left input[type=text]{width:200px;font-size:11px;height:30px;vertical-align:middle}#error{display:none}@media(max-height: 400px){#bot_bar{position:relative}}@media(min-width: 1200px){#bot_bar{width:1170px}}@media(min-width: 992px){#bot_bar{width:970}}@media(min-width: 768px){#bot_bar{width:750}}/*# sourceMappingURL=highlight.css.map */
......@@ -43,8 +43,8 @@ div#full_article {
.pull-left {
padding: 8px;
input[type='text'] {
width: 230px;
font-size: smaller;
width: 200px;
font-size: 11px;
height: 30px;
vertical-align: middle;
}
......
......@@ -6,9 +6,9 @@ cApp.config(['cfpLoadingBarProvider', function(cfpLoadingBarProvider) {
cApp.controller('IssuesController', function($scope, $http, $location, $anchorScroll) {
$scope.issues_loaded = false;
$http.get('https://issues.2pitau.org/controversy/issues')
$http.get('https://issues.2pitau.org/controversy/issues/numopen')
.success(function(res) {
$scope.issues = res;
$scope.numopen = res.numopen;
$scope.issues_loaded = true;
if ($location.search().bug) {
$location.hash('bugs');
......
var cApp = angular.module('Home', ['ngRoute', 'ngSanitize', 'angular-loading-bar', 'ngAnimate']);
var ERROR_MESSAGES = {
'no-articles' : 'Despite our best efforts, we could not find any recently published English articles with that keyword. May we interest you in another try?',
'our-fault' : 'Well, this is awkward; we messed up. Check current bugs. We were automatically sent an SMS about this error, but please report it if it\'s an unknown problem.',
'our-fault' : 'Well, this is awkward; we messed up. Check current bugs. We were automatically sent a message about this error, but please report it if it\'s an unknown problem.',
'not-logged-in' : 'You logged out in another window or a server update was just pushed! Please refresh the page, and log in again.',
'failed-to-parse' : 'There was a malformed article result that broke this response. Please try a different keyword, and file a bug.'
};
......
......@@ -97,13 +97,8 @@ function dismiss_error() {
<ul ng-controller='IssuesController' class='issues_list'>
Known problems &hellip;
{% raw %}
<b style='color:#4cae4c' ng-show='(issues.length == 0 || res.length == 0) && issues_loaded'>none &#10003;</b>
<li ng-show='issues && issues_loaded' ng-repeat='i in res = (issues | filter : { "state": "open" })'>
<dl>
<dt><sup><i>#</i></sup> {{ i.iid }} <b>{{ i.title }}</b></dt>
<dd>{{ i.body || 'No details provided' }}<br>{{ i.assignees[0].username || 'No one'}} was assigned on {{ i.created_at | date:'medium'}}. <a class='btn' target='_blank' href='{{ i.web_url }}'>view &rarr;</a></dd>
</dl>
</li>
<b style='color:#4cae4c' ng-show='(numopen == 0) && issues_loaded'>none &#10003;</b>
<span ng-show='(numopen !== 0) && issues_loaded'><b style='color:#edb43a' >&nbsp; {{ numopen }}</b> &nbsp; <a class='btn' href='https://issues.2pitau.org/controversy'>more information &rarr;</a></span>
{% endraw %}
</ul>
</div>
......
......@@ -13,13 +13,12 @@
<blockquote class='good'>
<p>Across Russia, companies are <i>being forced</i> to prioritize patriotism over profits.</p>
</blockquote>
<p>This sentence is controversial because it expresses a value-judgement, implying strongly that <q>patriotism</q> should be subordinate to <q>profits</q>. This prioritisation is typical of (American) capitalism&mdash;much to the detriment of schools, working conditions, health, the environment, and so on&mdash;but perhaps there exists a different hierarchy in Russian capitalism. Moreover, it implies that governments should have minimal intervention in corporate affairs, which is also far from a law of nature. The choice of words puts readers on the side of the ostensibly victimised corporation. This is ideologically revealing, considering the company in question (Aeroflot) is majority owned by the Russian government (is it not a capitalist principle that shareholders dictate policy?). So, it's a value-judgement from the <i>Times</i>.</p>
<p>This sentence is controversial because it expresses a value-judgement, implying strongly that <q>patriotism</q> should be subordinate to <q>profits</q>. It implies that governments should have minimal intervention in corporate affairs, which is far from a law of nature. The choice of words puts readers on the side of the ostensibly victimised corporation. This is ideologically revealing, considering the company in question (Aeroflot) is majority owned by the Russian government; is it not a capitalist principle that shareholders dictate policy?&mdash;much to the detriment of working conditions, access to healthcare/food/housing/&hellip;. So, it's a value-judgement from the <i>Times</i>.</p>
<p>Other examples of controversial sentences:</p>
<blockquote class='good'>
<p>The abortion clinic was destroyed soon after local Catholic extremist groups expressed <i>deep-seated hatred</i> for women's rights.</p>
<p>The airline has had <i>countless</i> safety problems in the past.</p>
<p>The airline has had <i>countless</i> safety problems in the past. [Surely, they <i>can</i> be counted!]</p>
<p>Worried about unemployment and political <i>unrest</i>, the government pushed back when Avtovaz, the maker of Lada cars, <i>moved quickly to cut</i> workers as the economy slowed.</p>
<p>In 1994, a pilot <i>let</i> his 16-year-old son fly an Airbus that <i>promptly</i> crashed, killing <i>all</i> 75 aboard.</p>
<p>In 1994, a pilot <i>let</i> his <i>16-year-old</i> son fly an Airbus that <i>promptly</i> crashed, killing <i>all</i> 75 aboard.</p>
</blockquote>
<p>The following non-controversial sentence just states numbers:</p>
<blockquote class='bad'>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment