I pasted this jsfiddle and it doesn't open the popup window - html

I have pasted a jsfiddle into my webpage and it doesn't work. Here is the jsfiddle. Pasted the CSS and javascript into the appropriaate places. There seem to be no errors on the console related to the link or popup.
All the link seems to do is to reload the current page.
Here is my HTML :
<div class="container">
<div class="row">
<div class="col-lg-8 col-md-8">
<!-- POST -->
{% for entry in entries %}
<div class="panel panel-default">
<div class="panel-body">
<div class="media media-clearfix-xs-min">
<div class="media-left">
<a href="lesson.html">
<span class="media-object icon-block bg-default"><i class="fa fa-github"></i></span>
</a>
</div>
<div class="media-body">
<h3 class="media-heading h4">{{ entry.title }}</h3>
<p class="small text-muted">
<!-- <i class="fa fa-clock-o fa-fw"></i> time since post -->
Open PopUp
<div class="popup-box" id="popup-box-1">
<div class="close">X</div>
<div class="top">
<h2>Sample Header</h2>
</div>
<div class="bottom">
<p><h1>Sample Text</h1></p>
</div>
</div>
<i class="fa fa-user fa-fw"></i> {{entry.user_name}}
<i class="fa fa-calendar fa-fw"></i> {{entry.date_posted}}
</p>
{% for tag in entry.tagList %}
<span class="label label-default">{{tag}}</span>
{% endfor %}
</div>
</div>
</div>
</div>
{% else %}
<em>No entries!</em>
{% endfor %}
</div>
</div>
</div>

Sorry, here, I should have tested more.
I thought I had pasted the javascript in the right file, but I didn't. Once I pasted the js in the right file, it worked fine.

Related

how to display <div> next to each other within a for loop?(laravel)

I'm working on a alumni portal where I need to display the committee member details. I need to print like 4 members in a line and next 4 in the next line. Any solution would be helpful.
<h2>Member Details</h2>
<div class="jumbotron container">
<div class="pull-right">
<a class="btn btn-primary" data-toggle="modal" id="mediumButton" data-target="#mediumModal" data-attr="{{ route('add_details')}}" title="Add Institute Details"> <i class="fas fa-plus-circle"></i>
</a>
</div>
<div class="container main" id="wrapper">
#foreach ($members as $member)
<div class="img-box">
<pre>
<img src="/uploads/image/{{ $member->image }}" width="100" height="100"/>
{{ $member->id }}<br/>
<a> {{ $member->name }}</a>
<!-- #if(($member->id) >=5 )
<span style="white-space: pre-line">
</span>
#endif
</pre> -->
</div>
#endforeach
</div>
</div>
if you use Bootstrap try this
<div class="row">
#foreach ($members as $member)
<div class="col-md-3">
<div class="img-box">
<pre>
<img src="/uploads/image/{{ $member->image }}" width="100" height="100"/>
{{ $member->id }}<br/>
<a> {{ $member->name }}</a>
</pre>
</div>
</div>
#endforeach
</div>
Add "display:grid;" to the container "div" tag You need to define the property.

elements in a foreach loop getting different css/bootstrap styles in laravel

am getting this weird bug whereby css styles are only applying to the first 2 items in my foreach loop.here is my code.
//html code
<div class="row">
#if ($housescategory->isEmpty())
<div class="col-lg-4">
No houses Found At the Moment
</div>
#else
#foreach ($housescategory as $rentalhse)
<div class="col-lg-4">
<section class="card hsecard">
<figure>
<div class="img-overlay hot-home">
#if($rentalhse->vacancy_status==1)
<span class="badge badge-info p-2 rounded-0 statusbadge">Vacants Available</span>
#elseif($rentalhse->vacancy_status==2)
<span class="badge badge-success p-2 rounded-0 statusbadge">Fully Booked</span>
#endif
<img src="{{ asset ('imagesforthewebsite/rentalhouses/rentalimages/medium/'.$rentalhse->rental_image) }}" alt="{{ $rentalhse->rental_name }}">
</div>
{{ $rentalhse->id }}<figcaption>{{ $rentalhse->rental_name }}
</figcaption>
<div class="pricelocation" style="display: flex;
justify-content: space-between;">
<section class="location">
<a class="disabled font-italic h6"><i class="fa fa-map-marker"></i>{{ $rentalhse->houselocation->location_title }}</a>
</section>
<section class="pricelink">
<span class="btn btn-dark">sh.{{ $rentalhse->monthly_rent }}</span>
</section>
</div>
</figure>
<div class="card-content">
<p>{!! Str::limit($rentalhse->rental_details, 80)!!}</p>
<section class="icons-home">
<div class="name-icon">
#if ($rentalhse->cctv_cameras == 'yes')
<span>CCtv Security Cameras</span>
<div class="icon">
<i class="fa fa-camera-retro"></i>
<span>Available</span>
</div>
#endif
</div>
<div class="name-icon">
#if ($rentalhse->parking == 'yes')
<span>Parking</span>
<div class="icon">
<i class='fas fa-parking'></i>
<span>Available</span>
</div>
#endif
</div>
<div class="name-icon">
#if ($rentalhse->generator == 'yes')
<span>Backup Generator</span>
<div class="icon">
<i class="fa fa-bolt"></i>
<span>Available</span>
</div>
#endif
</div>
</section>
</div>
<div class="viewprice" style="display: flex;
justify-content: space-between; margin:0px !important;">
<section class="viewlink">
Contact Admin
</section>
<section class="viewlink">
<a class="btn-sm btn-warning" href="{{ url('rentalhse/'.$rentalhse->rental_slug.'/'.$rentalhse->id) }}" role="button" >
View Details
</a>
</section>
</div>
</section>
</div>
#endforeach
#endif
here its how it looks like in the page .here the paragraph starts getting itaicised which is a different style from the first one.. here is the other part here the column gets smaller different from the set one in the row.its been giving me headache i havent understood why its coming up.

