aboutsummaryrefslogtreecommitdiffstats
path: root/app/views/home/main.html.erb
diff options
context:
space:
mode:
Diffstat (limited to 'app/views/home/main.html.erb')
-rw-r--r--app/views/home/main.html.erb36
1 files changed, 23 insertions, 13 deletions
diff --git a/app/views/home/main.html.erb b/app/views/home/main.html.erb
index 990f007..8f3a7f3 100644
--- a/app/views/home/main.html.erb
+++ b/app/views/home/main.html.erb
@@ -3,30 +3,40 @@
<div class="position-relative">
<div class="right-section">
- <span class="display-none margin-top-neg-15">
- <input type="text" class="form-field" />
- <button type="button" class="button">Create</button>
- <button type="button" class="button">Cancel</button>
+ <span class="margin-top-neg-15"
+ ng-show="notesService.show_create_buttons">
+ <input type="text" class="form-field"
+ ng-model="notesService.new_note_title" />
+ <button type="button" class="button"
+ ng-click="notesService.create()">Create</button>
+ <button type="button" class="button"
+ ng-click="notesService.show_create_buttons = false">Cancel</button>
</span>
- <a href="#" class="button">New</a>
+ <a href="#" class="button"
+ ng-hide="notesService.show_create_buttons"
+ ng-click="notesService.show_create_buttons = true">New</a>
- <a href="#" class="button margin-left-8">Save</a>
+ <a href="#" class="button margin-left-8"
+ ng-click="notesService.update()">Save</a>
</div>
</div>
</div>
<div class="margin-top-70">
<div class="sidebar position-fixed min-height-100%">
- <a href="#" class="sidebar-link display-block padding-13">A Note</a>
- <a href="#" class="delete-link display-none"><span>×</span></a>
- <a href="#" class="sidebar-link display-block padding-13">A Note</a>
- <a href="#" class="delete-link display-none"><span>×</span></a>
- <a href="#" class="sidebar-link display-block padding-13">A Note</a>
- <a href="#" class="delete-link display-none"><span>×</span></a>
+ <div ng-repeat="note in notesService.notes">
+ <a href="#" class="sidebar-link display-block padding-13"
+ ng-class="{ active: notesService.current_note === note }"
+ ng-click="notesService.open(note)"
+ ng-bind="note.title"></a>
+ <a href="#" class="delete-link"
+ ng-click="notesService.delete(note)"><span>×</span></a>
+ </div>
</div>
<div class="note-editor">
- <textarea class="border-none outline-none width-100% font-size-16"></textarea>
+ <textarea class="border-none outline-none width-100% font-size-16"
+ ng-model="notesService.current_note.body"></textarea>
</div>
</div>