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?
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'm creating a web page and if i put my div inside a form it makes it non-responsive but if i put that same form outside the div, everything works just fine.
I wanted to have a div called container-2 and 2 forms inside, one is on the left as you can see and the other one is a card payment method. If i try to resize my screen, the second form goes under the first one because i've set the flex-wrap:wrap; but the first form stays non-responsive.
Here is the code and thanks in advance.
<div class="container-2">
<form method="POST">-
<div class="item" id="payment">
<div class="row">
<h4>Možnost nakupa 1: Plačilo po povzetju <small><i>(Za plačevanje s kartico je treba izbrati samo
količino in vrsto izdelka!)</i></small></h4>
{% csrf_token %}
{% if form %}
<div class="input-group">
<div style="color: red;">{{ form.name.errors }}</div>
{{ form.name }}
</div>
<div class="input-group">
<div style="color: red;">{{ form.last_name.errors }}</div>
{{ form.last_name }}
</div>
<div class="input-group">
<div style="color: red;">{{ form.street_name.errors }}</div>
{{ form.street_name }}
</div>
<div class="input-group">
<div style="color: red;">{{ form.city_name.errors }}</div>
{{ form.city_name }}
</div>
<div class="input-group">
<div style="color: red;">{{ form.email.errors }}</div>
{{ form.email }}
</div>
<div class="input-group">
<div style="color: red;">{{ form.number.errors }}</div>
{{ form.number }}
</div>
{% endif %}
</div>
</div>
<div class="item">
<div class="row">
<div class="input-group">
{{ form.num_elements.errors }}
{{ form.num_elements }}
</div>
<div class="input-group" id="check_div">
<div
style="display: flex;width:100%;justify-content: space-between;align-items: center;font-size:medium;flex-wrap: wrap;">
<div style="display: flex;justify-content: space-between;margin:3px;">
{{ form.select_type.errors }}
{{ form.select_type.label_tag }}
{{ form.select_type }}
</div>
<div style="display: flex;justify-content: space-between;margin:3px;">
{{ form.select_type2.errors }}
{{ form.select_type2.label_tag }}
{{ form.select_type2 }}
</div>
</div>
</div>
<div class="input-group">
{{ form.warning_el.errors }}
{{ form.warning_el }}
</div>
<div style="display: flex;justify-content: space-between;margin: 0.5rem;">
<button class="button" type="submit" id="button"> Naroči <small>(povzetje)</small></button>
<a class="button" id="stripe-button">Plačaj s kartico!</a>
</div>
</div>
</div>
</form>
<div>
<form id="payment-form" data-locale="si">
<div id="payment-element">
<!--Stripe.js injects the Payment Element-->
</div>
<button id="submit" class="button1">
<div class="spinner hidden" id="spinner"></div>
<span id="button-text">Pay now</span>
</button>
<div id="payment-message" class="hidden"></div>
</form>
</div>
</div>
This is container-2.
You can add 100% in with property of your form css:
#payment {
width: 100%;
}
I have this code:
<div class="row">
<div class="box-body">
<div class="col-lg-12">
<div class="wrapper2">
<div class="col-xs-6">
<ul id="matchline-ul" class="todo-list matchline-options">
#foreach($question->answers as $answer)
#if($answer->is_key == 1)
<li id="matchline-static">
<span class="width-100" id="match-lines-options">
<input type="hidden" name="{{ $question->id }}[]" value="{{ $answer->order }}">
<div id="take-match-line-answer-text">
<span class="text padding-right-20">{!! $answer->text !!}</span>
</div>
</span>
</li>
#endif
#endforeach
</ul>
</div>
<div class="col-xs-6">
<ul class="todo-list">
#foreach($question->answers as $answer)
#if($answer->is_key == 0)
<li id="matchline-dynamic">
<span class="handle width-100">
<input type="hidden" name="{{ $question->id }}[]" value="{{ $answer->order }}">
<div id="take-order-answer-text">
<i class="fa fa-bars"></i>
</div>
<div class="float-left">
<span class="text padding-left-10">{!! $answer->text !!}</span>
</div>
</span>
</li>
#endif
#endforeach
</ul>
</div>
</div>
</div>
</div>
</div>
And the result of this is something like this photo:
I need cells on the left to match the height of cells on the right every time I move the cell up and down to be able the cell on left to be the same height as the one on right
Can someone please help me with this?
using tables instead of list or div will adjust the height and width automatically
I have a dropdown menu using boostrap card that look like this :
I set z-index property to 1000 for the card div, position absolute. This card is in a horizontal menu at the top of my page with a position fixed. My body have a relative position and my div with the content of my page have a relative position too.
This is the render of my page :
And there is my HTML code :
<body>
<div id="body">
<div class="header">
<div class="row">
<div class="col-1 col-sm-1">
<button class="hamburger">☰</button>
</div>
<!--<div class="col-1 col-sm-1 col-lg-1 offset-lg-2" id="spanSearch">
<h4><span class="badge indigo hide">{# block badge_research %}{% endblock #}</span></h4>
</div>
<div class="col-2 offset-2 col-sm-2 offset-sm-3 col-md-2 offset-md-3 col-lg-2 offset-lg-3">
<div class="search d-inline pull-right">
</i>
<form class="form-inline waves-effect waves-light" id="form">
<input class="form-control tags" id="search" type="text" placeholder="Search" onkeydown="keyDown()">
</form>
</div>
</div>
!-->
<div class="col-7 col-sm-6 col-md-6 col-lg-6 offset-lg-5">
<ul class="list-inline pull-right downMenu inline">
<li class="nav-item dropdown btn-group">
<a class="nav-link" id="dropdownMenu1" data-toggle="dropdown" aria-expanded="false"> {% if is_granted("IS_AUTHENTICATED_REMEMBERED") %} <img src="{{ asset('/Image/contact.png') }}" class="img-circle" width="50" height="50"> {% else %} {{ 'acreat.mailing.nav.account'|trans }} {% endif %}</a>
<div class="dropdown-menu top dropdown" no-escape aria-labelledby="dropdownMenu1">
<div class="card">
<div class="card-block">
<div class="container-fuild">
<div class="row">
<div class="col-3">
<img src="{{ asset('/Image/contact.png') }}" class="img-circle" width="200" height="112">
</div>
<div class="col-9">
{% if is_granted("IS_AUTHENTICATED_REMEMBERED") %}
{{ 'acreat.mailing.nav.myaccount'|trans }}
{{ 'acreat.mailing.nav.changepassword'|trans }}
{% if is_granted('ROLE_PREVIOUS_ADMIN') %}
{{'acreat.mailing.admin.impersonalisation'|trans}}
{% endif %}
</div>
</div>
<div class="card-footer text-center">
{{ 'acreat.mailing.nav.logout'|trans }}
{% else %}
{{ 'acreat.mailing.nav.login'|trans }}
</div>
{% endif %}
</div>
</div>
</div>
</li>
</ul>
<div class="search d-inline inline pull-right">
</i>
<form class="form-inline waves-effect waves-light" id="form">
<input class="form-control tags inline" id="search" type="text" placeholder="Search" onkeydown="keyDown()">
</form>
</div>
<div class="inline pull-right spanSearch">
<h5>{% block badge_research %}{% endblock %}</h5>
</div>
</div>
</div>
</div>
{% if is_granted("IS_AUTHENTICATED_REMEMBERED") %}
{% block navbar %}
<div class="sidebar blue-grey darken-4 no-escape" id="navbar">
<div class="user-box no-escape">
<a class="logo no-escape" href="/" title="Retour à l'accueil">
<img src ="https://www.acreat.com/sites/acreat.com/themes/acreat/images/logo.png" class="img-fluid text-center no-escape"></img>
</a>
<h5 class="text-center">{{ 'acreat.mailing.title.website'|trans }}</h5>
</div>
<div class="list-group panel no-escape" aria-expanded="true">
<i class="fa fa-dashboard margin-right"></i> <span>{{ 'acreat.mailing.nav.dashboard'|trans }}</span>
<i class="fa fa-tasks margin-right"></i><span>{{ 'acreat.mailing.nav.inbox'|trans }}<i class="fa fa-angle-down" id="wrapperArrow"></i></span>
<div class="collapse show no-escape" id="menu0">
<a href="/message/template/{{app.user.id}}" class="list-group-item no-escape" data-parent="#sidebar" aria-expanded="true">
<span>{{ 'acreat.mailing.nav.addmessage'|trans }}</span>
</a>
{%- set numberNotSent = doctrine.createQueryBuilder().select('COUNT(u.id)').from('CoreBundle:Message', 'u').where("u.status !='COMPLETED'")
.andWhere("u.account = " ~ app.user.id).andWhere("u.status !='SUBMITTED'").getQuery().getResult() -%}
<a href="/message/viewNotSent" class="list-group-item no-escape" data-parent="#sidebar" aria-expanded="true">
<span>{{ 'acreat.mailing.nav.messagenotsent'|trans }}
<span class="badge badge-primary badge-pill align-right">{{ numberNotSent[0][1] }}</span>
</span>
</a>
{%- set numberSent = doctrine.createQueryBuilder().select('COUNT(u.id)').from('CoreBundle:Message', 'u').where("u.status ='COMPLETED'")
.andWhere("u.account = " ~ app.user.id).getQuery().getResult() -%}
<a href="/message/viewSent" class="list-group-item no-escape" data-parent="#sidebar" aria-expanded="true">
<span>{{ 'acreat.mailing.nav.messagesent'|trans }}
<span class="badge badge-primary badge-pill align-right">{{ numberSent[0][1] }}</span>
</span>
</a>
<a href="/message/viewDraft" class="list-group-item no-escape" data-parent="#sidebar" aria-expanded="true">
<span>{{ 'acreat.mailing.nav.draft'|trans }}</span>
</a>
</div>
<i class="fa fa-list margin-right"></i> <span>{{ 'acreat.mailing.nav.mailinglist'|trans }}</span>
</i> <span>{{ 'acreat.mailing.nav.member'|trans }}</span>
{%- if is_granted('ROLE_ADMIN') -%}
<div id="adminBottom" class="no-escape">
<i class="fa fa-envelope margin-right"></i> <span >{{ 'acreat.mailing.nav.administration'|trans }}<i class="fa fa-angle-down" id="wrapperArrow2"></i></span>
<div class="collapse show no-escape" id="menu4">
{{ 'acreat.mailing.nav.administrationlist'|trans }}
{{ 'acreat.mailing.nav.administrationaccount'|trans }}
{{ 'acreat.mailing.nav.administrationnewsletter'|trans }}
{{ 'acreat.mailing.nav.administrationparameters'|trans }}
</div>
</div>
{%- endif -%}
</div>
</div>
{% endblock navbar %}
{%- endif -%}
<div id="content">
{% block body %}
{%- if app.user == false -%}
<main class="col-12 col-md-12 col-xs-12 col-lg-12 col-xl-12">
{%- else -%}
<main class="col-12 col-sm-12 col-md-12 col-lg-12 col-xl-12 ">
{%- endif -%}
{% block flashmessage %}
{% for flashMessage in app.session.flashbag.get('notice') %}
<div class="alert alert-success" role="alert">
{{ flashMessage }}
</div>
{% endfor %}
{% for flashMessage in app.session.flashbag.get('fail') %}
<div class="alert alert-danger" role="alert">
{{ flashMessage }}
</div>
{% endfor %}
{% for flashMessage in app.session.flashbag.get('success') %}
<div class="alert alert-success" role="alert">
{{ flashMessage }}
</div>
{% endfor %}
{% endblock flashmessage %}
{% block main %}
{%- block breadcrumb -%}{%- endblock -%}
<section></section>
{%- block confirmation -%}{%- endblock -%}
{% endblock main %}
{% block fos_user_content %}
{% endblock fos_user_content%}
</main>
{% endblock body %}
</div>
</div>
</body>
Thanks for the help
You should set z-index for fixed parent element, not for card
I am trying to show a list of data based on tabs. So far I was able of take the data and show it. The problem is the html part. Some parts of the html should not repeat but they have to be at least once...
[![<body class="bootstrap" >
<!--#INCLUDE VIRTUAL="TopNavInclude.asp" -->
<div class="container">
<div class="col-md-12">
<div class="panel panel-default panel-fade">
<div class="panel-heading">
<span class="panel-title">
<div class="pull-left">
<ul class="nav nav-tabs">
{% block content %}
{% for s in data_seasons %}
{% if s == 1 %}
<li class="active"></i> Temporada {{s}}</li>
{% else %}
<li></i> Temporada {{s}}</li>
{% endif %}
{% endfor %}
</ul>
</div>
<div class="btn-group pull-right">
<div class="btn-group">
<a href="#" class="btn dropdown-toggle" data-toggle="dropdown">
<span class="glyphicon glyphicon-cog"></span>
</a>
<ul class="dropdown-menu" role="menu">
<li>Action 1</li>
<li>Action 2</li>
<li class="divider"></li>
<li>Another Action</li>
</ul>
</div>
</div>
<div class="clearfix"></div>
</span>
</div>
<div class="panel-body">
<div class="tab-content">
{% for s in data_seasons %}
{% for ep in data_ep %}
{% if s == ep.tve_season %}
{% if s == 1 %}
<div class="tab-pane fade in active" id="tab{{s}}">
<h3>Episodios</h3>
<FORM ACTION="" METHOD="post">
<INPUT TYPE="hidden" NAME="FormName" VALUE="PrintLetters">
<TABLE class="table table-striped">
<THEAD>
<TR><TH>Selecionar</TH><TH style="text-align:left">Nome do Episodio</TH><TH style="text-align:left">Duracao</TH><TH>Data/Horario</TH><TH>Sumario</TH></TR>
</THEAD>
<TBODY>
<TR><TD><INPUT TYPE="checkbox" NAME="EventCode" VALUE=588031></TD><TD>{{ep.tve_name}}</TD><TD>{{ep.tve_runtime}}</TD><TD>{{ep.tve_schedule}}</TD><TD>...</TD></TR>
</TBODY>
</TABLE>
</FORM>
</div>
</div>
{% else %}
<div class="tab-pane fade" id="tab{{s}}">sss </div>
{% endif %}
{% endif %}
{% endfor %}
{% endfor %}
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<footer>
{% endblock %}][1]][1]
Original template:
http://bootsnipp.com/snippets/OMX7O
This the div part should only run once, the for it should be only for the variables:{{s}} and {{ep...}}
{% if s == ep.tve_season %}
{% if s == 1 %}
<!--This <div class="tab-pane fade in active" id="tab{{s}}">
<h3>Episodios</h3>
<FORM ACTION="" METHOD="post">
<INPUT TYPE="hidden" NAME="FormName" VALUE="PrintLetters">
<TABLE class="table table-striped">
<THEAD>
<TR><TH>Selecionar</TH><TH style="text-align:left">Nome do Episodio</TH><TH style="text-align:left">Duracao</TH><TH>Data/Horario</TH><TH>Sumario</TH></TR>
</THEAD>
<TBODY>
<TR><TD><INPUT TYPE="checkbox" NAME="EventCode" VALUE=588031></TD><TD>{{ep.tve_name}}</TD><TD>{{ep.tve_runtime}}</TD><TD>{{ep.tve_schedule}}</TD><TD>...</TD></TR>
</TBODY>
</TABLE>
</FORM>
</div> Until this-->
</div>
Look at the variables available in the for loop. There is one called forloop.first which may be a better choice than checking if s = 1.
Documentation
https://docs.djangoproject.com/en/1.10/ref/templates/builtins/#for
There is a similar discussion at:
Django {% if forloop.first %} question
Can you show what your desired output looks like?