Browse Source

added note stuff

Josh Kamau 5 years ago
parent
commit
4685d2572f

+ 101 - 0
app/Http/Controllers/NoteController.php

@@ -0,0 +1,101 @@
+<?php
+
+namespace App\Http\Controllers;
+
+use Illuminate\Http\Request;
+use Illuminate\Support\Facades\Http;
+use App\HttpModels\ClientLobbyModel;
+use App\HttpModels\MeetingModel;
+use App\Models\AppSession;
+use Cookie;
+
+use App\Models\Note;
+use App\Models\Client;
+use App\Models\SectionTemplate;
+
+class NoteController extends Controller
+{
+
+    public function renderNote($noteUid, Request $request)
+    {
+
+        $note = Note::where('uid', $noteUid)->first();
+        $client = Client::where('id', $note->client_id)->first();
+
+        return view('client/note', compact('note', 'client'));
+    }
+
+    public function selectSectionTemplateForm($note_uid, Request $request)
+    {
+        $sectionTemplates = SectionTemplate::all();
+        $note = Note::where('uid', $note_uid)->first();
+        return view('client/select_section_template_form', compact('note', 'sectionTemplates'));
+    }
+
+    public function sectionCreateForm($note_uid, $section_template_uid, Request $request)
+    {
+
+        $note = Note::where('uid', $note_uid)->first();
+
+        $sectionTemplate = SectionTemplate::where('uid', $section_template_uid)->first();
+
+        $section = null; // convenience
+
+        include(storage_path('sections/' . $sectionTemplate->internal_name . '/form.blade.php'));
+    }
+
+    public function processFormSubmit(Request $request)
+    {
+        // for CREATE
+        $note_uid =  $request->note_uid;
+        $section_template_uid =  $request->section_template_uid;
+        
+        // for UPDATE
+        $section_uid =  $request->section_uid;
+
+        $section = $section_uid ? Section::where('uid', $section_uid)->first() : null;
+        $note = null;
+        $sectionTemplate = null;
+        
+        if($section == null){
+            $note = Note::where('uid', $note_uid)->first();
+            $sectionTemplate = SectionTemplate::where('uid', $section_template_uid)->first();
+        } else {
+            $note = $section->note();
+            $sectionTemplate = $section->sectionTemplate();
+        }
+
+        $newContentData = [];
+        
+        // we wish to pass THESE arguments into this include: 
+        // if CREATE, $note and $sectionTemplate, and $request
+        // if UPDATE, $section, and $request
+        include(storage_path('sections/' . $sectionTemplate->internal_name . '/processor.php'));
+
+        $newContentData = ['dog' => 'bark', 'cat' => 'meow'];
+        // now, create summaryHtml appropriate
+        ob_start();
+        echo 'this is not going to scream anywhere.';
+        include(storage_path('sections/' . $sectionTemplate->internal_name . '/summary.php'));
+        $newSummaryHtml = ob_get_contents();
+        ob_end_clean();
+
+        if($section){
+            // call Java to update section
+        }else{
+            // call Java to create section
+            $data = [
+                'noteUid' => $note->uid,
+                'sectionTemplateUid' => $sectionTemplate->uid,
+                'contentData' => json_encode($newContentData),
+                'summaryHtml' => $newSummaryHtml
+            ];
+            $url = env('BACKEND_URL', 'http://localhost:8080') . '/api/section/create';
+            $response = Http::asForm()
+            ->withHeaders(['sessionKey'=>$request->cookie('sessionKey')])
+            ->post($url, $data)
+            ->json();
+            dd($response);
+        }
+    }
+}

+ 7 - 0
app/Http/Controllers/notes_SINGLE_Controller.php

@@ -29,6 +29,13 @@ class notes_SINGLE_Controller extends Controller
 		return response()->view('pro/notes_SINGLE/SUB_bills', compact('record', 'subRecords'), session('message') ? 500 : 200)->header('Content-Type', 'text/html');
 	}
 
