Blob Blame Raw
<!DOCTYPE html>
<html lang='en'>
<head>
  <title>{% block title %}{% endblock %}</title>
  <link href="{{ url_for('static', filename='fedora-bootstrap/fedora-bootstrap.css') }}" rel="stylesheet" />
  <link href="{{ url_for('static', filename='css/style.css') }}" rel="stylesheet" />
  <link href="{{ url_for('static', filename='css/pace-theme-minimal.css') }}" rel="stylesheet" />
  <link rel="stylesheet" href="//code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css">
  <script type="text/javascript"  src="{{ url_for('static', filename='js/pace.min.js') }}"></script>
  <script type="text/javascript"  src="{{ url_for('static', filename='notificon.js') }}"></script>
  <link href="{{ url_for('static', filename='open_iconic_1.1.0/css/open-iconic.min.css') }}"
        type="text/css" rel="stylesheet" />
  <link href="{{ url_for('static', filename='badges/b.css') }}"
        type="text/css" rel="stylesheet" />
  <link rel="icon" type="image/png"
      href="{{ url_for('static', filename='img/favicon.png') }}">
</head>
<body>
<div class="masthead">
  <div class="row p-a-0">
    <div class="col-xs-4" id="logo">
      <img src="{{ url_for('static', filename='img/logo-hubs.png') }}" alt="Fedora Hubs" height="40px" class="p-l-1">
    </div>
    <div class="col-sm-4 col-sm-push-4 col-xs-8">
      {% if g.auth.logged_in %}
        <div class="dropdown pull-xs-right showpointer">
          <span class="dropdown-toggle m-r-1" type="button" id="dropdownMenu1"
            data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">
            <img src="{{ g.auth.avatar }}" id="avatar" alt="User Icon"/>
          </span>
          <div class="dropdown-menu dropdown-menu-right m-r-1" aria-labelledby="dropdownMenu1">
            <h6 class="dropdown-header">Account Information</h6>
            <a href="#" class="dropdown-item">Full Name: {{ g.auth.fullname }}</a>
            <a href="#" class="dropdown-item">Email: {{ g.auth.email }}</a>
            <div class="dropdown-divider"></div>
            <a href="#" class="dropdown-item">Separated link</a>
          </div>
        </div>
        <img id="chaticon" class="pull-xs-right m-r-2" src="{{ url_for('static', filename='img/irc_icon.png') }}" alt="IRC Chats">
      {% else %}
        Not logged in.  Click to <a href="{{url_for('login')}}">login</a>.
      {% endif %}
    </div>
    <div class="col-sm-4 col-sm-pull-4 col-xs-12">
      <!-- NOT HOOKED UP TO ANYTHING XOXO -->
      <div class="input-group">
        <input type="search" class="form-control" placeholder="Search across all hubs ..." aria-describedby="searchform-addon"></input>
        <span class="input-group-addon" id="searchform-addon">
          <span class="oi" data-glyph="magnifying-glass"></span>
        </span>
    </div>
    </div>
  </div>
</div>
<div class="bodycontent">
  <nav class="navbar navbar-light navbar-underline p-t-0 p-b-0">
        <button type="button" class="navbar-toggler hidden-sm-up"
            data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
          <span class="sr-only">Toggle navigation</span>
          <span class="oi" data-glyph="menu"></span>
        </button>
      <!-- Collect the nav links, forms, and other content for toggling -->
      <div class="collapse navbar-toggleable-xs" id="bs-example-navbar-collapse-1">
        <ul class="nav navbar-nav nav-underline">
          {% if g.auth.logged_in %}
          <li class="p-x-1 nav-item {% if request.path.endswith('/' + g.auth.user.username + '/') %}active{% endif %}">
            <a class="nav-link" href="/{{g.auth.user.username}}">me</a></li>
          {% for hub in g.auth.user.bookmarks %}
          <li class='p-x-1 nav-item idle-{{hub.activity_class}}{% if request.path.endswith('/' + hub.name + '/') %} active{% endif %}'>
          <a class="nav-link" href="/{{hub.name}}">{{hub.name}}</a></li>
          {% endfor %}
          <!-- At the end of the list, tack on a link to all groups -->
          <li class="p-x-1 nav-item"><a class="nav-link" href="/groups">all</a></li>
          <button type="button" class="btn btn-primary pull-right" data-toggle="modal" data-target="#edit_bookmarks">edit...</button>
          {% endif %}
        </ul>
        <div class="bookmark-container">
          <div class= "modal fade" id="edit_bookmarks"> 
            <div class="modal-dialog">
              <div class="modal-content" id="edit_modal_content">
                <!-- Modal content-->
                <div class="modal-header">
                      <button type="button" class="close" data-dismiss="modal">&times;</button>
                      <h4 class="modal-title">Manage Bookmarked Hubs</h4>
                </div>
                <div class="modal-body" id="bookmarks">
                  {% for hub in g.auth.user.bookmarks %}
                    <div class="row" id="bookmark_row">
                      <div class='p-x-1 nav-item idle-{{hub.activity_class}}{% if request.path.endswith('/' + hub.name + '/') %} active{% endif %}'><span class="ui-icon ui-icon-arrowthick-2-n-s"></span>
                        <a class="link" href="/{{hub.name}}">{{hub.name}}</a></div>
                    </div>
                  {% endfor %}
                  </div>
                  <button type="button" class="btn btn-primary pull-right" data-dismiss="modal" id="save_b_edits">Save</button>
                  <button type="button" class="btn pull-right" data-dismiss="modal">Cancel</button>
                  <div class="dropdown-divider"></div>
                  <p id="help">Click & drag to re-order or use keyboard up & down arrows to select, shift+arrow to move</p>  
              </div><!-- end of modal content --> 
            </div>
          </div>
        </div>
      </div><!-- /.navbar-collapse -->
  </nav>
{% block content %}{% endblock %}
</div> <!--end bodycontent-->
{% block jscripts %}
<script type="text/javascript" src="{{
  url_for('static', filename='js/jquery-1.10.2.min.js') }}"></script>
  <script type="text/javascript" src="{{
  url_for('static',filename='fedora-bootstrap/fedora-bootstrap.js')}}"></script>
  <script type="text/javascript" src="{{
  url_for('static', filename='js/Sortable.min.js') }}"></script>
  <script type="text/javascript">
  function make_bookmarks_sortable() {
    var byId = function (id) { return document.getElementById(id); }
    Sortable.create(byId('bookmarks'), {
      animation: 150,
      handle: '.row',
    });
    $("#save_b_edits").click(function() {
      b_values = [];
      $( "#bookmark_row a" ).each(function(){b_values.push($(this).text());});
      $.ajax({
        method: "POST",
        url: window.location.hostname,
        data: {'bookmark_values': b_values},
        dataType: 'html',
        success: function(html) {
          $('#edit_modal_content').html(html);
          $('#edit_bookmarks').modal();
        },
      });
    });
  };
  make_bookmarks_sortable();
  </script>
{% endblock %}
</body>
</html>