Does anybody know why the first li item is raised in its position. And it only happens when I add id or class to the div.
Here is code:
<div id="pickList">
<ul *ngFor="let channel of currentPickSelection">
<li class="list-group-item" style="float:Left;margin:1px;" (dragover)="onDragOver(channel[0])" (drop)="onDrop()"
[ngStyle]="{'background-color': channel[0].compChannel[0].compChannelLogo.length !== 0 ? '#8EC0D1' : 'aliceblue' }">
<ng-container *ngIf="channel[0].compChannel[0].compChannelLogo.length !== 0; else noCompChannel">
<img class="img-rounded" src="{{ channel[0].logo }}" alt="{{ channel[0].channel }}" width="50" height="50">
<img class="img-rounded" src="{{ channel[0].compChannel[0].compChannelLogo }}" alt="{{ channel[0].compChannel[0].compChannelName }}"
width="50" height="50">
</ng-container>
<br>
<div align="center">
<strong>
<font size="2">{{ channel[0].pickCode }}</font>
</strong>
</div>
</li>
</ul>
</div>
Here is the CSS:
#pickList {
height:565px;
scroll-behavior: auto;
overflow:auto;
}
I figured it out this way, by adding an extra div in between
<div class="row pickList" align="center">
<div>
<ul *ngFor="let channel of currentPickSelection">
<li class="list-group-item" style="float:Left;margin:1px;" (dragover)="onDragOver(channel[0])" (drop)="onDrop()" [ngStyle]="{'background-color': channel[0].compChannel[0].compChannelLogo.length !== 0 ? '#8EC0D1' : 'aliceblue' }">
<ng-container *ngIf="channel[0].compChannel[0].compChannelLogo.length !== 0; else noCompChannel">
<img class="img-rounded" src="{{ channel[0].logo }}" alt="{{ channel[0].channel }}" width="50" height="50">
<img class="img-rounded" src="{{ channel[0].compChannel[0].compChannelLogo }}" alt="{{ channel[0].compChannel[0].compChannelName }}"
width="50" height="50">
</ng-container>
<br>
<div align="center">
<strong>
<font size="2">{{ channel[0].pickCode }}</font>
</strong>
</div>
</li>
</ul>
</div>
</div>
Related
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.
I have no idea where the problem comes from, a similar problem happens with the like button.
I've left my code below, if you want I can post it in more detail
{% for post_item in post_items %} doesn't seem to work as it should, but whyyyy?
my.html
{% for post_item in post_items %}
<ul style="padding-inline-start: 10px;" id="dataList_post">
<li class="content hidden">
<div>
<div class="post" style="min-height: 174px; border: 1px solid #f0f0f0; border-width: 2px; border-radius: 20px; max-width: 600px; height: auto; margin-right: 100px;">
<div class="posticon">
{% if post_item.user.profile.avatar %}
<a style="text-decoration: none; color: black;" href="{% url 'users' post_item.user %}"><img src="{{ post_item.user.profile.avatar.url }}" style="border-radius: 100%; width: 48px; height: 48px;" alt=""></a>
{% else %}
<a style="text-decoration: none; color: black;" href="{% url 'users' post_item.user %}"><img src="{% static 'img/default.png' %}" style="border-radius: 100%; width: 48px; height: 48px;" alt=""></a>
{% endif %}
</div>
<div class="postname">
<a style="text-decoration: none; color: black;" href="{% url 'users' post_item.user %}">
<h5 class="postname_location" style="font-family: cursive;"><b>{{ post_item.user.username }}</b></h5>
</a>
</div>
<div class="postcomment">
<a style="text-decoration: none; color:black;" href="{{ post_item.get_absolute_url }}">
<span>{{ post_item.caption }}</span>
<br>
</a>
{% for tag in post_item.tags.all %}<b>#{{ tag }}</b>{% endfor %}
<small class="font-italic text-muted" style="float: right;">{{ post_item.posted | naturaltime }}</small>
</div>
{% if post_item.content.first.file.name|slice:"-3:" == 'jpg' or post_item.content.first.file.name|slice:"-3:" == 'png' %}
<div class="dropdown_post">
<a data-toggle="dropdown"><img style="max-height: 560px; max-width: 560px;min-width:560px; border-radius: 10px;" src="{{ post_item.content.first.file.url }}" alt="Placeholder image"></a>
<ul class="dropdown-content_notf dropdown-menu dropdown-menu-center_img">
<img style="max-height: 900px; max-width: 1200px;" src="{{ post_item.content.first.file.url }}" alt="Placeholder image">
</ul>
</div>
{% elif post_item.content.first.file.name|slice:"-3:" == 'mp4' %}
<video class="postvideo" style="max-height: 600px;" controls="controls" preload="metadata">
<source src="{{ post_item.content.first.file.url }}#t=0.5" type="video/mp4">
</video>
{% else %}
{% endif %}
</div>
</div>
<hr>
</li>
</ul>
{% endfor %}
<a style="margin-left:300px; border-radius:100px;background-image: url('img/more.png'); " class="more_post" id="moreButton_post" type="button" onclick="showMore()"><img src="{% static 'img/more.png' %}"></a>
</div>
<script>
document.querySelector('video').setAttribute("controlslist", "nodownload");
</script>
{% endblock %}
querySelector() returns the first item that matches
querySelectorAll() returns an array of all objects that match
to update the attributes on all videos, you'll want to use something like:
nodes = document.querySelectorAll('video')
for (var i=0; i<nodes.length; i++) {
node = nodes[i];
node.setAttribute("controlslist", "nodownload");
}
I have accepted a job, in which I have to work on some html and css in frontend. However, the files I was given to work with seem to be interpreted by some kind of interpreter (I think Flask with Jinja2). All I have however are frontend files and I cannot figure out, how to debug my code without any interpreter.
F:.
├───static
│ ├───css
│ └───images
│ └───navigation
└───templates
├───admin
├───cart
├───home
├───order
├───partials
├───payment
├───product
├───ticket
└───user
above I have listed the folders I have to work with. Each folder only contains html files, that look like this for example:
<input id="navi-open" type="checkbox" name="" class="ct" />
<div id="navigation" class="column">
<label for="navi-open" class="navi-button">
<img src="{{ url_for('static', filename='images/cancel.png') }}" alt="" />
</label>
<div id="navigation-items" class="column h-sb">
<div class="category">
<a href="{{ url_for('home.home') }}" style="opacity:1"
class="navigation-item light {{ 'active' if current_page == 'homepage' else '' }}">
<div style="opacity:1" class="icon">
<img src="{{ url_for('static', filename='images/karma_blackwhite.png') }}" alt=""
style="filter: invert(0);" />
</div>
<div class="label">Homepage</div>
<div class="tooltip">Homepage</div>
<div class="indicator"></div>
</a>
<a href="{{ url_for('home.news') }}" class="navigation-item {{ 'active' if current_page == 'news' else '' }}">
<div class="icon">
<img src="{{ url_for('static', filename='images/navigation/newspaper.png') }}" alt="" />
</div>
<div class="label">News</div>
<div class="tooltip">News</div>
<div class="indicator"></div>
</a>
<a href="{{ url_for('home.about') }}" class="navigation-item {{ 'active' if current_page == 'about' else '' }}">
<div class="icon">
<img src="{{ url_for('static', filename='images/navigation/information.png') }}" alt="" />
</div>
<div class="label">About</div>
<div class="tooltip">About</div>
<div class="indicator"></div>
</a>
<a href="{{ url_for('home.reviews') }}"
class="navigation-item {{ 'active' if current_page == 'reviews' else '' }}">
<div class="icon">
<img src="{{ url_for('static', filename='images/navigation/feedback.png') }}" alt="" />
</div>
<div class="label">Reviews</div>
<div class="tooltip">Reviews</div>
<div class="indicator"></div>
</a>
</div>
{% if current_user.is_authenticated %}
<div class="category">
<a href="{{ url_for('cart.cart') }}" class="navigation-item {{ 'active' if current_page == 'cart' else '' }}">
<div class="icon">
<img src="{{ url_for('static', filename='images/navigation/shopping-cart.png') }}" alt="" />
</div>
<div class="label">Cart</div>
<div class="tooltip">Cart</div>
<div class="indicator"></div>
</a>
<a href="{{ url_for('ticket.view_all_tickets') }}"
class="navigation-item {{ 'active' if current_page == 'tickets' else '' }}">
<div class="icon">
<img src="{{ url_for('static', filename='images/navigation/envelope.png') }}" alt="" />
</div>
<div class="label">Tickets</div>
<div class="tooltip">Tickets</div>
<div class="indicator"></div>
</a>
<a href="{{ url_for('user.notifications') }}" num="{{ current_user.notifications|length }}"
class="navigation-item {{ 'active' if current_page == 'notifications' else '' }}">
<div class="icon">
<img src="{{ url_for('static', filename='images/navigation/chat-2.png') }}" alt="" />
</div>
<div class="label">Notifications</div>
<div class="tooltip">Notifications</div>
<div class="indicator"></div>
</a>
<a href="{{ url_for('order.view_all_orders') }}"
class="navigation-item {{ 'active' if current_page == 'orders' else '' }}">
<div class="icon">
<img src="{{ url_for('static', filename='images/navigation/package-6.png') }}" alt="" />
</div>
<div class="label">Orders</div>
<div class="tooltip">Orders</div>
<div class="indicator"></div>
</a>
</div>
<div class="category">
<a href="{{ url_for('user.profile') }}"
class="navigation-item {{ 'active' if current_page == 'settings' else '' }}">
<div class="icon">
<img src="{{ url_for('static', filename='images/navigation/settings.png') }}" alt="" />
</div>
<div class="label">Settings</div>
<div class="tooltip">Settings</div>
<div class="indicator"></div>
</a>
<a href="{{ url_for('user.logout') }}" class="navigation-item">
<div class="icon">
<img src="{{ url_for('static', filename='images/navigation/logout.png') }}" alt="" />
</div>
<div class="label">Logout</div>
<div class="tooltip">Logout</div>
<div class="indicator"></div>
</a>
</div>
{% else %}
<label for="login" class="navigation-item">
<div class="icon">
<img src="{{ url_for('static', filename='images/navigation/login.png') }}" alt="" />
</div>
<div class="label">Login</div>
<div class="tooltip">Login</div>
<div class="indicator"></div>
</label>
{% endif %}
</div>
<input id="login" type="checkbox" name="" class="popup-controller" />
<div class="popup-wrapper">
<label for="login" class="popup-bg"></label>
<div class="popup">
<div class="popup-content">
<form id="auth-container" action="{{ url_for('user.login') }}" method="post">
{{ g.login_form.csrf_token }}
<div class="title-big">Log in to your account</div>
<div class="input-group">
<div class="input-wrapper">
<div class="input-field column"><input type="text" name="username" required="required"
placeholder="Username" />
<div class="input-label required">Username</div>
<div class="input-status"></div>
</div>
</div>
<div class="input-wrapper">
<div class="input-field column"><input type="password" name="password" required="required"
placeholder="Password" />
<div class="input-label required">Password</div>
<div class="input-status"></div>
</div>
</div>
</div>
<div class="action-btns btns row">
<button type="submit" class="button submit">Log in</button>
</div>
<div class="infos row h-sb">
Restore password
Create an account
</div>
</form>
</div>
</div>
</div>
</div>
I don't know how to work with this, if I just need to change frontend code...
Thanks
First of all, congratulations on your new job!
Did you try debugging the company's code using VScode? they have a great tutorial on how to debug python codes, and specifically Django code; Check https://code.visualstudio.com/docs/python/tutorial-django
I have this angular app, I'm trying to display some products, but at some point, I don't know why it shows me a row with only one product
Html
<div class="items-container">
<div class="row">
<div
class="col-3 single-item-display"
*ngFor="let product of products.products"
>
<img src="{{ 'assets/img/Products/' + product.img + '.jpg' }}" />
<div class="item-description">
<span>{{ product.name }}</span>
<span>{{ product.price }}$</span>
<div class="add-remove-item">
<a
href="#"
href="#"
(click)="
removeItem(product);
$event.preventDefault();
$event.stopPropagation()
"
>
<fa-icon [icon]="remove"></fa-icon>
</a>
{{ product.quantity }}
<a
href="#"
(click)="
addItem(product);
$event.preventDefault();
$event.stopPropagation()
"
>
<fa-icon [icon]="add"></fa-icon>
</a>
</div>
<a
href="#"
class="add-to-cart"
(click)="
addToCart(product);
$event.preventDefault();
$event.stopPropagation()
"
>
Agregar a carrito
</a>
<a
href="#"
class="buy-now"
style="margin-top: 10px;"
(click)="
buyNow(product); $event.preventDefault(); $event.stopPropagation()
"
>
Comprar
</a>
</div>
</div>
</div>
</div>
I got the css for the classes row and col- from w3schools.
I also tried to make an array of arrays to wrap my row class and put the *ngFor inside that div, but it didn't have the right width even if I hardcode width: 100vw
I have an AngularJS app that uses same modals to ask questions. In one modal I am able to scroll the contents but in another one, generated the same way, I am not. All scrolling works fine on desktops but not on mobile (both Safari and Chrome). I have read a lot of others posts about this problem but I haven't been to solve the problem...
This modal does scroll:
<div class="mod mod--info" ng-init="displayInfo('order')" style="overflow: scroll;">
<div class="mod__loading" ng-show="!orderInfo">
<fa name="spinner" spin></fa>
<small>{{ 'modal.info.fetch' | translate }}</small>
</div>
<div class="mod__list">
<ul>
<li class="mod__box" ng-repeat="batch in orderInfo track by batch.batch_id" ng-show="batch.order_lines.length > 0">
<span>
<label ng-show="batch['full_name']">{{ 'modal.info.batch' | translate }} {{ batch['created_at'] | amDateFormat:'DD-MM-YYYY HH:mm:ss' }}</label>
<small>{{ 'modal.info.by' | translate }} {{ batch['full_name'] }}</small>
</span>
<ul>
<li ng-repeat="line in batch.order_lines">
<label ng-bind-html="fixedLine(line)"></label>
<ul class="indent" ng-show="line.additions.length > 0">
<li ng-repeat="addition in line.additions">
<label>{{ addition.quantity }} x {{ addition.product }}</label>
</li>
</ul>
<ul class="indent" ng-show="line.menu_items.length > 0">
<li ng-repeat="menu_item in line.menu_items">
<label>{{ menu_item.quantity }} x {{ menu_item.product }}</label>
<ul class="indent" ng-show="menu_item.additions.length > 0">
<li ng-repeat="menu_item_addition in menu_item.additions">
<label>{{ menu_item_addition.quantity }} x {{ menu_item_addition.product }}</label>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
<div class="button button--danger" hm-tap="close()">
<fa name="times"></fa> {{ 'general.close' | translate }}
</div>
This one does not:
<div class="mod">
<div class="mod__list" ng-show="$index == step" ng-repeat="q in questions track by $index">
<div class="mod__heading">
<h4>
{{ product['receipt_name'] }}
<small>
{{ 'modal.question.sequal' | translate }} {{ $index + 1 }}
</small>
</h4>
</div>
<div class="mod__list-item-container">
<div class="mod__list-item mod__list-item--dark-blue ignore-nth-child" ng-repeat="a in q['answers']" hm-tap="add(a['product'])">
<span>
{{ a['product']['display_name'] }}
<span ng-show="a['price'] > 0" ng-bind="formatPrice(a['price'])"></span>
</span>
</div>
</div>
<div class="mod__list-item mod__list-item--pink" hm-tap="cancel()" ng-show="parser.toBoolean(q.required)">Annuleren</div>
<div class="mod__list-item mod__list-item--pink" hm-tap="next()" ng-hide="parser.toBoolean(q.required)">
{{ 'modal.question.skip' | translate }} <fa name="share"></fa>
</div>
</div>
</div>
The CSS for the mod__list-item-container:
&__list-item-container {
width: 100%;
max-height: 70vh;
overflow: scroll;
//overflow-y: scroll;
//-webkit-overflow-scrolling: touch;
}
Does anyone have an idea?