Skip to content

Commit

Permalink
Rapidez v3 colors and Blade Components + Dutch translations (#27)
Browse files Browse the repository at this point in the history
  • Loading branch information
Roene-JustBetter authored Dec 11, 2024
1 parent 78dbc62 commit 5dd06ed
Show file tree
Hide file tree
Showing 6 changed files with 59 additions and 13 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/translations.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Check translations

on:
push:
branches:
- master
- '*.x'
pull_request:

jobs:
translations:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.3'
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick
coverage: none
- name: Install dependencies
run: composer install --prefer-dist --no-interaction
- name: Check translations
uses: rapidez/laravel-translation-checker@master
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"illuminate/database": "^9.0|^10.0|^11.0",
"illuminate/support": "^9.0|^10.0|^11.0",
"illuminate/view": "^9.0|^10.0|^11.0",
"rapidez/core": "~0.57|^1.0|^2.0|^3.0"
"rapidez/core": "^3.0"
},
"autoload": {
"psr-4": {
Expand Down
11 changes: 11 additions & 0 deletions lang/nl.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"Add Your Review": "Voeg uw review toe",
"Be the first to write a review": "Schrijf de eerste review",
"Nickname": "Nickname",
"No reviews found": "Geen reviews gevonden",
"Rating": "Rating",
"Review": "Review",
"Submit Review": "Review indienen",
"Summary": "Summary",
"You submitted your review for moderation.": "Uw review is in behandeling."
}
6 changes: 3 additions & 3 deletions resources/js/components/Stars.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,17 @@
classStar: {
type: String,
required: false,
default: 'w-4 h-4 fill-current text-neutral'
default: 'size-4 fill-current text'
},
classStarInactive: {
type: String,
required: false,
default: 'w-4 h-4 fill-current text-gray-400'
default: 'size-4 fill-current text-muted'
},
classCount: {
type: String,
required: false,
default: 'text-gray-500 text-sm'
default: 'text-muted text-sm'
}
},
computed: {
Expand Down
23 changes: 16 additions & 7 deletions resources/views/form.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<star-input v-model="variables.ratings[index]" :rating="rating">
<fieldset class="flex items-center" slot-scope="{ rating, isActive, _renderProxy: starInput }">
<label v-for="ratingValue in rating.values">
<x-heroicon-s-star class="w-5 h-5 cursor-pointer" v-bind:class="isActive(ratingValue) ? 'text-neutral' : 'text-gray-400'"/>
<x-heroicon-s-star class="size-5 cursor-pointer" v-bind:class="isActive(ratingValue) ? 'text' : 'text-muted'"/>
<input class="sr-only" type="radio" v-model="starInput.value" :name="'stars' + rating.id" :value="{ id: rating.id, value_id: ratingValue.value_id }" required />
</label>
</fieldset>
Expand All @@ -30,21 +30,30 @@
<x-rapidez::label>@lang('Rating')</x-rapidez::label>
<div class="flex">
@for ($i = 0; $i < 5; $i++)
<x-heroicon-s-star class="w-5 h-5 cursor-pointer text-gray-400" />
<x-heroicon-s-star class="size-5 cursor-pointer text-muted" />
@endfor
</div>
</div>
</graphql>
<div class="space-y-2">
<x-rapidez::input v-model="variables.nickname" name="nickname" required/>
<x-rapidez::input v-model="variables.summary" name="summary" required/>
<x-rapidez::textarea v-model="variables.text" name="review" required/>
<label>
<x-rapidez::label>@lang('Nickname')</x-rapidez::label>
<x-rapidez::input v-model="variables.nickname" name="nickname" required/>
</label>
<label>
<x-rapidez::label>@lang('Summary')</x-rapidez::label>
<x-rapidez::input v-model="variables.summary" name="summary" required/>
</label>
<label>
<x-rapidez::label>@lang('Review')</x-rapidez::label>
<x-rapidez::input.textarea v-model="variables.text" name="review" required/>
</label>
</div>
</div>
<div class="w-full flex items-center mt-2">
<x-rapidez::button type="submit">
<x-rapidez::button.secondary type="submit">
@lang('Submit Review')
</x-rapidez::button>
</x-rapidez::button.secondary>
<span v-if="mutated" v-cloak class="ml-3 text-green-500">
@lang('You submitted your review for moderation.')
</span>
Expand Down
4 changes: 2 additions & 2 deletions resources/views/reviews.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<meta itemprop="bestRating" content="100" />
</div>
<div v-for="review in data.products.items[0].reviews.items" class="w-full p-8 border rounded bg-white" itemprop="review" itemtype="https://schema.org/Review" itemscope>
<div class="flex items-center gap-2 text-inactive" itemprop="author" itemtype="https://schema.org/Person" itemscope>
<div class="flex items-center gap-2 text-muted" itemprop="author" itemtype="https://schema.org/Person" itemscope>
<strong itemprop="name">@{{ review.nickname }}</strong>
<span class="text-xs">@{{ new Date(review.created_at).toLocaleDateString() }}</span>
</div>
Expand All @@ -25,7 +25,7 @@
</lazy>
@else
<div class="w-full p-8 mb-4 border rounded bg-white">
<div class="flex items-center gap-2 text-inactive">
<div class="flex items-center gap-2 text-muted">
<strong itemprop="name">@lang('No reviews found')</strong>
<span class="text-xs">
@{{ new Date(Date.now()).toLocaleDateString() }}
Expand Down

0 comments on commit 5dd06ed

Please sign in to comment.