Unwanted gaps appear on the template (Django)

I give the products to the page with the loop in the template, but there is a problem. There is a gap on the page and I can't find the reason. Most likely because of HTML codes. I will be glad if you help.
This gap in the middle
products.html
<!-- STORE -->
<div id="store">
<!-- row -->
<div class="row">
<!-- Product Single -->
{% for product in products %}
{% if product.available %}
<div class="col-md-4 col-sm-6 col-xs-6">
<div class="product product-single">
<div class="product-thumb">
<div class="product-label">
<span>New</span>
{% if product.sale %}
<span class="sale">-{{product.sale}}%</span>
{% endif %}
</div>
<button class="main-btn quick-view"><i class="fa fa-search-plus"></i> Göz At</button>
<img src="{{product.main_image.url}}" alt="">
</div>
<div class="product-body">
{% if product.sale %}
<h3 class="product-price">{{product.discount}} AZN <del class="product-old-price">{{product.price}} AZN</del></h3>
{% else %}
<h3 class="product-price">{{product.price}} AZN</h3>
{% endif %}
<div class="product-rating">
<i class="fa fa-star"></i>
<i class="fa fa-star"></i>
<i class="fa fa-star"></i>
<i class="fa fa-star"></i>
<i class="fa fa-star-o empty"></i>
</div>
<h2 class="product-name">{{product.name}}</h2>
<div class="product-btns">
<button class="main-btn icon-btn"><i class="fa fa-heart"></i></button>
<button class="main-btn icon-btn"><i class="fa fa-exchange"></i></button>
<button class="primary-btn add-to-cart"><i class="fa fa-shopping-cart"></i> Səbətə At</button>
</div>
</div>
</div>
</div>
{% endif %}
{% endfor %}
<!-- /Product Single -->
</div>
<!-- /row -->
</div>
<!-- /STORE -->

Can not see image during server side rendering in django

I can not see the image during server side rendering in django. Any help or hint would be appreciated. Below is the code I have written.
{% if object_list %}
{% for post in object_list %}
<div id="colorlib-main">
<section class="ftco-section ftco-no-pt ftco-no-pb">
<div class="container">
<div class="row d-flex">
<div class="col-xl-8 py-5 px-md-5">
<div class="row pt-md-4">
<div class="col-md-12">
<div class="d-md-flex">
<div class="text text-2 pl-md-4">
<h3 class="mb-2">{{post.title}}</h3>
<div class="meta-wrap">
<p class="meta">
<span><i class="icon-calendar mr-2"></i>June 28, 2019</span>
<span><i class="icon-folder-o mr-2"></i>Travel</span>
<span><i class="icon-comment2 mr-2"></i>5 Comment</span>
</p>
</div>
<p class="mb-4">A small river named Duden flows by their place and supplies it with the necessary regelialia.</p>
<p>Read More <span class="ion-ios-arrow-forward"></span></p>
</div>
</div>
</div>
</div>
{% endfor %}
{% else %}
<p>No post yet!!</p>
{% endif %}
Any clue/hint?

How to use an angular function in my case?

I have to hide some button in an html page and for this I wanted to use a line that is located in another html file of mine, the ng-if="category.layers_count > 0".
enter image description here
But when I tried to put it in my other file, it doesn't work and I don't know why.
This is how I tried to do it.
{% verbatim %}
<div ng-repeat="category in categories"</div>
{% endverbatim %}
<div ng-if="category.layers_count > 0">
<div class="col-xs-4 col-sm-3 col-md-2 col-lg-1">
<a target="_self" href="{% url "search" %}?limit=100&offset=0&category__identifier__in=biota">
<div class="category" data-toggle="tooltip" data-placement="auto"
title="{% trans "Flora and/or fauna in natural environment. Examples: wildlife, vegetation, biological sciences, ecology, wilderness, sealife, wetlands, habitat." %}">
<i class="fa fa-leaf fa-3x"></i>
<h4>{% trans "Biota" %}</h4>
</div>
</a>
</div>
</div>