-
Notifications
You must be signed in to change notification settings - Fork 48
New feature: set a note as favorite (star/unstar) #248
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
ddf8e34
c55a59b
1903317
34dd112
7dfe6bc
94b5d81
3aed82d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -42,10 +42,15 @@ | |
| display: none; | ||
| } | ||
|
|
||
| #app-navigation .active > .utils .icon-delete { | ||
| display: block; | ||
| #app-navigation .active > .utils .icon-delete, | ||
| #app-navigation .active > .utils .icon-star { | ||
| display: inline-block; | ||
| opacity: .3; | ||
| } | ||
| #app-navigation .utils .icon-starred { | ||
| display: inline-block; | ||
| opacity: 1 !important; | ||
| } | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It should be possible to remove the #app-navigation .active > .utils .icon-starred {
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That's not possible here, because the starred icon should be shown for not-active notes, too. |
||
|
|
||
| .tooltip { | ||
| text-shadow: none; | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -24,31 +24,38 @@ | |
| * @method void setTitle(string $value) | ||
| * @method string getContent() | ||
| * @method void setContent(string $value) | ||
| * @method boolean getFavorite() | ||
| * @method void setFavorite(boolean $value) | ||
| * @package OCA\Notes\Db | ||
| */ | ||
| class Note extends Entity { | ||
|
|
||
| public $modified; | ||
| public $title; | ||
| public $content; | ||
| public $favorite = false; | ||
|
|
||
| public function __construct() { | ||
| $this->addType('modified', 'integer'); | ||
| $this->addType('favorite', 'boolean'); | ||
| } | ||
|
|
||
| /** | ||
| * @param File $file | ||
| * @return static | ||
| */ | ||
| public static function fromFile(File $file){ | ||
| public static function fromFile(File $file, $tags=[]){ | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. as soon as travis is happy with this change, I'll merge it.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks for you feedback. As far as I can see, this was not sufficient. See my above comment: #248 (comment) |
||
| $note = new static(); | ||
| $note->setId($file->getId()); | ||
| $note->setContent($file->getContent()); | ||
| $note->setModified($file->getMTime()); | ||
| $note->setTitle(pathinfo($file->getName(),PATHINFO_FILENAME)); // remove extension | ||
| if(is_array($tags) && in_array(\OC\Tags::TAG_FAVORITE, $tags)) { | ||
| $note->setFavorite(true); | ||
| //unset($tags[array_search(\OC\Tags::TAG_FAVORITE, $tags)]); | ||
| } | ||
| $note->resetUpdatedFields(); | ||
| return $note; | ||
| } | ||
|
|
||
|
|
||
| } | ||
| } | ||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Large diffs are not rendered by default.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please merge this rule with the previous rule:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done