From ade5abc841f510d973b8ac290c4dcee1de5cb4d4 Mon Sep 17 00:00:00 2001 From: "Helmut K. C. Tessarek" Date: Wed, 31 Dec 2014 00:10:20 -0500 Subject: [PATCH] Site Content option: show expiration date for every paste new option `Show expiration` in `Site settings - Content` - if enabled, the expiration date is shown in the footer - disabled by default --- app/config/default.php | 1 + app/lang/en/admin.php | 3 +++ app/models/Paste.php | 1 + .../skins/bootstrap/admin/site.blade.php | 23 +++++++++++++++++++ .../skins/bootstrap/site/paste.blade.php | 15 ++++++++++++ 5 files changed, 43 insertions(+) diff --git a/app/config/default.php b/app/config/default.php index 5484a113f..40ec53e40 100755 --- a/app/config/default.php +++ b/app/config/default.php @@ -29,6 +29,7 @@ 'pasteVisibility' => 'default', 'guestPosts' => '1', 'pasteSearch' => '1', + 'showExp' => '0', 'comments' => '1', 'noExpire' => 'all', 'csrf' => '1', diff --git a/app/lang/en/admin.php b/app/lang/en/admin.php index 97b577f96..32b37d667 100755 --- a/app/lang/en/admin.php +++ b/app/lang/en/admin.php @@ -27,6 +27,7 @@ "save_all" => "Save all", "posted_at" => "Posted at", "expires_at" => "Expires at", + "expires_on" => "expires on", "is_private" => "Is private", "has_password" => "Has password", "poster_ip" => "Poster's IP", @@ -89,6 +90,8 @@ "expire_1month" => "1 month", "expire_1year" => "1 year", "expire_forever" => "Keep forever", + "show_exp" => "Show expiration", + "show_exp_exp" => "Show the expiration date for pastes.", "expiration" => "Expiration", "expiration_exp" => "This setting determines the maximum age for pastes created on this site.", "noexpire_none" => "Everyone must set a finite expiration time", diff --git a/app/models/Paste.php b/app/models/Paste.php index 8cb7b07b8..84821d87c 100755 --- a/app/models/Paste.php +++ b/app/models/Paste.php @@ -51,6 +51,7 @@ class Paste extends Eloquent { 'project', 'timestamp', 'expire', + 'showExp', 'title', 'data', 'language', diff --git a/app/views/skins/bootstrap/admin/site.blade.php b/app/views/skins/bootstrap/admin/site.blade.php index a431d6512..45c4066c1 100755 --- a/app/views/skins/bootstrap/admin/site.blade.php +++ b/app/views/skins/bootstrap/admin/site.blade.php @@ -383,6 +383,29 @@ +
+ {{ + Form::label('show_exp', Lang::get('admin.show_exp'), array( + 'class' => 'control-label col-sm-3 col-lg-2' + )) + }} + +
+ {{ + Form::select('show_exp', array( + '1' => Lang::get('admin.enabled'), + '0' => Lang::get('admin.disabled'), + ), $site->general->showExp, array( + 'class' => 'form-control' + )) + }} + +
+ {{ Lang::get('admin.show_exp_exp') }} +
+
+
+
{{ Form::label('paste_search', Lang::get('admin.paste_search'), array( diff --git a/app/views/skins/bootstrap/site/paste.blade.php b/app/views/skins/bootstrap/site/paste.blade.php index faa37ff4f..77c756f4d 100755 --- a/app/views/skins/bootstrap/site/paste.blade.php +++ b/app/views/skins/bootstrap/site/paste.blade.php @@ -136,12 +136,27 @@