Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: enable and disable twitter section #880

Merged
merged 2 commits into from
Dec 10, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .env.sample
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ API_KEY=

UI_THEME=ontoportal

TWITTER_NEWS=

BIOMIXER_URL=
BIOMIXER_APIKEY=

Expand Down
7 changes: 6 additions & 1 deletion app/assets/stylesheets/home.scss
Original file line number Diff line number Diff line change
Expand Up @@ -412,6 +412,11 @@ i.fa.fa-caret-square-o-down {
}
.home-sub-section-left{
width: 550px;
flex-grow: 0;
}
.home-sub-section-left.full-width {
width: 100%; /* Takes the full width when the right section is absent */
flex-grow: 1; /* Allows the left section to stretch and fill available space */
}

.home-sub-section-right{
Expand All @@ -423,7 +428,7 @@ i.fa.fa-caret-square-o-down {
font-weight: 700;
}
.home-fair-scores{
height: 360px;
/* height: 550px; */
padding-top: 35px;
}
.home-twitter-news{
Expand Down
20 changes: 11 additions & 9 deletions app/views/home/index.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,8 @@
%img{:src => asset_path("play-white.svg")}/
.home-section
.home-section-sub-sections-container
.home-sub-section-left
- is_twitter_enabled = !$TWITTER_NEWS.blank?
.home-sub-section-left{class: (is_twitter_enabled ? '' : 'full-width')}
%div.align-items
%h4.margin-items= t('home.fairness')
= render Display::InfoTooltipComponent.new(text: t('home.info_tooltip_text') )
Expand Down Expand Up @@ -166,14 +167,15 @@
%div.home-fair-details
%p= t('home.fair_details')

.home-sub-section-right
%h4= t('home.twitter_news')
%hr.home-section-line
.home-card.home-twitter-news
%a.twitter-timeline{"data-height" => "360", :href => "https://twitter.com/lagroportal?ref_src=twsrc%5Etfw"}
.home-twitter-loader
= render LoaderComponent.new(type: 'pulsing')
%script{:async => "", :charset => "utf-8", :src => "https://platform.twitter.com/widgets.js"}
- if is_twitter_enabled
.home-sub-section-right
%h4= t('home.twitter_news')
%hr.home-section-line
.home-card.home-twitter-news
%a.twitter-timeline{"data-height" => "360", :href => $TWITTER_NEWS}
.home-twitter-loader
= render LoaderComponent.new(type: 'pulsing')
%script{:async => "", :charset => "utf-8", :src => "https://platform.twitter.com/widgets.js"}

- if slices_enabled?
.home-section
Expand Down
3 changes: 3 additions & 0 deletions config/bioportal_config_env.rb.sample
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ $ORG_URL = ENV['ORG_URL']
# Site name (required)
$SITE = ENV['SITE']

# Twitter section
$TWITTER_NEWS = ENV["TWITTER_NEWS"]

# Full string for site, EX: "NCBO BioPortal", do not modify
$ORG_SITE = $ORG.nil? || $ORG.empty? ? $SITE : "#{$ORG} #{$SITE}"

Expand Down
Loading