mirror of
https://github.com/Retrospring/retrospring.git
synced 2025-03-15 18:39:58 +01:00
add basic functionality
This commit is contained in:
parent
5c13dda585
commit
86b5e9933e
7 changed files with 44 additions and 5 deletions
3
app/views/discover/_tab_answers.html.haml
Normal file
3
app/views/discover/_tab_answers.html.haml
Normal file
|
@ -0,0 +1,3 @@
|
|||
.tab-pane.active.fade.in{role: "tabpanel", id: "answers"}
|
||||
- answers.each do |a|
|
||||
= render 'shared/answerbox', a: a
|
3
app/views/discover/_tab_asked.html.haml
Normal file
3
app/views/discover/_tab_asked.html.haml
Normal file
|
@ -0,0 +1,3 @@
|
|||
.tab-pane.fade{role: "tabpanel", id: "asked"}
|
||||
- asked.each do |user|
|
||||
= render 'discover/userbox', u: user.user, type: "asked", q: user.question_count
|
3
app/views/discover/_tab_new.html.haml
Normal file
3
app/views/discover/_tab_new.html.haml
Normal file
|
@ -0,0 +1,3 @@
|
|||
.tab-pane.active.fade.in{role: "tabpanel", id: "new"}
|
||||
- new.each do |user|
|
||||
= render 'discover/userbox', u: user, type: "new"
|
3
app/views/discover/_tab_questions.html.haml
Normal file
3
app/views/discover/_tab_questions.html.haml
Normal file
|
@ -0,0 +1,3 @@
|
|||
.tab-pane.fade{role: "tabpanel", id: "questions"}
|
||||
- questions.each do |q|
|
||||
= render 'shared/question', q: q
|
20
app/views/discover/_userbox.html.haml
Normal file
20
app/views/discover/_userbox.html.haml
Normal file
|
@ -0,0 +1,20 @@
|
|||
.panel.panel-default.questionbox{data: { id: u.id }}
|
||||
.panel-body
|
||||
.media
|
||||
.pull-left
|
||||
%img.answerbox--img{src: u.profile_picture.url(:medium)}
|
||||
.media-body
|
||||
%h6.media-heading
|
||||
- if u.display_name.blank?
|
||||
%span= u.screen_name
|
||||
- else
|
||||
%span= u.display_name
|
||||
%span.text-muted= u.screen_name
|
||||
%p.answerbox--question-text
|
||||
- if type == "new"
|
||||
registered
|
||||
= time_ago_in_words(u.created_at)
|
||||
ago
|
||||
- else
|
||||
asked
|
||||
= pluralize(q, "question")
|
|
@ -4,7 +4,7 @@
|
|||
.particle-content
|
||||
%h1 Discover
|
||||
%p
|
||||
The perfect place to find interesting content on
|
||||
The perfect place to find interesting content from the last week on
|
||||
= succeed '!' do
|
||||
= APP_CONFIG['site_name']
|
||||
.container
|
||||
|
@ -20,15 +20,21 @@
|
|||
%li{role: "presentation"}
|
||||
%a{href: "#questions", role: "tab", aria: {controls: "questions"}, data: {toggle: "tab"}}
|
||||
Questions
|
||||
.tab-content
|
||||
= render 'discover/tab_answers', answers: @popular_answers
|
||||
= render 'discover/tab_questions', questions: @popular_questions
|
||||
.col-md-4.col-sm-6
|
||||
%h2 Users
|
||||
%p Users that ask the most questions and new users!
|
||||
%div{role: "tabpanel"}
|
||||
%ul.nav.nav-tabs{role: "tablist"}
|
||||
%li.active{role: "presentation"}
|
||||
%a{href: "#asked", role: "tab", aria: {controls: "asked"}, data: {toggle: "tab"}}
|
||||
Most Asked Questions
|
||||
%li{role: "presentation"}
|
||||
%a{href: "#new", role: "tab", aria: {controls: "new"}, data: {toggle: "tab"}}
|
||||
New Users
|
||||
%p TODO: Add content
|
||||
%li{role: "presentation"}
|
||||
%a{href: "#asked", role: "tab", aria: {controls: "asked"}, data: {toggle: "tab"}}
|
||||
Most Asked Questions
|
||||
.tab-content
|
||||
= render 'discover/tab_new', new: @new_users
|
||||
= render 'discover/tab_asked', asked: @users_with_most_questions
|
||||
.tab-content
|
||||
|
|
|
@ -22,6 +22,7 @@
|
|||
%ul.nav.navbar-nav
|
||||
= nav_entry "Timeline", root_path
|
||||
= nav_entry "Inbox", "/inbox", badge: inbox_count
|
||||
= nav_entry "Discover", discover_path
|
||||
%ul.nav.navbar-nav.navbar-right
|
||||
= render "layouts/notifications"
|
||||
%li.hidden-xs{"data-toggle" => "tooltip", "data-placement" => "bottom", title: "Ask a question"}
|
||||
|
|
Loading…
Reference in a new issue