diff --git a/app/assets/images/emoji/emoji-one-unicorn.png b/app/assets/images/emoji/emoji-one-unicorn.png
index faed20aed..2148647cb 100644
Binary files a/app/assets/images/emoji/emoji-one-unicorn.png and b/app/assets/images/emoji/emoji-one-unicorn.png differ
diff --git a/app/assets/stylesheets/preact/article-form.scss b/app/assets/stylesheets/preact/article-form.scss
index c4550bb4c..ffe851338 100644
--- a/app/assets/stylesheets/preact/article-form.scss
+++ b/app/assets/stylesheets/preact/article-form.scss
@@ -1,28 +1,68 @@
@import 'variables';
.articleformcontainer {
- padding-top: calc(80px + 0.2vw);
+ padding-top: 80px;
@media screen and (min-width: 500px) {
- padding-top: calc(98px + 0.2vw);
+ padding-top: calc(90px + 0.2vw);
}
+
padding-bottom: calc(94px + 2vw);
- background: $light-gray;
- background: var(--theme-background, $light-gray);
+}
+
+.article-form-video-preview {
+ text-align: center;
+ padding-top: 60px;
+ margin: auto;
+ max-width: 880px;
+ margin-bottom: -50px;
+ .article-form-video-image-url {
+ padding-top: 15px;
+ font-family: $monospace;
+ input {
+ padding: 3px;
+ font-size: 1em;
+ border-radius: 3px;
+ border: 1px solid darken($light-medium-gray, 5%);
+ border: var(--theme-container-border, 1px solid darken($light-medium-gray, 5%));
+ width: 340px;
+ margin: 10px;
+ &[type='submit'] {
+ padding: 3px 8px;
+ border: 1px solid $green;
+ border-radius: 100px;
+ width: 200px;
+ }
+ }
+ }
}
.articleform {
margin: 0 auto;
- width: calc(95% - 40px);
- max-width: 880px;
- padding: 0px 20px;
- box-shadow: 5px 5px 0px darken($light-medium-gray, 3%);
- box-shadow: var(--theme-container-box-shadow, 5px 5px 0px darken($light-medium-gray, 3%));
- border: 1px solid darken($light-medium-gray, 5%);
- border: var(--theme-container-border, 1px solid darken($light-medium-gray, 5%));
- border-radius: 3px;
+ width: 97%;
+ max-width: 860px;
+ padding: 0px 6px;
background: white;
background: var(--theme-container-background, white);
position: relative;
+ box-sizing: border-box;
+ border: 1px solid darken($light-medium-gray, 5%);
+ border: var(--theme-container-border, 1px solid darken($light-medium-gray, 5%));
+ box-shadow: $bold-shadow;
+ box-shadow: var(--theme-container-box-shadow, $bold-shadow);
+ border-radius: 3px;
+
+ @media screen and (min-width: 500px) {
+ padding: 0px 12px;
+ border: 1px solid darken($light-medium-gray, 5%);
+ border: var(--theme-container-border, 1px solid darken($light-medium-gray, 5%));
+ }
+ @media screen and (min-width: 600px) {
+ width: calc(97% - 30px);
+ }
+ @media screen and (min-width: 800px) {
+ width: calc(95% - 40px);
+ padding: 0px 20px;
+ }
.container {
border: 1px solid $light-medium-gray;
}
@@ -54,12 +94,12 @@
padding: 0px;
padding-left: 0px;
margin: 20px 2px 0px;
- font-size: 17px;
+ font-size: 16px;
cursor: pointer;
user-select: none;
img {
- height: 28px;
- width: 28px;
+ height: 26px;
+ width: 26px;
border-radius: 50px;
vertical-align: -7px;
margin-right: 4px;
@@ -67,17 +107,23 @@
button {
background: transparent;
border-radius: 3px;
- border: 0px;
font-size: 0.8em;
font-family: $helvetica-condensed;
- width: 80px;
+ width: 70px;
border-radius: 100px;
padding: 1px 0px;
margin-left: 10px;
- border: 3px solid white;
+ border: var(--theme-container-border, 1px solid white);
+ &:focus {
+ outline: 0;
+ border: 1px solid $green;
+ }
&.no {
background: $light-gray;
+ background: var(--theme-background, $light-gray);
color: $medium-gray;
+ color: var(--theme-secondary-color, $medium-gray);
+
}
&.yes {
background: darken($green, 18%);
@@ -85,11 +131,11 @@
}
}
@media screen and (min-width: 600px) {
- font-size: 23px;
+ font-size: 18px;
padding-left: 10px;
img {
- height: 33px;
- width: 33px;
+ height: 29px;
+ width: 29px;
vertical-align: -8px;
margin-right: 8px;
}
@@ -100,20 +146,54 @@
}
.articleform__mainimage {
- padding: 10px 0px;
text-align: center;
- width: 100%;
+ width: 60%;
+ border-radius: 8px;
+ background: $light-gray;
+ background: var(--theme-background, $light-gray);
+ border: 1px solid $light-medium-gray;
+ border: var(--theme-container-border, 1px solid $light-medium-gray);
+ margin-top: 10px;
+ cursor: pointer;
+ @media screen and (min-width: 550px) {
+ width: 40%;
+ }
+ @media screen and (min-width: 985px) {
+ width: 30%;
+ }
img {
width: 100%;
- height: calc(42vw - 44px);
+ height: calc(28vw - 42px);
background: #fcfcfc;
+ border-radius: 8px;
+ @media screen and (min-width: 550px) {
+ height: calc(16.8vw - 18px);
+ }
@media screen and (min-width: 985px) {
- height: 370px;
+ height: 111px;
}
display: block;
- cursor: pointer;
+ }
+ &:hover {
+ opacity: 0.8;
+ }
+ &.articleform__mainimagepreview {
+ border-radius: 0px;
+ border: 0px;
+ margin-top: 0px;
+ border-radius: 3px;
+ width: 100%;
+ cursor: default;
+ img {
+ width: 100%;
+ height: calc(42vw - 44px);
+ border-radius: 3px;
+ @media screen and (min-width: 985px) {
+ height: 355px;
+ }
+ }
&:hover {
- opacity: 0.8;
+ opacity: 1;
}
}
}
@@ -121,8 +201,7 @@
.articleform__title {
height: 26px;
width: 99%;
- font-size: 18px;
- word-break: break-word;
+ font-size: 17px;
border: 0;
padding: 20px 0px 15px;
font-weight: 600;
@@ -130,6 +209,7 @@
color: var(--theme-secondary-color, $black);
background: white;
background: var(--theme-container-background, white);
+ resize: none;
@media screen and (min-width: 600px) {
font-size: 29px;
height: 50px;
@@ -138,7 +218,35 @@
color:#8f949c;
color: var(--theme-secondary-color, #8f949c);
}
+ &.articleform__titlepreview {
+ height: 26px;
+ margin-bottom: 0px;
+ margin-top: -3px;
+ margin-bottom: 1px;
+ @media screen and (min-width: 600px) {
+ height: 34px;
+ margin-top: 0px;
+ margin-bottom: 4px;
+ }
+ }
}
+
+.articleform__titleTooLong {
+ position: relative;
+ &::before {
+ content: "Title Too Long";
+ top: 5px;
+ left: 5px;
+ position: absolute;
+ font-size: 0.8em;
+ font-weight: bold;
+ }
+ .articleform__title {
+ background: darken($red, 8%);
+ border-radius: 3px;
+ }
+}
+
.articleform__detailfields {
display: flex;
flex-direction: row;
@@ -174,15 +282,20 @@
font-family: $monospace;
font-weight: bold;
background: $light-gray;
+ background: var(--theme-background, $light-gray);
+ color: $black;
+ color: var(--theme-secondary-color, $black);
}
.articleform__tagsoptions {
position: absolute;
- left: 0;
- right: 0;
+ left: -4px;
+ right: 3px;
top: 50px;
@media screen and (min-width: 600px) {
top: 30px;
+ left: 8px;
+ right: 155px;
}
background: white;
background: var(--theme-container-background, white);
@@ -194,54 +307,68 @@
}
.articleform__tagoptionrow {
padding: 10px;
+ font-weight: bold;
cursor: pointer;
&:hover {
background: lighten($green, 27%);
+ background: var(--theme-container-background-hover, lighten($green, 27%));
color: $black;
+ color: var(--theme-color, $black);
+
}
}
.articleform__tagoptionrow--active {
background: $green;
+ background: var(--theme-container-accent-background, $green);
color: $black;
- &:hover {
- background: darken($green, 10%);
-
- }
+ color: var(--theme-color, $black);
+}
+
+.articleform__tagoptionsummary {
+ color: $medium-gray;
+ color: var(--theme-secondary-color, $medium-gray);
+ font-weight: 400;
}
.articleform__detailsButton {
color: $black;
- background: $purple;
+ color: var(--theme-color, $black);
+ background: lighten($light-medium-gray, 8%);
+ background: var(--theme-container-accent-background, lighten($light-medium-gray, 8%));
border: 0px;
border-radius: 300px;
padding: 3px 18px;
font-family: $helvetica-condensed;
font-size: 14.4px;
height: 34px;
+ width: 60px;
display: none;
@media screen and (min-width: 600px) {
display: inline-block;
}
margin-left: 25px;
&:hover {
- background: lighten($green, 24%);
+ background: lighten($purple, 5%);
+ background: var(--theme-container-background-hover, lighten($purple, 5%));
}
img {
- width: 21px;
- height: 21px;
+ width: 18px;
+ height: 18px;
vertical-align: -4px;
display: inline-block;
+ filter: invert(100);
+ filter: var(--theme-social-icon-invert, invert(0));
+
}
&.articleform__detailsButton--moreconfig {
margin-left: 5px;
- background: $light-medium-gray;
&.articleform__detailsButton--bottom {
margin-left: 5px;
width: 50px;
}
}
&.articleform__detailsButton--bottom {
- margin-left: -5px;
+ margin-left: 2px;
margin-top: 10px;
margin-bottom: 8px;
display: inline-block;
@@ -249,18 +376,26 @@
border-radius: 3px;
width: 100px;
@media screen and (min-width: 600px) {
+ margin-left: -5px;
display: none;
}
}
}
+.articleform__form--v1 {
+ .articleform__detailsButton--bottom {
+ @media screen and (min-width: 600px) {
+ display: inline-block;
+ }
+ }
+}
+
.articleform__description {
height: 30px;
}
.articleform__body {
- min-height: calc(90vh - 370px);
- // height: calc(90vh - 240px);
+ min-height: calc(80vh - 370px);
width: 98%;
border: 0;
font-size: 15px;
@@ -274,13 +409,22 @@
color: var(--theme-secondary-color, $black);
@media screen and (min-width: 600px) {
font-size: 18px;
- min-height: calc(90vh - 280px);
+ min-height: calc(85vh - 280px);
}
&::placeholder{
color:#8f949c;
color: var(--theme-secondary-color, #8f949c);
}
}
+.articleform__form--v1 {
+ .articleform__body {
+ min-height: calc(90vh - 370px);
+ @media screen and (min-width: 600px) {
+ font-size: 18px;
+ min-height: calc(95vh - 280px);
+ }
+ }
+}
.articleform__buttons {
padding-bottom: 5px;
@@ -297,6 +441,8 @@
background: var(--theme-container-background, white);
z-index: 20;
border-top: 1px solid $light-medium-gray;
+ border-top: var(--theme-container-border, 1px solid $light-medium-gray);
+
* {
margin: 4px calc(0.7vw);
}
@@ -306,11 +452,18 @@
display: -ms-inline-flexbox;
display: inline-flex;
flex-direction: column;
+ max-width: 90%;
+ width: 290px;
+ @media screen and (min-width: 430px) {
+ max-width: 90%;
+ width: auto;
+ }
p {
display: inline-block;
margin-bottom: 2px;
- font-size: 12.5px;
+ font-size: 11px;
color: $medium-gray;
+ color: var(--theme-secondary-color, $medium-gray);
font-style: italic;
margin-left: -2px;
}
@@ -330,7 +483,8 @@
background: none;
border: none;
box-shadow: none;
- color: #666;
+ color: $medium-gray;
+ color: var(--theme-secondary-color, $medium-gray);
font-family: sans-serif;
font-size: 1rem;
cursor: pointer;
@@ -362,10 +516,11 @@
}
button,
a {
- margin-top: 20px;
- margin-bottom: 20px;
+ margin-top: 5px;
+ margin-bottom: 5px;
cursor: pointer;
background: $light-gray;
+ background: var(--theme-background, $light-gray);
font-family: $helvetica-condensed;
font-size: 14.5px;
border: 0px;
@@ -376,12 +531,25 @@
display: inline-block;
text-align: center;
color: $medium-gray;
+ color: var(--theme-secondary-color, $medium-gray);
white-space: nowrap;
+ @media screen and (min-width: 430px) {
+ margin-top: 16px;
+ margin-bottom: 16px;
+ }
&:hover {
background: lighten($green, 24%);
+ background: var(--theme-container-accent-background, lighten($green, 24%));
+ }
+ &:focus {
+ background: lighten($green, 29%);
+ background: var(--theme-container-accent-background, lighten($green, 29%));
+ outline: 0;
+ box-shadow: 0px 0px 1px lighten($green, 15%);
}
&.active {
background: $green;
+ color: $black;
}
&.articleform__buttons--small {
width: 45px;
@@ -395,7 +563,7 @@
}
}
@media screen and (min-width: 630px) {
- font-size: 16px;
+ font-size: 15px;
}
}
}
@@ -408,16 +576,26 @@
bottom: 0;
background: $dark-gray;
color: white;
- padding: 5%;
+ padding: 4%;
box-shadow: $bold-shadow;
box-shadow: var(--theme-container-box-shadow, $bold-shadow);
text-align: center;
border-radius: 3px;
+ overflow-y: scroll;
h2 {
color: $green;
- font-size: 2em;
+ font-size: 1.9em;
font-family: $helvetica-condensed;
}
+ p {
+ font-size: 0.8em;
+ padding: 20px 0px;
+ code {
+ background: $black;
+ padding: 1px 4px;
+ border-radius: 3px;
+ }
+ }
input[type='file'] {
width: 90%;
background: $black;
@@ -505,7 +683,9 @@
img {
display: block;
margin: 10px auto;
- max-width: 80%;
+ width: 200px;
+ height: 84px;
+ border-radius: 8px;
}
}
@@ -527,7 +707,14 @@
}
}
+.articleform_titlepreviewsmall {
+ font-size: calc(1.9vw + 22px) !important;
+ @media screen and (min-width: 1600px) {
+ font-size: 50px !important;
+ }
+}
+
.articleform__uploaderror {
- color: $red;
+ color: darken($red, 8%);
font-size: 0.8em;
}
diff --git a/app/assets/stylesheets/sticky-nav.scss b/app/assets/stylesheets/sticky-nav.scss
index f56f5cfcf..defb7cca6 100644
--- a/app/assets/stylesheets/sticky-nav.scss
+++ b/app/assets/stylesheets/sticky-nav.scss
@@ -15,6 +15,9 @@
overflow: hidden;
z-index: 100;
}
+ &.hidden {
+ display: none;
+ }
.primary-sticky-nav-author{
a{
@include themeable(
diff --git a/app/assets/stylesheets/top-bar.scss b/app/assets/stylesheets/top-bar.scss
index 5f1a4a393..b99aea6ea 100644
--- a/app/assets/stylesheets/top-bar.scss
+++ b/app/assets/stylesheets/top-bar.scss
@@ -21,15 +21,17 @@
-webkit-backface-visibility: hidden;
z-index: 1000;
font-size: 17px;
- height: 48px;
+ height: 46px;
@include themeable(
background,
theme-top-bar-background,
$tan
);
position: fixed;
- border-bottom: 1px solid rgba(0, 0, 0, 0.33);
- box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.13);
+ border-bottom: 1px solid rgba(0, 0, 0, 0.2);
+ &.hidden {
+ display: none;
+ }
nav {
max-width: 100%;
width: 1250px;
@@ -89,7 +91,7 @@
width: 118px;
padding: 3px 0px;
height: auto;
- top: 12px;
+ top: 11px;
text-align: center;
font-weight: bold;
border-radius: 3px;
@@ -120,7 +122,7 @@
display: block;
text-align: center;
z-index: 10;
- top: 1px;
+ top: 0px;
right: 90px;
@include themeable(
fill,
@@ -136,7 +138,7 @@
}
.connect-number {
position: absolute;
- top: 6px;
+ top: 5px;
left: 17px;
background: $green;
padding: 2px 7px;
@@ -159,7 +161,7 @@
}
.notifications-icon {
right: 50px;
- top: 5px;
+ top: 4px;
width: 22px;
height: 41px;
display: block;
@@ -179,7 +181,7 @@
}
.notifications-number {
position: absolute;
- top: 2px;
+ top: 1px;
left: 11px;
background: $dark-purple;
padding: 2px 7px;
@@ -250,7 +252,7 @@
all: unset;
position: absolute;
right: 0px;
- top: 8px;
+ top: 7px;
padding-top: 6px;
padding-bottom: 6px;
padding-left: 28px;
@@ -372,7 +374,7 @@
width: 33px;
height: 21px;
padding: 7px 8px 6px 10px;
- margin-top: 7px;
+ margin-top: 6px;
@include themeable(
fill,
theme-logo-color,
@@ -389,7 +391,7 @@
.nav-search-form {
position: absolute;
- top: 7px;
+ top: 8px;
left: calc(50px + 5vw);
bottom: 0px;
width: calc(55vw - 63px);
@@ -416,7 +418,7 @@
width: calc(100% - 12px);
border-radius: 3px;
border: 0px;
- padding: 8px;
+ padding: 6px 9px;
font-size: 0.9em;
@include themeable(
background,
diff --git a/app/controllers/api/v0/articles_controller.rb b/app/controllers/api/v0/articles_controller.rb
index 234bee5d9..de53a6f6b 100644
--- a/app/controllers/api/v0/articles_controller.rb
+++ b/app/controllers/api/v0/articles_controller.rb
@@ -86,10 +86,16 @@ module Api
elsif params["article"]["series"] == ""
params["article"]["collection_id"] = nil
end
- params.require(:article).permit(
- :title, :body_markdown, :main_image, :published, :description,
- :tag_list, :organization_id, :canonical_url, :series, :collection_id
- )
+ if params["article"]["version"] == "v1"
+ params.require(:article).permit(
+ :body_markdown, :organization_id
+ )
+ else
+ params.require(:article).permit(
+ :title, :body_markdown, :main_image, :published, :description,
+ :tag_list, :organization_id, :canonical_url, :series, :collection_id
+ )
+ end
end
end
end
diff --git a/app/controllers/articles_controller.rb b/app/controllers/articles_controller.rb
index f3ffaa4cc..7aa9ed58c 100644
--- a/app/controllers/articles_controller.rb
+++ b/app/controllers/articles_controller.rb
@@ -104,7 +104,14 @@ class ArticlesController < ApplicationController
if @article
format.json { render json: @article.errors, status: :unprocessable_entity }
else
- format.json { render json: { processed_html: processed_html, title: parsed["title"] }, status: 200 }
+ format.json { render json: {
+ processed_html: processed_html,
+ title: parsed["title"],
+ tags: (Article.new.tag_list.add(parsed["tags"], parser: ActsAsTaggableOn::TagParser) if parsed["tags"]),
+ cover_image: (ApplicationController.helpers.cloud_cover_url(parsed["cover_image"]) if parsed["cover_image"])
+ },
+ status: 200
+ }
end
end
end
diff --git a/app/controllers/reading_list_items_controller.rb b/app/controllers/reading_list_items_controller.rb
index f6b36b821..96996ea1c 100644
--- a/app/controllers/reading_list_items_controller.rb
+++ b/app/controllers/reading_list_items_controller.rb
@@ -1,5 +1,5 @@
class ReadingListItemsController < ApplicationController
-
+
def index
@reading_list_items_index = true
set_view
diff --git a/app/javascript/article-form/__tests__/__snapshots__/articleForm.test.jsx.snap b/app/javascript/article-form/__tests__/__snapshots__/articleForm.test.jsx.snap
index 30710be59..63b2df629 100644
--- a/app/javascript/article-form/__tests__/__snapshots__/articleForm.test.jsx.snap
+++ b/app/javascript/article-form/__tests__/__snapshots__/articleForm.test.jsx.snap
@@ -2,64 +2,78 @@
exports[`