Vue component getting cut off inside card - vue.js

This is happening to one of the final components
This is what I want it to look like
This is the code for the card, I'm not sure why the upload is getting cut off I've tried adding a fixed height for the avatar-uploader class and for the div around it but so far nothing has helped.
<el-card>
<el-form class="form" :model="ruleForm" :rules="rules" ref="ruleForm" role="form">
<h1>Editando Curso</h1>
<el-form-item label="Nombre del curso" class="labels" prop="name">
<el-input v-model="ruleForm.name"></el-input>
</el-form-item>
<el-form-item label="Seleccione la materia requerida">
<el-select style="width: 80%;" v-model="matery" prop="materia" name="materia"
placeholder="Seleccionar la materia"
clearable>
<el-option
v-for="item in materia"
:key="item.id"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
<el-checkbox v-model="strict" prop="strict" name="strict">Obligatorio</el-checkbox>
<el-checkbox v-if="matery" v-model="remover" prop="remover">Remover</el-checkbox>
</el-form-item>
<el-form-item label="Resumen" prop="resumen">
<el-input type="textarea" v-model="ruleForm.summary"></el-input>
</el-form-item>
<el-form-item label="Descripcion" prop="description" class="vue-editor-form">
<vue-editor v-model="ruleForm.description">
<el-input v-model="ruleForm.description"></el-input>
</vue-editor>
</el-form-item>
<el-row :gutter="20">
<el-col :md="8">
<el-form-item label="Precio" prop="price">
<el-input-number controls-position="right" class="full-width" :min="1"
v-model="ruleForm.price"></el-input-number>
</el-form-item>
</el-col>
<el-col :md="8">
<el-form-item label="Horas" prop="hours">
<el-input-number controls-position="right" class="full-width" :min="1"
v-model="ruleForm.hours"></el-input-number>
</el-form-item>
</el-col>
<el-col :md="8">
<el-form-item label="Nota mínima" prop="min_grade">
<el-input-number controls-position="right" class="full-width" :min="1"
v-model="ruleForm.min_grade"></el-input-number>
</el-form-item>
</el-col>
</el-row>
<div class="line">
<el-upload
class="avatar-uploader"
action="/api/courses/upload-image"
:show-file-list="false"
:on-success="handleAvatarSuccess"
:before-upload="beforeAvatarUpload">
<img class="avatar" v-if="imageUrl" :src="imageUrl"/>
<img class="avatar" v-else :src="ruleForm.image"
#error="this.src='https://www.logistec.com/wp-content/uploads/2017/12/placeholder.png'">
</el-upload>
</div>
<el-row class="text-right">
<a href="/courses">
<el-button type="danger" plain>Cancelar</el-button>
</a>
<el-button icon="el-icon-check" type="danger" plain #click="submit(ruleForm)">
Guardar Edición
</el-button>
</el-row>
</el-form>
</el-card>
relevant css, the <el-card> had a class on it but that class doesn't exist so I removed it
.text-right {
text-align: right;
}
.full-width {
width: 100% !important;
}
.labels {
text-align: center;
padding-top: 2%;
}
.line {
text-align: center;
width: 100%;
}
.avatar-uploader .el-upload {
border: 1px dashed #d9d9d9;
border-radius: 6px;
cursor: pointer;
position: relative;
overflow: hidden;
height: 250px;
}
.avatar-uploader .el-upload:hover {
border-color: #409EFF;
}
.avatar-uploader-icon {
font-size: 28px;
color: #8c939d;
width: 178px;
height: 178px;
line-height: 178px;
text-align: center;
}
.avatar {
width: 178px;
height: 178px;
display: block;
}

Related

How do i click on the label to upload the file and show the file name in Vue 2

