Resourcify admin cp controllers, routes, and views

This commit is contained in:
Jonny Barnes 2017-03-03 13:22:21 +00:00
commit 17804eed27
34 changed files with 206 additions and 429 deletions

View file

@ -0,0 +1,27 @@
@extends('master')
@section('title')
New Article « Admin CP
@stop
@section('content')
@if(isset($message))<p class="error">{{ $message }}</p>@endif
<form action="/admin/blog/" method="post" accept-charset="utf-8" enctype="multipart/form-data" id="newarticle">
{{ csrf_field() }}
<label for="title">Title (URL):</label>
<br>
<input type="text" name="title" id="title" value="{{ old('title') }}" placeholder="Title here">
<br>
<input type="text" name="url" id="url" value="{{ old('url') }}" placeholder="Article URL">
<br>
<label for="main">Main:</label>
<br>
<textarea name="main" id="main" placeholder="Article here">{{ old('main') }}</textarea>
<br>
<label for="published">Published:</label><input type="checkbox" name="published" id="published" value="1">
<br>
<p>Or you can upload an <code>.md</code> file:</p><input type="file" accept=".md" name="article">
<br>
<button type="submit" name="save">Save</button>
</form>
@stop

View file

@ -1,13 +0,0 @@
@extends('master')
@section('title')
Delete Article? « Admin CP
@stop
@section('content')
<form action="/admin/blog/delete/{{ $id }}" method="post">
<label for="delete">Are you sure you want to delete this post? </label><input type="checkbox" name="delete" id="delete">
<br>
<input type="submit" id="submit" value="Submit">
</form>
@stop

View file

@ -1,9 +0,0 @@
@extends('master')
@section('title')
Article Deleted « Admin CP
@stop
@section('content')
<p>You have successfully deletd the article with id: {{ $id }}</p>
@stop

View file

@ -5,8 +5,9 @@ Edit Article « Admin CP
@stop
@section('content')
<form action="/admin/blog/edit/{{ $id }}" method="post" accept-charset="utf-8">
<input type="hidden" name="_token" value="{{ csrf_token() }}">
<form action="/admin/blog/{{ $id }}" method="post" accept-charset="utf-8">
{{ csrf_field() }}
{{ method_field('PUT') }}
<label for="title">Title (URL):</label>
<br>
<input type="text" name="title" id="title" value="{!! $post['0']['title'] !!}">
@ -21,21 +22,12 @@ Edit Article « Admin CP
<br>
<input type="submit" name="save" value="Save">
</form>
<h2>Preview</h2>
@stop
@section('scripts')
@parent
<script src="/assets/frontend/marked.min.js"></script>
<script>
var preview = document.createElement('div');
preview.classList.add('preview');
var main = document.querySelector('main');
main.appendChild(preview);
var textarea = document.querySelector('textarea');
window.setInterval(function () {
var markdown = textarea.value;
preview.innerHTML = marked(markdown);
}, 5000);
</script>
<hr>
<form action="/admin/blog/{{ $id }}" method="post">
{{ csrf_field() }}
{{ method_field('DELETE') }}
<button type="submit" name="submit">
Delete
</button>
</form>
@stop

View file

@ -1,9 +0,0 @@
@extends('master')
@section('title')
Article Successfully Edited « Admin CP
@stop
@section('content')
<p>Successfully edited article with id: {{ $id }}</p>
@stop

View file

@ -0,0 +1,14 @@
@extends('master')
@section('title')
List Articles « Admin CP
@stop
@section('content')
<p>Select article to edit:</p>
<ol reversed>
@foreach($posts as $post)
<li><a href="/admin/blog/{{ $post['id'] }}/edit">{{ $post['title'] }}</a>@if($post['published'] == '0')<span class="notpublished">not published</span>@endif
@endforeach
</ol>
@stop

View file

