Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Зуев Егор
/
wiki.dev
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
Authored by
Dan Brown
2016-06-11 21:04:18 +0100
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Commit
97d011ac8ea94ddb3dfc6c11d4dee78d4bcd3f5c
97d011ac
1 parent
61596a8e
Started work on page move view and entity selector
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
100 additions
and
9 deletions
app/Http/Controllers/PageController.php
app/Http/routes.php
resources/assets/js/directives.js
resources/assets/sass/_text.scss
resources/views/books/list-item.blade.php
resources/views/chapters/list-item.blade.php
resources/views/pages/list-item.blade.php
resources/views/pages/move.blade.php
resources/views/pages/show.blade.php
app/Http/Controllers/PageController.php
View file @
97d011a
...
...
@@ -451,6 +451,24 @@ class PageController extends Controller
}
/**
* Show the view to choose a new parent to move a page into.
* @param $bookSlug
* @param $pageSlug
* @return mixed
* @throws NotFoundException
*/
public
function
showMove
(
$bookSlug
,
$pageSlug
)
{
$book
=
$this
->
bookRepo
->
getBySlug
(
$bookSlug
);
$page
=
$this
->
pageRepo
->
getBySlug
(
$pageSlug
,
$book
->
id
);
$this
->
checkOwnablePermission
(
'page-update'
,
$page
);
return
view
(
'pages/move'
,
[
'book'
=>
$book
,
'page'
=>
$page
]);
}
/**
* Set the permissions for this page.
* @param $bookSlug
* @param $pageSlug
...
...
app/Http/routes.php
View file @
97d011a
...
...
@@ -34,6 +34,7 @@ Route::group(['middleware' => 'auth'], function () {
Route
::
get
(
'/{bookSlug}/page/{pageSlug}/export/html'
,
'PageController@exportHtml'
);
Route
::
get
(
'/{bookSlug}/page/{pageSlug}/export/plaintext'
,
'PageController@exportPlainText'
);
Route
::
get
(
'/{bookSlug}/page/{pageSlug}/edit'
,
'PageController@edit'
);
Route
::
get
(
'/{bookSlug}/page/{pageSlug}/move'
,
'PageController@showMove'
);
Route
::
get
(
'/{bookSlug}/page/{pageSlug}/delete'
,
'PageController@showDelete'
);
Route
::
get
(
'/{bookSlug}/draft/{pageId}/delete'
,
'PageController@showDeleteDraft'
);
Route
::
get
(
'/{bookSlug}/page/{pageSlug}/permissions'
,
'PageController@showRestrict'
);
...
...
resources/assets/js/directives.js
View file @
97d011a
...
...
@@ -149,7 +149,10 @@ module.exports = function (ngApp, events) {
};
}]);
/**
* Dropdown
* Provides some simple logic to create small dropdown menus
*/
ngApp
.
directive
(
'dropdown'
,
[
function
()
{
return
{
restrict
:
'A'
,
...
...
@@ -166,6 +169,10 @@ module.exports = function (ngApp, events) {
};
}]);
/**
* TinyMCE
* An angular wrapper around the tinyMCE editor.
*/
ngApp
.
directive
(
'tinymce'
,
[
'$timeout'
,
function
(
$timeout
)
{
return
{
restrict
:
'A'
,
...
...
@@ -231,6 +238,10 @@ module.exports = function (ngApp, events) {
}
}]);
/**
* Markdown input
* Handles the logic for just the editor input field.
*/
ngApp
.
directive
(
'markdownInput'
,
[
'$timeout'
,
function
(
$timeout
)
{
return
{
restrict
:
'A'
,
...
...
@@ -263,6 +274,10 @@ module.exports = function (ngApp, events) {
}
}]);
/**
* Markdown Editor
* Handles all functionality of the markdown editor.
*/
ngApp
.
directive
(
'markdownEditor'
,
[
'$timeout'
,
function
(
$timeout
)
{
return
{
restrict
:
'A'
,
...
...
@@ -342,6 +357,11 @@ module.exports = function (ngApp, events) {
}
}]);
/**
* Page Editor Toolbox
* Controls all functionality for the sliding toolbox
* on the page edit view.
*/
ngApp
.
directive
(
'toolbox'
,
[
function
()
{
return
{
restrict
:
'A'
,
...
...
@@ -378,6 +398,11 @@ module.exports = function (ngApp, events) {
}
}]);
/**
* Tag Autosuggestions
* Listens to child inputs and provides autosuggestions depending on field type
* and input. Suggestions provided by server.
*/
ngApp
.
directive
(
'tagAutosuggestions'
,
[
'$http'
,
function
(
$http
)
{
return
{
restrict
:
'A'
,
...
...
@@ -557,6 +582,17 @@ module.exports = function (ngApp, events) {
}
}
}]);
ngApp
.
directive
(
'entitySelector'
,
[
'$http'
,
function
(
$http
)
{
return
{
restrict
:
'A'
,
link
:
function
(
scope
,
element
,
attrs
)
{
scope
.
loading
=
true
;
}
};
}]);
};
...
...
resources/assets/sass/_text.scss
View file @
97d011a
...
...
@@ -3,7 +3,7 @@
*/
h1
{
font-size
:
3
.
6
25em
;
font-size
:
3
.
4
25em
;
line-height
:
1
.22222222em
;
margin-top
:
0
.48888889em
;
margin-bottom
:
0
.48888889em
;
...
...
@@ -33,10 +33,10 @@ h1, h2, h3, h4 {
display
:
block
;
color
:
#555
;
.subheader
{
display
:
block
;
//
display: block;
font-size
:
0
.5em
;
line-height
:
1em
;
color
:
lighten
(
$text-dark
,
16
%
);
color
:
lighten
(
$text-dark
,
32
%
);
}
}
...
...
resources/views/books/list-item.blade.php
View file @
97d011a
<div
class=
"book"
>
<div
class=
"book"
data-entity-type=
"book"
data-entity-id=
"{{$book->id}}"
>
<h3
class=
"text-book"
><a
class=
"text-book"
href=
"{{$book->getUrl()}}"
><i
class=
"zmdi zmdi-book"
></i>
{{$book->name}}
</a></h3>
@if(isset($book->searchSnippet))
<p
class=
"text-muted"
>
{!! $book->searchSnippet !!}
</p>
...
...
resources/views/chapters/list-item.blade.php
View file @
97d011a
<div
class=
"chapter"
>
<div
class=
"chapter"
data-entity-type=
"chapter"
data-entity-id=
"{{$chapter->id}}"
>
<h3>
<a
href=
"{{ $chapter->getUrl() }}"
class=
"text-chapter"
>
<i
class=
"zmdi zmdi-collection-bookmark"
></i>
{{ $chapter->name }}
...
...
resources/views/pages/list-item.blade.php
View file @
97d011a
<div
class=
"page {{$page->draft ? 'draft' : ''}}"
>
<div
class=
"page {{$page->draft ? 'draft' : ''}}"
data-entity-type=
"page"
data-entity-id=
"{{$page->id}}"
>
<h3>
<a
href=
"{{ $page->getUrl() }}"
class=
"text-page"
><i
class=
"zmdi zmdi-file-text"
></i>
{{ $page->name }}
</a>
</h3>
...
...
@@ -11,11 +11,11 @@
@if(isset($style)
&&
$style === 'detailed')
<div
class=
"row meta text-muted text-small"
>
<div
class=
"col-md-
4
"
>
<div
class=
"col-md-
6
"
>
Created {{$page->created_at->diffForHumans()}} @if($page->createdBy)by {{$page->createdBy->name}}@endif
<br>
Last updated {{ $page->updated_at->diffForHumans() }} @if($page->updatedBy)by {{$page->updatedBy->name}} @endif
</div>
<div
class=
"col-md-
8
"
>
<div
class=
"col-md-
6
"
>
<a
class=
"text-book"
href=
"{{ $page->book->getUrl() }}"
><i
class=
"zmdi zmdi-book"
></i>
{{ $page->book->getShortName(30) }}
</a>
<br>
@if($page->chapter)
...
...
resources/views/pages/move.blade.php
0 → 100644
View file @
97d011a
@extends('base')
@section('content')
<div
class=
"faded-small toolbar"
>
<div
class=
"container"
>
<div
class=
"row"
>
<div
class=
"col-sm-12 faded"
>
<div
class=
"breadcrumbs"
>
<a
href=
"{{$book->getUrl()}}"
class=
"text-book text-button"
><i
class=
"zmdi zmdi-book"
></i>
{{ $book->getShortName() }}
</a>
@if($page->hasChapter())
<span
class=
"sep"
>
»
</span>
<a
href=
"{{ $page->chapter->getUrl() }}"
class=
"text-chapter text-button"
>
<i
class=
"zmdi zmdi-collection-bookmark"
></i>
{{$page->chapter->getShortName()}}
</a>
@endif
<span
class=
"sep"
>
»
</span>
<a
href=
"{{$page->getUrl()}}"
class=
"text-page text-button"
><i
class=
"zmdi zmdi-file-text"
></i>
{{ $page->getShortName() }}
</a>
</div>
</div>
</div>
</div>
</div>
<div
class=
"container"
>
<h1>
Move Page
<small
class=
"subheader"
>
{{$page->name}}
</small></h1>
<div
class=
"bordered"
ng-cloak
entity-selector
>
<input
type=
"text"
placeholder=
"Search"
>
<div
class=
"text-center"
ng-if=
"loading"
>
@include('partials/loading-icon')
</div>
</div>
</div>
@stop
resources/views/pages/show.blade.php
View file @
97d011a
...
...
@@ -30,6 +30,7 @@
@if(userCan('page-update', $page))
<a
href=
"{{$page->getUrl()}}/revisions"
class=
"text-primary text-button"
><i
class=
"zmdi zmdi-replay"
></i>
Revisions
</a>
<a
href=
"{{$page->getUrl()}}/edit"
class=
"text-primary text-button"
><i
class=
"zmdi zmdi-edit"
></i>
Edit
</a>
<a
href=
"{{$page->getUrl()}}/move"
class=
"text-primary text-button"
><i
class=
"zmdi zmdi-folder"
></i>
Move
</a>
@endif
@if(userCan('restrictions-manage', $page))
<a
href=
"{{$page->getUrl()}}/permissions"
class=
"text-primary text-button"
><i
class=
"zmdi zmdi-lock-outline"
></i>
Permissions
</a>
...
...
Please
register
or
sign in
to post a comment