Skip to content

Commit

Permalink
Merge pull request #138 from standardnotes/fix/unlisted_posts_privacy
Browse files Browse the repository at this point in the history
Fix/unlisted posts privacy
  • Loading branch information
daianaszwimer authored Apr 5, 2021
2 parents b0ab875 + 005a9a9 commit 59f6d33
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 3 deletions.
6 changes: 6 additions & 0 deletions app/views/layouts/application.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,12 @@
</script>
<!-- End Piwik Code -->

<script type="text/javascript">
if("<%= ENV["RAILS_ENV"] %>" !== "development" && typeof window.__REACT_DEVTOOLS_GLOBAL_HOOK__ === "object") {
window.__REACT_DEVTOOLS_GLOBAL_HOOK__.inject = function () {}
}
</script>

</head>

<body>
Expand Down
3 changes: 2 additions & 1 deletion app/views/shared/_footer.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@
blogPage: @blog_page,
author: (@display_author || @author || @post && @post.author).as_json(
only: :display_name
)
),
privatePost: @post && @post.unlisted
}) %>
1 change: 1 addition & 0 deletions client/app/components/authors/HeaderContainer.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ const HeaderContainer = ({
pages={pages}
authorGuestbookEntriesUrl={authorGuestbookEntriesUrl}
currentUrl={currentUrl}
privatePost={privatePost}
/>
);

Expand Down
6 changes: 4 additions & 2 deletions client/app/components/shared/Footer.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import PropTypes from "prop-types";
import React from "react";
import "./Footer.scss";

const Footer = ({ blogPage, author }) => (
const Footer = ({ blogPage, author, privatePost }) => (
<div id="footer" className={blogPage ? "footer--blog-page" : ""}>
<div className="footer__container">
<p className="p3">Listed Blogging Platform</p>
Expand All @@ -12,7 +12,7 @@ const Footer = ({ blogPage, author }) => (
{" "}
{(new Date()).getFullYear()}
{" "}
{author.display_name}
{!privatePost && author.display_name}
</p>
)}
<p className="p3">
Expand All @@ -31,11 +31,13 @@ Footer.propTypes = {
display_name: PropTypes.string.isRequired,
}),
blogPage: PropTypes.bool,
privatePost: PropTypes.bool,
};

Footer.defaultProps = {
author: null,
blogPage: false,
privatePost: false,
};

export default (props) => <Footer {...props} />;

0 comments on commit 59f6d33

Please sign in to comment.