+	// GET /notes/view/{uid}/SUB_sections
+	public function SUB_sections(Request $request, $uid) {
+		$record = DB::table('note')->where('uid', $uid)->first();
+		$subRecords = DB::table('section')->where('note_id', $record->id)->get();
+		return response()->view('pro/notes_SINGLE/SUB_sections', compact('record', 'subRecords'), session('message') ? 500 : 200)->header('Content-Type', 'text/html');
+	}
+
 	// GET /notes/view/{uid}/SUB_audit_log
 	public function SUB_audit_log(Request $request, $uid) {
 		$record = DB::table('note')->where('uid', $uid)->first();

+ 24 - 0
app/Http/Controllers/section_templates_Controller.php

@@ -0,0 +1,24 @@
+<?php
+
+namespace App\Http\Controllers;
+
+use Illuminate\Http\Request;
+use Illuminate\Support\Facades\DB;
+use Illuminate\Support\Facades\Auth;
+
+class section_templates_Controller extends Controller
+{
+    public $selfName = 'section_templates_Controller';
+
+	// GET /section_templates
+	public function index(Request $request) {
+		$records = DB::table('section_template')->get();
+		return response()->view('admin/section_templates/index', compact('records'), session('message') ? 500 : 200)->header('Content-Type', 'text/html');
+	}
+
+	// GET /section_templates/add_new
+	public function add_new(Request $request) {
+		$records = DB::table('section_template')->get();
+		return response()->view('admin/section_templates/add_new', compact('records'), session('message') ? 500 : 200)->header('Content-Type', 'text/html');
+	}
+}

+ 1 - 1
app/Http/Middleware/VerifyCsrfToken.php

@@ -12,6 +12,6 @@ class VerifyCsrfToken extends Middleware
      * @var array
      */
     protected $except = [
-        //
+        "/process_form_submit"
     ];
 }

+ 4 - 1
app/Models/Client.php

@@ -9,5 +9,8 @@ class Client extends Model
 
     protected $table = "client";
 
-    //
+    public function notes()
+    {
+        return $this->hasMany(Note::class, 'client_id', 'id');
+    }
 }

+ 4 - 1
app/Models/Note.php

@@ -9,5 +9,8 @@ class Note extends Model
 
     protected $table = "note";
 
-    //
+    public function sections()
+    {
+        return $this->hasMany(Section::class, 'note_id', 'id');
+    }
 }

+ 12 - 0
app/Models/Section.php

@@ -0,0 +1,12 @@
+<?php
+
+namespace App\Models;
+
+use Illuminate\Database\Eloquent\Model;
+
+class Section extends Model
+{
+
+    protected $table = "section";
+
+}

+ 12 - 0
app/Models/SectionTemplate.php

@@ -0,0 +1,12 @@
+<?php
+
+namespace App\Models;
+
+use Illuminate\Database\Eloquent\Model;
+
+class SectionTemplate extends Model
+{
+
+    protected $table = "section_template";
+
+}

+ 10 - 0
generatecv/tree.txt

@@ -174,10 +174,12 @@ PRO
                     reasonDetail
             notes
                 id=note.client_id=>/notes/view/UID
+                !inc:category,content_text,content_detail
                 add_new:note=>/notes/view/UID
                     clientUid:hidden=uid
                     hcpProUid:record:pro:uid,name_display
                     allyProUid:record:pro:uid,name_display
+                    title
                     effectiveDateEST:date
                     effectiveTime:time
                     reason1
@@ -253,6 +255,9 @@ PRO
                     serviceLocation
                     modifier
                     numberOfUnits:number
+            sections
+                id=section.note_id
+                !inc:content_data,summary_html
             audit_log
     erx|action_item:action_item_category='RX'|view|icon:file-signature
     erx/view/{uid}
@@ -709,3 +714,8 @@ ADMIN
     meeting_message/view/{uid}
         SUB
             dashboard