@ -1,49 +0,0 @@
@extends('master')
@section('title')
New Article « Admin CP
@stop
@section('content')
@if(isset($message))<p class="error">{{ $message }}</p>@endif
<form action="/admin/blog/new" method="post" accept-charset="utf-8" enctype="multipart/form-data" id="newarticle">
<input type="hidden" name="_token" value="{{ csrf_token() }}">
<label for="title">Title (URL):</label>
<br>
<input type="text" name="title" id="title" value="{{ old('title') }}" placeholder="Title here">
<br>
<input type="text" name="url" id="url" value="{{ old('url') }}" placeholder="Article URL">
<br>
<label for="main">Main:</label>
<br>
<textarea name="main" id="main" placeholder="Article here">{{ old('main') }}</textarea>
<br>
<label for="published">Published:</label><input type="checkbox" name="published" id="published" value="1">
<br>
<p>Or you can upload an <code>.md</code> file:</p><input type="file" accept=".md" name="article">
<br>
<button type="submit" name="save">Save</button>
</form>
<h2>Preview</h2>
@stop
@section('scripts')
@parent
<script src="/assets/frontend/marked.min.js"></script>
<script>
var preview = document.createElement('div');
preview.classList.add('preview');
var main = document.querySelector('main');
main.appendChild(preview);
var textarea = document.querySelector('textarea');
window.setInterval(function () {
var markdown = textarea.value;
preview.innerHTML = marked(markdown);
}, 5000);
</script>
<script src="/assets/frontend/store2.min.js"></script>
<script src="/assets/frontend/alertify.js"></script>
<script src="/assets/js/form-save.js"></script>
<link rel="stylesheet" href="/assets/frontend/alertify.css">
@stop

View file

@ -1,9 +0,0 @@
@extends('master')
@section('title')
New Article Success « Admin CP
@stop
@section('content')
<p>Successfully created article with id: {{ $id }}, title: {{ $title }}</p>
@stop

View file

@ -0,0 +1,15 @@
@extends('master')
@section('title')
New Client « Admin CP
@stop
@section('content')
<h1>New Client</h1>
<form action="/admin/clients/" method="post" accept-charset="utf-8">
{{ csrf_field() }}
<input type="text" name="client_url" id="client_url" placeholder="client_url"><br>
<input type="text" name="client_name" id="client_name" placeholder="client_name"><br>
<input type="submit" name="submit" value="Submit">
</form>
@stop

View file

@ -1,9 +0,0 @@
@extends('master')
@section('title')
Edit Client « Admin CP
@stop
@section('content')
<p>Successfully deleted the client information.</p>
@stop

View file

@ -6,10 +6,17 @@ Edit Client « Admin CP
@section('content')
<h1>Edit Client</h1>
<form action="/admin/clients/edit/{{ $id }}" method="post" accept-charset="utf-8">
<form action="/admin/clients/{{ $id }}" method="post" accept-charset="utf-8">
{{ csrf_field() }}
{{ method_field('PUT') }}
<input type="text" name="client_url" id="client_url" value="{{ $client_url }}"><br>
<input type="text" name="client_name" id="client_name" value="{{ $client_name }}"><br>
<input type="submit" name="edit" value="Edit"><br><br>
<input type="submit" name="delete" value="Delete">
<input type="submit" name="submit" value="Edit">
</form>
<hr>
<form action="/admin/clients/{{ $id }}" method="post">
{{ csrf_field() }}
{{ method_field('DELETE') }}
<button type="submit">Delete Client</button>
</form>
@stop

View file

@ -1,9 +0,0 @@
@extends('master')
@section('title')
Edit Client « Admin CP
@stop
@section('content')
<p>Successfully edited the client information.</p>
@stop

View file

@ -0,0 +1,17 @@
@extends('master')
@section('title')
List Clients « Admin CP
@stop
@section('content')
<h1>Clients</h1>
<ul>
@foreach($clients as $client)
<li>{{ $client['client_url'] }} : {{ $client['client_name'] }}
<a href="/admin/clients/{{ $client['id'] }}/edit">edit?</a>
</li>
@endforeach
</ul>
<p>Create a <a href="/admin/clients/new">new entry</a>?</p>
@stop

