Use subdirectory for Discover tabs

This commit is contained in:
Andreas Nedbal 2022-07-29 20:09:33 +02:00 committed by Andreas Nedbal
parent 4b65a5bb60
commit e46b9b1389
10 changed files with 15 additions and 15 deletions

View File

@ -1,3 +0,0 @@
.tab-pane.fade{ role: :tabpanel, id: 'asked' }
- asked.each do |user|
= render 'discover/userbox', u: user.user, type: 'asked', q: user.question_count

View File

@ -1,3 +0,0 @@
.tab-pane.fade{ role: :tabpanel, id: 'answered' }
- answered.each do |user|
= render 'discover/userbox', u: user.user, type: 'most', a: user.answer_count

View File

@ -1,3 +0,0 @@
.tab-pane.active.fade.show{ role: :tabpanel, id: 'new' }
- new.each do |user|
= render 'discover/userbox', u: user, type: 'new'

View File

@ -18,9 +18,9 @@
%li.nav-item{ role: 'presentation' } %li.nav-item{ role: 'presentation' }
%a.nav-link{ href: '#comments', role: :tab, aria: { controls: 'comments' }, data: { toggle: :tab } }= t(".content.tab.comments") %a.nav-link{ href: '#comments', role: :tab, aria: { controls: 'comments' }, data: { toggle: :tab } }= t(".content.tab.comments")
.tab-content.mt-3 .tab-content.mt-3
= render 'discover/tab_answers', answers: @popular_answers = render 'discover/tab/answers', answers: @popular_answers
= render 'discover/tab_questions', questions: @popular_questions = render 'discover/tab/questions', questions: @popular_questions
= render 'discover/tab_discussed', comments: @most_discussed = render 'discover/tab/discussed', comments: @most_discussed
.col-md-5.col-sm-6 .col-md-5.col-sm-6
%h2= t(".people.heading") %h2= t(".people.heading")
%p= t(".people.description") %p= t(".people.description")
@ -33,7 +33,7 @@
%li.nav-item{ role: 'presentation' } %li.nav-item{ role: 'presentation' }
%a.nav-link{ href: '#answered', role: :tab, aria: { controls: 'answered' }, data: { toggle: :tab } }= t(".people.tab.answers") %a.nav-link{ href: '#answered', role: :tab, aria: { controls: 'answered' }, data: { toggle: :tab } }= t(".people.tab.answers")
.tab-content.mt-3 .tab-content.mt-3
= render 'discover/tab_new', new: @new_users = render 'discover/tab/new', new: @new_users
= render 'discover/tab_asked', asked: @users_with_most_questions = render 'discover/tab/asked', asked: @users_with_most_questions
= render 'discover/tab_most', answered: @users_with_most_answers = render 'discover/tab/most', answered: @users_with_most_answers
= render 'shared/links' = render 'shared/links'

View File

@ -0,0 +1,3 @@
.tab-pane.fade{ role: :tabpanel, id: 'asked' }
- asked.each do |user|
= render 'discover/userbox', u: user.user, type: 'asked', value: user.question_count

View File

@ -0,0 +1,3 @@
.tab-pane.fade{ role: :tabpanel, id: 'answered' }
- answered.each do |user|
= render 'discover/userbox', u: user.user, type: 'most', value: user.answer_count

View File

@ -0,0 +1,3 @@
.tab-pane.active.fade.show{ role: :tabpanel, id: 'new' }
- new.each do |user|
= render 'discover/userbox', u: user, type: 'new', value: time_ago_in_words(user.created_at)