forked from mHealthKenya/ushauri_dashboard
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #28 from palladiumkenya/feature/facility-search-fe…
…edback Feat: facility directory search feedback
- Loading branch information
Showing
8 changed files
with
663 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
<?php | ||
|
||
namespace App\View\Components; | ||
|
||
use Illuminate\View\Component; | ||
|
||
class Rating extends Component | ||
{ | ||
/** | ||
* Create a new component instance. | ||
* | ||
* @return void | ||
*/ | ||
|
||
/** | ||
* The facility code | ||
* | ||
* @var string | ||
*/ | ||
|
||
public $mflCode; | ||
|
||
|
||
/** | ||
* The search rating | ||
* | ||
* @var string | ||
*/ | ||
|
||
public $searchRating; | ||
|
||
/** | ||
* The search counter | ||
* | ||
* @var string | ||
*/ | ||
|
||
public $searchCounter; | ||
|
||
/** | ||
* Create the component instance. | ||
* | ||
* @param string $mflCode | ||
* @param string $searchRating | ||
* @param string $searchCounter | ||
* @return void | ||
*/ | ||
|
||
public function __construct($mflCode,$searchRating) | ||
{ | ||
$this->mflCode = $mflCode; | ||
$this->searchRating = $searchRating; | ||
$this->searchCounter = $searchRating > 0 ? $searchRating : 5; | ||
// dd($mflCode); | ||
} | ||
|
||
public function isSelected($option) | ||
{ | ||
return $option == $this->searchRating; | ||
} | ||
|
||
/** | ||
* Get the view / contents that represent the component. | ||
* | ||
* @return \Illuminate\Contracts\View\View|\Closure|string | ||
*/ | ||
public function render() | ||
{ | ||
return view('components.rating'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<div class="container"> | ||
<div class="row"> | ||
<div class="col"> | ||
<input type="hidden" name="facility_code_rate_{{ $mflCode }}" id="facility_code_rate_{{ $mflCode }}" value="{{ $mflCode }}"> | ||
|
||
<div class="{{ $searchRating > 0 ? 'rated' : 'rate' }}"> | ||
@for($i=1; $i<=$searchCounter; $i++) | ||
<label id="star_{{$i}}" class="star-rating-complete" title="text" data-toggle="modal" data-target="#modal_rating" onclick="document.getElementById('facility_code').value = '{{ $mflCode }}';document.getElementById('star{{$i}}').checked = true;">{{$i}} stars</label> | ||
@endfor | ||
</div> | ||
</div> | ||
</div> | ||
</div> |
Oops, something went wrong.