Skip to content

Commit

Permalink
Merge pull request #60 from tomatophp/develop
Browse files Browse the repository at this point in the history
Circle
  • Loading branch information
3x1io committed Apr 2, 2024
2 parents 3abbe28 + 6fe72a1 commit 9107a38
Show file tree
Hide file tree
Showing 157 changed files with 4,870 additions and 183 deletions.
Binary file modified .DS_Store
Binary file not shown.
Binary file added Modules/.DS_Store
Binary file not shown.
2 changes: 1 addition & 1 deletion Modules/CircleApps/App/Services/CircleAppsMenuServices.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

use Illuminate\Support\Collection;
use Illuminate\Support\Str;
use Modules\CircleApps\App\Facades\CircleApps;
use Modules\CircleApps\App\Facades\CircleXo;
use Spatie\Permission\Models\Role;
use TomatoPHP\TomatoAdmin\Facade\TomatoMenu as TomatoMenuFacade;
use TomatoPHP\TomatoAdmin\Services\Contracts\Menu;
Expand Down
3 changes: 2 additions & 1 deletion Modules/CircleApps/App/Services/CircleAppsServices.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@

use Illuminate\Support\Collection;
use Illuminate\Support\Str;
use Modules\CircleApps\App\Facades\CircleApps;
use Modules\CircleApps\App\Facades\CircleAppsMenu;
use Modules\CircleApps\App\Facades\CircleXo;
use Modules\CircleApps\App\Facades\CircleXoSlots;
use Spatie\Permission\Models\Role;
use TomatoPHP\TomatoAdmin\Facade\TomatoMenu as TomatoMenuFacade;
use TomatoPHP\TomatoAdmin\Services\Contracts\Menu;
Expand Down
6 changes: 3 additions & 3 deletions Modules/CircleApps/resources/views/show.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@
</div>
</div>
</div>
<div class="grid grid-cols-12 w-full gap-4 my-4">
<div class="bg-zinc-800 rounded-lg overflow-hidden shadow-md border border-zinc-700 p-4 col-span-9">
<div class="grid grid-cols-1 md:grid-cols-12 w-full gap-4 my-4">
<div class="bg-zinc-800 rounded-lg overflow-hidden shadow-md border border-zinc-700 p-4 col-span-1 lg:col-span-9">
<div style="background-image: url('{{$app->getMedia('cover')->first()?->getUrl()}}')" class="bg-cover bg-center w-full h-80 rounded-lg">

</div>
Expand All @@ -78,7 +78,7 @@
<x-tomato-markdown-viewer :content="$app->readme" />
@endif
</div>
<div class="bg-zinc-800 rounded-lg overflow-hidden shadow-md border border-zinc-700 p-6 col-span-3 flex flex-col gap-2 justify-start">
<div class="bg-zinc-800 rounded-lg overflow-hidden shadow-md border border-zinc-700 p-6 col-span-1 lg:col-span-3 flex flex-col gap-2 justify-start">
@if($app->homepage)
<div>
<h1>{{__('Website')}}</h1>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
use Illuminate\Support\Facades\Blade;
use Illuminate\Support\ServiceProvider;
use Modules\CircleApps\App\Facades\CircleAppsMenu;
use Modules\CircleApps\App\Facades\CircleXoSlots;
use Modules\CircleContacts\App\Console\CircleContactsInstall;
use Modules\CircleContacts\App\Console\CircleInovicesInstall;
use TomatoPHP\TomatoAdmin\Services\Contracts\Menu;
Expand Down
1 change: 1 addition & 0 deletions Modules/CircleDocs/.github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
github: [3x1io]
Empty file.
63 changes: 63 additions & 0 deletions Modules/CircleDocs/App/Console/CircleDocsInstall.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
<?php

namespace Modules\CircleDocs\App\Console;

use Illuminate\Console\Command;
use Modules\CircleApps\App\Models\App;
use TomatoPHP\ConsoleHelpers\Traits\RunCommand;

class CircleDocsInstall extends Command
{
use RunCommand;

/**
* The name and signature of the console command.
*
* @var string
*/
protected $name = 'circle-docs:install';

/**
* The console command description.
*
* @var string
*/
protected $description = 'install package and publish assets';

public function __construct()
{
parent::__construct();
}


/**
* Execute the console command.
*
* @return mixed
*/
public function handle()
{
$this->info('Install App');
$app = App::where('key', 'circle-docs')->first();
if(!$app){
$app = new App();
$app->key = 'circle-docs';
$app->name = 'Circle Docs';
$app->description = 'Create and share, search in your docs using markdown editor and GitHub integration';
$app->is_active = true;
$app->is_free = true;
$app->status = "active";
$app->homepage = "https://www.github.com/tomatophp/circle-docs";
$app->github = "https://www.github.com/tomatophp/circle-docs";
$app->docs = "https://www.github.com/tomatophp/circle-docs";
$app->privacy = "https://www.github.com/tomatophp/circle-docs";
$app->faq = "https://www.github.com/tomatophp/circle-docs";
$app->email = "info@3x1.io";
$app->save();
}
$this->callSilent('optimize:clear');
$this->artisanCommand(["migrate"]);
$this->artisanCommand(["optimize:clear"]);
$this->info('Circle Contacts App installed successfully.');
}
}
Empty file.
Empty file.
81 changes: 81 additions & 0 deletions Modules/CircleDocs/App/Http/Controllers/CircleDocsController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
<?php

namespace Modules\CircleDocs\App\Http\Controllers;

use App\Http\Controllers\Controller;
use App\Models\Account;
use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request;
use Illuminate\Http\Response;
use Modules\CircleDocs\App\Models\CircleXoDoc;

class CircleDocsController extends Controller
{
/**
* Display a listing of the resource.
*/
public function index(Request $request)
{
$query = CircleXoDoc::query();
$query->where('is_public', true);
if($request->has('search') && $request->input('search') != ''){
$query->where('name', 'like', '%'.$request->input('search').'%')->orWhere('package', 'like', '%'.$request->input('search').'%');
}
$query->where('is_public', true);
$query = $query->paginate(12);

return view('circle-docs::index', [
'docs' => $query
]);
}

public function profile($username)
{
$account = Account::where('username', $username)->firstOrFail();
if($account){
$query = CircleXoDoc::query();
$query->where('account_id', $account->id);
$query->where('is_public', true);
$query = $query->paginate(12);

return view('circle-docs::profile', [
'docs' => $query,
'account' => $account
]);
}
}

/**
* Show the specified resource.
*/
public function show($username, $slug)
{
$account = Account::where('username', $username)->firstOrFail();
if($account){
$doc = CircleXoDoc::where('package', $slug)->where('account_id', $account->id)->firstOrFail();
return view('circle-docs::show', [
'doc' => $doc,
'account' => $account
]);
}
}

/**
* Show the specified resource.
*/
public function page($username, $slug, $page)
{
$account = Account::where('username', $username)->firstOrFail();
if($account){
$doc = CircleXoDoc::where('package', $slug)->where('account_id', $account->id)->firstOrFail();
if($doc){
$page = $doc->pages()->where('slug', $page)->firstOrFail();
return view('circle-docs::show', [
'doc' => $doc,
'currentPage' => $page,
'account' => $account
]);
}
}
}
}

0 comments on commit 9107a38

Please sign in to comment.