diff --git a/resources/views/partials/entity-selector-popup.blade.php b/resources/views/partials/entity-selector-popup.blade.php
new file mode 100644
index 000000000..b9166896a
--- /dev/null
+++ b/resources/views/partials/entity-selector-popup.blade.php
@@ -0,0 +1,14 @@
+
+
\ No newline at end of file
diff --git a/resources/views/partials/image-manager.blade.php b/resources/views/partials/image-manager.blade.php
index 69928e119..83625ad88 100644
--- a/resources/views/partials/image-manager.blade.php
+++ b/resources/views/partials/image-manager.blade.php
@@ -1,84 +1,94 @@
+
+
+
+
+
+ @include('partials/entity-selector', ['name' => 'entity-selector'])
+ Entity Select
+
+
+
+
+
-
-
+
+
-
-
-
-
All
- Book
- Page
+
+
+
+ Image Select
+
+
+
+
\ No newline at end of file
diff --git a/tests/Entity/EntitySearchTest.php b/tests/Entity/EntitySearchTest.php
index a9d9bc047..8adfd35a3 100644
--- a/tests/Entity/EntitySearchTest.php
+++ b/tests/Entity/EntitySearchTest.php
@@ -76,6 +76,14 @@ class EntitySearchTest extends TestCase
->see('Chapter Search Results')->seeInElement('.entity-list', $chapter->name);
}
+ public function test_search_quote_term_preparation()
+ {
+ $termString = '"192" cat "dog hat"';
+ $repo = $this->app[\BookStack\Repos\EntityRepo::class];
+ $preparedTerms = $repo->prepareSearchTerms($termString);
+ $this->assertTrue($preparedTerms === ['"192"','"dog hat"', 'cat']);
+ }
+
public function test_books_search_listing()
{
$book = \BookStack\Book::all()->last();
diff --git a/tests/Entity/EntityTest.php b/tests/Entity/EntityTest.php
index 71d83dd47..296aa72ed 100644
--- a/tests/Entity/EntityTest.php
+++ b/tests/Entity/EntityTest.php
@@ -218,13 +218,24 @@ class EntityTest extends TestCase
public function test_old_page_slugs_redirect_to_new_pages()
{
- $page = \BookStack\Page::all()->first();
+ $page = \BookStack\Page::first();
$pageUrl = $page->getUrl();
$newPageUrl = '/books/' . $page->book->slug . '/page/super-test-page';
+ // Need to save twice since revisions are not generated in seeder.
$this->asAdmin()->visit($pageUrl)
+ ->clickInElement('#content', 'Edit')
+ ->type('super test', '#name')
+ ->press('Save Page');
+
+ $page = \BookStack\Page::first();
+ $pageUrl = $page->getUrl();
+
+ // Second Save
+ $this->visit($pageUrl)
->clickInElement('#content', 'Edit')
->type('super test page', '#name')
->press('Save Page')
+ // Check redirect
->seePageIs($newPageUrl)
->visit($pageUrl)
->seePageIs($newPageUrl);
+
-
+
-
+
All
+ Book
+ Page
+
-
-
-
-
-
-
-
-
-
-
-
- Uploaded @{{ getDate(image.created_at) | date:'mediumDate' }}
+
+
+
+
+
+
+
+
+
+
-
+
+
+
+
+
+ Uploaded @{{ getDate(image.created_at) }}
+
Load More
Load More
');
-
- var remoteFilename = "image-" + Date.now() + "." + ext;
- formData.append('file', file, remoteFilename);
- formData.append('_token', document.querySelector('meta[name="token"]').getAttribute('content'));
-
- xhr.open('POST', window.baseUrl('/images/gallery/upload'));
- xhr.onload = function () {
- if (xhr.status === 200 || xhr.status === 201) {
- var result = JSON.parse(xhr.responseText);
- editor.dom.setAttrib(id, 'src', result.url);
- } else {
- console.log('An error occured uploading the image');
- console.log(xhr.responseText);
- editor.dom.remove(id);
- }
- };
- xhr.send(formData);
- }
- }
- }
-
- }
+ editor.on('paste', function(event) {
+ editorPaste(event, editor);
});
}
};
\ No newline at end of file
diff --git a/resources/assets/sass/_buttons.scss b/resources/assets/sass/_buttons.scss
index 5bdb0cf28..5de889673 100644
--- a/resources/assets/sass/_buttons.scss
+++ b/resources/assets/sass/_buttons.scss
@@ -100,3 +100,13 @@ $button-border-radius: 2px;
}
}
+.button[disabled] {
+ background-color: #BBB;
+ cursor: default;
+ &:hover {
+ background-color: #BBB;
+ cursor: default;
+ box-shadow: none;
+ }
+}
+
diff --git a/resources/assets/sass/_image-manager.scss b/resources/assets/sass/_components.scss
similarity index 86%
rename from resources/assets/sass/_image-manager.scss
rename to resources/assets/sass/_components.scss
index 73b3b59d6..ccb69b44e 100644
--- a/resources/assets/sass/_image-manager.scss
+++ b/resources/assets/sass/_components.scss
@@ -1,5 +1,5 @@
.overlay {
- background-color: rgba(0, 0, 0, 0.2);
+ background-color: rgba(0, 0, 0, 0.333);
position: fixed;
z-index: 95536;
width: 100%;
@@ -10,26 +10,76 @@
left: 0;
right: 0;
bottom: 0;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ display: none;
}
-.image-manager-body {
+.popup-body-wrap {
+ display: flex;
+}
+
+.popup-body {
background-color: #FFF;
max-height: 90%;
- width: 90%;
- height: 90%;
+ width: 1200px;
+ height: auto;
margin: 2% 5%;
border-radius: 4px;
box-shadow: 0 0 15px 0 rgba(0, 0, 0, 0.3);
overflow: hidden;
- position: fixed;
- top: 0;
- bottom: 0;
- left: 0;
z-index: 999;
display: flex;
- h1, h2, h3 {
- font-weight: 300;
+ flex-direction: column;
+ &.small {
+ margin: 2% auto;
+ width: 800px;
+ max-width: 90%;
}
+ &:before {
+ display: flex;
+ align-self: flex-start;
+ }
+}
+
+//body.ie .popup-body {
+// min-height: 100%;
+//}
+
+.corner-button {
+ position: absolute;
+ top: 0;
+ right: 0;
+ margin: 0;
+ height: 40px;
+ border-radius: 0;
+ box-shadow: none;
+}
+
+.popup-header, .popup-footer {
+ display: block !important;
+ position: relative;
+ height: 40px;
+ flex: none !important;
+ .popup-title {
+ color: #FFF;
+ padding: 8px $-m;
+ }
+}
+body.flexbox-support #entity-selector-wrap .popup-body .form-group {
+ height: 444px;
+ min-height: 444px;
+}
+#entity-selector-wrap .popup-body .form-group {
+ margin: 0;
+}
+//body.ie #entity-selector-wrap .popup-body .form-group {
+// min-height: 60vh;
+//}
+
+.image-manager-body {
+ min-height: 70vh;
}
#image-manager .dropzone-container {
@@ -37,12 +87,6 @@
border: 3px dashed #DDD;
}
-.image-manager-bottom {
- position: absolute;
- bottom: 0;
- right: 0;
-}
-
.image-manager-list .image {
display: block;
position: relative;
@@ -103,18 +147,13 @@
.image-manager-sidebar {
width: 300px;
- height: 100%;
margin-left: 1px;
- padding: 0 $-l;
+ padding: $-m $-l;
+ overflow-y: auto;
border-left: 1px solid #DDD;
-}
-
-.image-manager-close {
- position: absolute;
- top: 0;
- right: 0;
- margin: 0;
- border-radius: 0;
+ .dropzone-container {
+ margin-top: $-m;
+ }
}
.image-manager-list {
@@ -125,7 +164,6 @@
.image-manager-content {
display: flex;
flex-direction: column;
- height: 100%;
flex: 1;
.container {
width: 100%;
@@ -141,12 +179,13 @@
* Copyright (c) 2012 Matias Meno