-
Notifications
You must be signed in to change notification settings - Fork 1
/
plugin.rb
33 lines (25 loc) · 1.04 KB
/
plugin.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# frozen_string_literal: true
# name: discourse-personal-notes
# about: Store personal notes
# version: 0.1
# authors: STEMAWAY/FS3-JUNE
# url:
enabled_site_setting :personal_notes_enabled
register_asset 'stylesheets/common/personal-notes.scss'
register_asset 'stylesheets/desktop/personal-notes.scss', :desktop
register_asset 'stylesheets/mobile/personal-notes.scss', :mobile
register_svg_icon "sticky-note" if respond_to?(:register_svg_icon)
load File.expand_path('../app/note_store.rb', __FILE__)
PLUGIN_NAME ||= 'Personal Notes'
after_initialize do
require_dependency 'user'
load File.expand_path('../app/controllers/personal_notes_controller.rb', __FILE__)
load File.expand_path('../app/controllers/notes_controller.rb', __FILE__)
Discourse::Application.routes.append do
# Map the path `/notebook` to `NotebookController`’s `index` method
get '/personal_notes' => 'personal_notes#index'
get '/notes' => 'notes#index'
put '/notes/:note_id' => 'notes#update'
delete '/notes/:note_id' => 'notes#destroy'
end
end