mirror of
https://github.com/silverstripe/silverstripe-blog
synced 2024-10-22 11:05:58 +02:00
Compare commits
14 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
ed0f42a509 | ||
|
031545737d | ||
|
9fae326927 | ||
|
ca0624cc25 | ||
|
95a2808c04 | ||
|
3b6a519b39 | ||
|
4ca99d07f3 | ||
|
712812332d | ||
|
eb108b8e83 | ||
|
941c2c7b11 | ||
|
84c93b1c2f | ||
|
ba49047d94 | ||
|
587379b8b3 | ||
|
0b231cb2a5 |
5
.github/workflows/ci.yml
vendored
5
.github/workflows/ci.yml
vendored
@ -4,13 +4,8 @@ on:
|
||||
push:
|
||||
pull_request:
|
||||
workflow_dispatch:
|
||||
# Every Tuesday at 12:20pm UTC
|
||||
schedule:
|
||||
- cron: '20 12 * * 2'
|
||||
|
||||
jobs:
|
||||
ci:
|
||||
name: CI
|
||||
# Only run cron on the silverstripe account
|
||||
if: (github.event_name == 'schedule' && github.repository_owner == 'silverstripe') || (github.event_name != 'schedule')
|
||||
uses: silverstripe/gha-ci/.github/workflows/ci.yml@v1
|
||||
|
16
.github/workflows/dispatch-ci.yml
vendored
Normal file
16
.github/workflows/dispatch-ci.yml
vendored
Normal file
@ -0,0 +1,16 @@
|
||||
name: Dispatch CI
|
||||
|
||||
on:
|
||||
# At 12:20 PM UTC, only on Tuesday and Wednesday
|
||||
schedule:
|
||||
- cron: '20 12 * * 2,3'
|
||||
|
||||
jobs:
|
||||
dispatch-ci:
|
||||
name: Dispatch CI
|
||||
# Only run cron on the silverstripe account
|
||||
if: (github.event_name == 'schedule' && github.repository_owner == 'silverstripe') || (github.event_name != 'schedule')
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Dispatch CI
|
||||
uses: silverstripe/gha-dispatch-ci@v1
|
@ -45,11 +45,17 @@ sk:
|
||||
PLURALNAME: 'Kategórie blogu'
|
||||
SINGULARNAME: 'Kategória blogu'
|
||||
Title: Názov
|
||||
belongs_many_many_BlogPosts: 'Príspevky v blogu'
|
||||
db_Title: Názov
|
||||
db_URLSegment: 'Časť URL'
|
||||
has_one_Blog: Blog
|
||||
SilverStripe\Blog\Model\BlogMemberExtension:
|
||||
BLOGPOSTS: 'Základné stránky'
|
||||
TABBLOGPOSTS: 'Základné stránky'
|
||||
belongs_many_many_BlogPosts: 'Príspevky v blogu'
|
||||
db_BlogProfileSummary: 'Prehľad profilu blogu'
|
||||
db_URLSegment: 'Časť URL'
|
||||
has_one_BlogProfileImage: 'Profilový obrázok blogu'
|
||||
SilverStripe\Blog\Model\BlogObject:
|
||||
Title: Názov
|
||||
SilverStripe\Blog\Model\BlogPost:
|
||||
@ -75,7 +81,9 @@ sk:
|
||||
PLURALNAME: 'Štítky blogu'
|
||||
SINGULARNAME: 'Štítok blogu'
|
||||
Title: Názov
|
||||
belongs_many_many_BlogPosts: 'Príspevky v blogu'
|
||||
db_Title: Názov
|
||||
db_URLSegment: 'Časť URL'
|
||||
has_one_Blog: Blog
|
||||
SilverStripe\Blog\Widgets\BlogArchiveWidget:
|
||||
ArchiveType: 'Typ archívu'
|
||||
|
10
lang/sl.yml
10
lang/sl.yml
@ -11,17 +11,27 @@ sl:
|
||||
AND: in
|
||||
Archive: Arhiv
|
||||
Comments: Komentarji
|
||||
FILTERDESCRIPTION_PAGE: 'Stran {page}'
|
||||
PLURALNAME: 'Izvorna stran'
|
||||
SilverStripe\Blog\Model\BlogCategory:
|
||||
belongs_many_many_BlogPosts: 'Zapisi na blogu'
|
||||
db_Title: Naziv
|
||||
db_URLSegment: 'Naslov URL'
|
||||
SilverStripe\Blog\Model\BlogMemberExtension:
|
||||
belongs_many_many_BlogPosts: 'Zapisi na blogu'
|
||||
db_BlogProfileSummary: 'Povzetek blogerskega profila'
|
||||
db_URLSegment: 'Naslov URL'
|
||||
has_one_BlogProfileImage: 'Osebna podoba'
|
||||
SilverStripe\Blog\Model\BlogObject:
|
||||
Title: Naziv
|
||||
SilverStripe\Blog\Model\BlogPost:
|
||||
AUTHOR: Avtor
|
||||
PLURALNAME: 'Izvorna stran'
|
||||
SilverStripe\Blog\Model\BlogTag:
|
||||
belongs_many_many_BlogPosts: 'Zapisi na blogu'
|
||||
db_Title: Naziv
|
||||
db_URLSegment: 'Naslov URL'
|
||||
SilverStripe\Blog\Widgets\BlogCategoriesWidget:
|
||||
Sort: Razvrščanje
|
||||
SilverStripe\Blog\Widgets\BlogTagsWidget:
|
||||
Sort: Razvrščanje
|
||||
|
@ -35,6 +35,10 @@ class BlogMemberExtension extends DataExtension
|
||||
'BlogProfileImage' => Image::class
|
||||
];
|
||||
|
||||
private static array $owns = [
|
||||
'BlogProfileImage',
|
||||
];
|
||||
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
@ -59,11 +63,6 @@ class BlogMemberExtension extends DataExtension
|
||||
$this->owner->URLSegment = preg_replace('/-[0-9]+$/', '', $this->owner->URLSegment ?? '') . '-' . $count;
|
||||
$count++;
|
||||
}
|
||||
|
||||
// Auto publish profile images
|
||||
if ($this->owner->BlogProfileImage() && $this->owner->BlogProfileImage()->exists()) {
|
||||
$this->owner->BlogProfileImage()->publishSingle();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -28,13 +28,17 @@ class BlogPostFilter extends DataExtension
|
||||
*/
|
||||
public function augmentSQL(SQLSelect $query, DataQuery $dataQuery = null)
|
||||
{
|
||||
$stage = Versioned::get_stage();
|
||||
|
||||
if (Controller::has_curr() && Controller::curr() instanceof LeftAndMain) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ($stage == 'Live' || !Permission::check('VIEW_DRAFT_CONTENT')) {
|
||||
if (Versioned::get_stage() === Versioned::LIVE ||
|
||||
(
|
||||
Versioned::get_draft_site_secured() &&
|
||||
!Permission::check('VIEW_DRAFT_CONTENT')
|
||||
)
|
||||
) {
|
||||
$query->addWhere(sprintf(
|
||||
'"PublishDate" < \'%s\'',
|
||||
Convert::raw2sql(DBDatetime::now())
|
||||
|
Loading…
Reference in New Issue
Block a user