Here is my code but it has not been added logic.
I'm trying to click on the label to upload the file instead of using the input tag.
Apply.vue
<div class="line">
<h6>Upload CV:</h6>
<div class="up-cv">
<button #click="onFileChange" type="button" id="custom-button">
<img src="../../assets/recruit/taicv.svg" alt="" />Upload
</button>
<input id="real-file" type="file" style="display: none" name="image" />
<div class="name-cv">
<h5 id="custom-text">you have not selected the file</h5>
<img onclick="deleteFile()" src="../../assets/recruit/delete.svg" alt="" />
</div>
</div>
</div>
Looking forward to your help, thanks a lot...
I have created one Demo as you want on stackblitz.
link - https://vue-j4h4a6.stackblitz.io/
also I have attached source code here
<template>
<div id="app">
<div class="line">
<h6>Upload CV:</h6>
<div class="up-cv">
<button
#click="onFileChange"
type="button"
id="custom-button"
>
<!-- <img src="../../assets/recruit/taicv.svg" alt="" /> -->
<span class="material-symbols-outlined"> file_upload </span>
Upload
</button>
<input
id="real-file"
type="file"
style="display: none"
name="image"
#change="fileName"
/>
<div class="name-cv">
<h5 v-if="uploadedFileName">{{ uploadedFileName }}</h5>
<h5 v-else id="custom-text">you have not selected the file</h5>
<!-- <img
onclick="deleteFile()"
src="../../assets/recruit/delete.svg"
alt=""
/> -->
<span
v-if="uploadedFileName"
class="material-symbols-outlined deleteBtn"
#click="deleteFile"
>
delete
</span>
</div>
</div>
</div>
</div>
</template>
<script>
export default {
name: 'App',
data() {
return {
uploadedFileName: null,
};
},
methods: {
onFileChange() {
document.getElementById('real-file').click();
},
fileName(e) {
this.uploadedFileName = e.target.value;
},
deleteFile() {
this.uploadedFileName = null;
},
},
};
</script>
<style>
#custom-button {
display: inline-block;
border: 1px solid grey;
padding: 10px;
cursor: pointer;
}
#custom-button span {
display: inline-block;
vertical-align: bottom;
}
#app {
font-family: Avenir, Helvetica, Arial, sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
text-align: center;
color: #2c3e50;
margin-top: 60px;
}
.deleteBtn {
cursor: pointer;
color: red;
}
</style>

how can I display tabular data in a flex-box?

How can I display tabular data in a flexbox? It us vuejs but I hope my question is generic. Maybe could I just simply drop the table and create divs to style it?
<template>
<div id="app">
<table>
<thead>
<tr>
<th>date</th>
<th>image</th>
<th>title</th>
<th>press</th>
</tr>
</thead>
<tbody >
<tr v-for="item in items.results" :key="item.id">
<td>{{ item.pub_date }}</td>
<td>{{ item.image.file }}</td>
<td>{{ item.title }}</td>
<div class="downloads">
<span
v-for="downloadable in item.downloadable.filter(d => !!d.document_en)"
:key="downloadable.id"
>{{ downloadable.document_en.file }}</span>
</div>
</tr>
Update:
What if I simply use a div instead of the tables? How can I organise them into flexboxes?
<template>
<div id="app">
<span v-for="item in items.results" :key="item.id">
{{ item.pub_date }} {{item.image.file}} {{item.title}}
<div class="downloads">
<span
v-for="downloadable in item.downloadable.filter(d => !!d.document_en)"
:key="downloadable.id"
>{{ downloadable.document_en.file }}</span>
</div>
</span>
</div>
</template>
Step 1: Create your html template
<ul class="flex-container">
<li v-for="item in items.results" :key="item.id" class="flex-item">
<h4>{{ formatDate(item.pub_date) }}, {{item.title}}</h4>
<img :src="item.image && item.image.file" />
<div class="downloads">
<span v-for="downloadable in item.downloadable.filter(d => !!d.document_en)"
:key="downloadable.id">
<a :href="downloadable.document_en.file">Download</a>
</span>
</div>
</li>
</ul>
Step 2: Add your CSS style flex
<style>
ul.flex-container {
padding: 0;
margin: 0;
list-style-type: none;
display: -webkit-box;
display: -moz-box;
display: -ms-flexbox;
display: -webkit-flex;
display: flex;
-webkit-flex-flow: row wrap;
flex-direction: row wrap;
flex-wrap: wrap;
justify-content: space-around;
}
li img {
display: initial;
height: 100px;
}
.flex-item {
background: tomato;
width: calc(100% / 5.5);
padding: 5px;
height: auto;
margin-top: 10px;
color: white;
font-weight: bold;
text-align: center;
}
.downloads {
margin-top: 10px;
}
</style>
DEMO Link

Click on a buttons with same id

