-
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 card for people section with bootstrap 4 upgrade
- Loading branch information
1 parent
2e38b8e
commit 533c499
Showing
4 changed files
with
116 additions
and
61 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 |
---|---|---|
@@ -1,56 +1,113 @@ | ||
<div class="container"> | ||
<div class="row"> | ||
<div class="col-md-6" style="font-family:Junction Regular;"> | ||
<% if current_user && (current_user.role == "admin" || current_user.role == "moderator")%> | ||
<h3><%= t('users.list.user_moderation') %></h3> | ||
<p><%= t('users.list.admins_ban_spam') %> </p> | ||
<% end %> | ||
<h2><%= raw t('People') %></h2> | ||
<h5><%= t('Recently active on Publiclab') =%></h5> | ||
<div> | ||
<br> | ||
<p style="width: 100%; font-size:14px; text-align: center; border-bottom: 1px solid #ccc; line-height:2px; margin: 10px 0 20px;"> | ||
<span style="background-color: #fff; padding: 0 10px; color: #808080;">Sort by: | ||
<a href = "<%= people_path %>?sort=username" style="text-decoration: underline; color: #808080;"> <%= t('users.list.username') %></a><span> | </span> | ||
<a href = "<%= people_path %>?sort=last_activity"style="text-decoration: underline; color: #808080;"> <%= t('users.list.last_activity') %></a><span> | </span> | ||
<a href = "<%= people_path %>?sort=joined" style="text-decoration: underline; color: #808080;"><%= t('users.list.joined') %></a><span> | </span> | ||
</span> | ||
</p> | ||
<br/> | ||
</div> | ||
<div class="row" id="user_cards"> | ||
|
||
<div class="col-lg-3"> | ||
<div class='row'> | ||
<div class='col-lg-12'> | ||
<p> This page shows a list of all Public Lab contributors and is sorted by those who have posted most recently. Click the profile link to view their posting activity. </p> | ||
</div> | ||
</div> | ||
<% if logged_in_as(['admin', 'moderator']) %> | ||
<h2><%= t('users.list.user_moderation') %></h2> | ||
<p><%= t('users.list.admins_ban_spam') %> </p> | ||
<% end %> | ||
</div> | ||
<div class="col-lg-9"> | ||
<h2><%= raw t('users.list.members_last_activity') %></h2> | ||
<%= render :partial => "map/peopleLeaflet" , locals: {people: true , lat:23 , lon: 4} %> | ||
<table class="table"> | ||
<tr> | ||
<th class="d-lg-none"></th> | ||
|
||
<th style="text-align: center;"><a href = "<%= people_path %>?sort=username"> <%= t('users.list.username') %></a> <i class="fa fa-arrows-v"></i></th> | ||
<th><a href = "<%= people_path %>?sort=last_activity"> <%= t('users.list.last_activity') %></a> <i class="fa fa-arrows-v"></i></th> | ||
<th><%= t('users.list.history') %></th> | ||
<th><a href = "<%= people_path %>?sort=joined"> <%= t('users.list.joined') %></a> <i class="fa fa-arrows-v"></i></th> | ||
|
||
<% if logged_in_as(['admin', 'moderator']) %> | ||
<th><%= t('users.list.moderation') %></th> | ||
<% end %> | ||
</tr> | ||
<% @users.each do |user| %> | ||
<tr> | ||
<td class="d-lg-none" style="padding-top: 16px;"> | ||
<img class="rounded-circle" id="profile-photo" style="width:40px;margin-right:8px;border: 1px solid lightgrey;" src="<%= user.profile_image %>" /> | ||
</td> | ||
<td style="display: flex; align-items: center;"> | ||
<div class="d-lg-none"> | ||
<img class="rounded-circle" id="profile-photo" style="width:40px;margin-right:8px;border: 1px solid lightgrey;" src="<%= user.profile_image %>" /> | ||
<div class ="col-md-6" id="user"> | ||
<div class="card"> | ||
<div class="card-body"> | ||
<div class="profile-image text-center"> | ||
<img class="rounded-circle img-fluid" id="profile-photo" src="<%= user.profile_image %>" /> | ||
</div> | ||
<br> | ||
<div class="card-info"> | ||
<a href="/profile/<%= user.username %>"><%= user.username %></a> | ||
<div class="sub-info"> | ||
<div>Last Activity : <%= t = user.revisions.order(timestamp: :desc).first.try(:created_at);time_ago_in_words(t) if (t) %></div> | ||
<div>History : <%= user.nodes.count %> <%= t('users.list.notes_and_edits') %></div> | ||
<div> Joined : <%= distance_of_time_in_words(user.created_at, Time.current, { include_seconds: false, scope: 'datetime.time_ago_in_words' }) %></div> | ||
</div> | ||
<% if current_user && (current_user.role == "admin" || current_user.role == "moderator") %> | ||
<div style="padding-top:16px; text-align:center;"> | ||
<% if user.status == 0 %> | ||
<i class='fa fa-ban' style="color:#a00;font-size:1em"></i> <%= t('users.list.banned') %> | ||
<% elsif user.status == 1 %> | ||
<a class="btn btn-outline-secondary btn-sm" style="font-size:1em;" data-confirm="<%= t('users.list.are_you_sure') %>" href="/ban/<%= user.uid %>" ><i class='fa fa-ban'></i> <%= t('users.list.ban') %></a> | ||
<% end %> | ||
</div> | ||
<% end %> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
<a style="margin-left: 12px;" href="/profile/<%= user.username %>"><%= user.username %></a> | ||
</td> | ||
<td style="padding-top:16px;"><%= t = user.revisions.order(timestamp: :desc).first.try(:created_at);time_ago_in_words(t) if (t) %></td> | ||
<td style="padding-top:16px;"><%= user.nodes.count %> <%= t('users.list.notes_and_edits') %></td> | ||
<td style="padding-top:16px;"><%= distance_of_time_in_words(user.created_at, Time.current, { include_seconds: false, scope: 'datetime.time_ago_in_words' }) %></td> | ||
<% if logged_in_as(['admin', 'moderator']) %> | ||
<td style="padding-top:16px;"> | ||
<% if user.status == 0 %> | ||
<i class='fa fa-ban' style="color:#a00;"></i> <%= t('users.list.banned') %> | ||
<% elsif user.status == 1 %> | ||
<a class="btn btn-outline-secondary btn-sm" data-confirm="<%= t('users.list.are_you_sure') %>" href="/ban/<%= user.uid %>" ><i class='fa fa-ban'></i> <%= t('users.list.ban') %></a> | ||
<% end %> | ||
</td> | ||
<% end %> | ||
</tr> | ||
<% end %> | ||
</table> | ||
</div> | ||
<%= will_paginate @users, renderer: WillPaginate::ActionView::BootstrapLinkRenderer unless @unpaginated %> | ||
</div> | ||
<div class="col-md-6 d-none d-md-block" style="margin-top:2em;"> | ||
<%= render :partial => "map/peopleLeaflet" , locals: {people: true , lat:23 , lon: 4} %> | ||
</div> | ||
<div class="col-md-6 d-md-none" style="margin-top:2em;"> | ||
<%= render :partial => "map/peopleLeaflet" , locals: {people: true , lat:23 , lon: 4} %> | ||
</div> | ||
</div> | ||
</div> | ||
<style> | ||
#user { | ||
padding:10px 8px 10px 8px | ||
} | ||
|
||
h5 { | ||
color: #666; | ||
} | ||
.card { | ||
background-color: #fff; | ||
border: 1px solid; | ||
border-color: #D3D3D3; | ||
border-radius: 6px; | ||
} | ||
|
||
.card-body { | ||
margin-bottom:0.3em; | ||
} | ||
|
||
.profile-image { | ||
margin-top: 0.5em; | ||
} | ||
|
||
#profile-photo { | ||
width: 6.5em; | ||
border-color:#555; | ||
border: 1px solid lightgrey; | ||
} | ||
|
||
.card-info { | ||
padding-left: 1em; | ||
padding-right:1em; | ||
} | ||
|
||
.card-info a{ | ||
font-size:1.2em; | ||
margin-bttom:1em; | ||
color:#222; | ||
} | ||
|
||
.sub-info { | ||
color:#666; | ||
font-size:0.8em; | ||
} | ||
|
||
.affix { | ||
top:50px; | ||
right:0; | ||
position:fixed; | ||
} | ||
</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