Сверстана главная страница.
Как прилинковать остальные?
И как можно реализовать такое: https://i.imgur.com/TOjiufG.mp4
Plant plant = plantRepository.findById(id);
Optional<Plant>
implementation group: 'org.thymeleaf.extras', name: 'thymeleaf-extras-springsecurity5', version: '3.0.4.RELEASE'
sec:authorize="hasAuthority('ADMIN')"
<div class="dashboard_rules" sec:authorize="hasAuthority('ADMIN')">
<!-- Увидит только админ-->
</div>
@PreAuthorize("hasAuthority('ADMIN')")
Как в зависимости от роли пользователя, после удачного входа подгружать index.html с разным наполнением?
@AuthenticationPrincipal UserDetails currentUser
User user = (User) userService.findUserByEmail(currentUser.getUsername());
@GetMapping("/dashboard")
public String dashboard(
@AuthenticationPrincipal UserDetails currentUser,
Model model
) {
model.addAttribute("pageTitle","Панель управления");
User user = (User) userService.findUserByEmail(currentUser.getUsername());
if(user.isAdmin()) {
model.addAttribute("posts", posts.getAdminPosts());
} else {
model.addAttribute("posts", posts.getUserPosts());
}
return "backend/dashboard";
}
<div id="portfoliowrap">
<div class="portfolio-centered">
<div class="recentitems portfolio">
<?php if( have_rows('gallery') ):
while( have_rows('gallery') ) : the_row();
?>
<div class="portfolio-item graphic-design">
<div class="he-wrap tpl6">
<?php $image = get_sub_field('image');
if( !empty($image) ): ?>
<img src="<?php echo $image['url']; ?>" alt="<?php echo $image['alt']; ?>" />
<?php endif; ?>
<div class="he-view">
<div class="bg a0" data-animate="fadeIn">
<h3 class="a1" data-animate="fadeInDown"><?php the_sub_field('title'); ?></h3>
<a data-rel="prettyPhoto" href="<?php echo $image['url']; ?>" class="dmbutton a2" data-animate="fadeInUp"><i class="fa fa-search"></i></a>
<a href="<?php echo get_sub_field('page_link');?>" class="dmbutton a2" data-animate="fadeInUp"><i class="fa fa-link"></i></a>
</div>
</div>
</div>
</div>
<?php endwhile; endif; ?>
</div>
</div>
</div>
<?php echo $image['url']; ?>
<?php the_sub_field('page_link');?>
<img src="<?php echo $image['url']; ?>" alt="<?php echo $image['alt']; ?>" />
передать урл миниатюры. <div style="float:left">
<script src="//yastatic.net/es5-shims/0.0.2/es5-shims.min.js"></script>
<script src="//yastatic.net/share2/share.js" async="async"></script>
<div class="ya-share2" data-services="collections,vkontakte,facebook,odnoklassniki,moimir,gplus,twitter,pocket,viber,whatsapp"></div>
</div>
<script src="//yastatic.net/es5-shims/0.0.2/es5-shims.min.js"></script>
<script src="//yastatic.net/share2/share.js" async="async"></script>
<?php wp_footer(); ?>
</body>
<div class="ya-share2" data-services="collections,vkontakte,facebook,odnoklassniki,moimir,gplus,twitter,pocket,viber,whatsapp"></div>
.ya-share2 {
display:block;
text-align: center;
}