I am confused on where I need template tags for this code. Originally I had no templates and my v-ifs didn't load. I added them in to see if it would fix it but had no luck. Weirdly my bottom v-if with the delete button seems to work. All the data seems to be correctly initialized. I saw people using the computed data section but since every post entry is rendered it seems like not the correct way to do this.
<!-- and now the posts -->
<div class="container block">
<template v-for="post in posts">
<div class="notification mb-4">
<h1><strong>{{post.content}}</strong></h1>
<h2><small>{{post.name}}</small></h2>
<!-- Delete Icon -->
<div class="columns">
<div class="column is-11">
<!-- Thumbs stuff -->
<span class="button inverted is-light icon is-medium has-text-info" #click="rating_up(post._idx)" #mouseover="post_over(post._idx, true)" #mouseout="post_out(post._idx)">
<template v-if="post.rating === 1">
<!-- Filled in -->
<i class="fa fa-thumbs-up"></i>
</template>
<template v-if="post.rating === 0">
<!-- Not filled in -->
<i class="fa fa-thumbs-o-up"></i>
</template>
</span>
<span class="button inverted is-light icon is-medium has-text-info" #click="rating_down(post._idx)" #mouseover="post_over(post._idx, false)" #mouseout="post_out(post._idx)">
<template v-if="post.rating === -1">
<!-- Filled in -->
<i class="fa fa-thumbs-down"></i>
</template>
<template v-if="post.rating === 0">
<!-- Not filled in -->
<i class="fa fa-thumbs-o-down"></i>
</template>
</span>
<template v-if="post.show_likers">
<span class="is_link">Liked by</span>
</template>
<template v-if="post.show_dislikers">
<span class="is_link">Disliked by</span>
</template>
</div>
<div class="column">
<div v-if="post.owner" class="container block">
<span class="button inverted is-light icon is-medium has-text-danger" #click="delete_post(post._idx)">
<i class="fa fa-trash"></i>
</span>
</div>
</div>
</div>
</div>
</template>
</div>
Also my icons that are "fa fa-thumbs-down" work but my "fa fa-thumbs-o-down" do not work, any idea why?
Chack you version of font awesome fa fa-thumbs-o-down is for 4:
const app = Vue.createApp({
data() {
return {
posts: [{_idx: 1, content: 'bbb', name: 'BBB', rating: 0, show_likers: 8, show_dislikers: 2, owner: 'www'}]
};
},
methods: {
post_over(id) {},
post_out(id) {}
}
})
app.mount('#demo')
<script src="https://unpkg.com/vue#3/dist/vue.global.prod.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.css" integrity="sha512-5A8nwdMOWrSz20fDsjczgUidUBR8liPYU+WymTZP1lmY9G6Oc7HlZv156XqnsgNUzTyMefFTcsFH/tnJE/+xBg==" crossorigin="anonymous" referrerpolicy="no-referrer" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bulma/0.9.4/css/bulma.min.css" integrity="sha512-HqxHUkJM0SYcbvxUw5P60SzdOTy/QVwA1JJrvaXJv4q7lmbDZCmZaqz01UPOaQveoxfYRv1tHozWGPMcuTBuvQ==" crossorigin="anonymous" referrerpolicy="no-referrer" />
<div id="demo">
<div class="container block">
<template v-for="(post, i) in posts" :key="i">
<div class="notification mb-4">
<h1><strong>{{post.content}}</strong></h1>
<h2><small>{{post.name}}</small></h2>
<!-- Delete Icon -->
<div class="columns">
<div class="column is-11">
<!-- Thumbs stuff -->
<span class="button inverted is-light icon is-medium has-text-info" #click="rating_up(post._idx)" #mouseover="post_over(post._idx, true)" #mouseout="post_out(post._idx)">
<template v-if="post.rating === 1">
<!-- Filled in -->
<i class="fa fa-thumbs-up"></i>
</template>
<template v-if="post.rating === 0">
<!-- Not filled in -->
<i class="fa fa-thumbs-o-up"></i>
</template>
</span>
<span class="button inverted is-light icon is-medium has-text-info" #click="rating_down(post._idx)" #mouseover="post_over(post._idx, false)" #mouseout="post_out(post._idx)">
<template v-if="post.rating === -1">
<!-- Filled in -->
<i class="fa fa-thumbs-down"></i>
</template>
<template v-if="post.rating === 0">
<!-- Not filled in -->
<i class="fa fa-thumbs-o-down"></i>
</template>
</span>
<template v-if="post.show_likers">
<span class="is_link">Liked by</span>
</template>
<template v-if="post.show_dislikers">
<span class="is_link">Disliked by</span>
</template>
</div>
<div class="column">
<div v-if="post.owner" class="container block">
<span class="button inverted is-light icon is-medium has-text-danger" #click="delete_post(post._idx)">
<i class="fa fa-trash"></i>
</span>
</div>
</div>
</div>
</div>
</template>
</div>
</div>
Related
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.
I was trying to make a FAQ system with jQuery with some animations.
What I do is: I get the box (with the question) index, and use this index for selecting the box (with the answer, which is below the question box). But somehow, the index returns the double of the value that it should return. This is my actual code:
function showFaqAnswers() {
var questionBox = $('.question-box')
var answerBox = $('.answer-box')
questionBox.click(function() {
var thisIndex = $(this).index()
if ($(this).hasClass('goShow')) {
$(this).removeClass('goShow')
answerBox.eq(thisIndex).slideToggle(250)
} else {
$(this).addClass('goShow')
answerBox.eq(thisIndex).slideToggle(250)
}
})
}
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<div class="questions-wraper">
<div class="question-box">
<i class="fas fa-question"></i>
<div class="question-text">
<p>Which payment methods are accepted?</p>
</div>
<!-- question-text -->
<div class="bottom-arrow">
<i class="fas fa-chevron-down"></i>
</div>
<!-- bottom-arrow -->
<div class="clear"></div>
<!-- clear -->
</div>
<!-- question-box -->
<div class="answer-box">
<p>The currently accepted methods are MercadoPago and PayPal.</p>
</div>
<!-- answer-box -->
<div class="question-box">
<i class="fas fa-question"></i>
<div class="question-text">
<p>How many ghost clients are detected?</p>
</div>
<!-- question-text -->
<div class="bottom-arrow">
<i class="fas fa-chevron-down"></i>
</div>
<!-- bottom-arrow -->
<div class="clear"></div>
<!-- clear -->
</div>
<!-- question-box -->
<div class="answer-box">
<p>It's hard to say because we are constantly updating our strings and detection methods, but it's more than 1000.</p>
</div>
<!-- answer-box -->
<div class="question-box">
<i class="fas fa-question"></i>
<div class="question-text">
<p>Is the tool really safe?</p>
</div>
<!-- question-text -->
<div class="bottom-arrow">
<i class="fas fa-chevron-down"></i>
</div>
<!-- bottom-arrow -->
<div class="clear"></div>
<!-- clear -->
</div>
<!-- question-box -->
<div class="answer-box">
<p>Of course. All your data is safe at your database, which has an end-to-end encryption. You don't need to worry about this.</p>
</div>
<!-- answer-box -->
<div class="question-box">
<i class="fas fa-question"></i>
<div class="question-text">
<p>Is there a partnership plan?</p>
</div>
<!-- question-text -->
<div class="bottom-arrow">
<i class="fas fa-chevron-down"></i>
</div>
<!-- bottom-arrow -->
<div class="clear"></div>
<!-- clear -->
</div>
<!-- question-box -->
<div class="answer-box">
<p>Yes. If you would like to be a partner, simply go to our Discord server (the button below) and open a ticket, the support team will quickly answer you.</p>
</div>
<!-- answer-box -->
</div>
<!-- questions-wraper -->
So what basically happens is: Instead of showing the next box with the answer for the question, it shows the the box that comes after the next one. And I've already console logged the index of the element (thisIndex), and it returns the double value of what it should return. I don't know why, can someone help me?
My Html code (use Bootstrap4).
<div>
<span class="d-inline-block">
<i class="fa fa-file-alt fa-3x text-primary"></i>
</span>
<span class="d-inline-block">Kadastrinis numeris: <strong style="font-size: 22px;">8741/0002:0014</strong></span>
</div>
Comes out:
But need inline, example:
Is it something like this?
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.14.0/css/all.min.css" rel="stylesheet" />
<link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.5.0/css/bootstrap.min.css" rel="stylesheet" />
<!-- code below this line -->
<div class="d-flex flex-wrap">
<span class="align-self-center p-2">
<i class="fa fa-file-alt fa-3x text-primary"></i>
</span>
<span class="align-self-center d-inline-flex p-2 flex-column">Kadastrinis numeris:
<strong style="font-size: 22px;">8741/0002:0014</strong>
</span>
</div>
Im add div class d-inline-flex this work
I'm using bootstrap for an easy responsive design. However, I moved computer today and was going to work on my project some more and my design is acting up (See attached figures). I have tested to see if I changed width, would it act up; no it did not. I then played with the height of my browsers to see if it did and yes it did act up and displayed improperly. I am fairly new-ish to bootstrap, but I am not sure what is causing this or could be on something on my computer end. I used Chrome for both viewing. I also tested with Edge and it displayed properly.
Look top-right for view port
This is what it should look like
This is what I get when changing resolution
At request, another part of the code which is loaded via JS.
<body>
<div id="interfaceNaviation" style="position:relative;top:0;left:0;right:0;background-color:green;">
<div class="navBar"><span class="navLink">Home</span> <span class="navLink">Presentation</span> <span class="navLink">Schedules</span> <span class="navLink">Display</span></div>
<br>
<div id="loginInfo">
<button id="signinButton" type="button" class="btn btn-primary btn-fixed-width navbar-btn" style="visibility: visible; display: inline;">
Sign in <i class="fa fa-white fa-sign-in icon-right"></i>
</button>
<a href="javascript:void(0);" id="signoutButton" class="navbar-nav" style="visibility: hidden; display: none;">
<span>Sign Out</span>
<i class="fa fa-blue-custom fa-sign-out"></i>
</a>
<div style="display:inline;" id="signinText">Authorize requests using OAuth 2.0:</div>
</div>
</div>
<div id="pres_interface" class="container-fluid" style="height:90%;">
<div id="pres_options" class="row" style="height:5%;">
<div id="add-placeholder" class="col-xs-2"><button id="btn_add-placeholder" class="btn btn-success fa-1.2x">Add Placeholder</button></div>
</div>
<!--style="left:0px;width:20%;height:100%;position:relative;"-->
<div id="pres_editor_panel" class="row" style="height:95%">
<div class="col-xs-2">
<div id="editor_display">
<div id="placeholderContainer"><span class="header fa-1.2x">Placeholders</span></div>
<li><span name="placeholders-change" class="fa-1.2x" data-id="ph1">ph1 <i data-id="void" class="fa fa-trash-o"></i></span></li>
<li><span name="placeholders-change" class="fa-1.2x" data-id="ph2">ph2 <i data-id="void" class="fa fa-trash-o"></i></span></li>
<li><span name="placeholders-change" class="fa-1.2x" data-id="ph04">ph04 <i data-id="void" class="fa fa-trash-o"></i></span></li>
<li><span name="placeholders-change" class="fa-1.2x" data-id="Test">Test <i data-id="void" class="fa fa-trash-o"></i></span></li>
<li><span name="placeholders-change" class="fa-1.2x" data-id="Test1">Test1 <i data-id="void" class="fa fa-trash-o"></i></span></li>
</div>
</div>
<!-- style="width:79.9%;height:100%" -->
<div class="col-xs-10 fa-padless-left">
<iframe id="fake_view" src="fake_view.html" style="width:100%;height:100%;border:1px solid #081D79;"></iframe>
</div>
</div>
</div>
<div id="pres_options-lower" style="background-color:purple;left:0;right:0;text-align:right;bottom:0;">
<button>Restore</button>
<button>Save</button>
<button>Publish</button>
</div>
<div id="window_mask" class="mask hidden"></div>
<div id="popup_display" class="hidden"></div>
<div id="sub_popup_display" class="hidden"></div>
<div id="sub_window_mask" class="mask hidden"></div>
</body>
This is my body code WITHOUT being edited via JS:
<body>
<div id="interfaceNaviation" style="position:relative;top:0;left:0;right:0;background-color:green;">
<div class="navBar"><span class="navLink">Home</span> <span class="navLink">Presentation</span> <span class="navLink">Schedules</span> <span class="navLink">Display</span></div>
<br /><div id="loginInfo">
<button id="signinButton" type="button" class="btn btn-primary btn-fixed-width navbar-btn">
Sign in <i class="fa fa-white fa-sign-in icon-right"></i>
</button>
<a href="javascript:void(0);" id="signoutButton" class="navbar-nav">
<span>Sign Out</span>
<i class="fa fa-blue-custom fa-sign-out"></i>
</a>
<div style="display:inline;" id="signinText"></div>
</div>
</div>
<div id="pres_interface" class="container-fluid" style="height:90%;" >
<div id="pres_options" class="row" style="height:5%;">
<div id="add-placeholder" class="col-xs-2"><button id="btn_add-placeholder" class="btn btn-success fa-1.2x">Add Placeholder</button></div>
</div>
<!--style="left:0px;width:20%;height:100%;position:relative;"-->
<div id="pres_editor_panel" class="row" style="height:95%">
<div class="col-xs-2">
<div id="editor_display" >
</div>
</div>
<!-- style="width:79.9%;height:100%" -->
<div class="col-xs-10 fa-padless-left">
<iframe id="fake_view" src="fake_view.html" style="width:100%;height:100%;border:1px solid #081D79;" ></iframe>
</div>
</div>
</div>
<div id="pres_options-lower" style="background-color:purple;left:0;right:0;text-align:right;bottom:0;">
<button>Restore</button>
<button>Save</button>
<button>Publish</button>
</div>
<div id="window_mask" class="mask hidden"></div>
<div id="popup_display" class="hidden"></div>
<div id="sub_popup_display" class="hidden"></div>
<div id="sub_window_mask" class="mask hidden"></div>
</body>
Thanks for any help! I am stumped at this right now.
I'm trying to put header and top navbar inside of the ion-view directive.
If I put header nav navbar outside of the ion-view tag page is blinking black if page is initialized.
But if I try to insert header and top navbar inside of the ion-view title and heading in the header is not displayed.
Could somebody tell me what I'm doing wrong?
Maybe some tag inside is missing?
Thanks for any help.
Here is the code of the template:
<div class="bar bar-header bar-positive has-tabs-top">
<button class="button button-icon icon ion-chevron-left" ui-sref="home">
</button>
<h1 class="title">{{ 'RESULTS_BY_DAY' | translate }}</h1>
<button class="button button-icon icon ion-stats-bars" ui-sref="daily-chart">
</button>
</div>
<!--TOP TAB BAR -->
<div class="tabs-striped tabs-top tabs-background-light tabs-light tabs-color-dark">
<div class="tabs">
<a class="tab-item orange">
Home
</a>
<a class="tab-item">
Favorites
</a>
<a class="tab-item">
Settings
</a>
</div>
</div>
<ion-view>
<div class="bar bar-header bar-positive has-tabs-top">
<button class="button button-icon icon ion-chevron-left" ui-sref="home">
</button>
<h1 class="title">{{ 'RESULTS_BY_DAY' | translate }}</h1>
<button class="button button-icon icon ion-stats-bars" ui-sref="daily-chart">
</button>
</div>
<!--TOP TAB BAR -->
<div class="tabs-striped tabs-top tabs-background-light tabs-light tabs-color-dark">
<div class="tabs">
<a class="tab-item orange">
Home
</a>
<a class="tab-item">
Favorites
</a>
<a class="tab-item">
Settings
</a>
</div>
</div>
<ion-content ng-controller="DailyListCtrl">
<!--WRITEOUT OVERAL STATS FOR DAYS -->
<ion-list class="list" >
<ion-item class="item itemListCustom" ng-repeat="listDataItem in listData">
<div class="listDateTimeBlock">
<div class="day"><h3>{{listDataItem.DATE_FROM_DD}}</h3></div>
<div class="month"><h3>{{listDataItem.DATE_FROM_MM}}</h3></div>
</div>
<!--ROW ONE -->
<div id="left">
<div class="left-inner">
{{ 'APPOINTMENT_SUCCESS_RATE' | translate }}:
</div>
<div class="right-inner">
{{listDataItem.SUCCESS_RATE}} %
</div>
</div>
<div id="right">
<div class="left-inner floatRight">
{{ 'DIALS' | translate }}:
</div>
<div class="right-inner">
{{listDataItem.DIALS_CNT}}
</div>
</div>
<!--ROW TWO-->
<div id="left">
<div class="left-inner ">
{{ 'SUCCESS_RATE_SINCE_START' | translate }}:
</div>
<div class="right-inner">
{{listDataItem.SUCCESS_RATE_SINCE}} %
</div>
</div>
<div id="right">
<div class="left-inner floatRight">
{{ 'CONVERSATIONS' | translate }} :
</div>
<div class="right-inner">
{{listDataItem.CONVERS_CNT}}
</div>
</div>
<!--ROW THREE-->
<div id="left">
<div class="left-inner">
{{ 'MY_DEFICIT' | translate }}:
</div>
<div class="right-inner">
{{listDataItem.DEFICIT}} %
</div>
</div>
<div id="right">
<div class="left-inner floatRight">
{{ 'APPOINTMENTS' | translate }} :
</div>
<div class="right-inner">
{{listDataItem.APPT_CNT}}
</div>
</div>
</ion-item>
</ion-list>
<ion-infinite-scroll
icon="ion-loading-c"
distance="30%"
on-infinite="setDateRange();">
</ion-infinite-scroll>
</ion-content>
<!-- BOTTOM TABS -->
<div class="tabs-striped tabs-background-positive tabs-light">
<div class="tabs">
<a class="tab-item active" ui-sref="daily-list" href="/#/daily-list">
<i class="icon ion-ios7-paper-outline"></i>
</a>
<a class="tab-item" ui-sref="weekly-list" href="/#/weekly-list">
<i class="icon ion-star"></i>
</a>
<a class="tab-item" ui-sref="daily-list" href="/#/daily-list">
<i class="icon ion-gear-a"></i>
</a>
<a class="tab-item" ui-sref="daily-list" href="/#/daily-list">
<i class="icon ion-gear-a"></i>
</a>
</div>
</div>
</ion-view>
Here are some examples of navbar usage:
Simple page with buttons left and right:
http://codepen.io/beaver71/pen/YwLELa
<ion-view title="onepage">
<ion-nav-buttons side="left">
<button class="button">
LeftButton
</button>
</ion-nav-buttons>
<ion-nav-buttons side="right">
<button class="button button-assertive">
RightButton
</button>
</ion-nav-buttons>
<ion-content class="padding">
<!-- The content of the page -->
</ion-content>
</ion-view>
Navigation via side menu:
http://codepen.io/beaver71/pen/XXBvYp
Navigation via side menu and tab bar:
http://codepen.io/beaver71/pen/xZWXBO
Try to use the JavaScript versions of tabs and navigation bars.
They are easier to be manipulated in JS code, because they come with the services $ionicTabsDelegate and $ionicNavBarDelegate.