I have this Angular code which is using the same button id 3 times: barcodeScanner.button
<mobileweb-rowify _ngcontent-svn-c50="" class="full-height-right-separator" fxflex="auto" _nghost-svn-c4="" style="flex: 1 1 auto; box-sizing: border-box;">
<!---->
<div _ngcontent-svn-c4="" fxlayout="column" class="full-height-right-separator" id="rowify" style="flex-direction: column; box-sizing: border-box; display: flex; place-content: stretch space-between; align-items: stretch; max-width: 100%;">
<mobileweb-value-input _ngcontent-svn-c50="" class="compact-xs" id="pick-slip" _nghost-svn-c6="">
<!---->
<mobileweb-columnify _ngcontent-svn-c6="" _nghost-svn-c5="">
<!---->
<div _ngcontent-svn-c5="" fxlayout="row" class="compact-xs" id="pick-slip.form-input.columnify" style="flex-direction: row; box-sizing: border-box; display: flex; place-content: stretch space-between; align-items: stretch; max-height: 100%;">
<!---->
<mobileweb-action-button _ngcontent-svn-c6="" button.flex="56px" button.image="fas fa-barcode fa-2x" class="compact-right-margin-half ng-star-inserted" fxlayout="row" fxlayoutalign="start end" id="barcodeScanner" _nghost-svn-c10="" style="flex-direction: row; box-sizing: border-box; display: flex; place-content: flex-end flex-start; align-items: flex-end;">
<!----><!----><!---->
<button _ngcontent-svn-c10="" mat-button="" mat-flat-button="" class="mat-button mat-flat-button mat-primary ng-star-inserted selector" id="barcodeScanner.button" style="flex: 1 1 56px; box-sizing: border-box; max-width: 56px; min-width: 56px;">
<span class="mat-button-wrapper">
<!----><!----><!----><i _ngcontent-svn-c10="" id="barcodeScanner.button.icon" class="fas fa-barcode fa-2x ng-star-inserted"></i><!---->
</span>
<div class="mat-button-ripple mat-ripple" matripple=""></div>
<div class="mat-button-focus-overlay"></div>
</button>
</mobileweb-action-button>
<!---->
<mobileweb-rowify _ngcontent-svn-c6="" fxflex="auto" _nghost-svn-c4="" class="ng-star-inserted" style="flex: 1 1 auto; box-sizing: border-box;">
<!---->
<div _ngcontent-svn-c4="" fxlayout="column" id="rowify" style="flex-direction: column; box-sizing: border-box; display: flex; place-content: stretch space-between; align-items: stretch; max-width: 100%;">
<mat-label _ngcontent-svn-c6="" class="compact-xs" id="pick-slip.label">Pick Slip:</mat-label>
<mat-form-field _ngcontent-svn-c6="" class="mat-form-field ng-tns-c11-58 mat-primary compact indent mat-form-field-type-mat-input mat-form-field-appearance-fill mat-form-field-can-float ng-pristine ng-valid ng-star-inserted ng-touched" id="pick-slip.formfield">
<div class="mat-form-field-wrapper">
<div class="mat-form-field-flex">
<!----><!---->
<div class="mat-form-field-infix">
<!----><input _ngcontent-svn-c6="" class="mat-input-element mat-form-field-autofill-control cdk-text-field-autofill-monitored ng-pristine ng-valid ng-star-inserted ng-touched" matinput="" type="text" id="pick-slip.input" placeholder="Enter Pick Slip" aria-invalid="false" aria-required="false"><!---->
<span class="mat-form-field-label-wrapper">
<!---->
</span>
</div>
<!---->
</div>
<!---->
<div class="mat-form-field-underline ng-tns-c11-58 ng-star-inserted"><span class="mat-form-field-ripple"></span></div>
<div class="mat-form-field-subscript-wrapper">
<!----><!---->
<div class="mat-form-field-hint-wrapper ng-tns-c11-58 ng-trigger ng-trigger-transitionMessages ng-star-inserted" style="opacity: 1; transform: translateY(0%);">
<!---->
<div class="mat-form-field-hint-spacer"></div>
</div>
</div>
</div>
</mat-form-field>
</div>
</mobileweb-rowify>
<!---->
</div>
</mobileweb-columnify>
<!---->
</mobileweb-value-input>
<mobileweb-value-input _ngcontent-svn-c50="" class="compact-xs" id="shipment" _nghost-svn-c6="">
<!---->
<mobileweb-columnify _ngcontent-svn-c6="" _nghost-svn-c5="">
<!---->
<div _ngcontent-svn-c5="" fxlayout="row" class="compact-xs" id="shipment.form-input.columnify" style="flex-direction: row; box-sizing: border-box; display: flex; place-content: stretch space-between; align-items: stretch; max-height: 100%;">
<!---->
<mobileweb-action-button _ngcontent-svn-c6="" button.flex="56px" button.image="fas fa-barcode fa-2x" class="compact-right-margin-half ng-star-inserted" fxlayout="row" fxlayoutalign="start end" id="barcodeScanner" _nghost-svn-c10="" style="flex-direction: row; box-sizing: border-box; display: flex; place-content: flex-end flex-start; align-items: flex-end;">
<!----><!----><!---->
<button _ngcontent-svn-c10="" mat-button="" mat-flat-button="" class="mat-button mat-flat-button mat-primary ng-star-inserted selector" id="barcodeScanner.button" style="flex: 1 1 56px; box-sizing: border-box; max-width: 56px; min-width: 56px;">
<span class="mat-button-wrapper">
<!----><!----><!----><i _ngcontent-svn-c10="" id="barcodeScanner.button.icon" class="fas fa-barcode fa-2x ng-star-inserted"></i><!---->
</span>
<div class="mat-button-ripple mat-ripple" matripple=""></div>
<div class="mat-button-focus-overlay"></div>
</button>
</mobileweb-action-button>
<!---->
<mobileweb-rowify _ngcontent-svn-c6="" fxflex="auto" _nghost-svn-c4="" class="ng-star-inserted" style="flex: 1 1 auto; box-sizing: border-box;">
<!---->
<div _ngcontent-svn-c4="" fxlayout="column" id="rowify" style="flex-direction: column; box-sizing: border-box; display: flex; place-content: stretch space-between; align-items: stretch; max-width: 100%;">
<mat-label _ngcontent-svn-c6="" class="compact-xs" id="shipment.label">Shipment:</mat-label>
<mat-form-field _ngcontent-svn-c6="" class="mat-form-field ng-tns-c11-59 mat-primary compact indent mat-form-field-type-mat-input mat-form-field-appearance-fill mat-form-field-can-float ng-untouched ng-pristine ng-valid ng-star-inserted" id="shipment.formfield">
<div class="mat-form-field-wrapper">
<div class="mat-form-field-flex">
<!----><!---->
<div class="mat-form-field-infix">
<!----><input _ngcontent-svn-c6="" class="mat-input-element mat-form-field-autofill-control cdk-text-field-autofill-monitored ng-untouched ng-pristine ng-valid ng-star-inserted" matinput="" type="text" id="shipment.input" placeholder="Enter Shipment" aria-invalid="false" aria-required="false"><!---->
<span class="mat-form-field-label-wrapper">
<!---->
</span>
</div>
<!---->
</div>
<!---->
<div class="mat-form-field-underline ng-tns-c11-59 ng-star-inserted"><span class="mat-form-field-ripple"></span></div>
<div class="mat-form-field-subscript-wrapper">
<!----><!---->
<div class="mat-form-field-hint-wrapper ng-tns-c11-59 ng-trigger ng-trigger-transitionMessages ng-star-inserted" style="opacity: 1; transform: translateY(0%);">
<!---->
<div class="mat-form-field-hint-spacer"></div>
</div>
</div>
</div>
</mat-form-field>
</div>
</mobileweb-rowify>
<!---->
</div>
</mobileweb-columnify>
<!---->
</mobileweb-value-input>
<mobileweb-value-input _ngcontent-svn-c50="" class="compact-xs" id="master-order" _nghost-svn-c6="">
<!---->
<mobileweb-columnify _ngcontent-svn-c6="" _nghost-svn-c5="">
<!---->
<div _ngcontent-svn-c5="" fxlayout="row" class="compact-xs" id="master-order.form-input.columnify" style="flex-direction: row; box-sizing: border-box; display: flex; place-content: stretch space-between; align-items: stretch; max-height: 100%;">
<!---->
<mobileweb-action-button _ngcontent-svn-c6="" button.flex="56px" button.image="fas fa-barcode fa-2x" class="compact-right-margin-half ng-star-inserted" fxlayout="row" fxlayoutalign="start end" id="barcodeScanner" _nghost-svn-c10="" style="flex-direction: row; box-sizing: border-box; display: flex; place-content: flex-end flex-start; align-items: flex-end;">
<!----><!----><!---->
<button _ngcontent-svn-c10="" mat-button="" mat-flat-button="" class="mat-button mat-flat-button mat-primary ng-star-inserted selector" id="barcodeScanner.button" style="flex: 1 1 56px; box-sizing: border-box; max-width: 56px; min-width: 56px;">
<span class="mat-button-wrapper">
<!----><!----><!----><i _ngcontent-svn-c10="" id="barcodeScanner.button.icon" class="fas fa-barcode fa-2x ng-star-inserted"></i><!---->
</span>
<div class="mat-button-ripple mat-ripple" matripple=""></div>
<div class="mat-button-focus-overlay"></div>
</button>
</mobileweb-action-button>
<!---->
<mobileweb-rowify _ngcontent-svn-c6="" fxflex="auto" _nghost-svn-c4="" class="ng-star-inserted" style="flex: 1 1 auto; box-sizing: border-box;">
<!---->
<div _ngcontent-svn-c4="" fxlayout="column" id="rowify" style="flex-direction: column; box-sizing: border-box; display: flex; place-content: stretch space-between; align-items: stretch; max-width: 100%;">
<mat-label _ngcontent-svn-c6="" class="compact-xs" id="master-order.label">Master Order:</mat-label>
<mat-form-field _ngcontent-svn-c6="" class="mat-form-field ng-tns-c11-60 mat-primary compact indent mat-form-field-type-mat-input mat-form-field-appearance-fill mat-form-field-can-float ng-untouched ng-pristine ng-valid ng-star-inserted" id="master-order.formfield">
<div class="mat-form-field-wrapper">
<div class="mat-form-field-flex">
<!----><!---->
<div class="mat-form-field-infix">
<!----><input _ngcontent-svn-c6="" class="mat-input-element mat-form-field-autofill-control cdk-text-field-autofill-monitored ng-untouched ng-pristine ng-valid ng-star-inserted" matinput="" type="text" id="master-order.input" placeholder="Enter Master Order" aria-invalid="false" aria-required="false"><!---->
<span class="mat-form-field-label-wrapper">
<!---->
</span>
</div>
<!---->
</div>
<!---->
<div class="mat-form-field-underline ng-tns-c11-60 ng-star-inserted"><span class="mat-form-field-ripple"></span></div>
<div class="mat-form-field-subscript-wrapper">
<!----><!---->
<div class="mat-form-field-hint-wrapper ng-tns-c11-60 ng-trigger ng-trigger-transitionMessages ng-star-inserted" style="opacity: 1; transform: translateY(0%);">
<!---->
<div class="mat-form-field-hint-spacer"></div>
</div>
</div>
</div>
</mat-form-field>
</div>
</mobileweb-rowify>
<!---->
</div>
</mobileweb-columnify>
<!---->
</mobileweb-value-input>
</div>
</mobileweb-rowify>
Is there some way to click on each of them using Selenium? The only way is to use full xpath. Is there also some other way?
Yo can select using xpath this way. Thanks
click_id = driver.find_elements_by_xpath('//*[#id="barcodeScanner.button"]')
click_id[0].click() # or [1],[2] meaning which one you need.
Try this:
List<WebElement> list = driver.findElements(By.xpath("//button[#id='barcodeScanner.button']"));
for (WebElement el : list ){
el.click();
}
Possibly you will have to add short delays between clicks in the loop to make them work properly.

