-
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.
Adds a new custom panel section alongside a few other general improve…
…ments. This should also fix the version check within the panel.
- Loading branch information
Showing
8 changed files
with
86 additions
and
9 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,22 @@ | ||
panel.plugin('scottboms/microseasons', { | ||
sections: { | ||
microseasons: { | ||
data: function () { | ||
return { | ||
microSeason: null | ||
} | ||
}, | ||
created: function() { | ||
this.load().then(response => { | ||
this.microSeason = response.microSeason; | ||
}); | ||
}, | ||
template: ` | ||
<k-section class="k-microseason-section"> | ||
<k-box style="--width: 1/1"> | ||
<k-text size="medium"><b>{{ microSeason['period'] }}</b> — {{ microSeason['name'] }} {{ microSeason['translation'] }} <span class="k-help">({{ microSeason['start'] }}–{{ microSeason['end'] }})</span></k-text> | ||
</k-box> | ||
</k-section>` | ||
} | ||
} | ||
}); |
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,8 @@ | ||
{ | ||
"name": "kirby-microseasons", | ||
"description": "Kirby plugin to output the current Japanese microseason information", | ||
"author": "Scott Boms <scottboms@gmail.com>", | ||
"version": "1.0.4", | ||
"type": "kirby-plugin", | ||
"license": "MIT" | ||
} |
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,24 @@ | ||
<?php | ||
|
||
use Kirby\Toolkit\Date; | ||
|
||
return [ | ||
'props' => [ | ||
'label' => function(string $label = "Current Microseason") { | ||
return $label; | ||
}, | ||
'layout' => function(string $layout = "list") { | ||
return $layout; | ||
} | ||
], | ||
|
||
'computed' => [ | ||
'microSeason' => function() { | ||
$currentDate = Scottboms\Microseasons\Season::getCurrentDate(); | ||
$jsonSeasons = Scottboms\Microseasons\Season::getAllSeasons(); | ||
$matchSeason = Scottboms\Microseasons\Season::getSeason($currentDate, $jsonSeasons); | ||
|
||
return $matchSeason; | ||
} | ||
] | ||
]; |
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