+    section_templates|section_template|add|icon:user-md
+        !inc:@title,internal_name
+    section_templates/add_new:create
+        title
+        internalName

+ 44 - 0
resources/views/admin/section_templates/add_new.blade.php

@@ -0,0 +1,44 @@
+@extends('layouts.pro-logged-in')
+@section('content')
+
+    <div class="form-contents"><div class="failed-form-contents">
+
+    <h4 class="d-flex m-0 p-3 stag-heading stag-heading-modal">
+        <div>Section Templates: Add New</div>
+        <div class="ml-auto">
+            <a class="text-secondary" href="{{route('section_templates-index')}}" up-close>
+                <i class="fa fa-times"></i>
+            </a>
+        </div>
+    </h4>
+
+    <form action="/post-to-api"
+          up-target="#main-content" up-history="false" up-fail-target=".failed-form-contents" up-reveal="true"
+          method="post" enctype="multipart/form-data"
+          class="border-top px-3 pt-3 pb-1 custom-submit">
+        @csrf
+
+        @if (session('message'))
+            <div class="alert alert-danger">{{ session('message') }}</div>
+        @endif
+
+        <input type="hidden" name="_api" value="/api/sectionTemplate/create">
+        <input type="hidden" name="_success" value="{{route('section_templates-index')}}">
+        <input type="hidden" name="_return" value="{{route('section_templates-add_new')}}">
+        <div class='form-group mb-3'>
+<label class='control-label'>Title </label>
+<input class='form-control' type='text' name='title' value='{{ old('title') ? old('title') : '' }}' >
+</div>
+<div class='form-group mb-3'>
+<label class='control-label'>Internal Name </label>
+<input class='form-control' type='text' name='internalName' value='{{ old('internalName') ? old('internalName') : '' }}' >
+</div>
+        <div class="form-group mb-3 d-flex justify-content-center">
+            <button class="btn btn-sm btn-primary mr-3 px-5">Submit</button>
+            <a href="{{route('section_templates-index')}}" class="btn btn-sm btn-default px-5" up-close>Cancel</a>
+        </div>
+    </form>
+
+    </div></div>
+
+@endsection

+ 32 - 0
resources/views/admin/section_templates/index.blade.php

@@ -0,0 +1,32 @@
+@extends('layouts.pro-logged-in')
+@section('content')
+
+    <h3 class="d-flex my-3 px-3 stag-heading stag-heading-index">
+        <div>Section Templates: List</div>
+        <div class="ml-auto">
+            <a class='btn btn-primary btn-sm ml-2' up-modal=".form-contents" up-width="800" up-history="false" href='/section_templates/add_new'><i class='fa fa-plus-circle' aria-hidden='true'></i> Add New</a>
+        </div>
+    </h3>
+
+    <div class="table-responsive p-0 bg-white border stag-table stag-table-index">
+        <table class="table table-hover text-nowrap table-striped">
+            <thead>
+            <tr>
+<th>&nbsp;</th>
+<th>Title</th>
+<th>Internal Name</th>
+            </tr>
+            </thead>
+            <tbody>
+            @foreach($records as $record)
+                <tr>
+<td><a href="/section_templates/view/<?= $record->uid ?>"><i class="fas fa-share-square"></i></a></td>
+<td><?= $record->title ?></td>
+<td><?= $record->internal_name ?></td>
+                </tr>
+            @endforeach
+            </tbody>
+        </table>
+    </div>
+
+@endsection

+ 33 - 0
resources/views/client/note.blade.php