Vue 2 select2 custom template for label

I know I can change the template for the option slot, but can we do the same for the label slot? Like for option:
<v-select inputId="originsId" :options="origins" label="city" placeholder="Search...">
<template slot="option" slot-scope="origin">
<div class="flex">
<div class="col">
<span>{{ origin.city }}</span>
</div>
<div class="col">
<span>{{ origin.country }}</span>
</div>
</div>
</template>
</v-select>
Is there some way I can style the label when the option is selected? Now it only shows the label="city" value. I need something like:
<v-select inputId="originsId" :options="origins" label="city" placeholder="Search...">
<template slot="label" slot-scope="origin">
<div class="flex">
<div class="col">
<span>Selected city: {{ origin.city }}</span>
</div>
<div class="col">
<span>Selected country: {{ origin.country }}</span>
</div>
</div>
</template>
<template slot="option" slot-scope="origin">
<div class="flex">
<div class="col">
<span>{{ origin.city }}</span>
</div>
<div class="col">
<span>{{ origin.country }}</span>
</div>
</div>
</template>
</v-select>
Basically I need some custom styling and additional info other then label="city" when the option is selected.
As Vue-select Github: L324 and Vue-select Github: L539, uses <slot name="selected-option"> will be one solution.
Updated: from Vue-select Github you will see there is one parent slot = selected-option-container, but I found it hasn't been deployed to the dist. In future, you should be able to use this slot to custom the whole container and the selected options.
Like below demo:
Vue.component('v-select', VueSelect.VueSelect)
new Vue({
el: '#app',
data: {
options: [
{
title: 'Read the Docs',
icon: 'fa-book',
url: 'https://codeclimate.com/github/sagalbot/vue-select'
},
{
title: 'View on GitHub',
icon: 'fa-github',
url: 'https://codeclimate.com/github/sagalbot/vue-select'
},
{
title: 'View on NPM',
icon: 'fa-database',
url: 'https://codeclimate.com/github/sagalbot/vue-select'
},
{
title: 'View Codepen Examples',
icon: 'fa-pencil',
url: 'https://codeclimate.com/github/sagalbot/vue-select'
}
]
}
})
body {
font-family: "Source Sans Pro", "Helvetica Neue", Arial, sans-serif;
}
h1,.muted {
color: #2c3e5099;
}
h1 {
font-size: 26px;
font-weight: 600;
text-rendering: optimizelegibility;
-moz-osx-font-smoothing: grayscale;
-moz-text-size-adjust: none;
}
#app {
max-width: 30em;
margin: 1em auto;
}
#app .dropdown li {
border-bottom: 1px solid rgba(112, 128, 144, 0.1)
}
#app .dropdown li:last-child {
border-bottom: none;
}
#app .dropdown li a {
padding: 10px 20px;
display: flex;
width: 100%;
align-items: center;
font-size: 1.25em;
}
#app .dropdown li a .fa {
padding-right: 0.5em;
}
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.css" rel="stylesheet"/>
<script src="https://cdnjs.cloudflare.com/ajax/libs/vue/2.5.16/vue.js"></script>
<script src="https://unpkg.com/vue-select#latest"></script>
<div id="app">
<h1>Vue Select - Custom Option Templating</h1>
<v-select :options="options" label="title">
<template slot="selected-option" slot-scope="option">
<div class="flex">
<div class="col">
<span class="fa" :class="option.icon"></span>
<span>Selected item: {{ option.title }}</span>
</div>
</div>
</template>
<template slot="option" slot-scope="option">
<span class="fa" :class="option.icon"></span>
{{ option.title }}
</template>
</v-select>
</div>

