Apply styling for iphone - ios

I am having a issue with the styling for the iphone.
I have this form where it displays list of doctors base on a list of doctors from the db and it it generates the results correctly.
However, when the results are generated, you need to swipe from right to left to see the info.
How can I target only Iphone users so the information is within the frame of the iphone?
Here is the following form I used. Ignore the "##", I am using coldfusion and bootstrap.
$(function(){
$('##myModal').modal('show');
});
<div class="widthResults">
<nav class="hidden-xs visible-md visible-lg" ng-show="ShowResults"><uib-pagination boundary-links="true" max-size="maxPageNumbersToShow" ng-model="currentPage" total-items="resultsCount"> </uib-pagination></nav>
<nav class="visible-xs hidden-md hidden-lg" ng-show="ShowResults"><uib-pager ng-model="currentPage" total-items="resultsCount"> </uib-pager></nav>
<div class="container">
<div id="searchResults" ng-repeat="e in providers" ng-show="ShowResults">
<div class="row">
<hr />
<h4>{{e.FullName}}</h4>
</div>
<div class="row">
<div class="col-md-4 no-margin padding"><strong>Specialty: </strong>{{e.Specialty}}<br />
<span class="padding"><strong>Gender:</strong> {{e.Gender}}</span><br />
<strong>Language(s):</strong> {{e.Languages}}</div>
<div class="col-md-4 no-margin"><strong>Clinic: </strong> <i class="glyphicon glyphicon-map-marker"></i> {{e.Address1}}<br />
<span class="shiftAdd padding">{{e.Address2}} </span><br />
<strong>Phone:</strong> <i class="glyphicon glyphicon-earphone"></i> {{e.Phone | PhoneNumber}}</div>
</div>
</div>
</div>
<nav class="visible-xs hidden-md hidden-lg" ng-show="ShowResults">
<hr /><uib-pager ng-model="currentPage" total-items="resultsCount"> </uib-pager></nav>
</div>

Related

BLog Pagination for dynamic data

I have to implement pagination for a dynamically binded data for blogs on a page. On the click of the next button the next blog should come and so on.
Below is the code. It is done in asp.net mvc.
</div>
<div class="absolute cust-movetext">
<!-- <small class="text-xs font-semibold text-white">Pet Care</small> -->
#*<h1 class="text-6xl font-semibold text-white">Your Dog’s Best Life In Every Bite.fe In Every Bife In Every Bi</h1>*#
<h1 class="lg:text-4xl md:text-xl text-xl font-semibold text-white mb-2 ">#Model.BlogTitle.ToString()</h1>
<p class="text-sm font-semibold text-white ml-6px"> #Model.BloggerName</p>
</div>
</div>
</section>
<div id="wrapper">
<section>
<div id="pet_offline">
<div class="container mx-auto">
<div class="lg:pt-16 md:pt-8 pt-8 lg:px-12 md:px-12 px-4">
<div class="custp font-weightlow">
<p type="hidden" class="text-3d3d3d font-normal opac-84 lh-33px custp">
#Html.Hidden("BlogId")
#*#Html.Hidden(Model.BlogId)*#
#Html.Raw(Server.HtmlDecode(Model.BlogContent))
</p>
</div>
</div>
</div>
</div>
<div >
<button id="prebtn" class="btn">PREVIOUS</button>
<button id="nexbtn" class="btn" align="right">NEXT</button>
<img src="../content/images/bg-city.png" alt="city" class="w-full" />
</div>
</section>
</div>
Here is the code that has the data binded and I need to add pagination on this. How to do that?

How can I change the order of the parahraph and image on Boostrap 5 only on mobile?

