Fixing quick notes

Updating all the icons
making search bar thinner
This commit is contained in:
Max G 2020-02-11 06:05:28 +00:00
parent 9b7fc679e8
commit c903bcbcd1
9 changed files with 49 additions and 60 deletions

View File

@ -105,13 +105,13 @@
<!-- Buttons -->
<div class="ui small compact basic button" v-on:click="openNote">
<i class="file icon"></i>
<i class="file outline icon"></i>
Open Note
</div>
<div class="ui small compact basic button" v-on:click="openEditAttachments"
:class="{ 'disabled':this.searchParams.noteId }">
<i class="folder icon"></i>
Note Attachments
<i class="folder open outline icon"></i>
Note Files
</div>
<div class="ui small compact basic icon button" v-on:click="deleteAttachment">
<i v-if="!working" class="trash alternate outline icon"></i>

View File

@ -153,7 +153,7 @@
<div class="menu-section" v-if="loggedIn">
<router-link exact-active-class="active" class="menu-item menu-button" to="/notes" v-on:click.native="emitReloadEvent()">
<i class="file icon"></i>Notes
<i class="file outline icon"></i>Notes
</router-link>
<div>
<!-- <div class="menu-item sub">Show Only <i class="caret down icon"></i></div> -->
@ -165,25 +165,25 @@
<div class="menu-section" v-if="loggedIn">
<div v-on:click="updateFastFilters(3)" class="menu-item menu-button">
<i class="mail icon"></i>Inbox
<i class="mail outline icon"></i>Inbox
</div>
</div>
<div class="menu-section" v-if="loggedIn">
<div v-on:click="updateFastFilters(2)" class="menu-item menu-button">
<i class="archive icon"></i>Archived
<i class="hdd outline icon"></i>Archived
</div>
</div>
<div class="menu-section" v-if="loggedIn">
<router-link class="menu-item menu-button" exact-active-class="active" to="/attachments">
<i class="folder icon"></i>Files
<i class="folder open outline icon"></i>Files
</router-link>
</div>
<div class="menu-section" v-if="loggedIn">
<router-link v-if="loggedIn" exact-active-class="active" class="menu-item menu-button" to="/quick">
<i class="coffee icon"></i>Quick
<i class="paper plane outline icon"></i>Quick
</router-link>
</div>
@ -208,7 +208,7 @@
<div class="menu-section" v-if="loggedIn">
<div v-if="loggedIn" v-on:click="destroyLoginToken" class="menu-item menu-button">
<i class="user icon"></i>{{ucWords($store.getters.getUsername)}}
<i class="user outline icon"></i>{{ucWords($store.getters.getUsername)}}
</div>
</div>

View File

@ -12,6 +12,7 @@
<div class="sixteen wide column">
<h3>All Tags</h3>
<h4 v-if="allTags.length == 0">No tags yet, add a tag.</h4>
<div v-if="allTags.length > 0">
<div class="ui icon large label clickable" v-for="tag in allTags" :class="{ 'green':isTagOnNote(tag.id) }" v-on:click="toggleTag(tag.text, tag.id, tag.entryId)">
{{ ucWords(tag.text) }}

View File

@ -1,11 +1,7 @@
<template>
<div class="ui form">
<div class="fields">
<div class="sixteen wide field">
<input v-model="searchTerm" @keyup="searchKeyUp" @:keyup.enter="search" placeholder="Search Notes and Files" />
</div>
</div>
</div>
</template>
<script>

View File

@ -4,7 +4,7 @@
<div class="ui sixteen wide column">
<h2 class="ui header">
<i class="folder icon"></i>
<i class="folder open outline icon"></i>
<div class="content">
Files
<div class="sub header">Uploaded Files and Websites from notes.</div>
@ -18,7 +18,7 @@
Show All Attachments
</div>
<div class="ui green button" v-on:click="openNote">
<i class="file icon"></i>
<i class="file outline icon"></i>
Open Note
</div>
</div>

View File

@ -3,33 +3,30 @@
<div class="ui grid" :class="{ 'mush-it-up':showOneColumn() }" ref="content">
<!-- Note filter options -->
<div class="row" v-if="!$store.getters.getIsUserOnMobile">
<div v-if="!$store.getters.getIsUserOnMobile"
:class="{ 'sixteen wide column':showOneColumn(), 'twelve wide column':!showOneColumn() }">
<div :class="{ 'sixteen wide column':showOneColumn(), 'eight wide column':!showOneColumn() }">
<div class="ui form">
<div class="fields">
<div class="ten wide field">
<div class="ui grid">
<div class="eight wide column">
<search-input></search-input>
</div>
<div class="six wide field">
<div class="eight wide column">
<!-- <fast-filters /> -->
<span class="ui fluid green button"
v-if="showClear"
@click="reset">
<i class="undo icon"></i>Back to All Notes
<i class="arrow circle left icon"></i>Back to All Notes
</span>
<!-- <fast-filters /> -->
</div>
</div>
</div>
</div>
</div>
</div>
<div v-if="$store.getters.getIsUserOnMobile && showClear" class="row">
<div class="sixteen wide column">
<span class="ui fluid green button"
@click="reset">
<i class="undo icon"></i>Reset Filters
<span class="ui fluid green button" @click="reset">
<i class="arrow circle left icon"></i>Back to All Notes
</span>
</div>
</div>
@ -118,7 +115,7 @@
<!-- found attachments -->
<div class="sixteen wide column" v-if="foundAttachments.length > 0">
<h4><i class="green folder icon"></i> Found in Files ({{ foundAttachments.length }})</h4>
<h4><i class="folder open outline icon"></i> Found in Files ({{ foundAttachments.length }})</h4>
<attachment-display
v-for="item in foundAttachments"
:item="item"

View File

@ -4,7 +4,7 @@
<div class="ui sixteen wide column">
<h2 class="ui header">
<i class="coffee icon"></i>
<i class="paper plane outline icon"></i>
<div class="content">
Quick
<div class="sub header">Add new information with great speed</div>
@ -26,7 +26,14 @@
</div>
<div class="field">
<div v-on:click="appendQuickNote" class="ui green button">Save (CRTL + Enter)</div>
<div v-if="quickNoteId" v-on:click="openNoteEdit" class="ui right floated basic button">Edit</div>
<div v-if="quickNoteId" class="ui right floated basic button" v-on:click="$router.push('/attachments/note/'+quickNoteId)">
<i class="folder open outline icon"></i>
Quick Files + Links
</div>
<div v-if="quickNoteId" v-on:click="openNoteEdit" class="ui right floated basic button">
<i class="file outline icon"></i>
Edit
</div>
</div>
</div>
</div>
@ -98,7 +105,7 @@
//Don't submit empty note
if(this.newText.trim() == ''){ return }
axios.post('/api/quick-note/update', { 'pushText':this.newText } )
axios.post('/api/quick-note/update', { 'pushText':this.newText.trim() } )
.then( results => {
this.newText = '' //Clear text area

View File

@ -105,7 +105,7 @@ Note.create = (userId, noteText, quickNote = 0) => {
const created = Math.round((+new Date)/1000)
db.promise()
.query(`INSERT INTO note_raw_text (text) VALUE ('')`)
.query(`INSERT INTO note_raw_text (text) VALUE (?)`, [noteText])
.then( (rows, fields) => {
const rawTextId = rows[0].insertId

View File

@ -10,7 +10,9 @@ QuickNote.get = (userId) => {
db.promise()
.query(`
SELECT id, text FROM note WHERE quick_note = 1 AND user_id = ? LIMIT 1
SELECT note.id, text FROM note
JOIN note_raw_text ON (note_raw_text.id = note.note_raw_text_id)
WHERE quick_note = 1 AND user_id = ? LIMIT 1
`, [userId])
.then((rows, fields) => {
@ -53,8 +55,10 @@ QuickNote.update = (userId, pushText) => {
db.promise()
.query(`
SELECT id, text, color, pinned, archived
FROM note WHERE quick_note = 1 AND user_id = ? LIMIT 1
SELECT note.id, text, color, pinned, archived
FROM note
JOIN note_raw_text ON (note_raw_text.id = note.note_raw_text_id)
WHERE quick_note = 1 AND user_id = ? LIMIT 1
`, [userId])
.then((rows, fields) => {
@ -95,19 +99,3 @@ QuickNote.update = (userId, pushText) => {
//Note.create(userId, 'Quick Note', 1)
}
QuickNote.create = (userId, noteText) => {
return new Promise((resolve, reject) => {
if(userId == null || userId < 10){ reject('User Id required to create note') }
const created = Math.round((+new Date)/1000)
db.promise()
.query('INSERT INTO note (user_id, text, created) VALUES (?,?,?)', [userId, noteText, created])
.then((rows, fields) => {
resolve(rows[0].insertId) //Only return the new note ID when creating a new note
})
.catch(console.log)
})
}