<commit_before>
<%inherit file="project.view.mako" />

<link rel="stylesheet" type="text/css" href="/static/css/jquery.tagsinput.css" />
<script src="/static/js/jquery.tagsinput.min.js"></script>
<script>
    $(function(){
        $('#node-tags').tagsInput({
            width: "100%",
            interactive:${'true' if user_can_edit else 'false'},
            onAddTag:function(tag){
                $.ajax({
                    url:"${node_url}" + "/addtag/" + tag,
                    type:"GET",
                });
            },
            onRemoveTag:function(tag){
                $.ajax({
                    url:"${node_url}" + "/removetag/" + tag,
                    type:"GET",
                });
            },
        });
        // Remove delete UI if not contributor
        % if not user_can_edit:
            $('a[title="Removing tag"]').remove();
            $('span.tag span').each(function(idx, elm) {
                $(elm).text($(elm).text().replace(/\s*$/, ''))
            });
        % endif
    });
</script>
  <div class="row">
    <div class="span7" id='containment'>
      <section id="Wiki Home">
        <div>
        %if wiki_home:
            ${ wiki_home }
            <p><a href="${node_url}/wiki/home">read more</a></p>
        %else:
            <p>No content</p>
        %endif
        </div>
      </section>
       %if not node:
      <section id="Nodes">

          <div class="page-header">
              <div style="float:right;">
                  % if user_can_edit:
                  <a class="btn" data-toggle="modal" href="#newComponent">
                  % else:
                  <a class="btn disabled">
                  % endif
                    Add Component
                  </a>
              </div>
              <h1>Components</h1>
          </div>
          <div class="modal hide fade" id="newComponent">
          <form class="form-horizontal form-horizontal-narrow" action="/project/${node_id}/newnode/" method="post">
            <div class="modal-header">
              <h3 class='img-add'>Add Component</h3>
            </div>
            <div class="modal-body">
                    <div class='control-group'>
                        <label for='title' class='control-label'>Title</label>
                        <input name="title" type="text" class='controls'>
                    </div>
                    <div class='control-group'>
                        <label for='category' class='control-label'>Category</label>
                        <select id="category" name="category" class='controls'>
                            <option disabled selected value=''>-- Choose--</option>
                            %for i in ["Project", "Hypothesis", "Methods and Measures", "Procedure", "Instrumentation", "Data", "Analysis", "Communication", "Other"]:
                            <option>${i}</option>
                            %endfor
                        </select>
                    </div>
            </div>
                <div class="modal-footer">
                   <a href="#" class="btn" data-dismiss="modal">Close</a>
                  <button type="submit" class="btn btn-primary">OK</button>
                </div>
            </form>
            </div>

          <script type="text/javascript">
            //$('#addContributor').modal('hide')
          </script>
          % if node_children:
              % for child in node_children:
                  <div mod-meta='{"tpl" : "util/render_node.html", "uri" : "${child['child_api_url']}get_summary/", "replace" : true}'></div>
              % endfor
          % else:
              <p>No components have been added to this project.</p>
          % endif
      </section>
      %endif<commit_msg>use render_nodes instead of render_node to fix reorder components<commit_after>
<%inherit file="project.view.mako" />

<link rel="stylesheet" type="text/css" href="/static/css/jquery.tagsinput.css" />
<script src="/static/js/jquery.tagsinput.min.js"></script>
<script>
    $(function(){
        $('#node-tags').tagsInput({
            width: "100%",
            interactive:${'true' if user_can_edit else 'false'},
            onAddTag:function(tag){
                $.ajax({
                    url:"${node_url}" + "/addtag/" + tag,
                    type:"GET",
                });
            },
            onRemoveTag:function(tag){
                $.ajax({
                    url:"${node_url}" + "/removetag/" + tag,
                    type:"GET",
                });
            },
        });
        // Remove delete UI if not contributor
        % if not user_can_edit:
            $('a[title="Removing tag"]').remove();
            $('span.tag span').each(function(idx, elm) {
                $(elm).text($(elm).text().replace(/\s*$/, ''))
            });
        % endif
    });
</script>
  <div class="row">
    <div class="span7" id='containment'>
      <section id="Wiki Home">
        <div>
        %if wiki_home:
            ${ wiki_home }
            <p><a href="${node_url}/wiki/home">read more</a></p>
        %else:
            <p>No content</p>
        %endif
        </div>
      </section>
       %if not node:
      <section id="Nodes">

          <div class="page-header">
              <div style="float:right;">
                  % if user_can_edit:
                  <a class="btn" data-toggle="modal" href="#newComponent">
                  % else:
                  <a class="btn disabled">
                  % endif
                    Add Component
                  </a>
              </div>
              <h1>Components</h1>
          </div>
          <div class="modal hide fade" id="newComponent">
          <form class="form-horizontal form-horizontal-narrow" action="/project/${node_id}/newnode/" method="post">
            <div class="modal-header">
              <h3 class='img-add'>Add Component</h3>
            </div>
            <div class="modal-body">
                    <div class='control-group'>
                        <label for='title' class='control-label'>Title</label>
                        <input name="title" type="text" class='controls'>
                    </div>
                    <div class='control-group'>
                        <label for='category' class='control-label'>Category</label>
                        <select id="category" name="category" class='controls'>
                            <option disabled selected value=''>-- Choose--</option>
                            %for i in ["Project", "Hypothesis", "Methods and Measures", "Procedure", "Instrumentation", "Data", "Analysis", "Communication", "Other"]:
                            <option>${i}</option>
                            %endfor
                        </select>
                    </div>
            </div>
                <div class="modal-footer">
                   <a href="#" class="btn" data-dismiss="modal">Close</a>
                  <button type="submit" class="btn btn-primary">OK</button>
                </div>
            </form>
            </div>

          <script type="text/javascript">
            //$('#addContributor').modal('hide')
          </script>
          % if node_children:
              <div mod-meta='{"tpl" : "util/render_nodes.html", "uri" : "${node_api_url}get_children/", "replace" : true, "kwargs" : {"sortable" : true}}'></div>
          % else:
              <p>No components have been added to this project.</p>
          % endif
      </section>
      %endif
{'fraction_non_alphanumeric': 0.1623783495533929, 'fraction_numerical': 0.0021330489268097585, 'mean_word_length': 1.4161030595813204, 'pattern_counts': {'":': 0, '<': 135, '<?xml version=': 0, '>': 135, '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': '4414576', 'n_tokens_mistral': 2067, 'n_tokens_neox': 1986, 'n_words': 403}