Query results not properly displaying sometimes

Results show up like this
http://puu.sh/hZrVY/cbfe561492.jpg
How can I make it so that they show up in rows of 3 with no offsetting.
Code:
#foreach ($posts as $post)
<div class="col-md-4 portfolio-item">
<a href="/stories/{{ $post->slug }}#disqus_thread">
<img class="img-responsive" src="http://placehold.it/700x400" alt="">
</a>
<h3>
{{ str_limit($post->title, 34) }}
</h3>
<p>{{ str_limit($post->content) }}</p>
<em>({{ $post->published_at->format('M jS Y g:ia') }})</em>
</div>
#endforeach
CSS:
body {
background-image: url("http://www.ruschgaming.tv/img/bg.png");
background-attachment: fixed;
background-repeat: no-repeat;
}
.portfolio-item {
margin-bottom: 25px;
}
.container {
margin-top: 80px;
padding-top: 20px;
height: 100%;
background-color: #ffffff;
border-radius: 12px;
box-shadow: 2px 2px 5px grey;
}
Missing the rows tags:
#foreach ($posts as $key => $post)
#if(($key==0) || is_int($key/3))
<div class="row">
#endif
<div class="col-md-4 portfolio-item">
<a href="/stories/{{ $post->slug }}#disqus_thread">
<img class="img-responsive" src="http://placehold.it/700x400" alt="">
</a>
<h3>
{{ str_limit($post->title, 34) }}
</h3>
<p>{{ str_limit($post->content) }}</p>
<em>({{ $post->published_at->format('M jS Y g:ia') }})</em>
</div>
#if(is_int($key/3))
<div>
#endif
#endforeach