@@ -0,0 +1,33 @@
+@extends('layouts.pro-logged-in')
+@section('content')
+<div class="container" id="note-container">
+    <div class="row">
+        <div class="col-md-12 mt-2">
+            <div class="card">
+                <div class="card-header">
+                    Note details:
+                </div>
+                <div class="card-body">
+                    <div class="mb-2">
+                        <a href="{{route('select_section_template_form', $note->uid)}}" 
+                            up-modal="#select_section_template_form" 
+                            up-history="false"
+                            class="btn btn-primary">Add section</a>
+                    </div>
+                    @if(!$note->sections->count())
+                    <div class="alert alert-info">No sections on this note.</div>
+                    @else 
+                    
+                    <div class="card">
+                        <div class="card-body">
+
+                        </div>
+                    </div>
+                    
+                    @endif
+                </div>
+            </div>
+        </div>
+    </div>
+</div>
+@endsection

+ 11 - 0
resources/views/client/section_create_form.blade.php

@@ -0,0 +1,11 @@
+<div id="section_create_form">
+    <div class="card">
+        <div class="card-header">
+            Create section
+        </div>
+        <div class="card-body">
+            Note UID: {{$note->uid}}
+            Section template UID: {{$sectionTemplate->uid}}
+        </div>
+    </div>
+</div>

+ 18 - 0
resources/views/client/select_section_template_form.blade.php

@@ -0,0 +1,18 @@
+<div id="select_section_template_form">
+    <div class="card">
+        <div class="card-header">Select section template</div>
+        <div class="card-body">
+            <h3>Select a template</h3>
+            <ul>
+                @foreach ($sectionTemplates as $sectionTemplate)
+                <li>
+                    <a href="{{route('section_create_form', [$note->uid, $sectionTemplate->uid])}}" 
+                        up-modal="#section_create_form" up-history="false">
+                        {{$sectionTemplate->title}}
+                    </a>
+                </li>
+                @endforeach
+            </ul>
+        </div>
+    </div>
+</div>

+ 2 - 1
resources/views/layouts/generated-links.blade.php

@@ -21,4 +21,5 @@
 <li class='nav-item'><a href='/meeting_invitations' class='nav-link {{ (isset(request()->route()->getController()->selfName) && strpos(request()->route()->getController()->selfName, 'meeting_invitations') === 0 ? 'active' : '') }} '><i class='nav-icon fa fa-envelope'></i><p>Meeting Invitations</p></a></li>
 <li class='nav-item'><a href='/meeting_rings' class='nav-link {{ (isset(request()->route()->getController()->selfName) && strpos(request()->route()->getController()->selfName, 'meeting_rings') === 0 ? 'active' : '') }} '><i class='nav-icon fa fa-phone'></i><p>Meeting Rings</p></a></li>
 <li class='nav-item'><a href='/meeting_knocks' class='nav-link {{ (isset(request()->route()->getController()->selfName) && strpos(request()->route()->getController()->selfName, 'meeting_knocks') === 0 ? 'active' : '') }} '><i class='nav-icon fa fa-door-closed'></i><p>Meeting Knocks</p></a></li>
-<li class='nav-item'><a href='/meeting_messages' class='nav-link {{ (isset(request()->route()->getController()->selfName) && strpos(request()->route()->getController()->selfName, 'meeting_messages') === 0 ? 'active' : '') }} '><i class='nav-icon fa fa-comments'></i><p>Meeting Messages</p></a></li>
+<li class='nav-item'><a href='/meeting_messages' class='nav-link {{ (isset(request()->route()->getController()->selfName) && strpos(request()->route()->getController()->selfName, 'meeting_messages') === 0 ? 'active' : '') }} '><i class='nav-icon fa fa-comments'></i><p>Meeting Messages</p></a></li>
+<li class='nav-item'><a href='/section_templates' class='nav-link {{ (isset(request()->route()->getController()->selfName) && strpos(request()->route()->getController()->selfName, 'section_templates') === 0 ? 'active' : '') }} '><i class='nav-icon fa fa-user-md'></i><p>Section Templates</p></a></li>

+ 4 - 0
resources/views/pro/my_clients_SINGLE/ACTION_notesAddNew.blade.php

