From f79a11cbf7276cff66a60fbf72bec4518bab10b0 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Fri, 3 Feb 2017 13:47:29 -0800 Subject: trying nav-login as modal --- view/tpl/nav.tpl | 27 ++++++++++++++++++++------- 1 file changed, 20 insertions(+), 7 deletions(-) diff --git a/view/tpl/nav.tpl b/view/tpl/nav.tpl index f59afee5b..3fccfaeb7 100755 --- a/view/tpl/nav.tpl +++ b/view/tpl/nav.tpl @@ -156,13 +156,7 @@ {{if $nav.login && !$userinfo}}
  • - {{$nav.loginmenu.0.1}} - + {{$nav.loginmenu.0.1}}
  • {{/if}} @@ -227,6 +221,25 @@ {{$navapps}} + + + {{if $nav.login && !$userinfo}} + + + + {{/if}} + + {{if $nav.help.6}}
    {{$nav.help.5}} -- cgit v1.2.3 From fc4083346eb6d7010e018b3dab92711f777f8572 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Fri, 3 Feb 2017 15:31:01 -0800 Subject: more work on nav-modal --- include/nav.php | 32 +++++++++++++++++++++----------- view/theme/redbasic/css/style.css | 5 ++++- view/tpl/nav.tpl | 20 +------------------- view/tpl/nav_login.tpl | 13 +++++++++++++ 4 files changed, 39 insertions(+), 31 deletions(-) create mode 100644 view/tpl/nav_login.tpl diff --git a/include/nav.php b/include/nav.php index 7d6877600..846ede717 100644 --- a/include/nav.php +++ b/include/nav.php @@ -76,6 +76,20 @@ EOT; $userinfo = null; $nav['loginmenu']=array(); + if($observer) { + $userinfo = array( + 'icon' => $observer['xchan_photo_m'], + 'name' => $observer['xchan_addr'], + ); + } + + 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'); + } + + + if(local_channel()) { @@ -114,6 +128,13 @@ EOT; if(! get_account_id()) { $nav['login'] = login(true,'main-login',false,false); $nav['loginmenu'][] = Array('login',t('Login'),'',t('Sign in'),'login_nav_btn'); + App::$page['content'] .= replace_macros(get_markup_template('nav_login.tpl'), + [ + '$nav' => $nav, + 'userinfo' => $userinfo + ] + ); + } else $nav['alogout'] = Array('logout',t('Logout'), "", t('End this session'),'logout_nav_btn'); @@ -121,17 +142,6 @@ EOT; } - if($observer) { - $userinfo = array( - 'icon' => $observer['xchan_photo_m'], - 'name' => $observer['xchan_addr'], - ); - } - - 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'); - } $homelink = get_my_url(); if(! $homelink) { diff --git a/view/theme/redbasic/css/style.css b/view/theme/redbasic/css/style.css index fd41b4c89..4cfd42ef1 100644 --- a/view/theme/redbasic/css/style.css +++ b/view/theme/redbasic/css/style.css @@ -2108,5 +2108,8 @@ dl.bb-dl > dd > li { #nav-login { padding: 10px; - min-width: 300px; + min-width: 300px; + + border: 1px solid #000; + background-color: #fff; } diff --git a/view/tpl/nav.tpl b/view/tpl/nav.tpl index 3fccfaeb7..7fae5cb87 100755 --- a/view/tpl/nav.tpl +++ b/view/tpl/nav.tpl @@ -156,7 +156,7 @@ {{if $nav.login && !$userinfo}}
  • - {{$nav.loginmenu.0.1}} + {{$nav.loginmenu.1.1}}
  • {{/if}} @@ -222,24 +222,6 @@
    - - {{if $nav.login && !$userinfo}} - - - - {{/if}} - - {{if $nav.help.6}}
    {{$nav.help.5}} diff --git a/view/tpl/nav_login.tpl b/view/tpl/nav_login.tpl new file mode 100644 index 000000000..fe93f0aa2 --- /dev/null +++ b/view/tpl/nav_login.tpl @@ -0,0 +1,13 @@ + {{if $nav.login && !$userinfo}} + + {{/if}} -- cgit v1.2.3 From 73845e01ed5e00a62341f2125e2a61c16bd73962 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Sat, 4 Feb 2017 14:58:13 -0800 Subject: cleanup --- view/theme/redbasic/css/style.css | 12 +++++++----- view/tpl/nav.tpl | 2 +- view/tpl/nav_login.tpl | 12 +++++++----- 3 files changed, 15 insertions(+), 11 deletions(-) diff --git a/view/theme/redbasic/css/style.css b/view/theme/redbasic/css/style.css index 4cfd42ef1..b398738e0 100644 --- a/view/theme/redbasic/css/style.css +++ b/view/theme/redbasic/css/style.css @@ -2107,9 +2107,11 @@ dl.bb-dl > dd > li { } #nav-login { - padding: 10px; - min-width: 300px; - - border: 1px solid #000; - background-color: #fff; } + +.rmagic-button { + max-width: 400px; + margin-top: 20px; + margin-left: auto; + margin-right: auto; +} \ No newline at end of file diff --git a/view/tpl/nav.tpl b/view/tpl/nav.tpl index 7fae5cb87..c504e5515 100755 --- a/view/tpl/nav.tpl +++ b/view/tpl/nav.tpl @@ -156,7 +156,7 @@ {{if $nav.login && !$userinfo}}
  • - {{$nav.loginmenu.1.1}} + {{$nav.loginmenu.1.1}}
  • {{/if}} diff --git a/view/tpl/nav_login.tpl b/view/tpl/nav_login.tpl index fe93f0aa2..0605ce44f 100644 --- a/view/tpl/nav_login.tpl +++ b/view/tpl/nav_login.tpl @@ -1,11 +1,13 @@ {{if $nav.login && !$userinfo}}