View file

@ -1,9 +0,0 @@
@extends('master')
@section('title')
New Client « Admin CP
@stop
@section('content')
<p>Succesfully created new client info.</p>
@stop

View file

@ -0,0 +1,17 @@
@extends('master')
@section('title')
New Contact « Admin CP
@stop
@section('content')
<h1>New Contact</h1>
<form action="/admin/contacts/" method="post" accept-charset="utf-8">
{{ csrf_field() }}
<label for="name">Real Name:</label> <input type="text" name="name" id="name" placeholder="Real Name"><br>
<label for="nick">Nick:</label> <input type="text" name="nick" id="nick" placeholder="local_nick"><br>
<label for="homepage">Homepage:</label> <input type="text" name="homepage" id="homepage" placeholder="https://homepage.com"><br>
<label for="twitter">Twitter Nick:</label> <input type="text" name="twitter" id="twitter" placeholder="Twitter handle"><br>
<input type="submit" name="submit" value="Submit">
</form>
@stop

View file

@ -1,14 +0,0 @@
@extends('master')
@section('title')
Delete Contact? « Admin CP
@stop
@section('content')
<form action="/admin/contacts/delete/{{ $id }}" method="post">
<input type="hidden" name="_token" value="{{ csrf_token() }}">
<label for="delete">Are you sure you want to delete this contact? </label><input type="checkbox" name="delete" id="delete">
<br>
<input type="submit" id="submit" value="Submit">
</form>
@stop

View file

@ -1,9 +0,0 @@
@extends('master')
@section('title')
Deleted Contact « Admin CP
@stop
@section('content')
<p>Successfully deleted the contact information.</p>
@stop

View file

@ -6,8 +6,9 @@ Edit Contact « Admin CP
@section('content')
<h1>Edit Contact</h1>
<form action="/admin/contacts/edit/{{ $contact->id }}" method="post" enctype="multipart/form-data" accept-charset="utf-8">
<input type="hidden" name="_token" value="{{ csrf_token() }}">
<form action="/admin/contacts/{{ $contact->id }}" method="post" enctype="multipart/form-data" accept-charset="utf-8">
{{ csrf_token() }}
{{ method_field('PUT') }}
<fieldset class="note-ui">
<legend>Conctact</legend>
<div>
@ -37,6 +38,5 @@ Edit Contact « Admin CP
<input type="submit" name="submit" value="Submit">
</fieldset>
</form>
<p>Or do you want to <a href="/admin/contacts/delete/{{ $contact->id }}">delete</a> this contact?</p>
<p>Instead of uploading an image, you can <a href="/admin/contacts/edit/{{ $contact->id }}/getavatar">grab from their homepage</a>?</p>
@stop

View file

@ -1,9 +0,0 @@
@extends('master')
@section('title')
Edit Contact « Admin CP
@stop
@section('content')
<p>Successfully edited the contact information.</p>
@stop

View file

@ -0,0 +1,29 @@
@extends('master')
@section('title')
List Contacts « Admin CP
@stop
@section('content')
<h1>Contacts</h1>
<table>
<tr>
<th>Real Name</th>
<th>Nick</th>
<th>Homepage</th>
<th>Twitter</th>
<th>Facebook</th>
<th></th>
</tr>
@foreach($contacts as $contact)
<tr>
<td>{{ $contact->name }}</td>
<td>{{ $contact->nick }}</td>
<td>{{ $contact->homepage }}</td>
<td>{{ $contact->twitter }}</td>
<td>{{ $contact->facebook }}</td>
<td><a href="/admin/contacts/{{ $contact->id }}/edit">edit</a></td>
</tr>
@endforeach
</table>
@stop

Some files were not shown because too many files have changed in this diff Show more