I have tried with both order-xs-1 and order-xs-first, but none is working and i don't know why. I want on mobile the image to be first and the paragraph second.
<div class="container"> <div class="row bg-white g-0"> <div class="col-xs-12 col-sm-12 col-md-6 col-lg-6 col-xl-6 col-xxl-6 pt-5 ps-5 "> <h2 class="fs-1 fw-light">Make It The Best</h2> <h4 class="fs-3 my-3 fw-bold">Unseen experience. Join Us !</h4> <p>A wonderful serenity has taken.</p> <button type="button" class="button px-4 py-3 me-3 mt-2 fs-5">Learn More</button> </div> <div class="col-xs-12 col-sm-12 col-md-6 col-lg-6 col-xl-6 col-xxl-6 "> <img src="/images/section3/drink.jpg" class="img-fluid" alt=""> </div> </div> </div>
There are a lot of things wrong with your code. I would go back and have a proper read of the way bootstrap handles breakpoints. If you have specified col-md-6 you don't need all the other col-SZ-6, as breakpoints work from a resolution UP.
As for your exact problem, it is easily fixed by putting the column first in the HTML and then letting bootstrap move it at the iPad breakpoint with order-md-last:
<div class="container">
<div class="row bg-white g-0">
<div class="col-12 col-md-6 order-md-last mb-3">
<img src="/images/section3/drink.jpg" class="img-fluid" alt="">
</div>
<div class="col-12 col-md-6">
<h1 class="h2 fs-1 fw-light">Make It The Best</h2>
<h2 class="h4 fs-3 my-3 fw-bold">Unseen experience. Join Us !</h4>
<p>A wonderful serenity has taken.</p>
<button type="button" class="button px-4 py-3 me-3 mt-2 fs-5">Learn More</button>
</div>
</div>
</div>
You should also not use H tags to style headings, either apply a H class like I have or use CSS to change the size of your headings. Heading tags should also go in order H1->H2 etc...

Images not rendering in Rails App