@@ -48,6 +48,10 @@
 </select>
 </div>
 <div class='form-group mb-3'>
+<label class='control-label'>Title </label>
+<input class='form-control' type='text' name='title' value='{{ old('title') ? old('title') : '' }}' >
+</div>
+<div class='form-group mb-3'>
 <label class='control-label'>Effective Date EST </label>
 <input class='form-control' type='date' name='effectiveDateEST' value='{{ old('effectiveDateEST') ? old('effectiveDateEST') : '' }}' >
 </div>

+ 2 - 56
resources/views/pro/my_clients_SINGLE/SUB_notes.blade.php

@@ -15,72 +15,18 @@
                 <thead>
                 <tr>
                     <th>&nbsp;</th>
-<th>Created At</th>
-<th>Type</th>
-<th>Cancellation Memo</th>
-<th>Cancelled At</th>
-<th>Is Cancelled</th>
 <th>Category</th>
-<th>Content Detail</th>
 <th>Content Text</th>
-<th>Effective Dateest</th>
-<th>Effective Time</th>
-<th>Is Signed By Ally</th>
-<th>Is Signed By Hcp</th>
-<th>Reason1</th>
-<th>Reason2</th>
-<th>Reason3</th>
-<th>Reason3plus</th>
-<th>Service Location</th>
-<th>Signed By Ally At</th>
-<th>Signed By Hcp At</th>
-<th>Created By Session Id</th>
-<th>Cancelled By Session Id</th>
-<th>Ally Pro Id</th>
-<th>Client Id</th>
-<th>Hcp Pro Id</th>
-<th>Signed By Ally Session Id</th>
-<th>Signed By Hcp Session Id</th>
-<th>Content Html</th>
-<th>Free Text Html</th>
-<th>Title</th>
-<th>Note Template Id</th>
+<th>Content Detail</th>
                 </tr>
                 </thead>
                 <tbody>
                 @foreach($subRecords as $subRecord)
                     <tr>
                         <td><a href="/notes/view/{{ $subRecord->uid }}"><i class="fas fa-share-square"></i></a></td>
-<td><?= friendly_date_time($record->created_at) ?></td>
-<td><?= $subRecord->type ?></td>
-<td><?= $subRecord->cancellation_memo ?></td>
-<td><?= friendly_date_time($record->cancelled_at) ?></td>
-<td><?= $subRecord->is_cancelled ?></td>
 <td><?= $subRecord->category ?></td>
-<td><?= $subRecord->content_detail ?></td>
 <td><?= $subRecord->content_text ?></td>
-<td><?= $subRecord->effective_dateest ?></td>
-<td><?= $subRecord->effective_time ?></td>
-<td><?= $subRecord->is_signed_by_ally ?></td>
-<td><?= $subRecord->is_signed_by_hcp ?></td>
-<td><?= $subRecord->reason1 ?></td>
-<td><?= $subRecord->reason2 ?></td>
-<td><?= $subRecord->reason3 ?></td>
-<td><?= $subRecord->reason3plus ?></td>
-<td><?= $subRecord->service_location ?></td>
-<td><?= friendly_date_time($record->signed_by_ally_at) ?></td>
-<td><?= friendly_date_time($record->signed_by_hcp_at) ?></td>
-<td><?= $subRecord->created_by_session_id ?></td>
-<td><?= $subRecord->cancelled_by_session_id ?></td>
-<td><?= $subRecord->ally_pro_id ?></td>
-<td><?= $subRecord->client_id ?></td>
-<td><?= $subRecord->hcp_pro_id ?></td>
-<td><?= $subRecord->signed_by_ally_session_id ?></td>
-<td><?= $subRecord->signed_by_hcp_session_id ?></td>
-<td><?= $subRecord->content_html ?></td>
-<td><?= $subRecord->free_text_html ?></td>
-<td><?= $subRecord->title ?></td>
-<td><?= $subRecord->note_template_id ?></td>
+<td><?= $subRecord->content_detail ?></td>
                     </tr>
                 @endforeach
                 </tbody>

