<commit_before><%
# WontoMedia - a wontology web application
# Copyright (C) 2009 - <NAME>
#    www.wontology.com
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License version
# 3 as published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
# Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program in the file COPYING and/or LICENSE.  If not,
# see "http://www.gnu.org/licenses/".
%>


<% require Rails.root.join( 'lib', 'helpers', 'node_helper') %>

<h1>Make a new node</h1>

<% options = @node.sti_type.nil? ? {} : { :url => nodes_path() }
   form_for(@node, options) do |f|
 %>
  <%= f.error_messages %>
  <div style="width: 40%; float: left;">
    <p class="inputpara">
      <%= f.label :sti_type, "Type" %>
      <%= select_tag "node[sti_type]",
            options_for_select( [ [ "- type of node -",          "" ],
                                  [ "Category",         "ClassNode" ],
                                  [ "Item",              "ItemNode" ],
                                  [ "Property",      "PropertyNode" ] ],
                                @node.sti_type.nil? ? "" : @node.sti_type )
       %>
      <%= image_tag "blank_error_icon.png", :id=>"sti_type_error_icon",
                    :alt=>"", :size=>"16x16" %>
    </p><p class="directions">
      <span id="sti_type_required">Selection of a type is required.</span>
    </p>
    <script type="text/javascript">
      $('node_sti_type').focus();
    </script>

    <%= render :partial => "form_fields", :locals => { :f => f } %>
  </div>

  <div style="width: 55%; float: right;">
    <dl><dt id="category_title">Category</dt><dd id="category_desc">

      "Category" is for groups of things, for concepts, and for the
      upper levels of hierarchies.  (Though a hierarchy made up entirely
      of concepts could be all Categories.)  Categories can "contain"
      other categories or items.

    </dd><dt id="item_title">Item</dt><dd id="item_desc">

      "Item" is for individual, concrete things.  Items can "contain"
      other items, but cannot contain categories.  ("Ford Model-T" might
      be an item, but could still contain parts that are also items,
      like "Windshield" and "Tire".)

    </dd><dt id="property_title">Property</dt><dd id="property_desc">

      "Property" is used to define relationships between other nodes.
      Once you create a new Property node, you should create one or
      more edges that relate that property to other existing
      properties.  In general, you will use the "sub_property_of"
      property in order to create these edges.  For example, if you
      were creating a description of famillial relations between
      people, you might create a new property named "spouseOf".  To
      define what the creation of edges using this new property
      <em>means</em>, you can create the edge "<code>spouseOf
      sub_property_of symmetric_relationship</code>".  This example
      will cause "spouseOf" to be treated as a "peer" relationship
      (rather than a hierarchical one), and as a symmetric
      relationship, so that creating a "spouseOf" edge from one node
      to another implies an edge going the other direction even if it
      is not defined explicitly.

    </dd></dl>

    <p id="create_button_container" style="text-align: center">
      <%= f.submit "Create" %>
    </p>

    <p style="text-align: center">
      <%= link_to 'Cancel, goto node list', nodes_path %> &mdash;
      <%= link_to 'Cancel, goto edge list', edges_path %>
    </p>
  </div>
<% end %>  <!-- of form_for -->

<%= javascript_include_tag "modalbox" %>
<%= javascript_include_tag "requiredFields" %><commit_msg>Yes, saying "goto" in a UI message is too nerdy.  Now "go to"...<commit_after><%
# WontoMedia - a wontology web application
# Copyright (C) 2009 - <NAME>
#    www.wontology.com
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License version
# 3 as published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
# Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program in the file COPYING and/or LICENSE.  If not,
# see "http://www.gnu.org/licenses/".
%>


<% require Rails.root.join( 'lib', 'helpers', 'node_helper') %>

<h1>Make a new node</h1>

<% options = @node.sti_type.nil? ? {} : { :url => nodes_path() }
   form_for(@node, options) do |f|
 %>
  <%= f.error_messages %>
  <div style="width: 40%; float: left;">
    <p class="inputpara">
      <%= f.label :sti_type, "Type" %>
      <%= select_tag "node[sti_type]",
            options_for_select( [ [ "- type of node -",          "" ],
                                  [ "Category",         "ClassNode" ],
                                  [ "Item",              "ItemNode" ],
                                  [ "Property",      "PropertyNode" ] ],
                                @node.sti_type.nil? ? "" : @node.sti_type )
       %>
      <%= image_tag "blank_error_icon.png", :id=>"sti_type_error_icon",
                    :alt=>"", :size=>"16x16" %>
    </p><p class="directions">
      <span id="sti_type_required">Selection of a type is required.</span>
    </p>
    <script type="text/javascript">
      $('node_sti_type').focus();
    </script>

    <%= render :partial => "form_fields", :locals => { :f => f } %>
  </div>

  <div style="width: 55%; float: right;">
    <dl><dt id="category_title">Category</dt><dd id="category_desc">

      "Category" is for groups of things, for concepts, and for the
      upper levels of hierarchies.  (Though a hierarchy made up entirely
      of concepts could be all Categories.)  Categories can "contain"
      other categories or items.

    </dd><dt id="item_title">Item</dt><dd id="item_desc">

      "Item" is for individual, concrete things.  Items can "contain"
      other items, but cannot contain categories.  ("Ford Model-T" might
      be an item, but could still contain parts that are also items,
      like "Windshield" and "Tire".)

    </dd><dt id="property_title">Property</dt><dd id="property_desc">

      "Property" is used to define relationships between other nodes.
      Once you create a new Property node, you should create one or
      more edges that relate that property to other existing
      properties.  In general, you will use the "sub_property_of"
      property in order to create these edges.  For example, if you
      were creating a description of famillial relations between
      people, you might create a new property named "spouseOf".  To
      define what the creation of edges using this new property
      <em>means</em>, you can create the edge "<code>spouseOf
      sub_property_of symmetric_relationship</code>".  This example
      will cause "spouseOf" to be treated as a "peer" relationship
      (rather than a hierarchical one), and as a symmetric
      relationship, so that creating a "spouseOf" edge from one node
      to another implies an edge going the other direction even if it
      is not defined explicitly.

    </dd></dl>

    <p id="create_button_container" style="text-align: center">
      <%= f.submit "Create" %>
    </p>

    <p style="text-align: center">
      <%= link_to 'Cancel, go to node list', nodes_path %> &mdash;
      <%= link_to 'Cancel, go to edge list', edges_path %>
    </p>
  </div>
<% end %>  <!-- of form_for -->

<%= javascript_include_tag "modalbox" %>
<%= javascript_include_tag "requiredFields" %>
{'fraction_non_alphanumeric': 0.12123839009287926, 'fraction_numerical': 0.0037151702786377707, 'mean_word_length': 2.7667910447761193, 'pattern_counts': {'":': 0, '<': 107, '<?xml version=': 0, '>': 121, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5497122', 'n_tokens_mistral': 2443, 'n_tokens_neox': 2288, 'n_words': 864}