i'm total beginner with all programming stuff. I decided to create a website (or should I say application? ;p) using bootstrap. Since i found Ruby very attractive i decided to integrate these 2 frameworks. So i did following this: https://github.com/twbs/bootstrap-rubygem
It went fine, i downloaded some bootstrap theme, throw all the files to my app files, change img paths in index.html.erb and when i started the server i got a website without any image. What am i doing wrong? I would appriciate any help.
my index.html.erb (which i copied from template folder)
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="description" content="">
<meta name="author" content="">
<title>Creative - Start Bootstrap Theme</title>
<!-- Bootstrap core CSS -->
<link href="test1/vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet">
<!-- Custom fonts for this template -->
<link href="test1/vendor/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css">
<link href='https://fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,700italic,800italic,400,300,600,700,800' rel='stylesheet' type='text/css'>
<link href='https://fonts.googleapis.com/css?family=Merriweather:400,300,300italic,400italic,700,700italic,900,900italic' rel='stylesheet' type='text/css'>
<!-- Plugin CSS -->
<link href="test1/vendor/magnific-popup/magnific-popup.css" rel="stylesheet">
<!-- Custom styles for this template -->
<link href="test1/assets/stylesheets/creative.min.css" rel="stylesheet">
<!-- Navigation -->
<nav class="navbar navbar-expand-lg navbar-light fixed-top" id="mainNav">
<div class="container">
<a class="navbar-brand js-scroll-trigger" href="#page-top">Start Bootstrap</a>
<button class="navbar-toggler navbar-toggler-right" type="button" data-toggle="collapse" data-target="#navbarResponsive" aria-controls="navbarResponsive" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarResponsive">
<ul class="navbar-nav ml-auto">
<li class="nav-item">
<a class="nav-link js-scroll-trigger" href="#about">About</a>
</li>
<li class="nav-item">
<a class="nav-link js-scroll-trigger" href="#services">Services</a>
</li>
<li class="nav-item">
<a class="nav-link js-scroll-trigger" href="#portfolio">Portfolio</a>
</li>
<li class="nav-item">
<a class="nav-link js-scroll-trigger" href="#contact">Contact</a>
</li>
</ul>
</div>
</div>
</nav>
<header class="masthead text-center text-white d-flex">
<div class="container my-auto">
<div class="row">
<div class="col-lg-10 mx-auto">
<h1 class="text-uppercase">
<strong>Your Favorite Source of Free Bootstrap Themes</strong>
</h1>
<hr>
</div>
<div class="col-lg-8 mx-auto">
<p class="text-faded mb-5">Start Bootstrap can help you build better websites using the Bootstrap CSS framework! Just download your template and start going, no strings attached!</p>
<a class="btn btn-primary btn-xl js-scroll-trigger" href="#about">Find Out More</a>
</div>
</div>
</div>
</header>
<section class="bg-primary" id="about">
<div class="container">
<div class="row">
<div class="col-lg-8 mx-auto text-center">
<h2 class="section-heading text-white">We've got what you need!</h2>
<hr class="light my-4">
<p class="text-faded mb-4">Start Bootstrap has everything you need to get your new website up and running in no time! All of the templates and themes on Start Bootstrap are open source, free to download, and easy to use. No strings attached!</p>
<a class="btn btn-light btn-xl js-scroll-trigger" href="#services">Get Started!</a>
</div>
</div>
</div>
</section>
<section id="services">
<div class="container">
<div class="row">
<div class="col-lg-12 text-center">
<h2 class="section-heading">At Your Service</h2>
<hr class="my-4">
</div>
</div>
</div>
<div class="container">
<div class="row">
<div class="col-lg-3 col-md-6 text-center">
<div class="service-box mt-5 mx-auto">
<i class="fa fa-4x fa-diamond text-primary mb-3 sr-icons"></i>
<h3 class="mb-3">Sturdy Templates</h3>
<p class="text-muted mb-0">Our templates are updated regularly so they don't break.</p>
</div>
</div>
<div class="col-lg-3 col-md-6 text-center">
<div class="service-box mt-5 mx-auto">
<i class="fa fa-4x fa-paper-plane text-primary mb-3 sr-icons"></i>
<h3 class="mb-3">Ready to Ship</h3>
<p class="text-muted mb-0">You can use this theme as is, or you can make changes!</p>
</div>
</div>
<div class="col-lg-3 col-md-6 text-center">
<div class="service-box mt-5 mx-auto">
<i class="fa fa-4x fa-newspaper-o text-primary mb-3 sr-icons"></i>
<h3 class="mb-3">Up to Date</h3>
<p class="text-muted mb-0">We update dependencies to keep things fresh.</p>
</div>
</div>
<div class="col-lg-3 col-md-6 text-center">
<div class="service-box mt-5 mx-auto">
<i class="fa fa-4x fa-heart text-primary mb-3 sr-icons"></i>
<h3 class="mb-3">Made with Love</h3>
<p class="text-muted mb-0">You have to make your websites with love these days!</p>
</div>
</div>
</div>
</div>
</section>
<section class="p-0" id="portfolio">
<div class="container-fluid p-0">
<div class="row no-gutters popup-gallery">
<div class="col-lg-4 col-sm-6">
<a class="portfolio-box" href="test1/app/assets/imgages/portfolio/fullsize/1.jpg">
<img class="img-fluid" src="test1/app/assets/imgages/portfoliothumbnails/1.jpg" alt="">
<div class="portfolio-box-caption">
<div class="portfolio-box-caption-content">
<div class="project-category text-faded">
Category
</div>
<div class="project-name">
Project Name
</div>
</div>
</div>
</a>
</div>
<div class="col-lg-4 col-sm-6">
<a class="portfolio-box" href="test1/app/assets/images/portfolio/fullsize/2.jpg">
<img class="img-fluid" src="test1/app/assets/images/portfoliothumbnails/2.jpg" alt="">
<div class="portfolio-box-caption">
<div class="portfolio-box-caption-content">
<div class="project-category text-faded">
Category
</div>
<div class="project-name">
Project Name
</div>
</div>
</div>
</a>
</div>
<div class="col-lg-4 col-sm-6">
<a class="portfolio-box" href="test1/app/assets/images/portfolio/fullsize/3.jpg">
<img class="img-fluid" src="test1/app/assets/images/portfolio/thumbnails/3.jpg" alt="">
<div class="portfolio-box-caption">
<div class="portfolio-box-caption-content">
<div class="project-category text-faded">
Category
</div>
<div class="project-name">
Project Name
</div>
</div>
</div>
</a>
</div>
<div class="col-lg-4 col-sm-6">
<a class="portfolio-box" href="test1/app/assets/imgages/portfolio/fullsize/4.jpg">
<img class="img-fluid" src="test1/app/assets/imgages/portfolio/thumbnails/4.jpg" alt="">
<div class="portfolio-box-caption">
<div class="portfolio-box-caption-content">
<div class="project-category text-faded">
Category
</div>
<div class="project-name">
Project Name
</div>
</div>
</div>
</a>
</div>
<div class="col-lg-4 col-sm-6">
<a class="portfolio-box" href="test1/assets/images/portfoliofullsize/5.jpg">
<img class="img-fluid" src="test1/assets/images/portfoliothumbnails/5.jpg" alt="">
<div class="portfolio-box-caption">
<div class="portfolio-box-caption-content">
<div class="project-category text-faded">
Category
</div>
<div class="project-name">
Project Name
</div>
</div>
</div>
</a>
</div>
<div class="col-lg-4 col-sm-6">
<a class="portfolio-box" href="test1/assets/images/portfolio/fullsize/6.jpg">
<img class="img-fluid" src="test1/assets/images/portfolio/thumbnails/6.jpg" alt="">
<div class="portfolio-box-caption">
<div class="portfolio-box-caption-content">
<div class="project-category text-faded">
Category
</div>
<div class="project-name">
Project Name
</div>
</div>
</div>
</a>
</div>
</div>
</div>
</section>
<section class="bg-dark text-white">
<div class="container text-center">
<h2 class="mb-4">Free Download at Start Bootstrap!</h2>
<a class="btn btn-light btn-xl sr-button" href="http://startbootstrap.com/template-overviews/creative/">Download Now!</a>
</div>
</section>
<section id="contact">
<div class="container">
<div class="row">
<div class="col-lg-8 mx-auto text-center">
<h2 class="section-heading">Let's Get In Touch!</h2>
<hr class="my-4">
<p class="mb-5">Ready to start your next project with us? That's great! Give us a call or send us an email and we will get back to you as soon as possible!</p>
</div>
</div>
<div class="row">
<div class="col-lg-4 ml-auto text-center">
<i class="fa fa-phone fa-3x mb-3 sr-contact"></i>
<p>123-456-6789</p>
</div>
<div class="col-lg-4 mr-auto text-center">
<i class="fa fa-envelope-o fa-3x mb-3 sr-contact"></i>
<p>
feedback#startbootstrap.com
</p>
</div>
</div>
</div>
</section>
<!-- Bootstrap core JavaScript -->
<script src="test1/vendor/jquery/jquery.min.js"></script>
<script src="test1/vendor/bootstrap/js/bootstrap.bundle.min.js"></script>
<!-- Plugin JavaScript -->
<script src="test1/vendor/jquery-easing/jquery.easing.min.js"></script>
<script src="test1/vendor/scrollreveal/scrollreveal.min.js"></script>
<script src="test1/vendor/magnific-popup/jquery.magnific-popup.min.js"></script>
<!-- Custom scripts for this template -->
<script src="test1/app/assets/javascript/creative.min.js"></script>
Use the helper classes:
<img class="img-fluid" src="test1/app/assets/images/portfolio/thumbnails/3.jpg" alt="">
becomes
image_tag("portfolio/thumbnails/3.jpg", class: "img-fluid")
Which should set the path correctly, assuming the file /app/assets/images/portfolio/thumbnails/3.jpg exists.

How to evaluate HTML<span sec:authentication=..> in thymleaf

I would like to Display image on my page, I am struggling with evaluating a span tag which contains an HTTP URL.
<span sec:authentication="principal.image">
I have Updated the Authentication Object to have custom fields like image, firstName, lastName etc. So Basically below HTML
<div th:fragment="logout" class="logout" sec:authorize="isAuthenticated()">
<div class="container">
<div class="row">
<div class="span2 display-label">Name:</div>
<div class="span4 display-values">
<p>
<span sec:authentication="principal.firstName"></span>
<span sec:authentication="principal.lastName"></span>
</p>
</div>
</div>
<div class="row">
<div class="span2 display-label">Email:</div>
<div class="span4 display-values">
<p>
<span sec:authentication="name"></span>
</p>
</div>
</div>
<div class="row">
<div class="span2 display-label">Image:</div>
<div class="span4 display-values">
<span sec:authentication="principal.image"> </span>
</div>
</div>
<div>
<form action="#" th:action="#{/logout}" method="post">
<input type="submit" value="Logout"/>
</form>
</div>
</div>
</div>
Is printing
Name:
Abhishek
Email:
abhishek#gmail.com
Image:
https://scontent.xx.fbcdn.net/v/t1.0-0/p480x480/320426_10151045513476766_423049521_n.jpg?oh=766767548269c2483f0ad1e865d
As you can see I do have a valid URL I want to enclose this URL as <img src=""...>
I have tried
<img src = <span sec:authentication="principal.image"> </span></img>
<img th:src = <span sec:authentication="principal.image"> </span></th>
But none of these is working.
PS: I don't want to create a model attribute to store image URL and show it on page.
The syntax you have posted is not correct. Try using the authentication object with the following syntax:
<img th:if="${#authentication.principal.image}"
th:src="${#authentication.principal.image}"
alt="placeholder" />

