Adds initial version of Profile View Mode.

This commit is contained in:
mateuswetah 2018-05-31 12:54:03 -03:00
parent 9cd0dad047
commit 25a3da3589
5 changed files with 115 additions and 1 deletions

View File

@ -29,6 +29,9 @@
font-size: 0.75rem;
line-height: 1.0;
margin-bottom: 0.2rem;
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
}
.metadata-value {

View File

@ -0,0 +1,64 @@
.tainacan-profile-container {
padding: 30px 4.166666667%;
.tainacan-profile {
padding: 12px;
margin: 24px;
border: 1px solid #e3e3e3;
background: #f9f9f9;
border-radius: 5px;
&:hover {
.media .media-body {
.metadata-title,
.metadata-label,
.metadata-value {
white-space: normal;
}
}
}
img {
width: 130px;
height: auto;
border-radius: 70px;
}
.media {
.media-body {
flex: 1;
font-size: 0.6875rem;
color: gray;
overflow: hidden;
.metadata-title {
flex-shrink: 0;
font-size: 0.875rem;
margin-bottom: 0.875rem;
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
}
.metadata-label {
font-size: 0.75rem;
line-height: 1.0;
margin-bottom: 0.2rem;
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
}
.metadata-value {
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
}
}
}
}
}

View File

@ -215,3 +215,5 @@ form{
@import "_view-mode-polaroid.scss";
@import "_view-mode-gallery.scss";
@import "_view-mode-profile.scss";

View File

@ -102,6 +102,12 @@ if(!function_exists('tainacan_setup')) {
'icon' => '<span class="icon"><i class="mdi mdi-polaroid mdi-24px"></i></span>',
'dynamic_metadata' => true,
]);
tainacan_register_view_mode('profile', [
'label' => 'Profile view',
'description' => 'A profile view, for displaying persons information',
'icon' => '<span class="icon"><i class="mdi mdi-account-card-details mdi-24px"></i></span>',
'dynamic_metadata' => true,
]);
}
}

View File

@ -0,0 +1,39 @@
<?php if (have_posts()): ?>
<div class="tainacan-profile-container">
<div class="row no-gutters">
<?php while (have_posts()): the_post(); ?>
<div class="col col-md-12 col-lg-6 col-xl-4">
<div class="tainacan-profile">
<div class="media">
<?php if ( tainacan_current_view_displays('thumbnail') ): ?>
<a href="<?php the_permalink(); ?>">
<?php the_post_thumbnail('medium', array('class' => 'mr-4')); ?>
</a>
<?php endif; ?>
<div class="list-metadata media-body">
<?php if ( tainacan_current_view_displays('title') ): ?>
<p class="metadata-title">
<a href="<?php the_permalink(); ?>">
<?php the_title(); ?>
</a>
</p>
<?php endif; ?>
<?php tainacan_the_metadata(array('metadata__in' => $displayed_metadata, 'exclude_title' => true, 'before_title' => '<h3 class="metadata-label">', 'before_value' => '<p class="metadata-value">')); ?>
</div>
</div>
</div>
</div>
<?php endwhile; ?>
</div>
</div>
<?php else: ?>
<div class="tainacan-cards-container">
Nenhum item encontrado
</div>
<?php endif; ?>