Commit 42189162 authored by ZeMKI's avatar ZeMKI

admin dashboard update

* dashboard on admin for users that agreed for the newsletter
parent 1731c988
......@@ -2,24 +2,10 @@
<project version="4">
<component name="ChangeListManager">
<list default="true" id="b51d2beb-a115-4b2a-80a2-b27cfb404d6c" name="Default Changelist" comment="">
<change afterPath="$PROJECT_DIR$/config/enums.php" afterDir="false" />
<change afterPath="$PROJECT_DIR$/database/migrations/2020_06_02_173558_add_newsletter_to_user_profiles.php" afterDir="false" />
<change afterPath="$PROJECT_DIR$/resources/views/admin/newsletter.blade.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/Answer.php" beforeDir="false" afterPath="$PROJECT_DIR$/app/Answer.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/Helpers/Helper.php" beforeDir="false" afterPath="$PROJECT_DIR$/app/Helpers/Helper.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/Http/Controllers/Auth/RegisterController.php" beforeDir="false" afterPath="$PROJECT_DIR$/app/Http/Controllers/Auth/RegisterController.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/Http/Controllers/HomeController.php" beforeDir="false" afterPath="$PROJECT_DIR$/app/Http/Controllers/HomeController.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/Http/Controllers/NotificationController.php" beforeDir="false" afterPath="$PROJECT_DIR$/app/Http/Controllers/NotificationController.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/Http/Controllers/StudyController.php" beforeDir="false" afterPath="$PROJECT_DIR$/app/Http/Controllers/StudyController.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/Profile.php" beforeDir="false" afterPath="$PROJECT_DIR$/app/Profile.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/User.php" beforeDir="false" afterPath="$PROJECT_DIR$/app/User.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/database/migrations/2018_10_04_145119_create_users_profiles_table.php" beforeDir="false" afterPath="$PROJECT_DIR$/database/migrations/2018_10_04_145119_create_users_profiles_table.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/resources/js/app.js" beforeDir="false" afterPath="$PROJECT_DIR$/resources/js/app.js" afterDir="false" />
<change beforePath="$PROJECT_DIR$/resources/js/components/newstudy.vue" beforeDir="false" afterPath="$PROJECT_DIR$/resources/js/components/newstudy.vue" afterDir="false" />
<change beforePath="$PROJECT_DIR$/resources/sass/_variables.scss" beforeDir="false" afterPath="$PROJECT_DIR$/resources/sass/_variables.scss" afterDir="false" />
<change beforePath="$PROJECT_DIR$/resources/views/auth/register.blade.php" beforeDir="false" afterPath="$PROJECT_DIR$/resources/views/auth/register.blade.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/resources/views/home.blade.php" beforeDir="false" afterPath="$PROJECT_DIR$/resources/views/home.blade.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/resources/views/layouts/nav.blade.php" beforeDir="false" afterPath="$PROJECT_DIR$/resources/views/layouts/nav.blade.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/Http/Controllers/AdminController.php" beforeDir="false" afterPath="$PROJECT_DIR$/app/Http/Controllers/AdminController.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/resources/views/admin/layout.blade.php" beforeDir="false" afterPath="$PROJECT_DIR$/resources/views/admin/layout.blade.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/routes/web.php" beforeDir="false" afterPath="$PROJECT_DIR$/routes/web.php" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
......@@ -214,7 +200,7 @@
<property name="RunOnceActivity.OpenProjectViewOnStart" value="true" />
<property name="RunOnceActivity.ShowReadmeOnStart" value="true" />
<property name="WebServerToolWindowFactoryState" value="false" />
<property name="last_opened_file_path" value="$PROJECT_DIR$/resources/js/components/Interview" />
<property name="last_opened_file_path" value="$PROJECT_DIR$/resources/views/admin" />
<property name="node.js.detected.package.eslint" value="true" />
<property name="node.js.path.for.package.eslint" value="project" />
<property name="node.js.selected.package.eslint" value="(autodetect)" />
......@@ -223,12 +209,13 @@
<property name="settings.editor.selected.configurable" value="preferences.customizations" />
</component>
<component name="RecentsManager">
<key name="MoveFile.RECENT_KEYS">
<recent name="$PROJECT_DIR$/resources/lang/" />
</key>
<key name="CopyFile.RECENT_KEYS">
<recent name="$PROJECT_DIR$/resources/views/admin" />
<recent name="$PROJECT_DIR$/resources/js/components/Interview" />
</key>
<key name="MoveFile.RECENT_KEYS">
<recent name="$PROJECT_DIR$/resources/lang/" />
</key>
</component>
<component name="RunManager" selected="PHP Built-in Web Server.Valet mesort">
<configuration name="watch-poll" type="js.build_tools.npm" temporary="true" nameIsGenerated="true">
......@@ -283,6 +270,7 @@
<workItem from="1590665422138" duration="4114000" />
<workItem from="1591103340019" duration="9647000" />
<workItem from="1591616407634" duration="531000" />
<workItem from="1591617713043" duration="637000" />
</task>
<servers />
</component>
......@@ -290,6 +278,10 @@
<option name="version" value="2" />
</component>
<component name="WindowStateProjectService">
<state x="712" y="383" key="#com.intellij.openapi.updateSettings.impl.PluginUpdateInfoDialog" timestamp="1591617679721">
<screen x="0" y="0" width="2048" height="1280" />
</state>
<state x="712" y="383" key="#com.intellij.openapi.updateSettings.impl.PluginUpdateInfoDialog/0.0.2048.1280@0.0.2048.1280" timestamp="1591617679721" />
<state x="762" y="402" key="#com.jetbrains.php.actions.copyPaste.importReferences.PhpImportReferencesDialog" timestamp="1590662018992">
<screen x="0" y="0" width="2048" height="1280" />
</state>
......@@ -372,10 +364,10 @@
<state x="799" y="561" key="com.intellij.openapi.vcs.update.UpdateOrStatusOptionsDialogupdate-v2/0.0.2048.1280@0.0.2048.1280" timestamp="1591186286502" />
<state x="799" y="561" key="com.intellij.openapi.vcs.update.UpdateOrStatusOptionsDialogupdate-v2/128.-1080.1920.1080/0.0.2048.1280@0.0.2048.1280" timestamp="1590054170589" />
<state x="799" y="561" key="com.intellij.openapi.vcs.update.UpdateOrStatusOptionsDialogupdate-v2/65.-1080.1920.1080/0.0.2048.1280@0.0.2048.1280" timestamp="1590404098131" />
<state x="1038" y="638" width="632" height="534" key="find.popup" timestamp="1591115078673">
<state x="1038" y="638" width="632" height="534" key="find.popup" timestamp="1591618306491">
<screen x="0" y="0" width="2048" height="1280" />
</state>
<state x="1038" y="638" width="632" height="534" key="find.popup/0.0.2048.1280@0.0.2048.1280" timestamp="1591115078673" />
<state x="1038" y="638" width="632" height="534" key="find.popup/0.0.2048.1280@0.0.2048.1280" timestamp="1591618306491" />
<state x="708" y="373" width="632" height="534" key="find.popup/65.-1080.1920.1080/0.0.2048.1280@0.0.2048.1280" timestamp="1590406250473" />
<state x="899" y="515" width="250" height="278" key="jetbrains.javascript.buildTools.run-task-popup" timestamp="1590568927491">
<screen x="0" y="0" width="2048" height="1280" />
......@@ -393,10 +385,10 @@
</state>
<state x="824" y="505" key="scopes/128.-1057.1920.1057/0.0.2048.1280@0.0.2048.1280" timestamp="1590055889310" />
<state x="824" y="505" width="498" height="379" key="scopes/128.-1080.1920.1080/0.0.2048.1280@0.0.2048.1280" timestamp="1590055356254" />
<state x="689" y="291" width="670" height="676" key="search.everywhere.popup" timestamp="1591617063454">
<state x="689" y="291" width="670" height="676" key="search.everywhere.popup" timestamp="1591617993489">
<screen x="0" y="0" width="2048" height="1280" />
</state>
<state x="689" y="291" width="670" height="676" key="search.everywhere.popup/0.0.2048.1280@0.0.2048.1280" timestamp="1591617063454" />
<state x="689" y="291" width="670" height="676" key="search.everywhere.popup/0.0.2048.1280@0.0.2048.1280" timestamp="1591617993489" />
<state x="689" y="291" width="670" height="676" key="search.everywhere.popup/0.23.2048.1257@0.23.2048.1257" timestamp="1591115561349" />
<state x="689" y="291" width="670" height="676" key="search.everywhere.popup/128.-1080.1920.1080/0.0.2048.1280@0.0.2048.1280" timestamp="1590054146808" />
<state x="689" y="292" width="715" height="677" key="search.everywhere.popup/65.-1080.1920.1080/0.0.2048.1280@0.0.2048.1280" timestamp="1590667028046" />
......
......@@ -60,7 +60,6 @@ class AdminController extends Controller
public function downloadBackup()
{
return Storage::disk('local')->download('backup.7z');
}
/**
......@@ -70,7 +69,6 @@ class AdminController extends Controller
public function downloadYesterdayBackup()
{
return Storage::disk('local')->download('backup.old.7z');
}
public function supervisorIndex()
......@@ -93,4 +91,11 @@ class AdminController extends Controller
$user->attachPermissions($createStudyPermission);
return view('admin.supervisor', ['message' => 'Supervisor added']);
}
public function listForNewsletter()
{
$users = User::join('users_profiles', 'users.id', '=', 'user_id')->where('newsletter', '=', 2)->get();
return view('admin.newsletter', ['users' => $users]);
}
}
......@@ -111,6 +111,13 @@
class="pb-1 md:pb-0 text-sm">Notifications</span>
</a>
</li>
<li class="mr-6 my-2 md:my-0">
<a href="{{url('admin/newsletter')}}" :class="url == 'newsletter' ? 'text-blue-400' :'text-gray-500'"
class="block py-1 md:py-3 pl-1 align-middle no-underline hover:text-gray-100 border-b-2 border-gray-900 hover:border-red-400">
<i class="fa fa-wallet fa-fw mr-3"></i><span
class="pb-1 md:pb-0 text-sm">Newsletter</span>
</a>
</li>
<li class="mr-6 my-2 md:my-0">
<a href="{{url('')}}"
class="block py-1 text-gray-500 md:py-3 pl-1 align-middle no-underline hover:text-gray-100 border-b-2 border-gray-900 hover:border-red-400">
......
@extends('admin.layout')
@section('content')
<div>
@if(isset($message))
<span @created="showtoast({{$message}})"></span>
@endif
<h1 class="text-4xl font-bold mb-2">Users that agreed to receive emails</h1>
<table class="table-fixed w-full border border-solid">
<thead class="border border-b-1 border-solid bg-black">
<tr>
<th class="px-4 py-2 text-white">ID</th>
<th class="px-4 py-2 text-white">Email</th>
</tr>
</thead>
<tbody>
@foreach($users as $user)
<tr class="hover:bg-gray-100">
<td class="border px-4 py-2">{{$user->id}}</td>
<td class="border px-4 py-2">{{$user->email}}</td>
</tr>
@endforeach
</tbody>
</table>
</div>
@endsection
......@@ -50,6 +50,7 @@ Route::group(['prefix' => 'admin', 'middleware' => ['role:admin']], static funct
Route::post('/users/supervisor', 'UserController@store');
Route::get('/notifications', 'NotificationController@create');
Route::post('/notify', 'NotificationController@store');
Route::get('/newsletter', 'AdminController@listForNewsletter');
});
Route::group(['middleware' => ['auth', 'verified']], static function () {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment