mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
initial community profiles infrastructure
This commit is contained in:
parent
c5e0f636f3
commit
08cda3fe3d
@ -1,75 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||
<title>Gradido Login Server: Email Verification</title>
|
||||
<link rel="stylesheet" type="text/css" href="http://192.168.178.52/css/main.css">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="layout">
|
||||
<div class="center-form-single">
|
||||
<div class="center-form-header">
|
||||
<a href="http://192.168.178.52/" class="center-logo">
|
||||
<picture>
|
||||
<source srcset="http://192.168.178.52/img/logo_schrift.webp" type="image/webp">
|
||||
<source srcset="http://192.168.178.52/img/logo_schrift.png" type="image/png">
|
||||
<img src="http://192.168.178.52/img/logo_schrift.png" alt="logo" />
|
||||
</picture>
|
||||
</a>
|
||||
</div>
|
||||
<div class="center-form-container">
|
||||
<div class="center-form-selectors">
|
||||
<form action="http://192.168.178.52/account/checkEmail" method="GET">
|
||||
<button id="flag-germany" name="lang" value="de" title="Deutsch" type="submit" class="flag-btn">
|
||||
<span class="flag flag-germany"></span>
|
||||
</button>
|
||||
<button id="flag-england" name="lang" value="en" title="English" type="submit" class="flag-btn">
|
||||
<span class="flag flag-england"></span>
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
<div class="center-form-title">
|
||||
<h1>E-Mail verifizieren</h1>
|
||||
</div>
|
||||
<div class="center-form-form">
|
||||
<form action="http://192.168.178.52/account/checkEmail" method="GET">
|
||||
<label class="form-label" for="email-verification-code">
|
||||
Bitte gib deinen E-Mail Verification Code ein:
|
||||
</label>
|
||||
<input
|
||||
class="form-control"
|
||||
type="number"
|
||||
name="email-verification-code"
|
||||
id="email-verification-code"
|
||||
placeholder="Email Verification Code">
|
||||
<button type="submit" class="center-form-submit form-button">Überprüfe Code</button>
|
||||
</form>
|
||||
</div>
|
||||
<div class="center-form-bottom">
|
||||
<div class="signup-link">
|
||||
<p class="margin-top-10">
|
||||
Funktioniert dein E-Mail Verification Code nicht?<br>
|
||||
Schicke uns eine E-Mail und wir kümmern uns darum: <br>
|
||||
<b><a href="mailto:webmaster@software-labor.de?subject=Invalid E-Mail Verification Code&body=Hallo Dario,%0D%0A%0D%0Amein E-Mail Verification-Code: 0 funktioniert nicht,%0D%0Akannst du das prüfen?%0D%0A%0D%0AMit freundlichen Grüßen%0D%0A">E-Mail an Support schicken</a></b>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="center-bottom">
|
||||
<p>Copyright © Gradido 2020</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="bottomleft">
|
||||
428 micro s
|
||||
</div>
|
||||
<div class="bottomright">
|
||||
<p>Login Server in Entwicklung</p>
|
||||
<p>Alpha 0.20.07.10</p>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@ -1,67 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||
<title>Gradido Login Server: Login</title>
|
||||
<link rel="stylesheet" type="text/css" href="http://192.168.178.52/css/main.css">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="layout">
|
||||
<div class="center-form-single">
|
||||
<div class="center-form-header">
|
||||
<a href="http://192.168.178.52/" class="center-logo">
|
||||
<picture>
|
||||
<source srcset="http://192.168.178.52/img/logo_schrift.webp" type="image/webp">
|
||||
<source srcset="http://192.168.178.52/img/logo_schrift.png" type="image/png">
|
||||
<img src="http://192.168.178.52/img/logo_schrift.png" alt="logo" />
|
||||
</picture>
|
||||
</a>
|
||||
</div>
|
||||
<div class="center-form-container">
|
||||
<div class="center-form-selectors">
|
||||
<form method="GET" action="">
|
||||
<button id="flag-germany" name="lang" value="de" title="Deutsch" type="submit" class="flag-btn">
|
||||
<span class="flag flag-germany"></span>
|
||||
</button>
|
||||
<button id="flag-england" name="lang" value="en" title="English" type="submit" class="flag-btn">
|
||||
<span class="flag flag-england"></span>
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
<div class="center-form-form">
|
||||
<form action="http://192.168.178.52/account/" method="POST">
|
||||
<input type="text" class="form-control" name="login-email" placeholder="E-Mail" value="" />
|
||||
<input type="password" class="form-control" name="login-password" placeholder="Passwort" />
|
||||
<button type="submit" name="submit" class="center-form-submit form-button">Anmeldung</button>
|
||||
</form>
|
||||
</div>
|
||||
<div class="center-form-bottom">
|
||||
<div class="signup-link">
|
||||
<p>Du hast noch kein Gradido-Konto?</p>
|
||||
<a href="http://192.168.178.52/account/registerDirect">
|
||||
Neues Konto erstellen
|
||||
</a>
|
||||
</div>
|
||||
<div class="reset-pwd-link">
|
||||
<a href="http://192.168.178.52/account/resetPassword">Passwort vergessen</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="center-bottom">
|
||||
<p>Copyright © Gradido 2020</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="bottomleft">
|
||||
428 micro s
|
||||
</div>
|
||||
<div class="bottomright">
|
||||
<p>Login Server in Entwicklung</p>
|
||||
<p>Alpha 0.20.07.10</p>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@ -1,58 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||
<title>Gradido Login Server: Registrierung</title>
|
||||
<link rel="stylesheet" type="text/css" href="http://192.168.178.52/css/main.css">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="layout">
|
||||
<div class="center-form-single">
|
||||
<div class="center-form-header">
|
||||
<a href="http://192.168.178.52/" class="center-logo">
|
||||
<picture>
|
||||
<source srcset="http://192.168.178.52/img/logo_schrift.webp" type="image/webp">
|
||||
<source srcset="http://192.168.178.52/img/logo_schrift.png" type="image/png">
|
||||
<img src="http://192.168.178.52/img/logo_schrift.png" alt="logo" />
|
||||
</picture>
|
||||
</a>
|
||||
</div>
|
||||
<div class="center-form-container">
|
||||
<div class="center-form-title">
|
||||
<h1>Einen neuen Account anlegen</h1>
|
||||
</div>
|
||||
<div class="center-form-form">
|
||||
<form method="POST">
|
||||
<p>Bitte gib deine Daten an, um einen Account anzulegen:</p>
|
||||
<label class="form-label" for="register-first-name">Vorname</label>
|
||||
<input class="form-control" id="register-first-name" type="text" name="register-first-name" value="" />
|
||||
<label class="form-label" for="register-last-name">Nachname</label>
|
||||
<input class="form-control" id="register-last-name" type="text" name="register-last-name" value="" />
|
||||
<label class="form-label" for="register-email">E-Mail</label>
|
||||
<input class="form-control" id="register-email" type="email" name="register-email" value="" />
|
||||
<label class="form-label" for="register-password">Passwort</label>
|
||||
<input class="form-control" id="register-password" type="password" name="register-password" />
|
||||
<label class="form-label" for="register-password">Passwort Bestätigung</label>
|
||||
<input class="form-control" id="register-password2" type="password" name="register-password2" />
|
||||
<input class="center-form-submit form-button" type="submit" name="submit" value="Anmelden">
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<div class="center-bottom">
|
||||
<p>Copyright © Gradido 2020</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="bottomleft">
|
||||
428 micro s
|
||||
</div>
|
||||
<div class="bottomright">
|
||||
<p>Login Server in Entwicklung</p>
|
||||
<p>Alpha 0.20.07.10</p>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@ -1,58 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||
<title>Gradido Login Server: Passwort vergessen</title>
|
||||
<link rel="stylesheet" type="text/css" href="http://192.168.178.52/css/main.css">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="layout">
|
||||
<div class="center-form-single">
|
||||
<div class="center-form-header">
|
||||
<a href="http://192.168.178.52/" class="center-logo">
|
||||
<picture>
|
||||
<source srcset="http://192.168.178.52/img/logo_schrift.webp" type="image/webp">
|
||||
<source srcset="http://192.168.178.52/img/logo_schrift.png" type="image/png">
|
||||
<img src="http://192.168.178.52/img/logo_schrift.png" alt="logo" />
|
||||
</picture>
|
||||
</a>
|
||||
</div>
|
||||
<div class="center-form-container">
|
||||
<div class="center-form-title">
|
||||
<h1>Passwort zurücksetzen</h1>
|
||||
</div>
|
||||
<div class="center-form-form">
|
||||
<form action="http://192.168.178.52/account/resetPassword">
|
||||
<label class="form-label" for="email">Gib bitte hier deine E-Mail Adresse an:</label>
|
||||
<input class="form-control" type="text" name="email" id="email" placeholder="E-Mail"
|
||||
value="">
|
||||
<input class="center-form-submit form-button" type="submit" name="submit" value="Bestätigen">
|
||||
</form>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
function removeGroupInvalidClass() {
|
||||
var elements = document.getElementsByClassName("group-is-invalid");
|
||||
if (elements.length > 0) {
|
||||
elements[0].classList.remove("group-is-invalid");
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</div>
|
||||
<div class="center-bottom">
|
||||
<p>Copyright © Gradido 2020</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="bottomleft">
|
||||
428 micro s
|
||||
</div>
|
||||
<div class="bottomright">
|
||||
<p>Login Server in Entwicklung</p>
|
||||
<p>Alpha 0.20.07.10</p>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@ -1,52 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||
<title>Gradido Login Server: Passwort bestimmen</title>
|
||||
<link rel="stylesheet" type="text/css" href="http://192.168.178.52/css/main.css">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="layout">
|
||||
<div class="center-form-single">
|
||||
<div class="center-form-header">
|
||||
<a href="http://192.168.178.52/" class="center-logo">
|
||||
<picture>
|
||||
<source srcset="http://192.168.178.52/img/logo_schrift.webp" type="image/webp">
|
||||
<source srcset="http://192.168.178.52/img/logo_schrift.png" type="image/png">
|
||||
<img src="http://192.168.178.52/img/logo_schrift.png" alt="logo" />
|
||||
</picture>
|
||||
</a>
|
||||
</div>
|
||||
<div class="center-form-container">
|
||||
<div class="center-form-title">
|
||||
<h1>Passwort bestimmen</h1>
|
||||
</div>
|
||||
<div class="center-form-form">
|
||||
<form method="POST">
|
||||
<p>Bitte denke dir ein sicheres Passwort aus, das mindestens 8 Zeichen lang ist, ein Klein- und einen Großbuchstaben enthält, eine Zahl und eines der folgenden Sonderzeichen: @$!%*?&+-</p>
|
||||
<label class="form-label" for="register-password">Passwort</label>
|
||||
<input class="form-control" id="register-password" type="password" name="register-password" />
|
||||
<label class="form-label" for="register-password2">Passwort Bestätigung</label>
|
||||
<input class="form-control" id="register-password2" type="password" name="register-password2" />
|
||||
<input class="center-form-submit form-button" type="submit" name="submit" value="Änderung(en) speichern">
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<div class="center-bottom">
|
||||
<p>Copyright © Gradido 2020</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="bottomleft">
|
||||
428 micro s
|
||||
</div>
|
||||
<div class="bottomright">
|
||||
<p>Login Server in Entwicklung</p>
|
||||
<p>Alpha 0.20.07.10</p>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
106
src/Controller/CommunityProfilesController.php
Normal file
106
src/Controller/CommunityProfilesController.php
Normal file
@ -0,0 +1,106 @@
|
||||
<?php
|
||||
namespace App\Controller;
|
||||
|
||||
use App\Controller\AppController;
|
||||
|
||||
/**
|
||||
* CommunityProfiles Controller
|
||||
*
|
||||
* @property \App\Model\Table\CommunityProfilesTable $CommunityProfiles
|
||||
*
|
||||
* @method \App\Model\Entity\CommunityProfile[]|\Cake\Datasource\ResultSetInterface paginate($object = null, array $settings = [])
|
||||
*/
|
||||
class CommunityProfilesController extends AppController
|
||||
{
|
||||
/**
|
||||
* Index method
|
||||
*
|
||||
* @return \Cake\Http\Response|null
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
$communityProfiles = $this->paginate($this->CommunityProfiles);
|
||||
|
||||
$this->set(compact('communityProfiles'));
|
||||
}
|
||||
|
||||
/**
|
||||
* View method
|
||||
*
|
||||
* @param string|null $id Community Profile id.
|
||||
* @return \Cake\Http\Response|null
|
||||
* @throws \Cake\Datasource\Exception\RecordNotFoundException When record not found.
|
||||
*/
|
||||
public function view($id = null)
|
||||
{
|
||||
$communityProfile = $this->CommunityProfiles->get($id, [
|
||||
'contain' => [],
|
||||
]);
|
||||
|
||||
$this->set('communityProfile', $communityProfile);
|
||||
}
|
||||
|
||||
/**
|
||||
* Add method
|
||||
*
|
||||
* @return \Cake\Http\Response|null Redirects on successful add, renders view otherwise.
|
||||
*/
|
||||
public function add()
|
||||
{
|
||||
$communityProfile = $this->CommunityProfiles->newEntity();
|
||||
if ($this->request->is('post')) {
|
||||
$communityProfile = $this->CommunityProfiles->patchEntity($communityProfile, $this->request->getData());
|
||||
if ($this->CommunityProfiles->save($communityProfile)) {
|
||||
$this->Flash->success(__('The community profile has been saved.'));
|
||||
|
||||
return $this->redirect(['action' => 'index']);
|
||||
}
|
||||
$this->Flash->error(__('The community profile could not be saved. Please, try again.'));
|
||||
}
|
||||
$this->set(compact('communityProfile'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Edit method
|
||||
*
|
||||
* @param string|null $id Community Profile id.
|
||||
* @return \Cake\Http\Response|null Redirects on successful edit, renders view otherwise.
|
||||
* @throws \Cake\Datasource\Exception\RecordNotFoundException When record not found.
|
||||
*/
|
||||
public function edit($id = null)
|
||||
{
|
||||
$communityProfile = $this->CommunityProfiles->get($id, [
|
||||
'contain' => [],
|
||||
]);
|
||||
if ($this->request->is(['patch', 'post', 'put'])) {
|
||||
$communityProfile = $this->CommunityProfiles->patchEntity($communityProfile, $this->request->getData());
|
||||
if ($this->CommunityProfiles->save($communityProfile)) {
|
||||
$this->Flash->success(__('The community profile has been saved.'));
|
||||
|
||||
return $this->redirect(['action' => 'index']);
|
||||
}
|
||||
$this->Flash->error(__('The community profile could not be saved. Please, try again.'));
|
||||
}
|
||||
$this->set(compact('communityProfile'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete method
|
||||
*
|
||||
* @param string|null $id Community Profile id.
|
||||
* @return \Cake\Http\Response|null Redirects to index.
|
||||
* @throws \Cake\Datasource\Exception\RecordNotFoundException When record not found.
|
||||
*/
|
||||
public function delete($id = null)
|
||||
{
|
||||
$this->request->allowMethod(['post', 'delete']);
|
||||
$communityProfile = $this->CommunityProfiles->get($id);
|
||||
if ($this->CommunityProfiles->delete($communityProfile)) {
|
||||
$this->Flash->success(__('The community profile has been deleted.'));
|
||||
} else {
|
||||
$this->Flash->error(__('The community profile could not be deleted. Please, try again.'));
|
||||
}
|
||||
|
||||
return $this->redirect(['action' => 'index']);
|
||||
}
|
||||
}
|
||||
28
src/Model/Entity/CommunityProfile.php
Normal file
28
src/Model/Entity/CommunityProfile.php
Normal file
@ -0,0 +1,28 @@
|
||||
<?php
|
||||
namespace App\Model\Entity;
|
||||
|
||||
use Cake\ORM\Entity;
|
||||
|
||||
/**
|
||||
* CommunityProfile Entity
|
||||
*
|
||||
* @property int $id
|
||||
* @property string|resource|null $profile_img
|
||||
* @property string|null $profile_desc
|
||||
*/
|
||||
class CommunityProfile extends Entity
|
||||
{
|
||||
/**
|
||||
* Fields that can be mass assigned using newEntity() or patchEntity().
|
||||
*
|
||||
* Note that when '*' is set to true, this allows all unspecified fields to
|
||||
* be mass assigned. For security purposes, it is advised to set '*' to false
|
||||
* (or remove it), and explicitly make individual fields accessible as needed.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $_accessible = [
|
||||
'profile_img' => true,
|
||||
'profile_desc' => true,
|
||||
];
|
||||
}
|
||||
60
src/Model/Table/CommunityProfilesTable.php
Normal file
60
src/Model/Table/CommunityProfilesTable.php
Normal file
@ -0,0 +1,60 @@
|
||||
<?php
|
||||
namespace App\Model\Table;
|
||||
|
||||
use Cake\ORM\Query;
|
||||
use Cake\ORM\RulesChecker;
|
||||
use Cake\ORM\Table;
|
||||
use Cake\Validation\Validator;
|
||||
|
||||
/**
|
||||
* CommunityProfiles Model
|
||||
*
|
||||
* @method \App\Model\Entity\CommunityProfile get($primaryKey, $options = [])
|
||||
* @method \App\Model\Entity\CommunityProfile newEntity($data = null, array $options = [])
|
||||
* @method \App\Model\Entity\CommunityProfile[] newEntities(array $data, array $options = [])
|
||||
* @method \App\Model\Entity\CommunityProfile|false save(\Cake\Datasource\EntityInterface $entity, $options = [])
|
||||
* @method \App\Model\Entity\CommunityProfile saveOrFail(\Cake\Datasource\EntityInterface $entity, $options = [])
|
||||
* @method \App\Model\Entity\CommunityProfile patchEntity(\Cake\Datasource\EntityInterface $entity, array $data, array $options = [])
|
||||
* @method \App\Model\Entity\CommunityProfile[] patchEntities($entities, array $data, array $options = [])
|
||||
* @method \App\Model\Entity\CommunityProfile findOrCreate($search, callable $callback = null, $options = [])
|
||||
*/
|
||||
class CommunityProfilesTable extends Table
|
||||
{
|
||||
/**
|
||||
* Initialize method
|
||||
*
|
||||
* @param array $config The configuration for the Table.
|
||||
* @return void
|
||||
*/
|
||||
public function initialize(array $config)
|
||||
{
|
||||
parent::initialize($config);
|
||||
|
||||
$this->setTable('community_profiles');
|
||||
$this->setDisplayField('id');
|
||||
$this->setPrimaryKey('id');
|
||||
}
|
||||
|
||||
/**
|
||||
* Default validation rules.
|
||||
*
|
||||
* @param \Cake\Validation\Validator $validator Validator instance.
|
||||
* @return \Cake\Validation\Validator
|
||||
*/
|
||||
public function validationDefault(Validator $validator)
|
||||
{
|
||||
$validator
|
||||
->integer('id')
|
||||
->allowEmptyString('id', null, 'create');
|
||||
|
||||
$validator
|
||||
->allowEmptyFile('profile_img');
|
||||
|
||||
$validator
|
||||
->scalar('profile_desc')
|
||||
->maxLength('profile_desc', 2000)
|
||||
->allowEmptyFile('profile_desc');
|
||||
|
||||
return $validator;
|
||||
}
|
||||
}
|
||||
23
src/Template/CommunityProfiles/add.ctp
Normal file
23
src/Template/CommunityProfiles/add.ctp
Normal file
@ -0,0 +1,23 @@
|
||||
<?php
|
||||
/**
|
||||
* @var \App\View\AppView $this
|
||||
* @var \App\Model\Entity\CommunityProfile $communityProfile
|
||||
*/
|
||||
?>
|
||||
<nav class="large-3 medium-4 columns" id="actions-sidebar">
|
||||
<ul class="side-nav">
|
||||
<li class="heading"><?= __('Actions') ?></li>
|
||||
<li><?= $this->Html->link(__('List Community Profiles'), ['action' => 'index']) ?></li>
|
||||
</ul>
|
||||
</nav>
|
||||
<div class="communityProfiles form large-9 medium-8 columns content">
|
||||
<?= $this->Form->create($communityProfile) ?>
|
||||
<fieldset>
|
||||
<legend><?= __('Add Community Profile') ?></legend>
|
||||
<?php
|
||||
echo $this->Form->control('profile_desc');
|
||||
?>
|
||||
</fieldset>
|
||||
<?= $this->Form->button(__('Submit')) ?>
|
||||
<?= $this->Form->end() ?>
|
||||
</div>
|
||||
29
src/Template/CommunityProfiles/edit.ctp
Normal file
29
src/Template/CommunityProfiles/edit.ctp
Normal file
@ -0,0 +1,29 @@
|
||||
<?php
|
||||
/**
|
||||
* @var \App\View\AppView $this
|
||||
* @var \App\Model\Entity\CommunityProfile $communityProfile
|
||||
*/
|
||||
?>
|
||||
<nav class="large-3 medium-4 columns" id="actions-sidebar">
|
||||
<ul class="side-nav">
|
||||
<li class="heading"><?= __('Actions') ?></li>
|
||||
<li><?= $this->Form->postLink(
|
||||
__('Delete'),
|
||||
['action' => 'delete', $communityProfile->id],
|
||||
['confirm' => __('Are you sure you want to delete # {0}?', $communityProfile->id)]
|
||||
)
|
||||
?></li>
|
||||
<li><?= $this->Html->link(__('List Community Profiles'), ['action' => 'index']) ?></li>
|
||||
</ul>
|
||||
</nav>
|
||||
<div class="communityProfiles form large-9 medium-8 columns content">
|
||||
<?= $this->Form->create($communityProfile) ?>
|
||||
<fieldset>
|
||||
<legend><?= __('Edit Community Profile') ?></legend>
|
||||
<?php
|
||||
echo $this->Form->control('profile_desc');
|
||||
?>
|
||||
</fieldset>
|
||||
<?= $this->Form->button(__('Submit')) ?>
|
||||
<?= $this->Form->end() ?>
|
||||
</div>
|
||||
47
src/Template/CommunityProfiles/index.ctp
Normal file
47
src/Template/CommunityProfiles/index.ctp
Normal file
@ -0,0 +1,47 @@
|
||||
<?php
|
||||
/**
|
||||
* @var \App\View\AppView $this
|
||||
* @var \App\Model\Entity\CommunityProfile[]|\Cake\Collection\CollectionInterface $communityProfiles
|
||||
*/
|
||||
?>
|
||||
<nav class="large-3 medium-4 columns" id="actions-sidebar">
|
||||
<ul class="side-nav">
|
||||
<li class="heading"><?= __('Actions') ?></li>
|
||||
<li><?= $this->Html->link(__('New Community Profile'), ['action' => 'add']) ?></li>
|
||||
</ul>
|
||||
</nav>
|
||||
<div class="communityProfiles index large-9 medium-8 columns content">
|
||||
<h3><?= __('Community Profiles') ?></h3>
|
||||
<table cellpadding="0" cellspacing="0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col"><?= $this->Paginator->sort('id') ?></th>
|
||||
<th scope="col"><?= $this->Paginator->sort('profile_desc') ?></th>
|
||||
<th scope="col" class="actions"><?= __('Actions') ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach ($communityProfiles as $communityProfile): ?>
|
||||
<tr>
|
||||
<td><?= $this->Number->format($communityProfile->id) ?></td>
|
||||
<td><?= h($communityProfile->profile_desc) ?></td>
|
||||
<td class="actions">
|
||||
<?= $this->Html->link(__('View'), ['action' => 'view', $communityProfile->id]) ?>
|
||||
<?= $this->Html->link(__('Edit'), ['action' => 'edit', $communityProfile->id]) ?>
|
||||
<?= $this->Form->postLink(__('Delete'), ['action' => 'delete', $communityProfile->id], ['confirm' => __('Are you sure you want to delete # {0}?', $communityProfile->id)]) ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="paginator">
|
||||
<ul class="pagination">
|
||||
<?= $this->Paginator->first('<< ' . __('first')) ?>
|
||||
<?= $this->Paginator->prev('< ' . __('previous')) ?>
|
||||
<?= $this->Paginator->numbers() ?>
|
||||
<?= $this->Paginator->next(__('next') . ' >') ?>
|
||||
<?= $this->Paginator->last(__('last') . ' >>') ?>
|
||||
</ul>
|
||||
<p><?= $this->Paginator->counter(['format' => __('Page {{page}} of {{pages}}, showing {{current}} record(s) out of {{count}} total')]) ?></p>
|
||||
</div>
|
||||
</div>
|
||||
28
src/Template/CommunityProfiles/view.ctp
Normal file
28
src/Template/CommunityProfiles/view.ctp
Normal file
@ -0,0 +1,28 @@
|
||||
<?php
|
||||
/**
|
||||
* @var \App\View\AppView $this
|
||||
* @var \App\Model\Entity\CommunityProfile $communityProfile
|
||||
*/
|
||||
?>
|
||||
<nav class="large-3 medium-4 columns" id="actions-sidebar">
|
||||
<ul class="side-nav">
|
||||
<li class="heading"><?= __('Actions') ?></li>
|
||||
<li><?= $this->Html->link(__('Edit Community Profile'), ['action' => 'edit', $communityProfile->id]) ?> </li>
|
||||
<li><?= $this->Form->postLink(__('Delete Community Profile'), ['action' => 'delete', $communityProfile->id], ['confirm' => __('Are you sure you want to delete # {0}?', $communityProfile->id)]) ?> </li>
|
||||
<li><?= $this->Html->link(__('List Community Profiles'), ['action' => 'index']) ?> </li>
|
||||
<li><?= $this->Html->link(__('New Community Profile'), ['action' => 'add']) ?> </li>
|
||||
</ul>
|
||||
</nav>
|
||||
<div class="communityProfiles view large-9 medium-8 columns content">
|
||||
<h3><?= h($communityProfile->id) ?></h3>
|
||||
<table class="vertical-table">
|
||||
<tr>
|
||||
<th scope="row"><?= __('Profile Desc') ?></th>
|
||||
<td><?= h($communityProfile->profile_desc) ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><?= __('Id') ?></th>
|
||||
<td><?= $this->Number->format($communityProfile->id) ?></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
46
tests/Fixture/CommunityProfilesFixture.php
Normal file
46
tests/Fixture/CommunityProfilesFixture.php
Normal file
@ -0,0 +1,46 @@
|
||||
<?php
|
||||
namespace App\Test\Fixture;
|
||||
|
||||
use Cake\TestSuite\Fixture\TestFixture;
|
||||
|
||||
/**
|
||||
* CommunityProfilesFixture
|
||||
*/
|
||||
class CommunityProfilesFixture extends TestFixture
|
||||
{
|
||||
/**
|
||||
* Fields
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
// @codingStandardsIgnoreStart
|
||||
public $fields = [
|
||||
'id' => ['type' => 'integer', 'length' => 11, 'unsigned' => false, 'null' => false, 'default' => null, 'comment' => '', 'autoIncrement' => true, 'precision' => null],
|
||||
'profile_img' => ['type' => 'binary', 'length' => 4294967295, 'null' => true, 'default' => null, 'comment' => '', 'precision' => null],
|
||||
'profile_desc' => ['type' => 'string', 'length' => 2000, 'null' => true, 'default' => null, 'collate' => 'utf8mb4_general_ci', 'comment' => '', 'precision' => null, 'fixed' => null],
|
||||
'_constraints' => [
|
||||
'primary' => ['type' => 'primary', 'columns' => ['id'], 'length' => []],
|
||||
],
|
||||
'_options' => [
|
||||
'engine' => 'InnoDB',
|
||||
'collation' => 'utf8mb4_general_ci'
|
||||
],
|
||||
];
|
||||
// @codingStandardsIgnoreEnd
|
||||
/**
|
||||
* Init method
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function init()
|
||||
{
|
||||
$this->records = [
|
||||
[
|
||||
'id' => 1,
|
||||
'profile_img' => 'Lorem ipsum dolor sit amet',
|
||||
'profile_desc' => 'Lorem ipsum dolor sit amet',
|
||||
],
|
||||
];
|
||||
parent::init();
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,75 @@
|
||||
<?php
|
||||
namespace App\Test\TestCase\Controller;
|
||||
|
||||
use App\Controller\CommunityProfilesController;
|
||||
use Cake\TestSuite\IntegrationTestTrait;
|
||||
use Cake\TestSuite\TestCase;
|
||||
|
||||
/**
|
||||
* App\Controller\CommunityProfilesController Test Case
|
||||
*
|
||||
* @uses \App\Controller\CommunityProfilesController
|
||||
*/
|
||||
class CommunityProfilesControllerTest extends TestCase
|
||||
{
|
||||
use IntegrationTestTrait;
|
||||
|
||||
/**
|
||||
* Fixtures
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
public $fixtures = [
|
||||
'app.CommunityProfiles',
|
||||
];
|
||||
|
||||
/**
|
||||
* Test index method
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function testIndex()
|
||||
{
|
||||
$this->markTestIncomplete('Not implemented yet.');
|
||||
}
|
||||
|
||||
/**
|
||||
* Test view method
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function testView()
|
||||
{
|
||||
$this->markTestIncomplete('Not implemented yet.');
|
||||
}
|
||||
|
||||
/**
|
||||
* Test add method
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function testAdd()
|
||||
{
|
||||
$this->markTestIncomplete('Not implemented yet.');
|
||||
}
|
||||
|
||||
/**
|
||||
* Test edit method
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function testEdit()
|
||||
{
|
||||
$this->markTestIncomplete('Not implemented yet.');
|
||||
}
|
||||
|
||||
/**
|
||||
* Test delete method
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function testDelete()
|
||||
{
|
||||
$this->markTestIncomplete('Not implemented yet.');
|
||||
}
|
||||
}
|
||||
72
tests/TestCase/Model/Table/CommunityProfilesTableTest.php
Normal file
72
tests/TestCase/Model/Table/CommunityProfilesTableTest.php
Normal file
@ -0,0 +1,72 @@
|
||||
<?php
|
||||
namespace App\Test\TestCase\Model\Table;
|
||||
|
||||
use App\Model\Table\CommunityProfilesTable;
|
||||
use Cake\ORM\TableRegistry;
|
||||
use Cake\TestSuite\TestCase;
|
||||
|
||||
/**
|
||||
* App\Model\Table\CommunityProfilesTable Test Case
|
||||
*/
|
||||
class CommunityProfilesTableTest extends TestCase
|
||||
{
|
||||
/**
|
||||
* Test subject
|
||||
*
|
||||
* @var \App\Model\Table\CommunityProfilesTable
|
||||
*/
|
||||
public $CommunityProfiles;
|
||||
|
||||
/**
|
||||
* Fixtures
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
public $fixtures = [
|
||||
'app.CommunityProfiles',
|
||||
];
|
||||
|
||||
/**
|
||||
* setUp method
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setUp()
|
||||
{
|
||||
parent::setUp();
|
||||
$config = TableRegistry::getTableLocator()->exists('CommunityProfiles') ? [] : ['className' => CommunityProfilesTable::class];
|
||||
$this->CommunityProfiles = TableRegistry::getTableLocator()->get('CommunityProfiles', $config);
|
||||
}
|
||||
|
||||
/**
|
||||
* tearDown method
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function tearDown()
|
||||
{
|
||||
unset($this->CommunityProfiles);
|
||||
|
||||
parent::tearDown();
|
||||
}
|
||||
|
||||
/**
|
||||
* Test initialize method
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function testInitialize()
|
||||
{
|
||||
$this->markTestIncomplete('Not implemented yet.');
|
||||
}
|
||||
|
||||
/**
|
||||
* Test validationDefault method
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function testValidationDefault()
|
||||
{
|
||||
$this->markTestIncomplete('Not implemented yet.');
|
||||
}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user