mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-06-04 00:44:41 +08:00
Added page editing
This commit is contained in:
@ -19,4 +19,10 @@ header .menu {
|
||||
display: inline-block;
|
||||
margin-left: $-m;
|
||||
}
|
||||
}
|
||||
|
||||
.page-title input {
|
||||
display: block;
|
||||
width: 100%;
|
||||
font-size: 1.4em;
|
||||
}
|
@ -5,7 +5,9 @@
|
||||
<meta name="viewport" content="width=device-width">
|
||||
<link rel="stylesheet" href="/css/app.css">
|
||||
<link href='http://fonts.googleapis.com/css?family=Roboto:400,400italic,500,500italic,700,700italic,300italic,100,300' rel='stylesheet' type='text/css'>
|
||||
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css">
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script>
|
||||
@yield('head')
|
||||
</head>
|
||||
<body>
|
||||
|
||||
|
@ -4,4 +4,14 @@
|
||||
|
||||
<h2>{{$book->name}}</h2>
|
||||
<p class="text-muted">{{$book->description}}</p>
|
||||
<a href="{{$book->getUrl() . '/page/create'}}">+ New Page</a>
|
||||
|
||||
<h4>Pages:</h4>
|
||||
@if(count($book->pages) > 0)
|
||||
@foreach($book->pages as $page)
|
||||
<a href="{{$page->getUrl()}}">{{$page->name}}</a><br>
|
||||
@endforeach
|
||||
@else
|
||||
<p class="text-muted">This book has no pages</p>
|
||||
@endif
|
||||
@stop
|
@ -1,5 +1,6 @@
|
||||
<input type="text" id="{{ $name }}" name="{{ $name }}"
|
||||
@if($errors->has($name)) class="neg" @endif
|
||||
@if(isset($placeholder)) placeholder="{{$placeholder}}" @endif
|
||||
@if(isset($model) || old($name)) value="{{ old($name) ? old($name) : $model->$name}}" @endif>
|
||||
@if($errors->has($name))
|
||||
<div class="text-neg text-small">{{ $errors->first($name) }}</div>
|
||||
|
19
resources/views/pages/create.blade.php
Normal file
19
resources/views/pages/create.blade.php
Normal file
@ -0,0 +1,19 @@
|
||||
@extends('base')
|
||||
|
||||
@section('head')
|
||||
<link rel="stylesheet" href="/plugins/css/froala_editor.min.css">
|
||||
<link rel="stylesheet" href="/plugins/css/froala_style.min.css">
|
||||
<script src="/plugins/js/froala_editor.min.js"></script>
|
||||
@stop
|
||||
|
||||
@section('content')
|
||||
<form action="{{$book->getUrl() . '/page'}}" method="POST">
|
||||
@include('pages/form')
|
||||
</form>
|
||||
|
||||
<script>
|
||||
$(function() {
|
||||
$('#html').editable({inlineMode: false});
|
||||
});
|
||||
</script>
|
||||
@stop
|
20
resources/views/pages/edit.blade.php
Normal file
20
resources/views/pages/edit.blade.php
Normal file
@ -0,0 +1,20 @@
|
||||
@extends('base')
|
||||
|
||||
@section('head')
|
||||
<link rel="stylesheet" href="/plugins/css/froala_editor.min.css">
|
||||
<link rel="stylesheet" href="/plugins/css/froala_style.min.css">
|
||||
<script src="/plugins/js/froala_editor.min.js"></script>
|
||||
@stop
|
||||
|
||||
@section('content')
|
||||
<form action="{{$page->getUrl()}}" method="POST">
|
||||
<input type="hidden" name="_method" value="PUT">
|
||||
@include('pages/form', ['model' => $page])
|
||||
</form>
|
||||
|
||||
<script>
|
||||
$(function() {
|
||||
$('#html').editable({inlineMode: false});
|
||||
});
|
||||
</script>
|
||||
@stop
|
13
resources/views/pages/form.blade.php
Normal file
13
resources/views/pages/form.blade.php
Normal file
@ -0,0 +1,13 @@
|
||||
{{ csrf_field() }}
|
||||
<div class="page-title row">
|
||||
<div class="col-md-10">
|
||||
@include('form/text', ['name' => 'name', 'placeholder' => 'Enter Page Title'])
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<button type="submit" class="button pos">Save</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="edit-area">
|
||||
@include('form/textarea', ['name' => 'html'])
|
||||
</div>
|
||||
|
12
resources/views/pages/show.blade.php
Normal file
12
resources/views/pages/show.blade.php
Normal file
@ -0,0 +1,12 @@
|
||||
@extends('base')
|
||||
|
||||
@section('content')
|
||||
|
||||
<a href="{{$page->getUrl() . '/edit'}}" class="button primary float right">Edit Page</a>
|
||||
|
||||
<h1>{{$page->name}}</h1>
|
||||
|
||||
<div class="page-content">
|
||||
{!! $page->html !!}
|
||||
</div>
|
||||
@stop
|
Reference in New Issue
Block a user