mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-28 01:56:01 -05:00
Merge branch 'master' of https://github.com/discourse/discourse
This commit is contained in:
commit
b5f3dc196e
44 changed files with 239 additions and 144 deletions
|
@ -66,7 +66,7 @@ GEM
|
|||
timers (~> 4.0.0)
|
||||
certified (1.0.0)
|
||||
coderay (1.1.0)
|
||||
connection_pool (2.1.2)
|
||||
connection_pool (2.2.0)
|
||||
crass (1.0.1)
|
||||
daemons (1.2.2)
|
||||
debug_inspector (0.0.2)
|
||||
|
@ -139,7 +139,7 @@ GEM
|
|||
jquery-rails (3.1.2)
|
||||
railties (>= 3.0, < 5.0)
|
||||
thor (>= 0.14, < 2.0)
|
||||
json (1.8.2)
|
||||
json (1.8.3)
|
||||
jwt (1.3.0)
|
||||
kgio (2.9.3)
|
||||
librarian (0.1.2)
|
||||
|
@ -270,7 +270,7 @@ GEM
|
|||
trollop (>= 1.16.2)
|
||||
redcarpet (3.2.2)
|
||||
redis (3.2.1)
|
||||
redis-namespace (1.5.1)
|
||||
redis-namespace (1.5.2)
|
||||
redis (~> 3.0, >= 3.0.4)
|
||||
ref (1.0.5)
|
||||
rest-client (1.7.2)
|
||||
|
@ -326,7 +326,7 @@ GEM
|
|||
shoulda-context (1.2.1)
|
||||
shoulda-matchers (2.7.0)
|
||||
activesupport (>= 3.0.0)
|
||||
sidekiq (3.3.2)
|
||||
sidekiq (3.3.4)
|
||||
celluloid (>= 0.16.0)
|
||||
connection_pool (>= 2.1.1)
|
||||
json
|
||||
|
|
|
@ -5,7 +5,15 @@ export default Ember.Component.extend({
|
|||
classNameBindings: ['notification.read', 'notification.is_warning'],
|
||||
|
||||
scope: function() {
|
||||
return "notifications." + this.site.get("notificationLookup")[this.get("notification.notification_type")];
|
||||
var notificationType = this.get("notification.notification_type");
|
||||
var lookup = this.site.get("notificationLookup");
|
||||
var name = lookup[notificationType];
|
||||
|
||||
if (name === "custom") {
|
||||
return this.get("notification.data.message");
|
||||
} else {
|
||||
return "notifications." + name;
|
||||
}
|
||||
}.property("notification.notification_type"),
|
||||
|
||||
url: function() {
|
||||
|
|
|
@ -7,8 +7,8 @@
|
|||
width: 100%;
|
||||
tr {text-align: left;}
|
||||
td, th {padding: 8px;}
|
||||
th {border-top: 1px solid scale-color-diff();}
|
||||
td {border-bottom: 1px solid scale-color-diff(); border-top: 1px solid scale-color-diff();}
|
||||
th {border-top: 1px solid dark-light-diff($primary, $secondary, 90%, -60%);}
|
||||
td {border-bottom: 1px solid dark-light-diff($primary, $secondary, 90%, -60%); border-top: 1px solid dark-light-diff($primary, $secondary, 90%, -60%);}
|
||||
tr:hover { background-color: darken($secondary, 2.5%); }
|
||||
tr.selected { background-color: lighten($primary, 80%); }
|
||||
.filters input { margin-bottom: 0; }
|
||||
|
@ -23,7 +23,7 @@ td.flaggers td {
|
|||
font-size: 0.857em;
|
||||
float: right;
|
||||
margin-right: 10px;
|
||||
background-color: scale-color-diff();
|
||||
background-color: dark-light-diff($primary, $secondary, 90%, -60%);
|
||||
padding: 2px 5px;
|
||||
border-radius: 5px;
|
||||
color: $primary;
|
||||
|
@ -107,7 +107,7 @@ td.flaggers td {
|
|||
.nav.nav-pills {
|
||||
li.active {
|
||||
a {
|
||||
border-color: scale-color-diff();
|
||||
border-color: dark-light-diff($primary, $secondary, 90%, -60%);
|
||||
background-color: lighten($primary, 40%);
|
||||
&:hover {
|
||||
background-color: lighten($primary, 40%);
|
||||
|
@ -198,7 +198,7 @@ td.flaggers td {
|
|||
width: 76.5765%;
|
||||
min-height: 800px;
|
||||
margin-left: 0;
|
||||
border-left: solid 1px scale-color-diff();
|
||||
border-left: solid 1px dark-light-diff($primary, $secondary, 90%, -60%);
|
||||
padding: 30px 0 30px 30px;
|
||||
}
|
||||
|
||||
|
@ -233,7 +233,7 @@ td.flaggers td {
|
|||
width: 408px;
|
||||
padding: 1px;
|
||||
background-color: $secondary;
|
||||
border: 1px solid scale-color-diff();
|
||||
border: 1px solid dark-light-diff($primary, $secondary, 90%, -60%);
|
||||
border-radius: 3px;
|
||||
box-shadow: inset 0 1px 1px rgba(51, 51, 51, 0.3);
|
||||
transition: border linear 0.2s, box-shadow linear 0.2s;
|
||||
|
@ -301,7 +301,7 @@ section.details {
|
|||
color: $primary;
|
||||
padding: 5px 10px;
|
||||
margin: 30px 0 5px 0;
|
||||
border-bottom: 5px solid scale-color-diff();
|
||||
border-bottom: 5px solid dark-light-diff($primary, $secondary, 90%, -60%);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -333,7 +333,7 @@ section.details {
|
|||
&.highlight-danger {
|
||||
background-color: scale-color($danger, $lightness: 50%);
|
||||
}
|
||||
border-top: 1px solid scale-color-diff();
|
||||
border-top: 1px solid dark-light-diff($primary, $secondary, 90%, -60%);
|
||||
&:before, &:after {
|
||||
display: table;
|
||||
content: "";
|
||||
|
@ -436,14 +436,14 @@ section.details {
|
|||
font-size: 1em;
|
||||
line-height: 16px;
|
||||
padding: 4px;
|
||||
background-color: scale-color-diff();
|
||||
background-color: dark-light-diff($primary, $secondary, 90%, -60%);
|
||||
}
|
||||
|
||||
.badge-query-plan {
|
||||
font-size: 0.857em;
|
||||
line-height: 13px;
|
||||
padding: 4px;
|
||||
background-color: scale-color-diff();
|
||||
background-color: dark-light-diff($primary, $secondary, 90%, -60%);
|
||||
}
|
||||
|
||||
.count-warning {
|
||||
|
@ -892,7 +892,7 @@ table.api-keys {
|
|||
|
||||
|
||||
.commits-widget {
|
||||
border: solid 1px scale-color-diff();
|
||||
border: solid 1px dark-light-diff($primary, $secondary, 90%, -60%);
|
||||
height: 180px;
|
||||
margin-bottom: 36px;
|
||||
|
||||
|
@ -938,7 +938,7 @@ table.api-keys {
|
|||
@extend .clearfix;
|
||||
line-height: 1.0em;
|
||||
padding: 6px 8px;
|
||||
background-color: scale-color-diff();
|
||||
background-color: dark-light-diff($primary, $secondary, 90%, -60%);
|
||||
.left {
|
||||
float: left;
|
||||
}
|
||||
|
@ -948,7 +948,7 @@ table.api-keys {
|
|||
|
||||
img {
|
||||
margin-top: 2px;
|
||||
border: solid 1px scale-color-diff();
|
||||
border: solid 1px dark-light-diff($primary, $secondary, 90%, -60%);
|
||||
padding: 2px;
|
||||
background-color: $secondary;
|
||||
}
|
||||
|
@ -983,7 +983,7 @@ table.api-keys {
|
|||
-webkit-border-radius: 3px;
|
||||
}
|
||||
::-webkit-scrollbar-track {
|
||||
border-left: solid 1px scale-color-diff();
|
||||
border-left: solid 1px dark-light-diff($primary, $secondary, 90%, -60%);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1001,10 +1001,10 @@ table.api-keys {
|
|||
margin: 0;
|
||||
|
||||
li:first-of-type {
|
||||
border-top: 1px solid scale-color-diff();
|
||||
border-top: 1px solid dark-light-diff($primary, $secondary, 90%, -60%);
|
||||
}
|
||||
li {
|
||||
border-bottom: 1px solid scale-color-diff();
|
||||
border-bottom: 1px solid dark-light-diff($primary, $secondary, 90%, -60%);
|
||||
}
|
||||
|
||||
li a {
|
||||
|
@ -1013,7 +1013,7 @@ table.api-keys {
|
|||
color: $primary;
|
||||
|
||||
&:hover {
|
||||
background-color: scale-color-diff();
|
||||
background-color: dark-light-diff($primary, $secondary, 90%, -60%);
|
||||
color: $primary;
|
||||
}
|
||||
|
||||
|
@ -1174,7 +1174,7 @@ table.api-keys {
|
|||
color: $primary;
|
||||
&:hover {
|
||||
color: $primary;
|
||||
background-color: scale-color-diff();
|
||||
background-color: dark-light-diff($primary, $secondary, 90%, -60%);
|
||||
|
||||
|
||||
}
|
||||
|
@ -1208,7 +1208,7 @@ table.api-keys {
|
|||
|
||||
.heading-container {
|
||||
width: 100%;
|
||||
background-color: scale-color-diff();
|
||||
background-color: dark-light-diff($primary, $secondary, 90%, -60%);
|
||||
}
|
||||
.col.heading {
|
||||
font-weight: bold;
|
||||
|
@ -1224,7 +1224,7 @@ table.api-keys {
|
|||
|
||||
.ember-list-item-view {
|
||||
width: 100%;
|
||||
border-top: solid 1px scale-color-diff();
|
||||
border-top: solid 1px dark-light-diff($primary, $secondary, 90%, -60%);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1414,7 +1414,7 @@ tr.not-activated {
|
|||
.user-field {
|
||||
padding: 10px;
|
||||
margin-bottom: 10px;
|
||||
border-bottom: 1px solid scale-color-diff();
|
||||
border-bottom: 1px solid dark-light-diff($primary, $secondary, 90%, -60%);
|
||||
|
||||
.form-display {
|
||||
width: 25%;
|
||||
|
|
|
@ -195,7 +195,7 @@ ol.category-breadcrumb {
|
|||
overflow-x: hidden;
|
||||
overflow-y: auto;
|
||||
position: absolute;
|
||||
border: 1px solid scale-color-diff();
|
||||
border: 1px solid dark-light-diff($primary, $secondary, 90%, -60%);
|
||||
background-color: $secondary;
|
||||
z-index: 100;
|
||||
|
||||
|
@ -244,7 +244,7 @@ ol.category-breadcrumb {
|
|||
|
||||
@include unselectable;
|
||||
|
||||
border: 1px solid scale-color-diff();
|
||||
border: 1px solid dark-light-diff($primary, $secondary, 90%, -60%);
|
||||
padding: 5px;
|
||||
background: $secondary;
|
||||
position: absolute;
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
max-width: 300px;
|
||||
|
||||
.colorpicker {
|
||||
border: 1px solid scale-color-diff();
|
||||
border: 1px solid dark-light-diff($primary, $secondary, 90%, -60%);
|
||||
margin-right: 2px;
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
|
||||
.select2-container {
|
||||
border-radius: 3px;
|
||||
border: 1px solid scale-color-diff();
|
||||
border: 1px solid dark-light-diff($primary, $secondary, 90%, -60%);
|
||||
&.select2-dropdown-open {
|
||||
border: 0;
|
||||
}
|
||||
|
|
|
@ -3,13 +3,13 @@
|
|||
position: absolute;
|
||||
width: 240px;
|
||||
background-color: $secondary;
|
||||
border: 1px solid scale-color-diff();
|
||||
border: 1px solid dark-light-diff($primary, $secondary, 90%, -60%);
|
||||
ul {
|
||||
list-style: none;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
li {
|
||||
border-bottom: 1px solid scale-color-diff();
|
||||
border-bottom: 1px solid dark-light-diff($primary, $secondary, 90%, -60%);
|
||||
a[href] {
|
||||
padding: 5px;
|
||||
display: block;
|
||||
|
@ -50,7 +50,7 @@ div.ac-wrap.disabled {
|
|||
|
||||
div.ac-wrap {
|
||||
background-color: $secondary;
|
||||
border: 1px solid scale-color-diff();
|
||||
border: 1px solid dark-light-diff($primary, $secondary, 90%, -60%);
|
||||
padding: 5px 4px 1px 4px;
|
||||
div.item {
|
||||
float: left;
|
||||
|
@ -69,7 +69,7 @@ div.ac-wrap {
|
|||
border-radius: 12px;
|
||||
width: 10px;
|
||||
display: inline-block;
|
||||
border: 1px solid scale-color-diff();
|
||||
border: 1px solid dark-light-diff($primary, $secondary, 90%, -60%);
|
||||
&:hover {
|
||||
background-color: scale-color($danger, $lightness: 75%);
|
||||
border: 1px solid scale-color($danger, $lightness: 30%);
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
td, th {
|
||||
padding: 0.5em;
|
||||
text-align: left;
|
||||
border-bottom: 1px solid scale-color-diff();
|
||||
border-bottom: 1px solid dark-light-diff($primary, $secondary, 90%, -60%);
|
||||
|
||||
.number, .time-read {
|
||||
font-size: 1.4em;
|
||||
|
@ -54,7 +54,7 @@
|
|||
}
|
||||
|
||||
&:hover {
|
||||
background-color: scale-color-diff();
|
||||
background-color: dark-light-diff($primary, $secondary, 90%, -60%);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -149,10 +149,10 @@ body {
|
|||
width: 540px;
|
||||
background-color: $secondary;
|
||||
padding: 0 10px 13px 10px;
|
||||
border: 1px solid scale-color-diff();
|
||||
border: 1px solid dark-light-diff($primary, $secondary, 90%, -60%);
|
||||
.preview {
|
||||
margin-top: 8px;
|
||||
border: 1px dashed scale-color-diff();
|
||||
border: 1px dashed dark-light-diff($primary, $secondary, 90%, -60%);
|
||||
padding: 8px 8px 0 8px;
|
||||
p {
|
||||
margin: 0 0 10px 0;
|
||||
|
|
|
@ -72,14 +72,14 @@
|
|||
|
||||
&:hover {
|
||||
color: $primary;
|
||||
background-color: scale-color-diff();
|
||||
background-color: dark-light-diff($primary, $secondary, 90%, -60%);
|
||||
border-top: 1px solid transparent;
|
||||
border-left: 1px solid transparent;
|
||||
border-right: 1px solid transparent;
|
||||
}
|
||||
&:active {
|
||||
color: $primary;
|
||||
background-color: scale-color-diff();
|
||||
background-color: dark-light-diff($primary, $secondary, 90%, -60%);
|
||||
}
|
||||
}
|
||||
.active .icon {
|
||||
|
@ -87,9 +87,9 @@
|
|||
color: #7b7b7b;
|
||||
background-color: $secondary;
|
||||
cursor: default;
|
||||
border-top: 1px solid scale-color-diff();
|
||||
border-left: 1px solid scale-color-diff();
|
||||
border-right: 1px solid scale-color-diff();
|
||||
border-top: 1px solid dark-light-diff($primary, $secondary, 90%, -60%);
|
||||
border-left: 1px solid dark-light-diff($primary, $secondary, 90%, -60%);
|
||||
border-right: 1px solid dark-light-diff($primary, $secondary, 90%, -60%);
|
||||
&:after {
|
||||
display: block;
|
||||
position: absolute;
|
||||
|
@ -143,7 +143,7 @@
|
|||
right: 0;
|
||||
z-index: 1100;
|
||||
overflow: auto;
|
||||
border: 1px solid scale-color-diff();
|
||||
border: 1px solid dark-light-diff($primary, $secondary, 90%, -60%);
|
||||
padding: 5px;
|
||||
|
||||
box-shadow: 0 2px 2px rgba(0,0,0, .4);
|
||||
|
|
|
@ -64,8 +64,8 @@
|
|||
max-width: 710px;
|
||||
margin: 0 auto;
|
||||
background-color: $secondary;
|
||||
border: 1px solid scale-color-diff();
|
||||
border: 1px solid scale-color-diff();
|
||||
border: 1px solid dark-light-diff($primary, $secondary, 90%, -60%);
|
||||
border: 1px solid dark-light-diff($primary, $secondary, 90%, -60%);
|
||||
|
||||
box-shadow: 0 3px 7px rgba(0,0,0, .8);
|
||||
background-clip: padding-box;
|
||||
|
@ -91,7 +91,7 @@
|
|||
}
|
||||
.modal-footer {
|
||||
padding: 14px 15px 15px;
|
||||
border-top: 1px solid scale-color-diff();
|
||||
border-top: 1px solid dark-light-diff($primary, $secondary, 90%, -60%);
|
||||
}
|
||||
.modal-footer:before,
|
||||
.modal-footer:after {
|
||||
|
@ -109,7 +109,7 @@
|
|||
li > a {
|
||||
font-size: 1em;
|
||||
}
|
||||
border-bottom: 1px solid scale-color-diff();
|
||||
border-bottom: 1px solid dark-light-diff($primary, $secondary, 90%, -60%);
|
||||
|
||||
}
|
||||
|
||||
|
@ -168,7 +168,7 @@
|
|||
font-weight: normal;
|
||||
}
|
||||
&.btn-reply-here {
|
||||
background: scale-color-diff();
|
||||
background: dark-light-diff($primary, $secondary, 90%, -60%);
|
||||
text-shadow: none;
|
||||
color: $primary;
|
||||
}
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
height: 20px;
|
||||
margin-right: 8px;
|
||||
margin-left: 5px;
|
||||
background-color: scale-color-diff();
|
||||
background-color: dark-light-diff($primary, $secondary, 90%, -60%);
|
||||
display: inline-block;
|
||||
float: left;
|
||||
}
|
||||
|
@ -63,7 +63,7 @@
|
|||
}
|
||||
|
||||
.wmd-button:hover {
|
||||
background-color: scale-color-diff();
|
||||
background-color: dark-light-diff($primary, $secondary, 90%, -60%);
|
||||
}
|
||||
|
||||
|
||||
|
@ -130,8 +130,8 @@
|
|||
}
|
||||
|
||||
.wmd-prompt-dialog {
|
||||
border: 1px solid scale-color-diff();
|
||||
background-color: scale-color-diff();
|
||||
border: 1px solid dark-light-diff($primary, $secondary, 90%, -60%);
|
||||
background-color: dark-light-diff($primary, $secondary, 90%, -60%);
|
||||
}
|
||||
|
||||
.wmd-prompt-dialog > div {
|
||||
|
@ -140,12 +140,12 @@
|
|||
}
|
||||
|
||||
.wmd-prompt-dialog > form > input[type="text"] {
|
||||
border: 1px solid scale-color-diff();
|
||||
border: 1px solid dark-light-diff($primary, $secondary, 90%, -60%);
|
||||
color: $primary;
|
||||
}
|
||||
|
||||
.wmd-prompt-dialog > form > input[type="button"] {
|
||||
border: 1px solid scale-color-diff();
|
||||
border: 1px solid dark-light-diff($primary, $secondary, 90%, -60%);
|
||||
font-family: trebuchet MS, helvetica, sans-serif;
|
||||
font-size: 0.8em;
|
||||
font-weight: bold;
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
background-color: $secondary;
|
||||
width: 205px;
|
||||
padding: 10px;
|
||||
border: 1px solid scale-color-diff();
|
||||
border: 1px solid dark-light-diff($primary, $secondary, 90%, -60%);
|
||||
z-index: 1001;
|
||||
|
||||
ul {
|
||||
|
|
|
@ -172,7 +172,7 @@ pre {
|
|||
kbd
|
||||
{
|
||||
background-color: $secondary;
|
||||
border: 1px solid scale-color-diff();
|
||||
border: 1px solid dark-light-diff($primary, $secondary, 90%, -60%);
|
||||
border-radius: 3px;
|
||||
box-shadow: 0 1px 0 rgba(0,0,0, .8);
|
||||
color: $primary;
|
||||
|
|
|
@ -67,7 +67,7 @@
|
|||
/* Badge listing in /badges. */
|
||||
table.badges-listing {
|
||||
margin: 20px 0;
|
||||
border-bottom: 1px solid scale-color-diff();
|
||||
border-bottom: 1px solid dark-light-diff($primary, $secondary, 90%, -60%);
|
||||
width: 90%;
|
||||
|
||||
.user-badge {
|
||||
|
@ -112,7 +112,7 @@ table.badges-listing {
|
|||
}
|
||||
|
||||
tr {
|
||||
border-top: 1px solid scale-color-diff();
|
||||
border-top: 1px solid dark-light-diff($primary, $secondary, 90%, -60%);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -55,7 +55,7 @@
|
|||
color: #fff;
|
||||
}
|
||||
&[disabled] {
|
||||
background: scale-color-diff();
|
||||
background: dark-light-diff($primary, $secondary, 90%, -60%);
|
||||
&:hover { color: scale-color($primary, $lightness: 70%); }
|
||||
cursor: not-allowed;
|
||||
}
|
||||
|
|
|
@ -41,7 +41,7 @@ hr {
|
|||
height: 1px;
|
||||
margin: 1em 0;
|
||||
border: 0;
|
||||
border-top: 1px solid scale-color-diff();
|
||||
border-top: 1px solid dark-light-diff($primary, $secondary, 90%, -60%);
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -42,12 +42,3 @@ $base-font-family: Helvetica, Arial, sans-serif !default;
|
|||
@return scale-color($adjusted-color, $lightness: $darkness);
|
||||
}
|
||||
}
|
||||
|
||||
// phasing out scale-color-diff for dark-light-diff
|
||||
@function scale-color-diff() {
|
||||
@if lightness($primary) < lightness($secondary) {
|
||||
@return scale-color($primary, $lightness: 90%);
|
||||
} @else {
|
||||
@return scale-color($primary, $lightness: -60%);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#topic-entrance {
|
||||
|
||||
border: 1px solid scale-color-diff();
|
||||
border: 1px solid dark-light-diff($primary, $secondary, 90%, -60%);
|
||||
padding: 5px;
|
||||
background: $secondary;
|
||||
box-shadow: 0 0px 2px rgba(0,0,0, .2);
|
||||
|
|
|
@ -103,7 +103,7 @@
|
|||
width: 100%;
|
||||
z-index: 1039;
|
||||
height: 0;
|
||||
background-color: scale-color-diff();
|
||||
background-color: dark-light-diff($primary, $secondary, 90%, -60%);
|
||||
bottom: 0;
|
||||
font-size: 1em;
|
||||
position: fixed;
|
||||
|
@ -147,7 +147,7 @@
|
|||
&.draft {
|
||||
height: 40px !important;
|
||||
cursor: pointer;
|
||||
border-top: 1px solid scale-color-diff();
|
||||
border-top: 1px solid dark-light-diff($primary, $secondary, 90%, -60%);
|
||||
.draft-text {
|
||||
display: block;
|
||||
}
|
||||
|
@ -160,7 +160,7 @@
|
|||
}
|
||||
&.saving {
|
||||
height: 40px !important;
|
||||
border-top: 1px solid scale-color-diff();
|
||||
border-top: 1px solid dark-light-diff($primary, $secondary, 90%, -60%);
|
||||
.saving-text {
|
||||
display: block;
|
||||
}
|
||||
|
@ -255,18 +255,18 @@
|
|||
margin-right: 10px;
|
||||
float: left;
|
||||
&:disabled {
|
||||
background-color: scale-color-diff();
|
||||
background-color: dark-light-diff($primary, $secondary, 90%, -60%);
|
||||
}
|
||||
}
|
||||
#wmd-input:disabled {
|
||||
background-color: scale-color-diff();
|
||||
background-color: dark-light-diff($primary, $secondary, 90%, -60%);
|
||||
}
|
||||
#wmd-input, #wmd-preview {
|
||||
color: $primary;
|
||||
}
|
||||
|
||||
#wmd-preview {
|
||||
border: 1px dashed scale-color-diff();
|
||||
border: 1px dashed dark-light-diff($primary, $secondary, 90%, -60%);
|
||||
overflow: auto;
|
||||
visibility: visible;
|
||||
cursor: default;
|
||||
|
@ -303,7 +303,7 @@
|
|||
.show-admin-options {
|
||||
vertical-align: top;
|
||||
margin-top: 8px;
|
||||
background: scale-color-diff();
|
||||
background: dark-light-diff($primary, $secondary, 90%, -60%);
|
||||
&:hover {
|
||||
color: $secondary;
|
||||
background: $primary;
|
||||
|
@ -405,7 +405,7 @@
|
|||
#wmd-button-bar {
|
||||
top: 0;
|
||||
position: absolute;
|
||||
border-bottom: 1px solid scale-color-diff();
|
||||
border-bottom: 1px solid dark-light-diff($primary, $secondary, 90%, -60%);
|
||||
background-color: $secondary;
|
||||
z-index: 100;
|
||||
}
|
||||
|
|
|
@ -77,14 +77,14 @@ body {
|
|||
|
||||
.grippie {
|
||||
width: 100%;
|
||||
border: 1px solid scale-color-diff();
|
||||
border: 1px solid dark-light-diff($primary, $secondary, 90%, -60%);
|
||||
border-width: 1px 0;
|
||||
cursor: row-resize;
|
||||
height: 11px;
|
||||
overflow: hidden;
|
||||
background-color: scale-color-diff();
|
||||
background-color: dark-light-diff($primary, $secondary, 90%, -60%);
|
||||
display:block;
|
||||
background: image-url("grippie.png") scale-color-diff() no-repeat center 3px;
|
||||
background: image-url("grippie.png") dark-light-diff($primary, $secondary, 90%, -60%) no-repeat center 3px;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -194,7 +194,7 @@ body {
|
|||
width: 210px;
|
||||
height: auto;
|
||||
background-color:$secondary;
|
||||
border: 1px solid scale-color-diff();
|
||||
border: 1px solid dark-light-diff($primary, $secondary, 90%, -60%);
|
||||
border-radius: 3px;
|
||||
box-shadow: inset 0 1px 1px rgba(0,0,0, .3);
|
||||
transition: border linear 0.2s, box-shadow linear 0.2s;
|
||||
|
@ -202,7 +202,7 @@ body {
|
|||
input {
|
||||
&[type="text"], &[type="password"], &[type="datetime"], &[type="datetime-local"], &[type="date"], &[type="month"], &[type="time"], &[type="week"], &[type="number"], &[type="email"], &[type="url"], &[type="search"], &[type="tel"], &[type="color"] {
|
||||
background-color: $secondary;
|
||||
border: 1px solid scale-color-diff();
|
||||
border: 1px solid dark-light-diff($primary, $secondary, 90%, -60%);
|
||||
border-radius: 3px;
|
||||
box-shadow: inset 0 1px 1px rgba(0,0,0, .3);
|
||||
transition: border linear 0.2s, box-shadow linear 0.2s;
|
||||
|
@ -238,7 +238,7 @@ body {
|
|||
|
||||
select {
|
||||
width: 220px;
|
||||
border: 1px solid scale-color-diff();
|
||||
border: 1px solid dark-light-diff($primary, $secondary, 90%, -60%);
|
||||
&[multiple], &[size] {
|
||||
height: auto;
|
||||
}
|
||||
|
@ -288,8 +288,8 @@ body {
|
|||
}
|
||||
input[disabled], select[disabled], textarea[disabled], input[readonly], select[readonly], textarea[readonly] {
|
||||
cursor: not-allowed;
|
||||
background-color: scale-color-diff();
|
||||
border-color: scale-color-diff();
|
||||
background-color: dark-light-diff($primary, $secondary, 90%, -60%);
|
||||
border-color: dark-light-diff($primary, $secondary, 90%, -60%);
|
||||
}
|
||||
input {
|
||||
&[type="radio"][disabled], &[type="checkbox"][disabled], &[type="radio"][readonly], &[type="checkbox"][readonly] {
|
||||
|
@ -388,7 +388,7 @@ body {
|
|||
text-align: center;
|
||||
vertical-align: middle;
|
||||
background-color: $secondary;
|
||||
border: 1px solid scale-color-diff();
|
||||
border: 1px solid dark-light-diff($primary, $secondary, 90%, -60%);
|
||||
}
|
||||
.input-prepend .add-on, .input-append .add-on, .input-prepend .btn, .input-append .btn {
|
||||
margin-left: -1px;
|
||||
|
|
|
@ -35,7 +35,7 @@ and (max-width : 570px) {
|
|||
// Common
|
||||
|
||||
.heading {
|
||||
border-top: 1px solid scale-color-diff();
|
||||
border-top: 1px solid dark-light-diff($primary, $secondary, 90%, -60%);
|
||||
}
|
||||
|
||||
// Categories
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
#revision-details {
|
||||
padding: 5px;
|
||||
margin-top: 10px;
|
||||
border-bottom: 3px solid scale-color-diff();
|
||||
border-bottom: 3px solid dark-light-diff($primary, $secondary, 90%, -60%);
|
||||
}
|
||||
#revisions {
|
||||
word-wrap: break-word;
|
||||
|
|
|
@ -16,8 +16,8 @@
|
|||
height: auto;
|
||||
margin: -250px 0 0 -305px;
|
||||
background-color: $secondary;
|
||||
border: 1px solid scale-color-diff();
|
||||
border: 1px solid scale-color-diff();
|
||||
border: 1px solid dark-light-diff($primary, $secondary, 90%, -60%);
|
||||
border: 1px solid dark-light-diff($primary, $secondary, 90%, -60%);
|
||||
|
||||
box-shadow: 0 3px 7px rgba(0,0,0, .8);
|
||||
background-clip: padding-box;
|
||||
|
@ -54,7 +54,7 @@
|
|||
}
|
||||
|
||||
.modal-header {
|
||||
border-bottom: 1px solid scale-color-diff();
|
||||
border-bottom: 1px solid dark-light-diff($primary, $secondary, 90%, -60%);
|
||||
h3 {
|
||||
font-size: 1.429em;
|
||||
padding: 10px 15px 7px;
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
}
|
||||
}
|
||||
.post-title {
|
||||
color: darken(scale-color-diff(), 50%);
|
||||
color: darken(dark-light-diff($primary, $secondary, 90%, -60%), 50%);
|
||||
font-weight: bold;
|
||||
|
||||
.badge-wrapper {
|
||||
|
|
|
@ -63,7 +63,7 @@
|
|||
padding: 0;
|
||||
background: transparent;
|
||||
&:hover {
|
||||
color: scale-color-diff();
|
||||
color: dark-light-diff($primary, $secondary, 90%, -60%);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -140,7 +140,7 @@ nav.post-controls {
|
|||
transition: all linear 0.15s;
|
||||
|
||||
&:hover {
|
||||
background: scale-color-diff();
|
||||
background: dark-light-diff($primary, $secondary, 90%, -60%);
|
||||
color: $primary;
|
||||
}
|
||||
|
||||
|
@ -194,7 +194,7 @@ nav.post-controls {
|
|||
background-color: $secondary;
|
||||
width: 205px;
|
||||
padding: 10px;
|
||||
border: 1px solid scale-color-diff();
|
||||
border: 1px solid dark-light-diff($primary, $secondary, 90%, -60%);
|
||||
position: absolute;
|
||||
text-align: left;
|
||||
bottom: -2px;
|
||||
|
@ -562,7 +562,7 @@ video {
|
|||
a.mention {
|
||||
padding: 2px 4px;
|
||||
color: $primary;
|
||||
background: scale-color-diff();
|
||||
background: dark-light-diff($primary, $secondary, 90%, -60%);
|
||||
}
|
||||
|
||||
|
||||
|
@ -709,7 +709,7 @@ $topic-avatar-width: 45px;
|
|||
}
|
||||
|
||||
.gap {
|
||||
background-color: scale-color-diff();
|
||||
background-color: dark-light-diff($primary, $secondary, 90%, -60%);
|
||||
padding: 5px 0;
|
||||
color: lighten($primary, 30%);
|
||||
cursor: pointer;
|
||||
|
@ -747,7 +747,7 @@ $topic-avatar-width: 45px;
|
|||
margin: 1px 0 0;
|
||||
list-style: none;
|
||||
background-color: $secondary;
|
||||
border: 1px solid scale-color-diff();
|
||||
border: 1px solid dark-light-diff($primary, $secondary, 90%, -60%);
|
||||
box-shadow: 0 1px 5px rgba(0,0,0, .4);
|
||||
background-clip: padding-box;
|
||||
span {font-size: 0.857em;}
|
||||
|
|
|
@ -120,7 +120,7 @@ a:hover.reply-new {
|
|||
}
|
||||
|
||||
#topic-progress-expanded {
|
||||
border: 1px solid scale-color-diff();
|
||||
border: 1px solid dark-light-diff($primary, $secondary, 90%, -60%);
|
||||
padding: 5px;
|
||||
background: $secondary;
|
||||
@include box-shadow(0 0px 2px rgba(0,0,0, .2));
|
||||
|
|
|
@ -145,7 +145,7 @@
|
|||
.user-content {
|
||||
padding: 10px 8px;
|
||||
background-color: $secondary;
|
||||
border: 1px solid scale-color-diff();
|
||||
border: 1px solid dark-light-diff($primary, $secondary, 90%, -60%);
|
||||
margin-bottom: 10px;
|
||||
box-sizing: border-box;
|
||||
|
||||
|
@ -163,13 +163,13 @@
|
|||
|
||||
th {
|
||||
text-align: left;
|
||||
border-bottom: 1px solid scale-color-diff();
|
||||
border-bottom: 1px solid dark-light-diff($primary, $secondary, 90%, -60%);
|
||||
padding: 5px;
|
||||
}
|
||||
|
||||
td {
|
||||
padding: 5px;
|
||||
border-bottom: 1px solid scale-color-diff();
|
||||
border-bottom: 1px solid dark-light-diff($primary, $secondary, 90%, -60%);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -422,7 +422,7 @@
|
|||
.item {
|
||||
padding: 20px 8px 15px 8px;
|
||||
background-color: $secondary;
|
||||
border-bottom: 1px solid scale-color-diff();
|
||||
border-bottom: 1px solid dark-light-diff($primary, $secondary, 90%, -60%);
|
||||
}
|
||||
.type {
|
||||
color: $primary;
|
||||
|
|
|
@ -13,8 +13,8 @@ article.post {
|
|||
}
|
||||
|
||||
.quote .title {
|
||||
border-left: 5px solid darken(scale-color-diff(), 10%);
|
||||
background-color: scale-color-diff();
|
||||
border-left: 5px solid darken(dark-light-diff($primary, $secondary, 90%, -60%), 10%);
|
||||
background-color: dark-light-diff($primary, $secondary, 90%, -60%);
|
||||
padding: 10px 10px 0 12px;
|
||||
.avatar { margin-right: 7px; }
|
||||
}
|
||||
|
@ -26,8 +26,8 @@ article.post {
|
|||
blockquote {
|
||||
padding: 10px 8px 10px 13px;
|
||||
margin: 0 0 10px 0;
|
||||
background-color: scale-color-diff();
|
||||
border-left: 5px solid darken(scale-color-diff(), 10%);
|
||||
background-color: dark-light-diff($primary, $secondary, 90%, -60%);
|
||||
border-left: 5px solid darken(dark-light-diff($primary, $secondary, 90%, -60%), 10%);
|
||||
overflow: hidden;
|
||||
p {
|
||||
margin: 0 0 10px 0;
|
||||
|
|
|
@ -39,7 +39,7 @@ display: none !important; // can be removed if inline JS CSS is removed from com
|
|||
width: 100%;
|
||||
z-index: 1039;
|
||||
height: 0;
|
||||
background-color: scale-color-diff();
|
||||
background-color: dark-light-diff($primary, $secondary, 90%, -60%);
|
||||
bottom: 0;
|
||||
font-size: 1em;
|
||||
position: fixed;
|
||||
|
@ -88,7 +88,7 @@ display: none !important; // can be removed if inline JS CSS is removed from com
|
|||
&.draft {
|
||||
height: 35px !important;
|
||||
cursor: pointer;
|
||||
border-top: 1px solid scale-color-diff();
|
||||
border-top: 1px solid dark-light-diff($primary, $secondary, 90%, -60%);
|
||||
.draft-text {
|
||||
display: block;
|
||||
position: absolute;
|
||||
|
@ -103,7 +103,7 @@ display: none !important; // can be removed if inline JS CSS is removed from com
|
|||
}
|
||||
&.saving {
|
||||
height: 40px !important;
|
||||
border-top: 1px solid scale-color-diff();
|
||||
border-top: 1px solid dark-light-diff($primary, $secondary, 90%, -60%);
|
||||
.saving-text {
|
||||
display: block;
|
||||
}
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
line-height: 2em;
|
||||
}
|
||||
#revision-details {
|
||||
background-color: scale-color-diff();
|
||||
background-color: dark-light-diff($primary, $secondary, 90%, -60%);
|
||||
padding: 5px;
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
|
|
@ -237,7 +237,7 @@ tr.category-topic-link {
|
|||
margin: 1px 0 0;
|
||||
list-style: none;
|
||||
background-color: $secondary;
|
||||
border: 1px solid scale-color-diff();
|
||||
border: 1px solid dark-light-diff($primary, $secondary, 90%, -60%);
|
||||
border: 1px solid rgba(0, 0, 0, 0.2);
|
||||
border-radius: 5px;
|
||||
box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
.gap {
|
||||
background-color: scale-color-diff();
|
||||
background-color: dark-light-diff($primary, $secondary, 90%, -60%);
|
||||
padding: 5px 15px;
|
||||
color: $primary;
|
||||
text-align: center;
|
||||
|
@ -7,7 +7,7 @@
|
|||
}
|
||||
|
||||
.topic-post {
|
||||
border-top: 1px solid scale-color-diff();
|
||||
border-top: 1px solid dark-light-diff($primary, $secondary, 90%, -60%);
|
||||
padding: 6px 0 3px 0;
|
||||
}
|
||||
|
||||
|
@ -74,7 +74,7 @@ button {
|
|||
background-color: $secondary;
|
||||
width: 205px;
|
||||
padding: 10px;
|
||||
border: 1px solid scale-color-diff();
|
||||
border: 1px solid dark-light-diff($primary, $secondary, 90%, -60%);
|
||||
position: absolute;
|
||||
text-align: left;
|
||||
bottom: 0;
|
||||
|
@ -286,7 +286,7 @@ a.star {
|
|||
}
|
||||
|
||||
#topic-footer-buttons {
|
||||
border-top: 1px solid scale-color-diff();
|
||||
border-top: 1px solid dark-light-diff($primary, $secondary, 90%, -60%);
|
||||
padding: 20px 10px 0 10px;
|
||||
.fa-bookmark.bookmarked { color: $tertiary; }
|
||||
}
|
||||
|
|
|
@ -61,7 +61,7 @@
|
|||
}
|
||||
|
||||
#topic-progress-expanded {
|
||||
border: 1px solid scale-color-diff();
|
||||
border: 1px solid dark-light-diff($primary, $secondary, 90%, -60%);
|
||||
padding: 5px;
|
||||
background: $secondary;
|
||||
box-shadow: 0 0px 2px rgba(0,0,0, .2);
|
||||
|
|
|
@ -186,7 +186,7 @@
|
|||
.user-content {
|
||||
padding: 10px 8px;
|
||||
background-color: $secondary;
|
||||
border: 1px solid scale-color-diff();
|
||||
border: 1px solid dark-light-diff($primary, $secondary, 90%, -60%);
|
||||
margin-bottom: 10px;
|
||||
box-sizing: border-box;
|
||||
margin-top: 20px;
|
||||
|
@ -205,13 +205,13 @@
|
|||
|
||||
th {
|
||||
text-align: left;
|
||||
border-bottom: 1px solid scale-color-diff();
|
||||
border-bottom: 1px solid dark-light-diff($primary, $secondary, 90%, -60%);
|
||||
padding: 5px;
|
||||
}
|
||||
|
||||
td {
|
||||
padding: 5px;
|
||||
border-bottom: 1px solid scale-color-diff();
|
||||
border-bottom: 1px solid dark-light-diff($primary, $secondary, 90%, -60%);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -420,7 +420,7 @@
|
|||
.item {
|
||||
padding: 20px 0 15px 0;
|
||||
background-color: $secondary;
|
||||
border-bottom: 1px solid scale-color-diff();
|
||||
border-bottom: 1px solid dark-light-diff($primary, $secondary, 90%, -60%);
|
||||
}
|
||||
.type {
|
||||
color: $primary;
|
||||
|
|
|
@ -31,7 +31,7 @@ class Notification < ActiveRecord::Base
|
|||
@types ||= Enum.new(
|
||||
:mentioned, :replied, :quoted, :edited, :liked, :private_message,
|
||||
:invited_to_private_message, :invitee_accepted, :posted, :moved_post,
|
||||
:linked, :granted_badge, :invited_to_topic
|
||||
:linked, :granted_badge, :invited_to_topic, :custom
|
||||
)
|
||||
end
|
||||
|
||||
|
|
|
@ -30,8 +30,10 @@ class TopicList
|
|||
|
||||
# Lazy initialization
|
||||
def topics
|
||||
return @topics if @topics.present?
|
||||
@topics ||= load_topics
|
||||
end
|
||||
|
||||
def load_topics
|
||||
@topics = @topics_input
|
||||
|
||||
# Attach some data for serialization to each topic
|
||||
|
|
|
@ -143,8 +143,8 @@ end
|
|||
|
||||
[
|
||||
[Badge::Promoter,"Promoter",BadgeType::Bronze,1,0],
|
||||
[Badge::Campaigner,"Campaigner",BadgeType::Silver,3,2],
|
||||
[Badge::Champion,"Champion",BadgeType::Gold,10,2],
|
||||
[Badge::Campaigner,"Campaigner",BadgeType::Silver,3,1],
|
||||
[Badge::Champion,"Champion",BadgeType::Gold,5,2],
|
||||
].each do |id, name, type, count, trust_level|
|
||||
Badge.seed do |b|
|
||||
b.id = id
|
||||
|
|
|
@ -3,6 +3,10 @@ module Demon; end
|
|||
# intelligent fork based demonizer
|
||||
class Demon::Base
|
||||
|
||||
def self.demons
|
||||
@demons
|
||||
end
|
||||
|
||||
def self.start(count=1)
|
||||
@demons ||= {}
|
||||
count.times do |i|
|
||||
|
@ -31,21 +35,57 @@ class Demon::Base
|
|||
end
|
||||
end
|
||||
|
||||
attr_reader :pid, :parent_pid, :started, :index
|
||||
attr_accessor :stop_timeout
|
||||
|
||||
def initialize(index)
|
||||
@index = index
|
||||
@pid = nil
|
||||
@parent_pid = Process.pid
|
||||
@started = false
|
||||
@stop_timeout = 10
|
||||
end
|
||||
|
||||
def pid_file
|
||||
"#{Rails.root}/tmp/pids/#{self.class.prefix}_#{@index}.pid"
|
||||
end
|
||||
|
||||
def alive?
|
||||
if @pid
|
||||
Demon::Base.alive?(@pid)
|
||||
else
|
||||
false
|
||||
end
|
||||
end
|
||||
|
||||
def stop
|
||||
@started = false
|
||||
if @pid
|
||||
# TODO configurable stop signal
|
||||
Process.kill("HUP",@pid)
|
||||
|
||||
wait_for_stop = lambda {
|
||||
timeout = @stop_timeout
|
||||
|
||||
while alive? && timeout > 0
|
||||
timeout -= (@stop_timeout/10.0)
|
||||
sleep(@stop_timeout/10.0)
|
||||
Process.waitpid(@pid, Process::WNOHANG) rescue -1
|
||||
end
|
||||
|
||||
Process.waitpid(@pid, Process::WNOHANG) rescue -1
|
||||
}
|
||||
|
||||
wait_for_stop.call
|
||||
|
||||
if alive?
|
||||
STDERR.puts "Process would not terminate cleanly, force quitting. pid: #{@pid}"
|
||||
Process.kill("KILL", @pid)
|
||||
end
|
||||
|
||||
wait_for_stop.call
|
||||
|
||||
|
||||
@pid = nil
|
||||
@started = false
|
||||
end
|
||||
|
@ -96,7 +136,7 @@ class Demon::Base
|
|||
def already_running?
|
||||
if File.exists? pid_file
|
||||
pid = File.read(pid_file).to_i
|
||||
if alive?(pid)
|
||||
if Demon::Base.alive?(pid)
|
||||
return pid
|
||||
end
|
||||
end
|
||||
|
@ -104,6 +144,15 @@ class Demon::Base
|
|||
nil
|
||||
end
|
||||
|
||||
def self.alive?(pid)
|
||||
begin
|
||||
Process.kill(0, pid)
|
||||
true
|
||||
rescue
|
||||
false
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def write_pid_file
|
||||
|
@ -130,14 +179,6 @@ class Demon::Base
|
|||
end
|
||||
end
|
||||
|
||||
def alive?(pid)
|
||||
begin
|
||||
Process.kill(0, pid)
|
||||
true
|
||||
rescue
|
||||
false
|
||||
end
|
||||
end
|
||||
|
||||
def suppress_stdout
|
||||
true
|
||||
|
|
|
@ -17,7 +17,7 @@ class EmailValidator < ActiveModel::EachValidator
|
|||
|
||||
def email_in_restriction_setting?(setting, value)
|
||||
domains = setting.gsub('.', '\.')
|
||||
regexp = Regexp.new("@(.+\.)?(#{domains})", true)
|
||||
regexp = Regexp.new("@(.+\\.)?(#{domains})", true)
|
||||
value =~ regexp
|
||||
end
|
||||
|
||||
|
|
40
spec/components/demon/base_spec.rb
Normal file
40
spec/components/demon/base_spec.rb
Normal file
|
@ -0,0 +1,40 @@
|
|||
require 'spec_helper'
|
||||
require 'demon/base'
|
||||
|
||||
describe Demon do
|
||||
|
||||
class RudeDemon < Demon::Base
|
||||
def self.prefix
|
||||
"rude"
|
||||
end
|
||||
|
||||
def after_fork
|
||||
Signal.trap("HUP"){}
|
||||
Signal.trap("TERM"){}
|
||||
sleep 999999
|
||||
end
|
||||
end
|
||||
|
||||
it "can terminate rude demons" do
|
||||
|
||||
skip("forking rspec has side effects")
|
||||
# Forking rspec has all sorts of weird side effects
|
||||
# this spec works but we must skip it to keep rspec
|
||||
# state happy
|
||||
|
||||
|
||||
RudeDemon.start
|
||||
_,demon = RudeDemon.demons.first
|
||||
pid = demon.pid
|
||||
wait_for {
|
||||
demon.alive?
|
||||
}
|
||||
|
||||
demon.stop_timeout = 0.05
|
||||
demon.stop
|
||||
demon.start
|
||||
|
||||
running = !!(Process.kill(0, pid)) rescue false
|
||||
expect(running).to eq(false)
|
||||
end
|
||||
end
|
|
@ -2,21 +2,33 @@ require 'spec_helper'
|
|||
|
||||
describe EmailValidator do
|
||||
|
||||
let(:record) { Fabricate.build(:user, email: "bad@spamclub.com") }
|
||||
let(:record) { }
|
||||
let(:validator) { described_class.new({attributes: :email}) }
|
||||
subject(:validate) { validator.validate_each(record,:email,record.email) }
|
||||
|
||||
def blocks?(email)
|
||||
user = Fabricate.build(:user, email: email)
|
||||
validator = EmailValidator.new(attributes: :email)
|
||||
validator.validate_each(user, :email, user.email)
|
||||
user.errors[:email].present?
|
||||
end
|
||||
|
||||
context "blocked email" do
|
||||
it "doesn't add an error when email doesn't match a blocked email" do
|
||||
ScreenedEmail.stubs(:should_block?).with(record.email).returns(false)
|
||||
validate
|
||||
expect(record.errors[:email]).not_to be_present
|
||||
expect(blocks?('sam@sam.com')).to eq(false)
|
||||
end
|
||||
|
||||
it "adds an error when email matches a blocked email" do
|
||||
ScreenedEmail.stubs(:should_block?).with(record.email).returns(true)
|
||||
validate
|
||||
expect(record.errors[:email]).to be_present
|
||||
ScreenedEmail.create!(email: 'sam@sam.com', action_type: ScreenedEmail.actions[:block])
|
||||
expect(blocks?('sam@sam.com')).to eq(true)
|
||||
end
|
||||
|
||||
it "blocks based on email_domains_blacklist" do
|
||||
SiteSetting.email_domains_blacklist = "email.com|mail.com|e-mail.com"
|
||||
expect(blocks?('sam@email.com')).to eq(true)
|
||||
expect(blocks?('sam@bob.email.com')).to eq(true)
|
||||
expect(blocks?('sam@e-mail.com')).to eq(true)
|
||||
expect(blocks?('sam@googlemail.com')).to eq(false)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -17,6 +17,7 @@ describe "i18n integrity checks" do
|
|||
|
||||
it "needs an i18n key (notification_types) for each Notification type" do
|
||||
Notification.types.each_key do |type|
|
||||
next if type == :custom
|
||||
expect(I18n.t("notification_types.#{type}")).not_to match(/translation missing/)
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue