Skip to content

Commit

Permalink
REFACTOR: uses only defined status in the UI
Browse files Browse the repository at this point in the history
  • Loading branch information
jjaffeux committed Mar 27, 2020
1 parent 15ca343 commit f7c2903
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
@@ -1,3 +1,4 @@
import { isPresent } from "@ember/utils";
import { h } from "virtual-dom";
import { avatarImg } from "discourse/widgets/post";
import { createWidget } from "discourse/widgets/widget";
Expand All @@ -7,11 +8,9 @@ export default createWidget("post-event-invitee", {
tagName: "li.post-event-invitee",

buildClasses(attrs) {
return [
Ember.isPresent(attrs.invitee.status)
? `status-${attrs.invitee.status}`
: `unanswered`
];
if (isPresent(attrs.invitee.status)) {
return `status-${attrs.invitee.status}`;
}
},

html(attrs) {
Expand Down
3 changes: 2 additions & 1 deletion assets/javascripts/initializers/discourse-calendar.js.es6
@@ -1,3 +1,4 @@
import { isPresent } from "@ember/utils";
import DiscourseURL from "discourse/lib/url";
import { Promise } from "rsvp";
import { cookAsync } from "discourse/lib/text";
Expand Down Expand Up @@ -74,7 +75,7 @@ function initializeDiscourseCalendar(api) {

const optionals = ["weekends", "tzPicker", "defaultView"];
optionals.forEach(optional => {
if (Ember.isPresent(categorySetting[optional])) {
if (isPresent(categorySetting[optional])) {
options.push(
`${optional}=${escapeExpression(categorySetting[optional])}`
);
Expand Down
7 changes: 5 additions & 2 deletions assets/stylesheets/common/post-event.scss
Expand Up @@ -239,9 +239,12 @@
list-style: none;
margin-right: 0.5em;
margin-bottom: 0.5em;
opacity: 0.25;

&.unanswered {
opacity: 0.25;
&.status-going,
&.status-not_going,
&.status-interested {
opacity: 1;
}
}

Expand Down

0 comments on commit f7c2903

Please sign in to comment.