Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/signup rec iteration 6 #1656

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
2 changes: 1 addition & 1 deletion deploy/resources.build.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
define('DEBUG', true); // *** Shorter debugging constant name, set as false on live.
define('SERVER_ROOT', realpath(__DIR__) . '/'); // *** The root deployment directory of the game
// Generally for the install purposes the SERVER_ROOT should correspond to /srv/ninjawars/deploy/
define('WEB_ROOT', "http://localhost:8765/"); // *** The base URL used to access the game, http://www.ninjawars.net on live
define('WEB_ROOT', "http://localhost:8765/"); // *** The base URL used to access the game, https://www.ninjawars.net on live
define('ADMIN_EMAIL', "[email protected]"); // *** For logs/emailed errors.
define('SUPPORT_EMAIL', "[email protected]"); // *** For public questions.
define('SUPPORT_EMAIL_NAME', "Ninjawars Tchalvak");
Expand Down
6 changes: 5 additions & 1 deletion deploy/templates/bath-house.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,11 @@
<ul id='duel-log' style='overflow-y: auto;max-height:20rem;'>
{foreach item="duel" from=$duels}
<li>
{include file="player-link.tpl" username=$duel.attacker id=$duel.attacker_id} has dueled {include file="player-link.tpl" username=$duel.defender id=$duel.defender_id} and {if $duel.won}won{else}lost{/if} for {$duel.killpoints} killpoints on {$duel.date}
{include file="player-link.tpl" username=$duel.attacker id=$duel.attacker_id}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was cherry-picked in elsewhere.

has dueled
{include file="player-link.tpl" username=$duel.defender id=$duel.defender_id}
and {if $duel.won}<span class='text-success'>won</span>{else}<span class='text-danger'>lost</span>{/if}
for <strong>{$duel.killpoints}</strong> killpoints <time class='chat-time timeago' datetime='{$duel.date|escape}' title='{$duel.date|escape}'>{$duel.date|escape}</time>
</li>
{/foreach}
</ul>
Expand Down
3 changes: 2 additions & 1 deletion deploy/templates/dojo.reminder-level.tpl
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
<p>Your current level is {$player->level|escape}. Your current kills are {$player->kills|escape}.</p>
<p>Your current level is <strong class='level'>{$player->level|escape}</strong>. <br />
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This has been cherry-picked in to master elsewhere.

Your current kills are <strong class='kills'>{$player->kills|escape}</strong>.</p>
3 changes: 2 additions & 1 deletion deploy/templates/login.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
<div class='centered'>
<input tabindex=3 name="login_request" id='request-login' class='btn btn-vital' type="submit" value="Login">
</div>
<div class='centered'>
<div class='centered my-thick'>
<a tabindex=4 href='/assistance'>forgot?</a>
</div>
</div>
Expand All @@ -97,4 +97,5 @@
{* see https://www.google.com/recaptcha/admin/site/692084162/settings *}
<!-- See staff page for policy information. -->
<script src="https://www.recaptcha.net/recaptcha/api.js?render={$smarty.const.RECAPTCHA_SITE_KEY}"></script>
<script src='/js/login.js'></script>
</div>
12 changes: 9 additions & 3 deletions deploy/templates/selfmenu.partial.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@
{/if}
<li class="divider"></li>
{if $ninja->isAdmin()}
<li><a href='/ninjamaster'><button class='btn btn-default' type='button'>Ninjamaster</button></a></li>
<li><a href='/ninjamaster' class='inline-block px-thick'>
<i class="fa-solid fa-screwdriver-wrench"></i> Ninjamaster
</a></li>
{/if}
<li><a href="/account" target="main" title='Your player account info, email, password, etc.' tabindex="-1"><i
class="fa fa-cog"></i> Account Info</a></li>
Expand All @@ -50,9 +52,13 @@
</div>
</div><!-- End of recent events -->
<li class="divider"></li>
<li><a target='main' href='/intro'><i class="fa fa-question-circle" tabindex="-1"></i> Intro Guide</a></li>
<li>
<a target='main' href='/intro'>
<i class="fa fa-question-circle" tabindex="-1"></i> Intro Guide
</a>
</li>
<li class="logout-item">
<form method='post' action='/logout'>
<form method='post' action='/logout' class='px-thick'>
<input type='submit' name='logout' value='Logout' class='btn btn-default'>
</form>
</li>
Expand Down
16 changes: 16 additions & 0 deletions deploy/www/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -5287,6 +5287,22 @@ input[type='button'].btn-block {
margin-right: 2rem;
}

.my-thick {
margin-top: 2rem;
margin-bottom: 2rem;
}

.px-thick {
padding-left: 2rem;
padding-right: 2rem;
}

.py-thick {
padding-top: 2rem;
padding-bottom: 2rem;
}


/**
* Media queries for responsive design.
*
Expand Down
27 changes: 27 additions & 0 deletions deploy/www/js/login.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/**
* General behaviors for the login page.
*/
// @ts-check

const { location: lLocation, top: lTop } = window;
const { location: lFrameLocation } = lTop || {};

/**
* Executions on the signup page.
*/
(() => {
// eslint-disable-next-line no-unused-vars
const { log, debug } = console || { log: () => { /** noop */ }, debug: () => { /** noop */ } };
debug('iife run on login.js');
// // eslint-disable-next-line eqeqeq
if (lLocation != lFrameLocation) { // Framebreak
if (window.top && window.top.location && window.top.location.href) {
window.top.location.href = document.location.href;
}
}
$( // on document ready
() => {

},
);
})();
33 changes: 12 additions & 21 deletions deploy/www/js/signup.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,42 +3,33 @@
*/
// @ts-check

// const { location: tLocation, top: tTop } = window;
// const { location: tFrameLocation } = tTop || {};
// eslint-disable-next-line no-unused-vars
const { log, debug } = console || { log: () => { /** noop */ }, debug: () => { /** noop */ } };
const { location: tLocation, top: tTop } = window;
const { location: tFrameLocation } = tTop || {};

/**
* Executions on the signup page.
*/
(() => {
// eslint-disable-next-line no-unused-vars
const { log, debug } = console || { log: () => { /** noop */ }, debug: () => { /** noop */ } };
debug('iife run on signup.js');
// // eslint-disable-next-line eqeqeq
// if (tLocation != tFrameLocation) { // Framebreak on the signup page as well.
// if (window.top && window.top.location && window.top.location.href) {
// window.top.location.href = document.location.href;
// }
// }
if (tLocation != tFrameLocation) { // Framebreak on the signup page as well.
if (window.top && window.top.location && window.top.location.href) {
window.top.location.href = document.location.href;
}
}
$( // on document ready
() => {
$('#become-a-ninja').hide().fadeIn(1500);
debug('Fading in the submit');
const response = $('#signup input[name=g-recaptcha-response]').val();
debug(response);
},
);
})();

// const signupFormId = 'signup';

/**
* Callback for the recaptcha widget.
* https://www.google.com/recaptcha/admin/site/692084162/settings
*/
// // eslint-disable-next-line no-unused-vars
// function onSubmit(token) {
// // For recaptcha
// if (!document) {
// throw new Error('Invalid call to recapcha onSubmit, in environment with no document');
// } else {
// document && document.getElementById(signupFormId).submit();
// }
// }
// Is handled in the form itself by recFormSubmit