<!doctype html>
<html lang="en">

<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>STEMChat</title>
  <link rel="shortcut icon" href="/favicon.ico">
  <link rel="stylesheet" href="/css/pure_css.css">
  <link rel="stylesheet" href="https://unpkg.com/purecss@2.0.3/build/grids-responsive-min.css" />
  <link rel="stylesheet" href="/css/blog.css">
  <link rel="stylesheet" href="/css/navbar.css">
  <link rel="stylesheet" href="/css/profile.css">
</head>

<body>
  <center>
    <div class="topnav" id="myTopnav1">
      <a href="javascript:void(0);" class="icon2" onclick="myFunction1()">
        <i>☰</i>
      </a>

      <!-- Navigation links (hidden by default) -->
      <div id="myLinks">
        <a href="/">Home</a>

        <a href='<%=about%>'>About</a>
        <%if(curr_user_more){%>
        <a href='<%=home%>'>Chat</a>
        <%}%>

        <a href='<%=blog%>'>Blogs</a>
        <a href='<%=project%>'>Projects</a>
        <a href='<%=feedback%>'>Feedback</a>
        <a href='/profile' class="active">Profile</a>

        <%if(!curr_user_more){%>
        <a href='<%=home%>'>Login</a>
        <%}%>
            <%if(curr_user_more){%>
        <a href="<%=logout%>">Logout</a>
        <%}%>
        </div>
        <!-- "Hamburger menu" / "Bar icon" to toggle the navigation links -->

    </div>
    <div class="topnav1" id="myTopnav">
      <a href='/profile' class='active'>Summary</a>

        <a href='/badges'>Badges</a>



        <a href="javascript:void(0);" class="icon" onclick="myFunction()">
          ☰</i>
        </a>
      </div>

      <div id="main">
        <div class="content">

          <div class="info">
            <%var str=curr_user.avatar_template;%>
            <%var str=str.replace('{size}','80');%>
            <%var url=url.substring(0,url.length-1);%>
            <h1> <img src='<%=url%><%=str%>' alt="profile pic round" id='uimg'>  <span><%=curr_user.name%><br>@<%=curr_user.username%><br><%=curr_user.user_fields['1']%></span></h1>
            <%if(curr_user.location){%>
            <h2>From: <%=curr_user.location%></h2><br>
            <%}%>
            <%if(curr_user.bio_raw){%>
            <h2><%=curr_user.bio_raw%></h2><br>
            <%}%>
            <%if(curr_user.website && !curr_user.website_name){%>
            <h2>Website: <%=curr_user.website%> (@<%=curr_user.website_name%>)</h2>
            <%}%>
            <%if(curr_user.website && curr_user.website_name){%>
            <h2>Website: <%=curr_user.website%> (@<%=curr_user.website_name%>)</h2>
            <%}%>
            <hr color='black' size='3px'>
          </div>
          <div class="data">
            Created: <%=curr_user_more.created_at.split('T').join(', ').split('.')[0]%>
            <br>
            <%if(curr_user_more.last_seen_at){var ls=curr_user_more.last_seen_at.split('T').join(', ').split('.')[0]}%>
            Last seen at: <%=ls%>
            <br>
            Days Visited: <%=curr_user_more.days_visited%>
            <br>
            <%var hr=Math.floor(curr_user_more.time_read/3600);%>
            <%var min=Math.floor(curr_user_more.time_read/60)%>
            Read Time: <%=hr%>hrs and <%=min%> mins
            <br>
            Topics Read: <%=curr_user_more.topics_entered%>
            <br>
            Posts Read: <%=curr_user_more.posts_read_count%>
            <br>
            Likes Given ❤️: <%=curr_user_more.like_given_count%>
            <br>
            Topics Created: <%=curr_user_more.topic_count%>
            <br>
            Posts Created: <%=curr_user_more.post_count%>
            <br>
            Likes Received ❤️: <%=curr_user_more.like_count%>
            <hr>
            <h3>Groups Joined</h3>
            <ul>
              <%for(var i=0;i<curr_user_more.groups.length;i++){%>
              <%if(!curr_user_more.groups[i].name.includes('trust')){%>
              <li>
                <h4>

                  <a href='/group/<%=curr_user_more.groups[i].name%>/<%=curr_user_more.groups[i].id%>'><%=curr_user_more.groups[i].name.split('_').join(' ')%> (User Count: <%=curr_user_more.groups[i].user_count%>)</a>

                </h4>
              </li>
              <%}%>

              <%}%>
            </ul>
            <hr>
            <h3>Topics</h3>
            <ul>
              <%for(var i=0;i<summary.topics.length;i++){%>

              <li>
                <h4>

                  <a href='/post/t/<%=summary.topics[i].slug%>/<%=summary.topics[i].id%>/1'><%=summary.topics[i].title.split('_').join(' ')%> (Posts Count: <%=summary.topics[i].posts_count%>)</a>

                </h4>
              </li>


              <%}%>
            </ul>
          </div>



          <!--
              <div class='foot'>
                  <p> MADE BY BITS 2020</p>
              </div>
              -->

        </div>
      </div>


  </center>


  <script src="/js/ui.js"></script>

  <script>
  //navbar
    function myFunction1() {
      var x = document.getElementById("myTopnav1");
      if (x.className === "topnav") {
        x.className += " responsive";
      } else {
        x.className = "topnav";
      }
    }

    function myFunction() {
      var x = document.getElementById("myTopnav");
      if (x.className === "topnav") {
        x.className += " responsive";
      } else {
        x.className = "topnav";
      }
    }
  </script>
</body>
</html>
