FEATURE: Reverse the order in which the notes are displayed

FEATURE: Reverse the order in which the notes are displayed

Attach note panel now appears at the top

diff --git a/assets/javascripts/discourse/controllers/staff-notes.js.es6 b/assets/javascripts/discourse/controllers/staff-notes.js.es6
index db1bc55..5706271 100644
--- a/assets/javascripts/discourse/controllers/staff-notes.js.es6
+++ b/assets/javascripts/discourse/controllers/staff-notes.js.es6
@@ -44,7 +44,7 @@ export default Ember.Controller.extend({
         .save(args)
         .then(() => {
           this.set("newNote", "");
-          this.get("model").pushObject(note);
+          this.get("model").insertAt(0, note);
           this._refreshCount();
         })
         .catch(popupAjaxError)
diff --git a/assets/javascripts/discourse/templates/modal/staff-notes.hbs b/assets/javascripts/discourse/templates/modal/staff-notes.hbs
index 3e86c59..7d198a1 100644
--- a/assets/javascripts/discourse/templates/modal/staff-notes.hbs
+++ b/assets/javascripts/discourse/templates/modal/staff-notes.hbs
@@ -1,4 +1,8 @@
 {{#d-modal-body class="staff-notes-modal"}}
+  {{textarea value=newNote}}
+  {{d-button action="attachNote" label="staff_notes.attach" class="btn-primary" disabled=attachDisabled}}
+  <hr/>
+
   {{#each model as |n|}}
     <div class='staff-note'>
       <div class='posted-by'>
@@ -35,7 +39,4 @@
       <div class='clearfix'></div>
     </div>
   {{/each}}
-
-  {{textarea value=newNote}}
-  {{d-button action="attachNote" label="staff_notes.attach" class="btn-primary" disabled=attachDisabled}}
 {{/d-modal-body}}
diff --git a/plugin.rb b/plugin.rb
index d7cc5cb..8dcae84 100644
--- a/plugin.rb
+++ b/plugin.rb
@@ -140,7 +140,7 @@ after_initialize do
       notes = ::DiscourseStaffNotes.notes_for(params[:user_id])
       render json: {
         extras: { username: user.username },
-        staff_notes: create_json(notes)
+        staff_notes: create_json(notes.reverse)
       }
     end

GitHub sha: 75bdf8ee