+ 1 - 0
resources/views/pro/notes/subs.blade.php

@@ -1,3 +1,4 @@
 <a href='/notes/view/<?= $record->uid ?>/SUB_dashboard' class='d-block px-3 py-2 border-bottom stag-sublink {{ request()->route()->getActionMethod() === 'SUB_dashboard' ? 'bg-secondary text-white font-weight-bold' : '' }}{{ strpos(request()->route()->getActionMethod(), 'ACTION_') === 0 ? 'bg-secondary text-white font-weight-bold' : '' }}'>Dashboard</a>
 <a href='/notes/view/<?= $record->uid ?>/SUB_bills' class='d-block px-3 py-2 border-bottom stag-sublink {{ request()->route()->getActionMethod() === 'SUB_bills' ? 'bg-secondary text-white font-weight-bold' : '' }}'>Bills</a>
+<a href='/notes/view/<?= $record->uid ?>/SUB_sections' class='d-block px-3 py-2 border-bottom stag-sublink {{ request()->route()->getActionMethod() === 'SUB_sections' ? 'bg-secondary text-white font-weight-bold' : '' }}'>Sections</a>
 <a href='/notes/view/<?= $record->uid ?>/SUB_audit_log' class='d-block px-3 py-2 border-bottom stag-sublink {{ request()->route()->getActionMethod() === 'SUB_audit_log' ? 'bg-secondary text-white font-weight-bold' : '' }}'>Audit Log</a>

+ 36 - 0
resources/views/pro/notes_SINGLE/SUB_sections.blade.php

@@ -0,0 +1,36 @@
+@extends('pro.notes.view')
+@section('content-inner')
+
+    <div class="pb-3">
+
+        <h5 class='my-3 d-flex stag-heading stag-heading-sub'>
+            <div>Sections</div>
+            <div class="ml-auto">
+                <!-- _ADD_NEW_LINK_ -->
+            </div>
+        </h5>
+
+        <div class="table-responsive p-0 bg-white border stag-table stag-table-sub">
+            <table class="table table-hover text-nowrap">
+                <thead>
+                <tr>
+                    <th>&nbsp;</th>
+<th>Content Data</th>
+<th>Summary Html</th>
+                </tr>
+                </thead>
+                <tbody>
+                @foreach($subRecords as $subRecord)
+                    <tr>
+                        <td><a href=""><i class="fas fa-share-square"></i></a></td>
+<td><?= $subRecord->content_data ?></td>
+<td><?= $subRecord->summary_html ?></td>
+                    </tr>
+                @endforeach
+                </tbody>
+            </table>
+        </div>
+
+    </div>
+
+@endsection

+ 8 - 3
routes/generated.php

@@ -81,6 +81,7 @@ Route::get('/notes/view/{uid}', 'notes_Controller@view')->name('notes-view');
 Route::get('/notes/view/{uid}/ACTION_signAsHcp', 'notes_SINGLE_Controller@ACTION_signAsHcp')->name('notes_SINGLE-ACTION_signAsHcp');
 Route::get('/notes/view/{uid}/SUB_dashboard', 'notes_SINGLE_Controller@SUB_dashboard')->name('notes_SINGLE-SUB_dashboard');
 Route::get('/notes/view/{uid}/SUB_bills', 'notes_SINGLE_Controller@SUB_bills')->name('notes_SINGLE-SUB_bills');
+Route::get('/notes/view/{uid}/SUB_sections', 'notes_SINGLE_Controller@SUB_sections')->name('notes_SINGLE-SUB_sections');
 Route::get('/notes/view/{uid}/SUB_audit_log', 'notes_SINGLE_Controller@SUB_audit_log')->name('notes_SINGLE-SUB_audit_log');
 Route::get('/notes/view/{uid}/ACTION_billsAddNew', 'notes_SINGLE_Controller@ACTION_billsAddNew')->name('notes_SINGLE-ACTION_billsAddNew');
 
