aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorzotlabs <mike@macgirvin.com>2017-01-23 16:31:40 -0800
committerzotlabs <mike@macgirvin.com>2017-01-23 16:31:40 -0800
commitcb47354a4f76e033485e9818b137742c01466dbe (patch)
tree1cba8e14d0cd1069a4d80bfa0acd51e24401b7bc
parent61588a4b772f8c5c0c231cf2eb63d72a8f64411d (diff)
downloadvolse-hubzilla-cb47354a4f76e033485e9818b137742c01466dbe.tar.gz
volse-hubzilla-cb47354a4f76e033485e9818b137742c01466dbe.tar.bz2
volse-hubzilla-cb47354a4f76e033485e9818b137742c01466dbe.zip
put login form into the nav bar. Proof of concept - needs a bit of UI tweaks.
-rw-r--r--include/channel.php14
-rw-r--r--include/nav.php2
-rw-r--r--view/theme/redbasic/css/style.css4
-rwxr-xr-xview/tpl/nav.tpl11
-rw-r--r--view/tpl/remote_login.tpl1
5 files changed, 28 insertions, 4 deletions
diff --git a/include/channel.php b/include/channel.php
index 247d3d358..d66ed7abe 100644
--- a/include/channel.php
+++ b/include/channel.php
@@ -1908,4 +1908,18 @@ function channel_manual_conv_update($channel_id) {
return intval($x);
+}
+
+
+function remote_login() {
+
+ $o = replace_macros(get_markup_template('remote_login.tpl'),array(
+ '$title' => t('Remote Authentication'),
+ '$desc' => t('Enter your channel address (e.g. channel@example.com)'),
+ '$submit' => t('Authenticate')
+ ));
+ return $o;
+
+
+
} \ No newline at end of file
diff --git a/include/nav.php b/include/nav.php
index 6ad43c909..ce259255e 100644
--- a/include/nav.php
+++ b/include/nav.php
@@ -112,6 +112,7 @@ EOT;
}
else {
if(! get_account_id()) {
+ $nav['login'] = login();
$nav['loginmenu'][] = Array('login',t('Login'),'',t('Sign in'),'login_nav_btn');
}
else
@@ -128,6 +129,7 @@ EOT;
}
elseif(! $_SESSION['authenticated']) {
+ $nav['remote_login'] = remote_login();
$nav['loginmenu'][] = Array('rmagic',t('Remote authentication'),'',t('Click to authenticate to your home hub'),'rmagic_nav_btn');
}
diff --git a/view/theme/redbasic/css/style.css b/view/theme/redbasic/css/style.css
index 5bffdd27b..f5e253eef 100644
--- a/view/theme/redbasic/css/style.css
+++ b/view/theme/redbasic/css/style.css
@@ -2104,4 +2104,8 @@ dl.bb-dl > dd > li {
.app-icon {
font-size: 80px;
text-align: center;
+}
+
+.rmagic-button {
+ margin-left: 10px;
} \ No newline at end of file
diff --git a/view/tpl/nav.tpl b/view/tpl/nav.tpl
index 4d8ce9317..c9b38859c 100755
--- a/view/tpl/nav.tpl
+++ b/view/tpl/nav.tpl
@@ -154,13 +154,16 @@
</li>
{{/if}}
- {{if $nav.loginmenu && !$userinfo}}
- <li class="{{$nav.loginmenu.0.2}} hidden-xs">
+ {{if $nav.login && !$userinfo}}
+ <li class="nav-login hidden-xs">
<a data-toggle="dropdown" href="{{$nav.loginmenu.0.0}}" title="{{$nav.loginmenu.0.3}}" id="{{$nav.loginmenu.0.4}}">{{$nav.loginmenu.0.1}} <span class="caret" id="loginmenu-caret"></span></a>
<ul class="dropdown-menu" role="menu">
- {{foreach $nav.loginmenu as $loginmenu}}
+ {{$nav.login}}
+ {{$nav.remote_login}}
+
+ <!-- {{foreach $nav.loginmenu as $loginmenu}}
<li role="presentation"><a class="{{$loginmenu.2}}" href="{{$loginmenu.0}}" title="{{$loginmenu.3}}" role="menuitem" id="{{$loginmenu.4}}">{{$loginmenu.1}}</a></li>
- {{/foreach}}
+ {{/foreach}} --!>
</ul>
</li>
{{foreach $nav.loginmenu as $loginmenu}}
diff --git a/view/tpl/remote_login.tpl b/view/tpl/remote_login.tpl
new file mode 100644
index 000000000..1d11fb712
--- /dev/null
+++ b/view/tpl/remote_login.tpl
@@ -0,0 +1 @@
+<a href="rmagic" class="btn btn-default rmagic-button">{{$title}}</a>