DataInventory

Details

diff --git a/app/Controllers/Http/ElementNoteController.js b/app/Controllers/Http/ElementNoteController.js
new file mode 100644
index 0000000..2d3bfe8
--- /dev/null
+++ b/app/Controllers/Http/ElementNoteController.js
@@ -0,0 +1,93 @@
+'use strict'
+
+/** @typedef {import('@adonisjs/framework/src/Request')} Request */
+/** @typedef {import('@adonisjs/framework/src/Response')} Response */
+/** @typedef {import('@adonisjs/framework/src/View')} View */
+
+/**
+ * Resourceful controller for interacting with elementnotes
+ */
+class ElementNoteController {
+  /**
+   * Show a list of all elementnotes.
+   * GET elementnotes
+   *
+   * @param {object} ctx
+   * @param {Request} ctx.request
+   * @param {Response} ctx.response
+   * @param {View} ctx.view
+   */
+  async index ({ request, response, view }) {
+  }
+
+  /**
+   * Render a form to be used for creating a new elementnote.
+   * GET elementnotes/create
+   *
+   * @param {object} ctx
+   * @param {Request} ctx.request
+   * @param {Response} ctx.response
+   * @param {View} ctx.view
+   */
+  async create ({ request, response, view }) {
+  }
+
+  /**
+   * Create/save a new elementnote.
+   * POST elementnotes
+   *
+   * @param {object} ctx
+   * @param {Request} ctx.request
+   * @param {Response} ctx.response
+   */
+  async store ({ request, response }) {
+  }
+
+  /**
+   * Display a single elementnote.
+   * GET elementnotes/:id
+   *
+   * @param {object} ctx
+   * @param {Request} ctx.request
+   * @param {Response} ctx.response
+   * @param {View} ctx.view
+   */
+  async show ({ params, request, response, view }) {
+  }
+
+  /**
+   * Render a form to update an existing elementnote.
+   * GET elementnotes/:id/edit
+   *
+   * @param {object} ctx
+   * @param {Request} ctx.request
+   * @param {Response} ctx.response
+   * @param {View} ctx.view
+   */
+  async edit ({ params, request, response, view }) {
+  }
+
+  /**
+   * Update elementnote details.
+   * PUT or PATCH elementnotes/:id
+   *
+   * @param {object} ctx
+   * @param {Request} ctx.request
+   * @param {Response} ctx.response
+   */
+  async update ({ params, request, response }) {
+  }
+
+  /**
+   * Delete a elementnote with id.
+   * DELETE elementnotes/:id
+   *
+   * @param {object} ctx
+   * @param {Request} ctx.request
+   * @param {Response} ctx.response
+   */
+  async destroy ({ params, request, response }) {
+  }
+}
+
+module.exports = ElementNoteController
diff --git a/app/Models/Contact.js b/app/Models/Contact.js
index 2f921c4..38eafac 100644
--- a/app/Models/Contact.js
+++ b/app/Models/Contact.js
@@ -5,10 +5,18 @@ const Model = use('Model')
 
 class Contact extends Model {
 
+  static get computed () {
+    return ['fullname']
+  }
+
   organization() {
     return this.belongsTo('App/Models/Organization')
   }
 
+  getFullname ({first_name, last_name}) {
+    return `${first_name} ${last_name}`
+  }
+
 }
 
 module.exports = Contact
diff --git a/resources/views/layouts/main.edge b/resources/views/layouts/main.edge
index 43d5950..5405875 100644
--- a/resources/views/layouts/main.edge
+++ b/resources/views/layouts/main.edge
@@ -14,7 +14,7 @@
     {{ script(APP_URL() + '/js/cash.js') }}
     @!section('head')
 </head>
-<body class='container'>
+<body style="margin: 10px">
   <div class="content">
     <nav class="navbar" role="navigation" aria-label="main navigation">
       <div class="navbar-brand">
diff --git a/resources/views/submissions/index.edge b/resources/views/submissions/index.edge
index dd88945..4cd8f78 100644
--- a/resources/views/submissions/index.edge
+++ b/resources/views/submissions/index.edge
@@ -2,44 +2,60 @@
 
 @section('content')
 
-<h1 class="is-size03">Submissions</h1>
+<h1 class="is-size-3">Data Submissions</h1>
 
 <p>There are {{ submissions.length }} total submissions.</p>
 
-<section class="box">
-  <table class="table">
-    <thead class="thead">
-      <tr>
-        <th>Name</th>
-        <th>Element</th>
-        <th>Theme</th>
-        <th>Date Created</th>
-        <th>Date Published</th>
-        <th>Status</th>
-        <th>Action</th>
-      </tr>
-    </thead>
-    <tbody class="tbody">
-      @each(submission in submissions)
-      <tr valign="middle">
-        <td>{{ submission.name }}</td>
-        <td>{{ submission.element.name }}</td>
-        <td>{{ submission.element.theme.name }}</td>
-        <td>{{ TO_LOCALE(submission.creation_date)}}</td>
-        <td>{{ TO_LOCALE(submission.published_date)}}</td>
-        <td>{{ submission.status.status }}</td>
-        <td>
+@each(submission in submissions)
+<section class="box"> 
+
+  <section>
+    <h2 class="is-size-4 is-marginless">
+      {{ submission.name }} 
+      <span class="is-pulled-right">
+        <span class="tag">T: {{ submission.element.theme.name }}</span>
+        <span class="tag">E: {{ submission.element.name }}</span>
+      </span>
+    </h2>
+  </section>
+
+  <hr style="margin: 8px"/>
+
+  <section class="columns is-marginless">
+    <div class="column is-8">
+      <p>
+        A submission for {{ submission.element.name }} was received on {{ TO_LOCALE(submission.upload_date) }} 
+        from {{ submission.steward.contact.fullname }}.
+      </p>
+      <p>
+        Current Status: <span class="tag">{{ submission.status.status }}</span>
+      </p>
+      <p class="is-size-7">
+        Submission Added: {{ submission.created_at}}
+      </p>
+      <p class="is-size-7">
+        Last Modified: {{ submission.updated_at}}
+      </p>
+    </div>
+    <div class ="column is-4">
+      <ul class="is-marginless" style="list-style: none">
+        <li>      
+          <a href="{{APP_URL() + route('/submissions.view', { id: submission.id })}}" class="button is-small is-fullwidth is-info">View Submission</a>
+        </li>
+        <li>
+          <a href="{{APP_URL() + route('/submissions.edit', { id: submission.id })}}" class="button is-small is-fullwidth is-warning">Edit Submission</a>
+        </li>
+        <li>
           <form action="{{ APP_URL() + route('/submissions.destroy', { id: submission.id }) + '?_method=DELETE'}}" method="post">
             {{ csrfField() }}
-            <button type="submit" name="button" class="is-small button is-danger" onclick="return confirm('Are you sure you want to delete this theme?');">Delete</button>
-            &nbsp;
-            <a href="{{APP_URL() + route('/submissions.edit', { id: submission.id })}}" class="button is-small is-warning">Edit</a>
+            <button type="submit" name="button" class="button is-small is-fullwidth is-danger" onclick="return confirm('Are you sure you want to delete this submission?');">Delete Submission</button>
           </form>
-        </td>
-      </tr>
-      @endeach
-    </tbody>
-  </table>
+        </li>
+      </ul>
+    </div>
+  </section>
+
 </section>
+@endeach
 
 @endsection
\ No newline at end of file