diff --git a/app/assets/stylesheets/style.css b/app/assets/stylesheets/style.css index 0bf628d7a2..a13cb906be 100644 --- a/app/assets/stylesheets/style.css +++ b/app/assets/stylesheets/style.css @@ -256,7 +256,7 @@ a .fa-white, color: #666; clear:both; margin-top: 40px; - padding: 30px; + padding: 30px !important; border-top: 1px solid #E5E5E5; background-color: #f8f8f8; } diff --git a/app/controllers/home_controller.rb b/app/controllers/home_controller.rb index 7aefcbb6dd..5c99117c68 100644 --- a/app/controllers/home_controller.rb +++ b/app/controllers/home_controller.rb @@ -5,7 +5,8 @@ def home if current_user redirect_to '/dashboard' else - blog + @projects = Tag.find_nodes_by_type('project:featured', 'page') + .sample(3) # random sampling @title = I18n.t('home_controller.science_community') render template: 'home/home' end @@ -13,7 +14,8 @@ def home # route for seeing the front page even if you are logged in def front - blog + @projects = Tag.find_nodes_by_type('project:featured', 'page') + .sample(3) # random sampling @title = I18n.t('home_controller.environmental_investigation') render template: 'home/home' @unpaginated = true diff --git a/app/models/node.rb b/app/models/node.rb index 950978f277..b4cc1c5280 100644 --- a/app/models/node.rb +++ b/app/models/node.rb @@ -275,15 +275,14 @@ def author User.find(uid) end - def coauthors - User.where(username: power_tags('with')) if has_power_tag('with') - end - - # for wikis: def authors revisions.collect(&:author).uniq end + def coauthors + User.where(username: power_tags('with')) if has_power_tag('with') + end + # tag- and node-based followers def subscribers(conditions = false) users = TagSelection.where(tid: tags.collect(&:tid)) @@ -312,6 +311,10 @@ def body latest&.body end + def summary + body.split('\n')&.first + end + # was unable to set up this relationship properly with ActiveRecord associations def drupal_main_image DrupalMainImage.order('vid') diff --git a/app/views/home/home.html.erb b/app/views/home/home.html.erb index 896fdda04b..5ce0f302fa 100644 --- a/app/views/home/home.html.erb +++ b/app/views/home/home.html.erb @@ -1,18 +1,119 @@ -