DataInventory
Changes
package.json 2(+1 -1)
resources/views/contacts/create.edge 4(+2 -2)
resources/views/contacts/index.edge 4(+2 -2)
resources/views/elements/create.edge 4(+2 -2)
resources/views/elements/edit.edge 4(+2 -2)
resources/views/elements/index.edge 6(+3 -3)
resources/views/inc/nav.edge 24(+12 -12)
resources/views/index.edge 2(+1 -1)
resources/views/layouts/main.edge 10(+5 -5)
resources/views/status/create.edge 4(+2 -2)
resources/views/status/index.edge 4(+2 -2)
resources/views/stewards/create.edge 4(+2 -2)
resources/views/stewards/index.edge 4(+2 -2)
resources/views/themes/create.edge 4(+2 -2)
resources/views/themes/edit.edge 4(+2 -2)
resources/views/themes/index.edge 6(+3 -3)
start/hooks.js 10(+10 -0)
start/routes.js 3(+2 -1)
web.config 13(+13 -0)
Details
diff --git a/app/Controllers/Http/ContactController.js b/app/Controllers/Http/ContactController.js
index 7e14448..5297329 100644
--- a/app/Controllers/Http/ContactController.js
+++ b/app/Controllers/Http/ContactController.js
@@ -6,6 +6,7 @@
const Contact = use('App/Models/Contact')
const Organization = use('App/Models/Organization')
const { validate } = use('Validator')
+const Env = use('Env')
/**
* Resourceful controller for interacting with contacts
@@ -76,7 +77,7 @@ class ContactController {
await Contact.create(data)
- return response.redirect('/contacts')
+ return response.redirect(Env.get('APP_URL') + '/contacts')
}
/**
@@ -126,7 +127,7 @@ class ContactController {
const contact = await Contact.findOrFail(params.id)
await contact.delete()
- return response.redirect('/contacts')
+ return response.redirect(Env.get('APP_URL') + '/contacts')
}
}
diff --git a/app/Controllers/Http/ElementController.js b/app/Controllers/Http/ElementController.js
index 528040e..99c36e6 100644
--- a/app/Controllers/Http/ElementController.js
+++ b/app/Controllers/Http/ElementController.js
@@ -6,6 +6,7 @@
const Element = use('App/Models/Element')
const Theme = use('App/Models/Theme')
const { validate, validateAll } = use('Validator')
+const Env = use('Env')
/**
* Resourceful controller for interacting with elements
@@ -73,7 +74,7 @@ class ElementController {
await Element.create(data)
- return response.redirect('/elements')
+ return response.redirect(Env.get('APP_URL') + '/elements')
}
/**
@@ -145,7 +146,7 @@ class ElementController {
element.merge(data)
await element.save()
- return response.redirect('/elements')
+ return response.redirect(Env.get('APP_URL') + '/elements')
}
/**
@@ -160,7 +161,7 @@ class ElementController {
const element = await Element.findOrFail(params.id)
await element.delete()
- return response.redirect('/elements')
+ return response.redirect(Env.get('APP_URL') + '/elements')
}
}
diff --git a/app/Controllers/Http/OrganizationController.js b/app/Controllers/Http/OrganizationController.js
index bf26895..1dfd0ae 100644
--- a/app/Controllers/Http/OrganizationController.js
+++ b/app/Controllers/Http/OrganizationController.js
@@ -6,6 +6,7 @@
const Organization = use('App/Models/Organization')
const Type = use('App/Models/OrganizationType')
const { validate } = use('Validator')
+const Env = use('Env')
/**
* Resourceful controller for interacting with organizations
@@ -75,7 +76,7 @@ class OrganizationController {
await Organization.create(data)
- return response.redirect('/organizations')
+ return response.redirect(Env.get('APP_URL') + '/organizations')
}
@@ -126,7 +127,7 @@ class OrganizationController {
const organization = await Organization.findOrFail(params.id)
await organization.delete()
- return response.redirect('/organizations')
+ return response.redirect(Env.get('APP_URL') + '/organizations')
}
}
diff --git a/app/Controllers/Http/OrganizationTypeController.js b/app/Controllers/Http/OrganizationTypeController.js
index c44b6f5..d8fa09b 100644
--- a/app/Controllers/Http/OrganizationTypeController.js
+++ b/app/Controllers/Http/OrganizationTypeController.js
@@ -5,6 +5,7 @@
/** @typedef {import('@adonisjs/framework/src/View')} View */
const OrganizationType = use('App/Models/OrganizationType')
const { validate } = use('Validator')
+const Env = use('Env')
/**
* Resourceful controller for interacting with organizationtypes
@@ -64,7 +65,7 @@ class OrganizationTypeController {
await OrganizationType.create(data)
- return response.redirect('/organization_types')
+ return response.redirect(Env.get('APP_URL') + '/organization_types')
}
/**
@@ -114,7 +115,7 @@ class OrganizationTypeController {
const type = await OrganizationType.findOrFail(params.id)
await type.delete()
- return response.redirect('/organization_types')
+ return response.redirect(Env.get('APP_URL') + '/organization_types')
}
}
diff --git a/app/Controllers/Http/StatusController.js b/app/Controllers/Http/StatusController.js
index 10d52fe..feced1e 100644
--- a/app/Controllers/Http/StatusController.js
+++ b/app/Controllers/Http/StatusController.js
@@ -5,7 +5,7 @@
/** @typedef {import('@adonisjs/framework/src/View')} View */
const Status = use('App/Models/Status')
const { validate } = use('Validator')
-
+const Env = use('Env')
/**
* Resourceful controller for interacting with statuses
*/
@@ -65,7 +65,7 @@ class StatusController {
await Status.create(data)
- return response.redirect('/status')
+ return response.redirect(Env.get('APP_URL') + '/status')
}
diff --git a/app/Controllers/Http/StewardController.js b/app/Controllers/Http/StewardController.js
index dcd75ba..cbe85bd 100644
--- a/app/Controllers/Http/StewardController.js
+++ b/app/Controllers/Http/StewardController.js
@@ -7,6 +7,7 @@ const Steward = use('App/Models/Steward')
const Contact = use('App/Models/Contact')
const Element = use('App/Models/Element')
const { validate } = use('Validator')
+const Env = use('Env')
/**
* Resourceful controller for interacting with stewards
@@ -68,7 +69,7 @@ class StewardController {
var steward = await Steward.create(data)
await steward.elements().attach([element])
- return response.redirect('/stewards')
+ return response.redirect(Env.get('APP_URL') + '/stewards')
}
@@ -120,7 +121,7 @@ class StewardController {
await steward.elements().detach()
await steward.delete()
- return response.redirect('/stewards')
+ return response.redirect(Env.get('APP_URL') + '/stewards')
}
}
diff --git a/app/Controllers/Http/SubmissionController.js b/app/Controllers/Http/SubmissionController.js
index a4568fa..f2d6cc3 100644
--- a/app/Controllers/Http/SubmissionController.js
+++ b/app/Controllers/Http/SubmissionController.js
@@ -9,6 +9,7 @@ const Element = use('App/Models/Element')
const Steward = use('App/Models/Steward')
const Status = use('App/Models/Status')
const { validate } = use('Validator')
+const Env = use('Env')
/**
* Resourceful controller for interacting with submissions
@@ -73,7 +74,7 @@ class SubmissionController {
await Submission.create(data)
- return response.redirect('/submissions')
+ return response.redirect(Env.get('APP_URL') + '/submissions')
}
/**
diff --git a/app/Controllers/Http/ThemeController.js b/app/Controllers/Http/ThemeController.js
index 45993c3..117d7d6 100644
--- a/app/Controllers/Http/ThemeController.js
+++ b/app/Controllers/Http/ThemeController.js
@@ -6,6 +6,7 @@
const Theme = use('App/Models/Theme')
const { validate, validateAll } = use('Validator')
+const Env = use('Env')
/**
* Resourceful controller for interacting with themes
@@ -66,7 +67,7 @@ class ThemeController {
await Theme.create(data)
- return response.redirect('/themes')
+ return response.redirect(Env.get('APP_URL') + '/themes')
}
@@ -134,7 +135,7 @@ class ThemeController {
theme.merge(data)
await theme.save()
- return response.redirect('/themes')
+ return response.redirect(Env.get('APP_URL') + '/themes')
}
/**
@@ -149,7 +150,7 @@ class ThemeController {
const theme = await Theme.findOrFail(params.id)
await theme.delete()
- return response.redirect('/themes')
+ return response.redirect(Env.get('APP_URL') + '/themes')
}
}
package.json 2(+1 -1)
diff --git a/package.json b/package.json
index 9cb4309..b3aa917 100644
--- a/package.json
+++ b/package.json
@@ -27,7 +27,7 @@
"@adonisjs/session": "^1.0.27",
"@adonisjs/shield": "^1.0.8",
"@adonisjs/validator": "^5.0.6",
- "pg": "^7.14.0"
+ "sqlite3": "^4.1.1"
},
"devDependencies": {},
"autoload": {
resources/views/contacts/create.edge 4(+2 -2)
diff --git a/resources/views/contacts/create.edge b/resources/views/contacts/create.edge
index 0eba3c3..1e91809 100644
--- a/resources/views/contacts/create.edge
+++ b/resources/views/contacts/create.edge
@@ -2,7 +2,7 @@
@section('content')
-<form method="POST" action="{{ route('/contacts.store') }}">
+<form method="POST" action="{{ APP_URL() + route('/contacts.store') }}">
{{ csrfField() }}
<div class="field">
<label class="label">First Name</label>
@@ -45,7 +45,7 @@
<button class="button is-link ss-submit" type="submit">Submit</button>
</div>
<div class="control">
- <button class="button is-text"><a href="{{ route('/contacts.index') }}">Cancel</a></button>
+ <button class="button is-text"><a href="{{ APP_URL() + route('/contacts.index') }}">Cancel</a></button>
</div>
</div>
<!--
resources/views/contacts/index.edge 4(+2 -2)
diff --git a/resources/views/contacts/index.edge b/resources/views/contacts/index.edge
index 9bcbd38..ed70986 100644
--- a/resources/views/contacts/index.edge
+++ b/resources/views/contacts/index.edge
@@ -5,7 +5,7 @@
<section class="box is-full-width">
<h3 class="is-size-3">Contact Actions</h3>
<ul>
- <li><a href="{{ route('/contacts/create') }}">Add Contact</a></li>
+ <li><a href="{{ APP_URL() + route('/contacts/create') }}">Add Contact</a></li>
</ul>
</section>
@@ -32,7 +32,7 @@
<td>{{ contact.email}}</td>
<td>{{ contact.phone }}</td>
<td>
- <form action="{{ route('/contacts.destroy', { id: contact.id }) + '?_method=DELETE'}}" method="post">
+ <form action="{{ APP_URL() + route('/contacts.destroy', { id: contact.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 contact?');">Delete</button>
</form>
resources/views/elements/create.edge 4(+2 -2)
diff --git a/resources/views/elements/create.edge b/resources/views/elements/create.edge
index 0808db7..7bfa983 100644
--- a/resources/views/elements/create.edge
+++ b/resources/views/elements/create.edge
@@ -2,7 +2,7 @@
@section('content')
-<form method="POST" action="{{ route('/elements.store') }}">
+<form method="POST" action="{{ APP_URL() + route('/elements.store') }}">
{{ csrfField() }}
<div class="field">
<label class="label">Element Name</label>
@@ -39,7 +39,7 @@
<button class="button is-link ss-submit" type="submit">Submit</button>
</div>
<div class="control">
- <button class="button is-text"><a href="{{ route('/themes.index') }}">Cancel</a></button>
+ <button class="button is-text"><a href="{{ APP_URL() + route('/themes.index') }}">Cancel</a></button>
</div>
</div>
<!--
resources/views/elements/edit.edge 4(+2 -2)
diff --git a/resources/views/elements/edit.edge b/resources/views/elements/edit.edge
index c2cd8bc..1a2bcf5 100644
--- a/resources/views/elements/edit.edge
+++ b/resources/views/elements/edit.edge
@@ -1,7 +1,7 @@
@layout('layouts.main')
@section('content')
-<form method="POST" action="{{ route('/elements.update', {id: element.id}) + '?_method=PUT'}}">
+<form method="POST" action="{{ APP_URL() + route('/elements.update', {id: element.id}) + '?_method=PUT'}}">
{{ csrfField() }}
<div class="field">
<label class="label">Element Name</label>
@@ -37,7 +37,7 @@
<button class="button is-link ss-submit" type="submit">Submit</button>
</div>
<div class="control">
- <button class="button is-text"><a href="{{ route('/elements.index') }}">Cancel</a></button>
+ <button class="button is-text"><a href="{{ APP_URL() + route('/elements.index') }}">Cancel</a></button>
</div>
</div>
</form>
resources/views/elements/index.edge 6(+3 -3)
diff --git a/resources/views/elements/index.edge b/resources/views/elements/index.edge
index ae2a120..24186bd 100644
--- a/resources/views/elements/index.edge
+++ b/resources/views/elements/index.edge
@@ -5,7 +5,7 @@
<section class="box is-full-width">
<h3 class="is-size-3">Element Actions</h3>
<ul>
- <li><a href="{{ route('/elements/create') }}">Add Element</a></li>
+ <li><a href="{{ APP_URL() + route('/elements/create') }}">Add Element</a></li>
</ul>
</section>
@@ -30,11 +30,11 @@
<td>{{ element.priority }}</td>
<td>{{ element.refresh_rate }}</td>
<td>
- <form action="{{ route('/elements.destroy', { id: element.id }) + '?_method=DELETE'}}" method="post">
+ <form action="{{ APP_URL() + route('/elements.destroy', { id: element.id }) + '?_method=DELETE'}}" method="post">
{{ csrfField() }}
<button type="submit" name="button" class="is-small button is-danger is-pulled-left" onclick="return confirm('Are you sure you want to delete this element?');">Delete</button>
- <a href="{{route('/elements.edit', { id: element.id })}}" class="button is-small is-warning">Edit</a>
+ <a href="{{APP_URL() + route('/elements.edit', { id: element.id })}}" class="button is-small is-warning">Edit</a>
</form>
</td>
</tr>
resources/views/inc/nav.edge 24(+12 -12)
diff --git a/resources/views/inc/nav.edge b/resources/views/inc/nav.edge
index 0447eb1..7cb25df 100644
--- a/resources/views/inc/nav.edge
+++ b/resources/views/inc/nav.edge
@@ -2,10 +2,10 @@
<h2 class="is-size-5">Data Submissions</h2>
<ul>
<li>
- <a href="{{ route('/submissions.create') }}">(+) Add Submission</a>
+ <a href="{{ APP_URL() + route('/submissions.create') }}">(+) Add Submission</a>
</li>
<li>
- <a href="{{ route('/submissions.index') }}">View Submissions</a>
+ <a href="{{ APP_URL() + route('/submissions.index') }}">View Submissions</a>
</li>
</ul>
</section>
@@ -13,13 +13,13 @@
<h2 class="is-size-5">Reporting</h2>
<ul>
<li>
- <a href="/">Database Diagram</a>
+ <a href="{{APP_URL()}}">Database Diagram</a>
</li>
<li>
- <a href="{{route('datasets')}}">Datasets</a>
+ <a href="{{APP_URL() + route('datasets')}}">Datasets</a>
</li>
<li>
- <a href="{{route('dashboard')}}">Dashboard</a>
+ <a href="{{APP_URL() + route('dashboard')}}">Dashboard</a>
</li>
</ul>
</section>
@@ -28,25 +28,25 @@
<h2 class="is-size-5">Admin Links</h2>
<ul>
<li>
- <a href="{{ route('/themes.index') }}">Themes</a>
+ <a href="{{ APP_URL() + route('/themes.index') }}">Themes</a>
</li>
<li>
- <a href="{{ route('/elements.index') }}">Elements</a>
+ <a href="{{ APP_URL() + route('/elements.index') }}">Elements</a>
</li>
<li>
- <a href="{{ route('/contacts.index') }}">Contacts</a>
+ <a href="{{ APP_URL() + route('/contacts.index') }}">Contacts</a>
</li>
<li>
- <a href="{{ route('/organizations.index') }}">Organizations</a>
+ <a href="{{ APP_URL() + route('/organizations.index') }}">Organizations</a>
</li>
<li>
- <a href="{{ route('/organization_types.index') }}">Organization Types</a>
+ <a href="{{ APP_URL() + route('/organization_types.index') }}">Organization Types</a>
</li>
<li>
- <a href="{{ route('/stewards.index') }}">Stewards</a>
+ <a href="{{ APP_URL() + route('/stewards.index') }}">Stewards</a>
</li>
<li>
- <a href="{{ route('/status.index') }}">Submission Status</a>
+ <a href="{{ APP_URL() + route('/status.index') }}">Submission Status</a>
</li>
</ul>
</section>
resources/views/index.edge 2(+1 -1)
diff --git a/resources/views/index.edge b/resources/views/index.edge
index 5413dbb..b966756 100644
--- a/resources/views/index.edge
+++ b/resources/views/index.edge
@@ -3,6 +3,6 @@
@section('content')
<a href="https://dbdiagram.io/d/5dd2d095edf08a25543e1166" target="_blank">Interactive DB Diagram</a>
-<img src="{{assetsUrl('db_diagram.png')}}" alt="DB Diagram">
+<img src="{{APP_URL() + assetsUrl('db_diagram.png')}}" alt="DB Diagram">
@endsection
\ No newline at end of file
resources/views/layouts/main.edge 10(+5 -5)
diff --git a/resources/views/layouts/main.edge b/resources/views/layouts/main.edge
index ffb225a..84ec3c0 100644
--- a/resources/views/layouts/main.edge
+++ b/resources/views/layouts/main.edge
@@ -6,10 +6,10 @@
<meta name="description" content="ArcGIS Online Configuration Backups for Versioning and Recovery">
<meta name="keywords" content="arcgis, backup, arcgis online, esri, recovery, versioning, tool, agol">
<title>navigatOR Data Inventory Tracking</title>
- {{ style('css/bulma.min.css') }}
- {{ style('css/main.css') }}
- {{ script('js/chart.js') }}
- {{ script('js/cash.js') }}
+ {{ style(APP_URL() + '/css/bulma.min.css') }}
+ {{ style(APP_URL() + '/css/main.css') }}
+ {{ script(APP_URL() + '/js/chart.js') }}
+ {{ script(APP_URL() + '/js/cash.js') }}
@!section('head')
</head>
<body class='container'>
@@ -17,7 +17,7 @@
<nav class="navbar" role="navigation" aria-label="main navigation">
<div class="navbar-brand">
<a class="navbar-item" href="/">
- <img src="{{ assetsUrl('logo.png') }}"" alt="Bulma: Free, open source, and modern CSS framework based on Flexbox" width="40" height="100%"> Oregon Geospatial Enterprise Office - Data Inventory Tracking
+ <img src="{{ APP_URL() + assetsUrl('logo.png') }}"" alt="Bulma: Free, open source, and modern CSS framework based on Flexbox" width="40" height="100%"> Oregon Geospatial Enterprise Office - Data Inventory Tracking
</a>
<a role="button" class="navbar-burger" aria-label="menu" aria-expanded="false">
diff --git a/resources/views/organization_types/create.edge b/resources/views/organization_types/create.edge
index 1b1a804..40331d3 100644
--- a/resources/views/organization_types/create.edge
+++ b/resources/views/organization_types/create.edge
@@ -2,7 +2,7 @@
@section('content')
-<form method="POST" action="{{ route('/organization_types.store') }}">
+<form method="POST" action="{{ APP_URL() + route('/organization_types.store') }}">
{{ csrfField() }}
<div class="field">
<label class="label">Organization Type</label>
@@ -15,7 +15,7 @@
<button class="button is-link ss-submit" type="submit">Submit</button>
</div>
<div class="control">
- <button class="button is-text"><a href="{{ route('/organization_types.index') }}">Cancel</a></button>
+ <button class="button is-text"><a href="{{ APP_URL() + route('/organization_types.index') }}">Cancel</a></button>
</div>
</div>
<!--
diff --git a/resources/views/organization_types/index.edge b/resources/views/organization_types/index.edge
index 14492a3..6d82388 100644
--- a/resources/views/organization_types/index.edge
+++ b/resources/views/organization_types/index.edge
@@ -5,7 +5,7 @@
<section class="box is-full-width">
<h3 class="is-size-3">Organization Type Actions</h3>
<ul>
- <li><a href="{{ route('/organization_types/create') }}">Add Organization Type</a></li>
+ <li><a href="{{ APP_URL() + route('/organization_types/create') }}">Add Organization Type</a></li>
</ul>
</section>
@@ -24,7 +24,7 @@
<tr>
<td>{{ type.type }}</td>
<td>
- <form action="{{ route('/orgnization_types.destroy', { id: type.id }) + '?_method=DELETE'}}" method="post">
+ <form action="{{ APP_URL() + route('/orgnization_types.destroy', { id: type.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 organization type?');">Delete</button>
</form>
diff --git a/resources/views/organizations/create.edge b/resources/views/organizations/create.edge
index da99eab..5a1591f 100644
--- a/resources/views/organizations/create.edge
+++ b/resources/views/organizations/create.edge
@@ -2,7 +2,7 @@
@section('content')
-<form method="POST" action="{{ route('/organizations.store') }}">
+<form method="POST" action="{{ APP_URL() + route('/organizations.store') }}">
{{ csrfField() }}
<div class="field">
<label class="label">Organization Name</label>
@@ -39,7 +39,7 @@
<button class="button is-link ss-submit" type="submit">Submit</button>
</div>
<div class="control">
- <button class="button is-text"><a href="{{ route('/themes.index') }}">Cancel</a></button>
+ <button class="button is-text"><a href="{{ APP_URL() + route('/themes.index') }}">Cancel</a></button>
</div>
</div>
<!--
diff --git a/resources/views/organizations/index.edge b/resources/views/organizations/index.edge
index 9a81cc5..a5248dc 100644
--- a/resources/views/organizations/index.edge
+++ b/resources/views/organizations/index.edge
@@ -5,7 +5,7 @@
<section class="box is-full-width">
<h3 class="is-size-3">Organization Actions</h3>
<ul>
- <li><a href="{{ route('/organizations/create') }}">Add Organization</a></li>
+ <li><a href="{{ APP_URL() + route('/organizations/create') }}">Add Organization</a></li>
</ul>
</section>
@@ -30,7 +30,7 @@
<td>{{ organization.phone }}</td>
<td>{{ organization.type.type }}</td>
<td>
- <form action="{{ route('/organizations.destroy', { id: organization.id }) + '?_method=DELETE'}}" method="post">
+ <form action="{{ APP_URL() + route('/organizations.destroy', { id: organization.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>
</form>
resources/views/status/create.edge 4(+2 -2)
diff --git a/resources/views/status/create.edge b/resources/views/status/create.edge
index 9563200..af4ccc8 100644
--- a/resources/views/status/create.edge
+++ b/resources/views/status/create.edge
@@ -2,7 +2,7 @@
@section('content')
-<form method="POST" action="{{ route('/status.store') }}">
+<form method="POST" action="{{ APP_URL() + route('/status.store') }}">
{{ csrfField() }}
<div class="field">
<label class="label">Status Title</label>
@@ -15,7 +15,7 @@
<button class="button is-link ss-submit" type="submit">Submit</button>
</div>
<div class="control">
- <button class="button is-text"><a href="{{ route('/status.index') }}">Cancel</a></button>
+ <button class="button is-text"><a href="{{ APP_URL() + route('/status.index') }}">Cancel</a></button>
</div>
</div>
<!--
resources/views/status/index.edge 4(+2 -2)
diff --git a/resources/views/status/index.edge b/resources/views/status/index.edge
index 5e4e2f6..ab469a9 100644
--- a/resources/views/status/index.edge
+++ b/resources/views/status/index.edge
@@ -5,7 +5,7 @@
<section class="box is-full-width">
<h3 class="is-size-3">Submission Status Actions</h3>
<ul>
- <li><a href="{{ route('/status/create') }}">Add Status</a></li>
+ <li><a href="{{ APP_URL() + route('/status/create') }}">Add Status</a></li>
</ul>
</section>
@@ -24,7 +24,7 @@
<tr>
<td>{{ status.status }}</td>
<td>
- <form action="{{ route('/status.destroy', { id: status.id }) + '?_method=DELETE'}}" method="post">
+ <form action="{{ APP_URL() + route('/status.destroy', { id: status.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 status?');">Delete</button>
</form>
resources/views/stewards/create.edge 4(+2 -2)
diff --git a/resources/views/stewards/create.edge b/resources/views/stewards/create.edge
index 2611ebc..27aff11 100644
--- a/resources/views/stewards/create.edge
+++ b/resources/views/stewards/create.edge
@@ -2,7 +2,7 @@
@section('content')
-<form method="POST" action="{{ route('/stewards.store') }}">
+<form method="POST" action="{{ APP_URL() + route('/stewards.store') }}">
{{ csrfField() }}
<div class="field">
<label class="label">Contact</label>
@@ -33,7 +33,7 @@
<button class="button is-link ss-submit" type="submit">Submit</button>
</div>
<div class="control">
- <button class="button is-text"><a href="{{ route('/stewards.index') }}">Cancel</a></button>
+ <button class="button is-text"><a href="{{ APP_URL() + route('/stewards.index') }}">Cancel</a></button>
</div>
</div>
<!--
resources/views/stewards/index.edge 4(+2 -2)
diff --git a/resources/views/stewards/index.edge b/resources/views/stewards/index.edge
index f2c5a2b..3b7f153 100644
--- a/resources/views/stewards/index.edge
+++ b/resources/views/stewards/index.edge
@@ -5,7 +5,7 @@
<section class="box is-full-width">
<h3 class="is-size-3">Steward Actions</h3>
<ul>
- <li><a href="{{ route('/stewards/create') }}">Add Steward</a></li>
+ <li><a href="{{ APP_URL() + route('/stewards/create') }}">Add Steward</a></li>
</ul>
</section>
@@ -28,7 +28,7 @@
<td>{{ steward.contact.first_name }} {{ steward.contact.last_name }}</td>
<td>{{ steward.contact.email }}</td>
<td>
- <form action="{{ route('/stewards.destroy', { id: steward.id }) + '?_method=DELETE'}}" method="post">
+ <form action="{{ APP_URL() + route('/stewards.destroy', { id: steward.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>
</form>
diff --git a/resources/views/submissions/create.edge b/resources/views/submissions/create.edge
index 942e826..008c07f 100644
--- a/resources/views/submissions/create.edge
+++ b/resources/views/submissions/create.edge
@@ -2,7 +2,7 @@
@section('content')
-<form method="POST" action="{{ route('/submissions.store') }}">
+<form method="POST" action="{{ APP_URL() + route('/submissions.store') }}">
{{ csrfField() }}
<div class="field">
<label class="label">Name of Submission</label>
@@ -85,7 +85,7 @@
<button class="button is-link ss-submit" type="submit">Submit</button>
</div>
<div class="control">
- <button class="button is-text"><a href="{{ route('/submissions.index') }}">Cancel</a></button>
+ <button class="button is-text"><a href="{{ APP_URL() + route('/submissions.index') }}">Cancel</a></button>
</div>
</div>
<!--
diff --git a/resources/views/submissions/index.edge b/resources/views/submissions/index.edge
index 2afa3d7..769e872 100644
--- a/resources/views/submissions/index.edge
+++ b/resources/views/submissions/index.edge
@@ -39,7 +39,7 @@
<td>{{ submission.status.status }}</td>
@endif
<td>
- <form action="{{ route('/themes.destroy', { id: submission.id }) + '?_method=DELETE'}}" method="post">
+ <form action="{{ APP_URL() + route('/themes.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>
</form>
resources/views/themes/create.edge 4(+2 -2)
diff --git a/resources/views/themes/create.edge b/resources/views/themes/create.edge
index b7999fb..89f58cd 100644
--- a/resources/views/themes/create.edge
+++ b/resources/views/themes/create.edge
@@ -2,7 +2,7 @@
@section('content')
-<form method="POST" action="{{ route('/themes.store') }}">
+<form method="POST" action="{{ APP_URL() + route('/themes.store') }}">
{{ csrfField() }}
<div class="field">
<label class="label">Theme Name</label>
@@ -15,7 +15,7 @@
<button class="button is-link ss-submit" type="submit">Submit</button>
</div>
<div class="control">
- <button class="button is-text"><a href="{{ route('/themes.index') }}">Cancel</a></button>
+ <button class="button is-text"><a href="{{ APP_URL() + route('/themes.index') }}">Cancel</a></button>
</div>
</div>
<!--
resources/views/themes/edit.edge 4(+2 -2)
diff --git a/resources/views/themes/edit.edge b/resources/views/themes/edit.edge
index bbc7bcc..820a926 100644
--- a/resources/views/themes/edit.edge
+++ b/resources/views/themes/edit.edge
@@ -1,7 +1,7 @@
@layout('layouts.main')
@section('content')
-<form method="POST" action="{{ route('/themes.update', {id: theme.id}) + '?_method=PUT'}}">
+<form method="POST" action="{{ APP_URL() + route('/themes.update', {id: theme.id}) + '?_method=PUT'}}">
{{ csrfField() }}
<div class="field">
<label class="label">Theme Name</label>
@@ -14,7 +14,7 @@
<button class="button is-link ss-submit" type="submit">Modify</button>
</div>
<div class="control">
- <button class="button is-text"><a href="{{ route('/themes.index') }}">Cancel</a></button>
+ <button class="button is-text"><a href="{{ APP_URL() + route('/themes.index') }}">Cancel</a></button>
</div>
</div>
</form>
resources/views/themes/index.edge 6(+3 -3)
diff --git a/resources/views/themes/index.edge b/resources/views/themes/index.edge
index a8c7b75..32edcd7 100644
--- a/resources/views/themes/index.edge
+++ b/resources/views/themes/index.edge
@@ -5,7 +5,7 @@
<section class="box is-full-width">
<h3 class="is-size-3">Theme Actions</h3>
<ul>
- <li><a href="{{ route('/themes/create') }}">Add Theme</a></li>
+ <li><a href="{{ APP_URL() + route('/themes/create') }}">Add Theme</a></li>
</ul>
</section>
@@ -24,12 +24,12 @@
<tr>
<td>{{ theme.name }}</td>
<td>
- <form action="{{ route('/themes.destroy', { id: theme.id }) + '?_method=DELETE'}}" method="post">
+ <form action="{{ APP_URL() + route('/themes.destroy', { id: theme.id }) + '?_method=DELETE'}}" method="post">
{{ csrfField() }}
<button type="submit" name="button" class="is-small button is-danger is-pulled-left" onclick="return confirm('Are you sure you want to delete this theme?');">Delete</button>
</form>
- <a href="{{route('/themes.edit', { id: theme.id })}}" class="button is-small is-warning">Edit</a>
+ <a href="{{APP_URL() + route('/themes.edit', { id: theme.id })}}" class="button is-small is-warning">Edit</a>
</td>
</tr>
@endeach
start/hooks.js 10(+10 -0)
diff --git a/start/hooks.js b/start/hooks.js
new file mode 100644
index 0000000..601322c
--- /dev/null
+++ b/start/hooks.js
@@ -0,0 +1,10 @@
+const { hooks } = use('@adonisjs/ignitor')
+
+hooks.after.providersBooted(() => {
+ const Env = use('Env')
+ const View = use('View')
+
+ View.global('APP_URL', function () {
+ return Env.get('APP_URL')
+ })
+})
\ No newline at end of file
start/routes.js 3(+2 -1)
diff --git a/start/routes.js b/start/routes.js
index 5c6d96c..dcc9848 100644
--- a/start/routes.js
+++ b/start/routes.js
@@ -19,6 +19,7 @@ const Route = use('Route')
// Main routes
Route.on('/').render('index')
+
// Resource Routes (FULL CRUD)
Route.resource('/themes','ThemeController')
Route.resource('/elements', 'ElementController')
@@ -31,4 +32,4 @@ Route.resource('/submissions', 'SubmissionController')
// Individual routes
Route.get('/datasets', 'DatasetController.index').as('datasets')
-Route.get('/dashboard', 'DashboardController.index').as('dashboard')
\ No newline at end of file
+Route.get('/dashboard', 'DashboardController.index').as('dashboard')
web.config 13(+13 -0)
diff --git a/web.config b/web.config
new file mode 100644
index 0000000..7cd3bb8
--- /dev/null
+++ b/web.config
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<configuration>
+ <system.webServer>
+ <rewrite>
+ <rules>
+ <rule name="ReverseProxyInboundRule1" stopProcessing="true">
+ <match url="(.*)" />
+ <action type="Rewrite" url="http://localhost:3333/{R:1}" />
+ </rule>
+ </rules>
+ </rewrite>
+ </system.webServer>
+</configuration>