-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add featured question section to shadow question page
- Loading branch information
1 parent
e634096
commit 9d5da34
Showing
5 changed files
with
168 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<% unless node.is_a?(Comment) || node.is_a?(Revision) || node.type == 'page' %> | ||
|
||
<div class="profile-image text-center"> | ||
<img class="rounded-circle img-fluid" id="profile-photo" src="<%= node.author.profile_image %>" /> | ||
</div> | ||
|
||
<a class="author" href="/profile/<%= node.author.name %>">@<%= node.author.name %></a> <%= node.author.new_contributor %> | ||
<% if node.has_power_tag('with') %> | ||
with | ||
<% node.coauthors.each_with_index do |coauthor,i| %> | ||
<a href="/profile/<%= coauthor.username %>"> | ||
<%= coauthor.username%> <%= coauthor.new_contributor %></a> | ||
<%= ',' if i < node.coauthors.length-1 %> | ||
<% end %> | ||
<% end %> | ||
<% end %> | ||
|
||
asked: | ||
</span> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
<% questions = questions || @questions # accept local if present, default to instance %> | ||
<div id="notes" class="col-md-12"> | ||
<div class="row"> | ||
<div class="col-md-2"> | ||
</div> | ||
<% questions.limit(2).each_with_index do |node,i| %> | ||
<div class="card <% if @widget %>col-xs-3 col-sm-3 col-md-3 <% end %>col-lg-3 note note-container-question" style="margin-top:20px;"> | ||
<div class="card-body"> | ||
<div class="card-info"> | ||
<p class="meta"><%= render partial: "dashboard/node_meta_shadow", locals: { node: node } %></p> | ||
<h4><a class="question" <% if @widget %>target="_blank"<% end %> href="<%= node.path(:question) %>"><%= node.title %></a></h4> | ||
<div> | ||
<div class="answer"> | ||
<% if params[:controller] == 'questions' %> | ||
<a class="peopleResponse" href="<%= node.path(:question) %>#answers" title="Answers"><%= node.answers.length %> people responded</a> | ||
<% end %> | ||
</div> | ||
</div> | ||
<a class="btn btn-outline-secondary" href="/q/<%= node.id %>" >Read More</a> | ||
</div> | ||
</div> | ||
</div> | ||
<% end %> | ||
|
||
<div class="col-md-2"> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
<style> | ||
|
||
.card { | ||
background-color: #fff; | ||
border: 1px solid; | ||
border-color: #D3D3D3; | ||
border-radius: 6px; | ||
margin:2em 1.5em 2em 1.5em; | ||
} | ||
|
||
.card-body { | ||
margin: auto; | ||
text-align: center; | ||
padding: 0.8em; | ||
} | ||
|
||
.profile-image { | ||
margin-bottom: 1em; | ||
} | ||
|
||
.author { | ||
color: #333; | ||
font-weight: bold; | ||
font-size: 1.2em; | ||
} | ||
|
||
.question { | ||
font-style: italic; | ||
color: #A9A9A9; | ||
} | ||
|
||
.peopleResponse { | ||
color: #A9A9A9; | ||
} | ||
|
||
.answer { | ||
margin-bottom: 1em; | ||
} | ||
|
||
.meta { | ||
color: #999; | ||
} | ||
|
||
#profile-photo { | ||
width: 6.5em; | ||
border-color:#555; | ||
border: 1px solid lightgrey; | ||
} | ||
|
||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters