<commit_before>{% extends "users/users_base.html" %}
{% load i18n %}
{% load hq_shared_tags %}

{% block js %}{{ block.super }}
    <script src="{% static 'users/js/key_filters.js' %}"></script>
    <script src="{% static 'locations/ko/location_tree.async.js' %}"></script>
{% endblock %}

{% block js-inline %}{{ block.super }}
    <script type="text/javascript">

var LOAD_LOCS_URL = '{{ api_root }}';

$(function() {

  var model = new LocationTreeViewModel();
  ko.applyBindings(model, $('#location_tree')[0]);
  model.load();

});

    </script>
{% endblock %}

{% block subsection-title %}
    <li class="active">
        <a href="#">Locations</a>
    </li>
{% endblock %}

{% block user-view %}
<header>
    <div class="row-fluid">
        <div class="span8">
            <h2>Manage Locations</h2>
        </div>
    </div>
</header>
<div>

    <div class="row-fluid">
        <div class="span12">
            <div class="btn-toolbar">
                <a class="btn" href="{% url upload_commcare_users domain %}">Bulk Import</a>
                <a class="btn" href="{% url upload_commcare_users domain %}">Bulk Export</a>
            </div>
        </div>
    </div>

    <style>

#location_tree {
  margin-left: -2em;
}

.loc_children {
  margin-left: 2em;
  margin-bottom: 1.5em;
}

.loc_child {
  margin-top: .5em;
}

.loc_name {
  font-weight: bold;
}

.loc_type {
  color: #777;
  font-variant: small-caps;
  font-weight: bold;
}

.no_children {
  font-style: italic;
}

    </style>

    <script type="text/html" id="location-template">
      <!-- header bar -->
      <div data-bind="if: name() != '_root'">
        <span data-bind="click: toggle">
          <span data-bind="if: can_have_children"><a class="label" data-bind="css: { 'icon-plus': !expanded(), 'icon-minus': expanded() }"></a></span>
          <span class="loc_name" data-bind="text: name"></span> <span class="loc_type">(<span data-bind="text: type"></span>)</span>
        </span>
        <a class="btn btn-primary" href="#">Edit</a>
      </div>
      <!-- child content -->
      <div class="loc_children" data-bind="visible: expanded">
        <!-- loader bar -->
        <div class="loc_child" data-bind="visible: children_status() == 'loading'">
          <img src="{% static 'hqwebapp/img/ajax-loader.gif' %}" alt="loading indicator" /> Loading&hellip;
        </div>
        <!-- child entries -->
        <div data-bind="foreach: children">
          <div class="loc_child" data-bind="template: { name: 'location-template' }"></div><commit_msg>mas style<commit_after>{% extends "users/users_base.html" %}
{% load i18n %}
{% load hq_shared_tags %}

{% block js %}{{ block.super }}
    <script src="{% static 'users/js/key_filters.js' %}"></script>
    <script src="{% static 'locations/ko/location_tree.async.js' %}"></script>
{% endblock %}

{% block js-inline %}{{ block.super }}
    <script type="text/javascript">

var LOAD_LOCS_URL = '{{ api_root }}';

$(function() {

  var model = new LocationTreeViewModel();
  ko.applyBindings(model, $('#location_tree')[0]);
  model.load();

});

    </script>
{% endblock %}

{% block subsection-title %}
    <li class="active">
        <a href="#">Locations</a>
    </li>
{% endblock %}

{% block user-view %}
<header>
    <div class="row-fluid">
        <div class="span8">
            <h2>Manage Locations</h2>
        </div>
    </div>
</header>
<div>

    <div class="row-fluid">
        <div class="span12">
            <div class="btn-toolbar">
                <a class="btn" href="{% url upload_commcare_users domain %}">Bulk Import</a>
                <a class="btn" href="{% url upload_commcare_users domain %}">Bulk Export</a>
            </div>
        </div>
    </div>

    <style>

#location_tree {
  margin-left: -2em;
  width: 500px;
}

.loc_children {
  margin-left: 2em;
  margin-bottom: 1.5em;
}

.loc_child {
  margin-top: .5em;
}

.loc_name {
  font-size: 110%;
  font-weight: bold;
}

.loc_type {
  color: #777;
  font-variant: small-caps;
  font-weight: bold;
}

.no_children {
  font-style: italic;
}

.loc_edit {
  float: right;
}

.loc_header {
  padding: 2px;
}

.loc_header:hover {
  background-color: #eef;
}

.loc_header_text {
  cursor: pointer;
}

    </style>

    <script type="text/html" id="location-template">
      <!-- header bar -->
      <div class="loc_header" data-bind="if: name() != '_root'">
        <a class="loc_edit btn btn-primary" href="http://google.com">Edit</a>
        <span class="loc_header_text" data-bind="click: toggle"> <!-- want to make entire row clickable, but overrides click on 'edit' button -->
          <span data-bind="if: can_have_children"><a class="label" data-bind="css: { 'icon-plus': !expanded(), 'icon-minus': expanded() }"></a></span>
          <span class="loc_name" data-bind="text: name"></span> <span class="loc_type">(<span data-bind="text: type"></span>)</span>
        </span>
        <div style="clear: both;"></div>
      </div>
      <!-- child content -->
      <div class="loc_children" data-bind="visible: expanded">
        <!-- loader bar -->
        <div class="loc_child" data-bind="visible: children_status() == 'loading'">
          <img src="{% static 'hqwebapp/img/ajax-loader.gif' %}" alt="loading indicator" /> Loading&hellip;
        </div>
        <!-- child entries -->
        <div data-bind="foreach: children">
          <div class="loc_child" data-bind="template: { name: 'location-template' }"></div>
{'fraction_non_alphanumeric': 0.2024618776410068, 'fraction_numerical': 0.007165166268601874, 'mean_word_length': 2.8392101551480957, 'pattern_counts': {'":': 0, '<': 124, '<?xml version=': 0, '>': 124, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3019004', 'n_tokens_mistral': 1952, 'n_tokens_neox': 1841, 'n_words': 392}