Skip to content

Commit

Permalink
Merge pull request #40 from ontoportal-lirmm/fix/disable-ga
Browse files Browse the repository at this point in the history
Fix: Disable GA from home and ontologies pages until support the new version of  GA4
  • Loading branch information
gturrisi-lifewatch authored Feb 7, 2024
2 parents cac0e20 + ded5a6a commit b101ed3
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 15 deletions.
12 changes: 6 additions & 6 deletions app/controllers/home_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,17 +48,17 @@ def index
@individuals_count = LinkedData::Client::Models::Metrics.all.map {|m| m.individuals.to_i}.sum
@prop_count = 36286
@map_count = total_mapping_count
@analytics = LinkedData::Client::Analytics.last_month
#@analytics = LinkedData::Client::Analytics.last_month

@ontology_names = @ontologies.map { |ont| ["#{ont.name} (#{ont.acronym})", ont.acronym] }

@anal_ont_names = {}
@anal_ont_numbers = []
@analytics.onts[0..4].each do |visits|
ont = @ontologies_hash[visits[:ont].to_s]
@anal_ont_names[ont.acronym] = ont.name
@anal_ont_numbers << visits[:views]
end
# @analytics.onts[0..4].each do |visits|
# ont = @ontologies_hash[visits[:ont].to_s]
# @anal_ont_names[ont.acronym] = ont.name
# @anal_ont_numbers << visits[:views]
# end


end
Expand Down
6 changes: 3 additions & 3 deletions app/controllers/ontologies_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ def index
@groups = LinkedData::Client::Models::Group.all(display_links: false, display_context: false)
@groups_hash = Hash[@groups.map {|g| [g.id, g] }]

analytics = LinkedData::Client::Analytics.last_month
@analytics = Hash[analytics.onts.map {|o| [o[:ont].to_s, o[:views]]}]
#analytics = LinkedData::Client::Analytics.last_month
#@analytics = Hash[analytics.onts.map {|o| [o[:ont].to_s, o[:views]]}]

reviews = {}
LinkedData::Client::Models::Review.all(display_links: false, display_context: false).each do |r|
Expand Down Expand Up @@ -93,7 +93,7 @@ def index
o[:review_count] = ont.reviews.length
o[:project_count] = ont.projects.length
o[:private] = ont.private?
o[:popularity] = @analytics[ont.acronym] || 0
#o[:popularity] = @analytics[ont.acronym] || 0
o[:submissionStatus] = []
o[:administeredBy] = ont.administeredBy
o[:name] = ont.name
Expand Down
12 changes: 6 additions & 6 deletions app/views/home/index.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,12 @@
%div.row.pt-3.statistics
%div.col
%div.card-deck
-# Ontology visits
%div.card
%div.card-header Semantic Resource Visits #{"in full #{$SITE} " if at_slice?} (#{@analytics.date.strftime("%B %Y")})
= content_tag(:div, nil, id: "ontology-visits-chart", class: "card-body", data: {ontnames: @anal_ont_names, ontnumbers: @anal_ont_numbers}) do
%canvas#myChart
= link_to("More", visits_path())
-# -# Ontology visits
-# %div.card
-# %div.card-header Semantic Resource Visits #{"in full #{$SITE} " if at_slice?} (#{@analytics.date.strftime("%B %Y")})
-# = content_tag(:div, nil, id: "ontology-visits-chart", class: "card-body", data: {ontnames: @anal_ont_names, ontnumbers: @anal_ont_numbers}) do
-# %canvas#myChart
-# = link_to("More", visits_path())
-# Ontology statistics
%div.card
%div.card-header #{$SITE} Statistics #{"in full #{$SITE}" if at_slice?}
Expand Down

0 comments on commit b101ed3

Please sign in to comment.