Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F117808142
D2476.1775275185.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Authored By
Unknown
Size
2 KB
Referenced Files
None
Subscribers
None
D2476.1775275185.diff
View Options
diff --git a/src/.gitignore b/src/.gitignore
--- a/src/.gitignore
+++ b/src/.gitignore
@@ -21,3 +21,4 @@
yarn-error.log
composer.lock
resources/countries.php
+resources/js/ts.js
diff --git a/src/resources/build/before.php b/src/resources/build/before.php
new file mode 100644
--- /dev/null
+++ b/src/resources/build/before.php
@@ -0,0 +1,9 @@
+<?php
+
+$rootDir = __DIR__ . '/../..';
+
+// Write build timestamp to a file that is then included by the vue components
+file_put_contents(
+ "{$rootDir}/resources/js/ts.js",
+ sprintf("export default new Date('%s')", date('c'))
+);
diff --git a/src/resources/vue/Widgets/Menu.vue b/src/resources/vue/Widgets/Menu.vue
--- a/src/resources/vue/Widgets/Menu.vue
+++ b/src/resources/vue/Widgets/Menu.vue
@@ -35,7 +35,7 @@
</li>
</ul>
<div v-if="mode == 'footer'" class="footer">
- <div id="footer-copyright">@ Apheleia IT AG, 2020</div>
+ <div id="footer-copyright">@ Apheleia IT AG, {{ buildYear }}</div>
<div v-if="footer" id="footer-company">{{ footer }}</div>
</div>
</div>
@@ -44,7 +44,14 @@
</template>
<script>
+ import buildDate from '../../js/ts.js'
+
export default {
+ data() {
+ return {
+ buildYear: buildDate.getFullYear()
+ }
+ },
props: {
mode: { type: String, default: 'header' },
footer: { type: String, default: '' }
diff --git a/src/tests/Browser/LogonTest.php b/src/tests/Browser/LogonTest.php
--- a/src/tests/Browser/LogonTest.php
+++ b/src/tests/Browser/LogonTest.php
@@ -22,7 +22,8 @@
$this->browse(function (Browser $browser) {
$browser->visit(new Home())
->within(new Menu(), function ($browser) {
- $browser->assertMenuItems(['signup', 'explore', 'blog', 'support', 'login']);
+ $browser->assertMenuItems(['signup', 'explore', 'blog', 'support', 'login'])
+ ->assertSeeIn('#footer-copyright', '@ Apheleia IT AG, ' . date('Y'));
});
if ($browser->isDesktop()) {
diff --git a/src/webpack.mix.js b/src/webpack.mix.js
--- a/src/webpack.mix.js
+++ b/src/webpack.mix.js
@@ -10,6 +10,7 @@
|
*/
+const { exec } = require('child_process');
const fs = require('fs');
const glob = require('glob');
const mix = require('laravel-mix');
@@ -22,6 +23,10 @@
}
})
+mix.before(() => {
+ exec('php resources/build/before.php')
+})
+
mix.js('resources/js/user.js', 'public/js').vue()
.js('resources/js/admin.js', 'public/js').vue()
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Apr 4, 3:59 AM (49 m, 24 s)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
18826192
Default Alt Text
D2476.1775275185.diff (2 KB)
Attached To
Mode
D2476: Use build year in the copyright footer
Attached
Detach File
Event Timeline