@@ -357,10 +358,14 @@ Route::get('/meeting_knocks/view/{uid}', 'meeting_knocks_Controller@view')->name
 // --- admin: meeting_knocks_SINGLE --- //
 Route::get('/meeting_knocks/view/{uid}/SUB_dashboard', 'meeting_knocks_SINGLE_Controller@SUB_dashboard')->name('meeting_knocks_SINGLE-SUB_dashboard');
 
-// --- admin: meeting_messages_SINGLE --- //
-Route::get('/meeting_message/view/{uid}/SUB_dashboard', 'meeting_messages_SINGLE_Controller@SUB_dashboard')->name('meeting_messages_SINGLE-SUB_dashboard');
-
 // --- admin: meeting_messages --- //
 Route::get('/meeting_messages', 'meeting_messages_Controller@index')->name('meeting_messages-index');
 Route::get('/meeting_message/view/{uid}', 'meeting_messages_Controller@view')->name('meeting_messages-view');
 
+// --- admin: meeting_messages_SINGLE --- //
+Route::get('/meeting_message/view/{uid}/SUB_dashboard', 'meeting_messages_SINGLE_Controller@SUB_dashboard')->name('meeting_messages_SINGLE-SUB_dashboard');
+
+// --- admin: section_templates --- //
+Route::get('/section_templates', 'section_templates_Controller@index')->name('section_templates-index');
+Route::get('/section_templates/add_new', 'section_templates_Controller@add_new')->name('section_templates-add_new');
+

+ 6 - 1
routes/web.php

@@ -69,4 +69,9 @@ Route::get('/client/meeting/{meeting_uid}', 'ClientController@entranceLobby')->n
 Route::bind('url_slug', function($value, $route)
 {
     return Lobby::where('url_slug', $value)->first();
-});
+});
+
+Route::get('/note/{note_uid}', 'NoteController@renderNote')->name('render-note');
+Route::get('/select_section_template_form/{note_uid}', 'NoteController@selectSectionTemplateForm')->name('select_section_template_form');
+Route::get('/section_create_form/{note_uid}/{section_template_uid}', 'NoteController@sectionCreateForm')->name('section_create_form');
+Route::post("/process_form_submit", 'NoteController@processFormSubmit')->name('process_form_submit');

+ 30 - 0
storage/sections/test1/form.blade.php

@@ -0,0 +1,30 @@
+<div id="section_create_form">
+
+    <div class="card">
+        <div class="card-header">
+            <?php if(!$section):?>
+            <div class="alert alert-info">Create section</div>
+            <?php else: ?>
+            <div class="alert alert-info">Update section</div>
+            <?php endif; ?>
+        </div>
+        <div class="card-body">
+            <form method="POST" up-target="#note-container" action="/process_form_submit" up-history="false">
+                <input type="hidden" name="note_uid" value="<?= $note->uid?>">
+                <input type="hidden" name="section_template_uid" value="<?= $sectionTemplate->uid ?>">
+                <div class="form-group">
+                    <label for="">Nickname</label>
+                    <input type="text" class="form-control" name="nickname" placeholder="nickname">
+                </div>
+                <div class="form-group">
+                    <label for="">Favorite color</label>
+                    <input type="text" class="form-control" name="favoriteColor" placeholder="Favorite color">
+                </div>
+                <div class="form-group">
+                    <button class="btn btn-primary">Submit</button>
+                </div>
+            </form>
+        </div>
+
+    </div>
+</div>

+ 3 - 0
storage/sections/test1/processor.php

@@ -0,0 +1,3 @@
+<?php 
+
+$name = "Hello";

+ 2 - 0
storage/sections/test1/summary.php

@@ -0,0 +1,2 @@
+<h1>This will not show without dd()</h1>
+<?php  var_dump($newContentData); ?>