Skip to content

Commit

Permalink
enable and disable twitter news in home page
Browse files Browse the repository at this point in the history
  • Loading branch information
imadbourouche committed Dec 3, 2024
1 parent 34ce85e commit 7984c56
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 10 deletions.
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

0 comments on commit 7984c56

Please sign in to comment.