slider height

This commit is contained in:
Shohrat 2023-10-03 17:36:41 +05:00
parent 92c8963296
commit 1f46a90644
4 changed files with 56 additions and 13 deletions

View File

@ -2,6 +2,9 @@
use Cms\Classes\ComponentBase; use Cms\Classes\ComponentBase;
use TPS\Birzha\Models\Product; use TPS\Birzha\Models\Product;
use TPS\Birzha\Models\Comment;
use RainLab\User\Facades\Auth;
use Flash;
class Singleoffer extends ComponentBase class Singleoffer extends ComponentBase
{ {
@ -31,6 +34,19 @@ class Singleoffer extends ComponentBase
]; ];
} }
public function onCommentSave(){
$data = post();
$comment = new Comment;
$comment->user_id = \Auth::user()->id;
$comment->product_id = $data["product_id"];
$comment->rating = $data["star"];
$comment->comment = $data["comment"];
$comment->save();
Flash::success("Teswir goshuldy");
}
public function onRun() { public function onRun() {
$this->offer = $this->loadOffer(); $this->offer = $this->loadOffer();
} }

View File

@ -109,9 +109,11 @@
<li class="nav-item"> <li class="nav-item">
<a href="#description" class="nav-link active" data-toggle="tab" role="tab">Giňişleýin maglumat</a> <a href="#description" class="nav-link active" data-toggle="tab" role="tab">Giňişleýin maglumat</a>
</li> </li>
{% if user %}
<li class="nav-item"> <li class="nav-item">
<a href="#reviews" class="nav-link" data-toggle="tab" role="tab">Teswirler <span class="text-muted">({{ product.comments_count }})</span></a> <a href="#reviews" class="nav-link" data-toggle="tab" role="tab">Teswirler <span class="text-muted">({{ product.comments_count }})</span></a>
</li> </li>
{% endif %}
<li class="nav-item"> <li class="nav-item">
<a href="#addi-info" class="nav-link" data-toggle="tab" role="tab">Goşmaça maglumat</a> <a href="#addi-info" class="nav-link" data-toggle="tab" role="tab">Goşmaça maglumat</a>
</li> </li>
@ -128,6 +130,8 @@
</div> </div>
</div> </div>
{% if user %}
<div role="tabpanel" class="tab-pane fade" id="reviews"> <div role="tabpanel" class="tab-pane fade" id="reviews">
<div class="reviews_area"> <div class="reviews_area">
<ul> <ul>
@ -153,35 +157,38 @@
<div class="submit_a_review_area mt-20"> <div class="submit_a_review_area mt-20">
<h4>Teswir ýazmak</h4> <h4>Teswir ýazmak</h4>
<form action="#" method="post"> <form
data-request="onCommentSave"
data-request-flash
data-request-validate
method="post">
<div class="form-group"> <div class="form-group">
<div class="stars"> <div class="stars">
<input type="radio" name="star" class="star-1" id="star-1"> <input type="radio" name="star" class="star-1" value="1" id="star-1">
<label class="star-1" for="star-1">1</label> <label class="star-1" for="star-1">1</label>
<input type="radio" name="star" class="star-2" id="star-2"> <input type="radio" name="star" class="star-2" value="2" id="star-2">
<label class="star-2" for="star-2">2</label> <label class="star-2" for="star-2">2</label>
<input type="radio" name="star" class="star-3" id="star-3"> <input type="radio" name="star" class="star-3" value="3" id="star-3">
<label class="star-3" for="star-3">3</label> <label class="star-3" for="star-3">3</label>
<input type="radio" name="star" class="star-4" id="star-4"> <input type="radio" name="star" class="star-4" value="4" id="star-4">
<label class="star-4" for="star-4">4</label> <label class="star-4" for="star-4">4</label>
<input type="radio" name="star" class="star-5" id="star-5"> <input type="radio" name="star" class="star-5" value="5" id="star-5">
<label class="star-5" for="star-5">5</label> <label class="star-5" for="star-5">5</label>
<span></span> <span></span>
</div> </div>
</div> </div>
<div class="form-group">
<label for="name">Ulanyjy adyňyz</label>
<input type="email" class="form-control" id="name" placeholder="Ulanyjy ady">
</div>
<div class="form-group"> <div class="form-group">
<label for="comments">Teswirler</label> <label for="comments">Teswirler</label>
<textarea class="form-control" id="comments" rows="5" data-max-length="150"></textarea> <input type="hidden" name="product_id" value="{{ product.id }}">
<textarea class="form-control" name="comment" id="comment" rows="5" data-max-length="300"></textarea>
</div> </div>
<button type="submit" class="btn btn-primary">Teswiri ugratmak</button> <button type="submit" class="btn btn-primary">Teswiri ugratmak</button>
</form> </form>
</div> </div>
</div> </div>
{% endif %}
<div role="tabpanel" class="tab-pane fade" id="addi-info"> <div role="tabpanel" class="tab-pane fade" id="addi-info">
<div class="additional_info_area"> <div class="additional_info_area">
<h5>Goşmaça maglumatlar</h5> <h5>Goşmaça maglumatlar</h5>
@ -224,3 +231,16 @@
</div> </div>
</section> </section>
<!-- Single Product Details Area End --> <!-- Single Product Details Area End -->
{% put scripts %}
<script type="text/javascript">
$(document).ready(function() {
$("[id^='star-']").each(function() {
var id = $(this).attr('id');
$('#star-'+id).on('click', function(e){
console.log(id);
});
});
})
</script>
{% endput %}

File diff suppressed because one or more lines are too long

View File

@ -229,7 +229,7 @@ pageNumber = "{{ :page }}"
<!-- Account --> <!-- Account -->
<div class="account-area"> <div class="account-area">
<div class="user-thumbnail"> <div class="user-thumbnail">
<i class="fa fa-user" aria-hidden="true"></i> <i class="icofont-user" aria-hidden="true"></i>
</div> </div>
<ul class="user-meta-dropdown"> <ul class="user-meta-dropdown">
<li class="user-title"><span>Salam,</span> {{ user.name }}</li> <li class="user-title"><span>Salam,</span> {{ user.name }}</li>