Skip to content

Commit

Permalink
Overall improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
LuckyCyborg committed May 12, 2019
1 parent 8f02e51 commit 3a2e904
Show file tree
Hide file tree
Showing 12 changed files with 27 additions and 29 deletions.
2 changes: 1 addition & 1 deletion app/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
*
* PREFER to be used in Database calls or storing Session data, default is 'nova_'
*/
define('PREFIX', 'nova_');
define('PREFIX', 'novapress_');

/**
* Setup the Config API Mode.
Expand Down
8 changes: 4 additions & 4 deletions modules/Contacts/Database/Seeds/PostsTableSeeder.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,13 @@ public function run()
'comment_status' => 'closed',
));

$block->guid = site_url('content/{0}', $block->id);
$block->guid = site_url($block->id);

// Setup the Metadata.
$block->saveMeta(array(
'block_show_title' => 0,
'block_visibility_mode' => 'show',
'block_visibility_path' => 'content/contact-us',
'block_visibility_path' => 'contact-us',
'block_visibility_filter' => 'any',
'block_widget_position' => 'content-footer',

Expand All @@ -63,7 +63,7 @@ public function run()
'comment_status' => 'closed',
));

$page->guid = site_url('content/{0}', $page->name);
$page->guid = site_url($page->name);

$page->save();

Expand Down Expand Up @@ -97,7 +97,7 @@ public function run()
'comment_status' => 'closed',
));

$menuItem->guid = site_url('content/{0}', $name = $menuItem->id);
$menuItem->guid = site_url($name = $menuItem->id);

$menuItem->name = $name;

Expand Down
16 changes: 8 additions & 8 deletions modules/Content/Database/Seeds/PostsTableSeeder.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public function run()
'status' => 'publish',
'menu_order' => 1,
'type' => 'block',
'guid' => site_url('content/1'),
'guid' => site_url('1'),
'comment_status' => 'closed',
));

Expand Down Expand Up @@ -62,7 +62,7 @@ public function run()
'status' => 'publish',
'menu_order' => 2,
'type' => 'block',
'guid' => site_url('content/2'),
'guid' => site_url('2'),
'comment_status' => 'closed',
));

Expand Down Expand Up @@ -90,7 +90,7 @@ public function run()
'status' => 'publish',
'menu_order' => 0,
'type' => 'block',
'guid' => site_url('content/3'),
'guid' => site_url('3'),
'comment_status' => 'closed',
));

Expand All @@ -117,7 +117,7 @@ public function run()
'excerpt' => null,
'status' => 'publish',
'type' => 'post',
'guid' => site_url('content/sample-post'),
'guid' => site_url('sample-post'),
'comment_status' => 'open',
));

Expand Down Expand Up @@ -148,7 +148,7 @@ public function run()
'excerpt' => null,
'status' => 'publish',
'type' => 'page',
'guid' => site_url('content/sample-page'),
'guid' => site_url('sample-page'),
'comment_status' => 'closed',
));

Expand Down Expand Up @@ -180,7 +180,7 @@ public function run()
'status' => 'publish',
'menu_order' => 0,
'type' => 'nav_menu_item',
'guid' => site_url('content/6'),
'guid' => site_url('6'),
'comment_status' => 'closed',
));

Expand All @@ -191,7 +191,7 @@ public function run()
'menu_item_object' => 'custom',
'menu_item_object_id' => $post->id,
'menu_item_target' => null,
'menu_item_url' => site_url('content'),
'menu_item_url' => site_url(),
));

$post->taxonomies()->attach($taxonomy);
Expand All @@ -207,7 +207,7 @@ public function run()
'status' => 'publish',
'menu_order' => 7,
'type' => 'nav_menu_item',
'guid' => site_url('content/7'),
'guid' => site_url('7'),
'comment_status' => 'closed',
));

Expand Down
12 changes: 5 additions & 7 deletions modules/Content/Routes/Web.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@


// The Media Files serving.
Route::get('content/media/serve/{name}', 'Attachments@serve');
Route::get('media/serve/{name}', 'Attachments@serve');


// The Content dispatching.
Route::paginate('content/archive/{year}/{month}', array(
Route::paginate('archive/{year}/{month}', array(
'uses' => 'Content@archive',

'where' => array(
Expand All @@ -31,14 +31,12 @@

Route::paginate('/', 'Content@homepage');

Route::paginate('content', array('uses' => 'Content@homepage'));

Route::paginate('content/search', 'Content@search');
Route::paginate('search', 'Content@search');

//
Route::paginate('content/{type}/{slug}', array('uses' => 'Content@taxonomy'))->where('type', Taxonomies::routePattern(false));
Route::paginate('{type}/{slug}', array('uses' => 'Content@taxonomy'))->where('type', Taxonomies::routePattern(false));

Route::get('content/{slug}', array('uses' => 'Content@show'))->order(100);
Route::get('{slug}', array('uses' => 'Content@show'))->order(100);

// Content unlocking for the Password Protected pages and posts.
Route::post('content/{id}', 'Content@unlock')->where('id', '\d+');
Expand Down
2 changes: 1 addition & 1 deletion modules/Content/Views/Admin/Attachments/Index.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
<script>

var publicUrl = "<?= site_url('assets/files'); ?>";
var mediaServeUrl = "<?= site_url('content/media/serve'); ?>";
var mediaServeUrl = "<?= site_url('media/serve'); ?>";

var fm_dropzone_main = null;

Expand Down
2 changes: 1 addition & 1 deletion modules/Content/Views/Admin/Posts/Edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -689,7 +689,7 @@ function contentEditorInsertMedia(url, type, upload) {
</div>
<div class="box-body">
<?php $thumbId = (int) $post->thumbnail_id ?: 0; ?>
<?php $thumbUrl = isset($post->thumbnail) && isset($post->thumbnail->attachment) ? site_url('content/media/serve/' .$post->thumbnail->attachment->name) : ''; ?>
<?php $thumbUrl = isset($post->thumbnail) && isset($post->thumbnail->attachment) ? site_url('media/serve/' .$post->thumbnail->attachment->name) : ''; ?>
<input name="thumbnail" id="thumbnail" type="hidden" class="uploaded_image_selecter" value="<?= $thumbId; ?>">
<a class="btn btn-primary btn-sm col-sm-6 pull-right btn_upload_image <?= ($thumbId > 0) ? 'hide' : ''; ?>" file_type="image" selecter="thumbnail"><?= __d('content', 'Set featured image'); ?></a>
<div class='clearfix uploaded_image <?= ($thumbId == 0) ? 'hide' : ''; ?>'><img class="img-responsive img-thumbnail" src="<?= $thumbUrl; ?>"></div>
Expand Down
2 changes: 1 addition & 1 deletion modules/Content/Views/Blocks/Search.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<div id="custom-search-input" style="margin-top: 15px;">
<form id="content-search-form" action="<?= site_url('content/search'); ?>" method='GET' role="form">
<form id="content-search-form" action="<?= site_url('search'); ?>" method='GET' role="form">

<div class="input-group col-md-12">
<input name="query" type="text" class="form-control input-lg" placeholder="<?= __d('content', 'Search ...'); ?>" />
Expand Down
2 changes: 1 addition & 1 deletion modules/Content/Views/Content/Index.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

<?php if (! $posts->isEmpty()) { ?>
<?php foreach ($posts as $post) { ?>
<?php $thumbnail = isset($post->thumbnail) && isset($post->thumbnail->attachment) ? site_url('content/media/serve/' .$post->thumbnail->attachment->name) .'?s=220' : ''; ?>
<?php $thumbnail = isset($post->thumbnail) && isset($post->thumbnail->attachment) ? site_url('media/serve/' .$post->thumbnail->attachment->name) .'?s=220' : ''; ?>

<h3><strong><?= $post->title; ?></strong></h3>
<hr style="margin-bottom: 10px;">
Expand Down
2 changes: 1 addition & 1 deletion modules/Content/Views/Content/Page.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

<?php $userIsAdmin = ! is_null($user = Auth::user()) && $user->hasRole('administrator'); ?>

<?php $thumbnail = isset($post->thumbnail) && isset($post->thumbnail->attachment) ? site_url('content/media/serve/' .$post->thumbnail->attachment->name) .'?s=270' : ''; ?>
<?php $thumbnail = isset($post->thumbnail) && isset($post->thumbnail->attachment) ? site_url('media/serve/' .$post->thumbnail->attachment->name) .'?s=270' : ''; ?>
<?php if (! empty($thumbnail)) { ?>
<div class="clearfix pull-left" style="margin: 0 20px 20px 0;"><img class="img-responsive img-thumbnail" src="<?= $thumbnail; ?>"></div>
<?php } ?>
Expand Down
2 changes: 1 addition & 1 deletion modules/Content/Views/Content/Post.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

<div class="col-md-<?= $hasSidebar ? 9 : 12; ?>" style="padding-bottom: 40px;">

<?php $thumbnail = isset($post->thumbnail) && isset($post->thumbnail->attachment) ? site_url('content/media/serve/' .$post->thumbnail->attachment->name) .'?s=270' : ''; ?>
<?php $thumbnail = isset($post->thumbnail) && isset($post->thumbnail->attachment) ? site_url('media/serve/' .$post->thumbnail->attachment->name) .'?s=270' : ''; ?>

<?php $format = __d('content', '%B %d, %Y'); ?>
<div class="pull-left"><?= __d('content', '{0} by <b>{1}</b>', $post->updated_at->formatLocalized($format), $post->author->realname); ?></div>
Expand Down
2 changes: 1 addition & 1 deletion modules/Content/Views/Partials/FileManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@

var mediaUploadUrl = "<?= site_url('admin/media/upload'); ?>";
var mediaUploadedUrl = "<?= site_url('admin/media/uploaded'); ?>";
var mediaServeUrl = "<?= site_url('content/media/serve'); ?>";
var mediaServeUrl = "<?= site_url('media/serve'); ?>";
var mediaPublicUrl = "<?= site_url('assets/files'); ?>";

var cntFiles = null;
Expand Down
4 changes: 2 additions & 2 deletions modules/Content/Widgets/MainMenu.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,14 @@ protected function handleMenuItems($items)
if ($type == 'taxonomy') {
$title = $instance->name;

$url = url('content', array($instance->taxonomy, $instance->slug));
$url = url(array($instance->taxonomy, $instance->slug));
}

// Everthing else is based on Posts or extended from them.
else {
$title = $instance->title;

$url = site_url('content/' .$instance->name);
$url = url($instance->name);
}

// If the user edited the title of the menu item, it will have its own title.
Expand Down

0 comments on commit 3a2e904

Please sign in to comment.