Combining conditions and iterations in thymeleaf

I want to generate a list o products using thymeleaf and bootstrap so that I have three products on a row.
If it weren't for the rows, I would have done something like:
<div class="col-sm-4" th:each="product, : ${products}">
<div class="product">
<h3 th:text="${product.name}">Product name</h3>
<img th:src="${product.imagePath}" />
</div>
</div>
But I want to enclose each three products in a <div class="row"> and I just can't figure out how to do this. Has anyone else stumbled upon this problem ? How can I achieve the desired output without explicitly creating lists of three products in the controller ?
Desired output
<div class="row">
<div class="col-sm-4">
<div class="product">
<h3>Product 1 name</h3>
<img src="/path/to/image" />
</div>
</div>
<div class="col-sm-4">
<div class="product">
<h3>Product 2 name</h3>
<img src="/path/to/image" />
</div>
</div>
<div class="col-sm-4">
<div class="product">
<h3>Product 3 name</h3>
<img src="/path/to/image" />
</div>
</div>
</div>
<div class="row">
<div class="col-sm-4">
<div class="product">
<h3>Product 1 name</h3>
<img src="/path/to/image" />
</div>
</div>
<div class="col-sm-4">
<div class="product">
<h3>Product 2 name</h3>
<img src="/path/to/image" />
</div>
</div>
<div class="col-sm-4">
<div class="product">
<h3>Product 3 name</h3>
<img src="/path/to/image" />
</div>
</div>
</div>
I would include Apache Commons Collections 4.1 and use ListUtils to partition the list and iterate like this:
<th:block th:with="partitions=${T(org.apache.commons.collections4.ListUtils).partition(products, 3)}">
<div class="row" th:each="partition: ${partitions}">
<div class="col-sm-4" th:each="product: ${partition}">
<div class="product">
<h3 th:text="${product.name}">Product name</h3>
<img th:src="${product.imagePath}" />
</div>
</div>
</div>
</th:block>

Resources