Skip to content

Commit

Permalink
displaying title
Browse files Browse the repository at this point in the history
  • Loading branch information
jaesivsm committed Jan 29, 2021
1 parent 0e14666 commit 344d1dc
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 4 deletions.
1 change: 1 addition & 0 deletions jarr/api/cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
'date': fields.DateTime()})
content_model = cluster_ns.model('ComplexContent', {
'type': fields.String(required=True),
'title': fields.String(),
'content': fields.String(),
'comments': fields.String(),
'link': fields.String(),
Expand Down
3 changes: 3 additions & 0 deletions jarr/lib/content_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ def generate(self):
text = self.article.title or self.article.content
content = {'type': self.article.article_type.value,
'alt': html.escape(text[:IMG_ALT_MAX_LENGTH]),
'title': self.article.title,
'src': self.article.link}
return True, content

Expand All @@ -100,6 +101,7 @@ def generate(self):
'from article', self.article)
try:
return True, {'type': self.article.article_type.value,
'title': self.article.title,
'player': 'youtube',
'videoId': yt_match.group(5)}
except IndexError:
Expand All @@ -119,6 +121,7 @@ def generate(self):
try:
content['content'] = self._from_goose_to_html()
content['link'] = self._page.final_url
content['title'] = getattr(self._page, 'title', self.article.title)
success = True
except Exception:
logger.exception("Could not rebuild parsed content for %r",
Expand Down
2 changes: 1 addition & 1 deletion jsclient/src/Jarr.theme.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export const jarrColors = {
contrastText: "#ffffff"
},
background: {
default: "rgb(95,158,160, 0.6)"
default: "rgb(95, 158, 160, 0.6)"
},
danger: {
main: "#F08080",
Expand Down
4 changes: 2 additions & 2 deletions jsclient/src/features/clusterlist/components/Article.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ function Article({ article, hidden, showTitle }) {
const classes = makeStyles();
const ref = useRef(null);
useEffect(() => {
if (ref.current) {
if (ref.current && ref.current.offsetTop && ref.current.offsetParent) {
window.scrollTo({ left: 0,
top: ref.current.offsetTop
+ ref.current.offsetParent.offsetTop
Expand All @@ -29,7 +29,7 @@ function Article({ article, hidden, showTitle }) {
}
return (
<div hidden={hidden} className={classes.article} ref={ref}>
<h1 hidden={!showTitle}>{article.title}</h1>
<h3 hidden={!showTitle}>{article.title}</h3>
<p>
<span>Link</span>
<Link color="secondary" target="_blank"
Expand Down
1 change: 1 addition & 0 deletions jsclient/src/features/clusterlist/components/Articles.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ function Articles({ articles, icons, content }) {
return (
<>
<Tabs indicatorColor="primary" textColor="primary"
variant="scrollable" scrollButtons="auto"
value={currentIndex}
onChange={(e, v) => setCurrentIndex(v)}>
{contentTitle}
Expand Down
2 changes: 1 addition & 1 deletion jsclient/src/features/clusterlist/components/Content.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ function Content({ content, hidden }) {
}
return (
<div hidden={hidden} className={classes.article}>
<h1>Proccessed Content</h1>
<h3>{content.title}</h3>
{head}
{comments}
<Divider />
Expand Down

0 comments on commit 344d1dc

Please sign in to comment.