client/templates/nodeeditor.html
author rougeronj
Tue, 16 Jun 2015 11:36:09 +0200
changeset 482 a55c33989404
parent 468 364c367df7fc
child 530 9823b527c3a1
permissions -rw-r--r--
add type selector in the node editor add node_editor_template options to add custom templates for the node editor
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
459
98cae534083d add node and edge stroke width + adjust text + arrow placement + conrol arrow visibility
ymh <ymh.work@gmail.com>
parents: 458
diff changeset
     1
<% //TODO: change class to id %>
420
22393cbf4467 export the templates of nodeeditor to html files
rougeronj
parents:
diff changeset
     2
<h2>
434
0d5998b32a7c clean, and finalize lodash migration
ymh <ymh.work@gmail.com>
parents: 420
diff changeset
     3
    <span class="Rk-CloseX">&times;</span><%-renkan.translate("Edit Node")%></span>
420
22393cbf4467 export the templates of nodeeditor to html files
rougeronj
parents:
diff changeset
     4
</h2>
22393cbf4467 export the templates of nodeeditor to html files
rougeronj
parents:
diff changeset
     5
<p>
434
0d5998b32a7c clean, and finalize lodash migration
ymh <ymh.work@gmail.com>
parents: 420
diff changeset
     6
    <label><%-renkan.translate("Title:")%></label>
0d5998b32a7c clean, and finalize lodash migration
ymh <ymh.work@gmail.com>
parents: 420
diff changeset
     7
    <input class="Rk-Edit-Title" type="text" value="<%-node.title%>" />
420
22393cbf4467 export the templates of nodeeditor to html files
rougeronj
parents:
diff changeset
     8
</p>
22393cbf4467 export the templates of nodeeditor to html files
rougeronj
parents:
diff changeset
     9
<% if (options.show_node_editor_uri) { %>
434
0d5998b32a7c clean, and finalize lodash migration
ymh <ymh.work@gmail.com>
parents: 420
diff changeset
    10
    <p>
0d5998b32a7c clean, and finalize lodash migration
ymh <ymh.work@gmail.com>
parents: 420
diff changeset
    11
        <label><%-renkan.translate("URI:")%></label>
0d5998b32a7c clean, and finalize lodash migration
ymh <ymh.work@gmail.com>
parents: 420
diff changeset
    12
        <input class="Rk-Edit-URI" type="text" value="<%-node.uri%>" />
0d5998b32a7c clean, and finalize lodash migration
ymh <ymh.work@gmail.com>
parents: 420
diff changeset
    13
        <a class="Rk-Edit-Goto" href="<%-node.uri%>" target="_blank"></a>
0d5998b32a7c clean, and finalize lodash migration
ymh <ymh.work@gmail.com>
parents: 420
diff changeset
    14
    </p>
482
a55c33989404 add type selector in the node editor
rougeronj
parents: 468
diff changeset
    15
<% } %> <% if (options.change_types) { %>
a55c33989404 add type selector in the node editor
rougeronj
parents: 468
diff changeset
    16
    <p>
a55c33989404 add type selector in the node editor
rougeronj
parents: 468
diff changeset
    17
        <label><%-renkan.translate("Types available")%>:</label>
a55c33989404 add type selector in the node editor
rougeronj
parents: 468
diff changeset
    18
        <select class="Rk-Edit-Type">
a55c33989404 add type selector in the node editor
rougeronj
parents: 468
diff changeset
    19
          <% _.each(types, function(type) { %>
a55c33989404 add type selector in the node editor
rougeronj
parents: 468
diff changeset
    20
            <option class="Rk-Edit-Vocabulary-Property" value="<%- type %>"<% if (node.type === type) { %> selected<% } %>>
a55c33989404 add type selector in the node editor
rougeronj
parents: 468
diff changeset
    21
                <%- renkan.translate(type.charAt(0).toUpperCase() + type.substring(1)) %>
a55c33989404 add type selector in the node editor
rougeronj
parents: 468
diff changeset
    22
            </option>
a55c33989404 add type selector in the node editor
rougeronj
parents: 468
diff changeset
    23
          <% }); %>
a55c33989404 add type selector in the node editor
rougeronj
parents: 468
diff changeset
    24
        </select>
a55c33989404 add type selector in the node editor
rougeronj
parents: 468
diff changeset
    25
    </p>
420
22393cbf4467 export the templates of nodeeditor to html files
rougeronj
parents:
diff changeset
    26
<% } %> <% if (options.show_node_editor_description) { %>
434
0d5998b32a7c clean, and finalize lodash migration
ymh <ymh.work@gmail.com>
parents: 420
diff changeset
    27
    <p>
0d5998b32a7c clean, and finalize lodash migration
ymh <ymh.work@gmail.com>
parents: 420
diff changeset
    28
        <label><%-renkan.translate("Description:")%></label>
468
364c367df7fc add rich text editor for description
ymh <ymh.work@gmail.com>
parents: 459
diff changeset
    29
        <% if (options.show_node_editor_description_richtext) { %>
364c367df7fc add rich text editor for description
ymh <ymh.work@gmail.com>
parents: 459
diff changeset
    30
            <div class="Rk-Edit-Description" contenteditable="true"><%=node.description%></div>
364c367df7fc add rich text editor for description
ymh <ymh.work@gmail.com>
parents: 459
diff changeset
    31
        <% } else { %>
364c367df7fc add rich text editor for description
ymh <ymh.work@gmail.com>
parents: 459
diff changeset
    32
            <textarea class="Rk-Edit-Description"><%=node.description%></textarea>
364c367df7fc add rich text editor for description
ymh <ymh.work@gmail.com>
parents: 459
diff changeset
    33
        <% } %>
434
0d5998b32a7c clean, and finalize lodash migration
ymh <ymh.work@gmail.com>
parents: 420
diff changeset
    34
    </p>
420
22393cbf4467 export the templates of nodeeditor to html files
rougeronj
parents:
diff changeset
    35
<% } %> <% if (options.show_node_editor_size) { %>
434
0d5998b32a7c clean, and finalize lodash migration
ymh <ymh.work@gmail.com>
parents: 420
diff changeset
    36
    <p>
0d5998b32a7c clean, and finalize lodash migration
ymh <ymh.work@gmail.com>
parents: 420
diff changeset
    37
        <span class="Rk-Editor-Label"><%-renkan.translate("Size:")%></span>
459
98cae534083d add node and edge stroke width + adjust text + arrow placement + conrol arrow visibility
ymh <ymh.work@gmail.com>
parents: 458
diff changeset
    38
        <a href="#" class="Rk-Edit-Size-Btn" id="Rk-Edit-Size-Down">-</a>
98cae534083d add node and edge stroke width + adjust text + arrow placement + conrol arrow visibility
ymh <ymh.work@gmail.com>
parents: 458
diff changeset
    39
        <span class="Rk-Edit-Size-Disp" id="Rk-Edit-Size-Value"><%-node.size%></span>
98cae534083d add node and edge stroke width + adjust text + arrow placement + conrol arrow visibility
ymh <ymh.work@gmail.com>
parents: 458
diff changeset
    40
        <a href="#" class="Rk-Edit-Size-Btn" id="Rk-Edit-Size-Up">+</a>
434
0d5998b32a7c clean, and finalize lodash migration
ymh <ymh.work@gmail.com>
parents: 420
diff changeset
    41
    </p>
458
423bdf56d103 migrated to style, added dash style to client + small refactoring for shapes + triangle
ymh <ymh.work@gmail.com>
parents: 441
diff changeset
    42
<% } %> <% if (options.show_node_editor_style) { %>
434
0d5998b32a7c clean, and finalize lodash migration
ymh <ymh.work@gmail.com>
parents: 420
diff changeset
    43
    <div class="Rk-Editor-p">
459
98cae534083d add node and edge stroke width + adjust text + arrow placement + conrol arrow visibility
ymh <ymh.work@gmail.com>
parents: 458
diff changeset
    44
      <% if (options.show_node_editor_style_color) { %>
458
423bdf56d103 migrated to style, added dash style to client + small refactoring for shapes + triangle
ymh <ymh.work@gmail.com>
parents: 441
diff changeset
    45
      <div id="Rk-Editor-p-color">
434
0d5998b32a7c clean, and finalize lodash migration
ymh <ymh.work@gmail.com>
parents: 420
diff changeset
    46
        <span class="Rk-Editor-Label">
0d5998b32a7c clean, and finalize lodash migration
ymh <ymh.work@gmail.com>
parents: 420
diff changeset
    47
        <%-renkan.translate("Node color:")%></span>
0d5998b32a7c clean, and finalize lodash migration
ymh <ymh.work@gmail.com>
parents: 420
diff changeset
    48
        <div class="Rk-Edit-ColorPicker-Wrapper">
0d5998b32a7c clean, and finalize lodash migration
ymh <ymh.work@gmail.com>
parents: 420
diff changeset
    49
            <span class="Rk-Edit-Color" style="background: <%-node.color%>;">
0d5998b32a7c clean, and finalize lodash migration
ymh <ymh.work@gmail.com>
parents: 420
diff changeset
    50
                <span class="Rk-Edit-ColorTip"></span>
0d5998b32a7c clean, and finalize lodash migration
ymh <ymh.work@gmail.com>
parents: 420
diff changeset
    51
            </span>
0d5998b32a7c clean, and finalize lodash migration
ymh <ymh.work@gmail.com>
parents: 420
diff changeset
    52
            <%= renkan.colorPicker %>
0d5998b32a7c clean, and finalize lodash migration
ymh <ymh.work@gmail.com>
parents: 420
diff changeset
    53
            <span class="Rk-Edit-ColorPicker-Text"><%- renkan.translate("Choose color") %></span>
0d5998b32a7c clean, and finalize lodash migration
ymh <ymh.work@gmail.com>
parents: 420
diff changeset
    54
        </div>
458
423bdf56d103 migrated to style, added dash style to client + small refactoring for shapes + triangle
ymh <ymh.work@gmail.com>
parents: 441
diff changeset
    55
      </div>
459
98cae534083d add node and edge stroke width + adjust text + arrow placement + conrol arrow visibility
ymh <ymh.work@gmail.com>
parents: 458
diff changeset
    56
      <% } %>
98cae534083d add node and edge stroke width + adjust text + arrow placement + conrol arrow visibility
ymh <ymh.work@gmail.com>
parents: 458
diff changeset
    57
      <% if (options.show_node_editor_style_dash) { %>
458
423bdf56d103 migrated to style, added dash style to client + small refactoring for shapes + triangle
ymh <ymh.work@gmail.com>
parents: 441
diff changeset
    58
      <div id="Rk-Editor-p-dash">
423bdf56d103 migrated to style, added dash style to client + small refactoring for shapes + triangle
ymh <ymh.work@gmail.com>
parents: 441
diff changeset
    59
        <span class="Rk-Editor-Label"><%-renkan.translate("Dash:")%></span>
423bdf56d103 migrated to style, added dash style to client + small refactoring for shapes + triangle
ymh <ymh.work@gmail.com>
parents: 441
diff changeset
    60
        <input type="checkbox" name="Rk-Edit-Dash" class="Rk-Edit-Dash" <%- node.dash %> />
423bdf56d103 migrated to style, added dash style to client + small refactoring for shapes + triangle
ymh <ymh.work@gmail.com>
parents: 441
diff changeset
    61
      </div>
459
98cae534083d add node and edge stroke width + adjust text + arrow placement + conrol arrow visibility
ymh <ymh.work@gmail.com>
parents: 458
diff changeset
    62
      <% } %>
98cae534083d add node and edge stroke width + adjust text + arrow placement + conrol arrow visibility
ymh <ymh.work@gmail.com>
parents: 458
diff changeset
    63
      <% if (options.show_node_editor_style_thickness) { %>
98cae534083d add node and edge stroke width + adjust text + arrow placement + conrol arrow visibility
ymh <ymh.work@gmail.com>
parents: 458
diff changeset
    64
      <div id="Rk-Editor-p-thickness">
98cae534083d add node and edge stroke width + adjust text + arrow placement + conrol arrow visibility
ymh <ymh.work@gmail.com>
parents: 458
diff changeset
    65
          <span class="Rk-Editor-Label"><%-renkan.translate("Thickness:")%></span>
98cae534083d add node and edge stroke width + adjust text + arrow placement + conrol arrow visibility
ymh <ymh.work@gmail.com>
parents: 458
diff changeset
    66
          <a href="#" class="Rk-Edit-Size-Btn" id="Rk-Edit-Thickness-Down">-</a>
98cae534083d add node and edge stroke width + adjust text + arrow placement + conrol arrow visibility
ymh <ymh.work@gmail.com>
parents: 458
diff changeset
    67
          <span class="Rk-Edit-Size-Disp" id="Rk-Edit-Thickness-Value"><%-node.thickness%></span>
98cae534083d add node and edge stroke width + adjust text + arrow placement + conrol arrow visibility
ymh <ymh.work@gmail.com>
parents: 458
diff changeset
    68
          <a href="#" class="Rk-Edit-Size-Btn" id="Rk-Edit-Thickness-Up">+</a>
98cae534083d add node and edge stroke width + adjust text + arrow placement + conrol arrow visibility
ymh <ymh.work@gmail.com>
parents: 458
diff changeset
    69
      </div>
98cae534083d add node and edge stroke width + adjust text + arrow placement + conrol arrow visibility
ymh <ymh.work@gmail.com>
parents: 458
diff changeset
    70
      <% } %>
434
0d5998b32a7c clean, and finalize lodash migration
ymh <ymh.work@gmail.com>
parents: 420
diff changeset
    71
    </div>
420
22393cbf4467 export the templates of nodeeditor to html files
rougeronj
parents:
diff changeset
    72
<% } %> <% if (options.show_node_editor_image) { %>
434
0d5998b32a7c clean, and finalize lodash migration
ymh <ymh.work@gmail.com>
parents: 420
diff changeset
    73
    <div class="Rk-Edit-ImgWrap">
0d5998b32a7c clean, and finalize lodash migration
ymh <ymh.work@gmail.com>
parents: 420
diff changeset
    74
        <div class="Rk-Edit-ImgPreview">
0d5998b32a7c clean, and finalize lodash migration
ymh <ymh.work@gmail.com>
parents: 420
diff changeset
    75
            <img src="<%-node.image || node.image_placeholder%>" />
0d5998b32a7c clean, and finalize lodash migration
ymh <ymh.work@gmail.com>
parents: 420
diff changeset
    76
            <% if (node.clip_path) { %>
0d5998b32a7c clean, and finalize lodash migration
ymh <ymh.work@gmail.com>
parents: 420
diff changeset
    77
                <svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewbox="0 0 1 1" preserveAspectRatio="none">
0d5998b32a7c clean, and finalize lodash migration
ymh <ymh.work@gmail.com>
parents: 420
diff changeset
    78
                    <path style="stroke-width: .02; stroke:red; fill-opacity:.3; fill:red;" d="<%- node.clip_path %>" />
0d5998b32a7c clean, and finalize lodash migration
ymh <ymh.work@gmail.com>
parents: 420
diff changeset
    79
                </svg>
0d5998b32a7c clean, and finalize lodash migration
ymh <ymh.work@gmail.com>
parents: 420
diff changeset
    80
            <% }%>
0d5998b32a7c clean, and finalize lodash migration
ymh <ymh.work@gmail.com>
parents: 420
diff changeset
    81
        </div>
0d5998b32a7c clean, and finalize lodash migration
ymh <ymh.work@gmail.com>
parents: 420
diff changeset
    82
    </div>
0d5998b32a7c clean, and finalize lodash migration
ymh <ymh.work@gmail.com>
parents: 420
diff changeset
    83
    <p>
0d5998b32a7c clean, and finalize lodash migration
ymh <ymh.work@gmail.com>
parents: 420
diff changeset
    84
        <label><%-renkan.translate("Image URL:")%></label>
0d5998b32a7c clean, and finalize lodash migration
ymh <ymh.work@gmail.com>
parents: 420
diff changeset
    85
        <div>
0d5998b32a7c clean, and finalize lodash migration
ymh <ymh.work@gmail.com>
parents: 420
diff changeset
    86
            <a class="Rk-Edit-Image-Del" href="#"></a>
0d5998b32a7c clean, and finalize lodash migration
ymh <ymh.work@gmail.com>
parents: 420
diff changeset
    87
            <input class="Rk-Edit-Image" type="text" value='<%-node.image%>' />
0d5998b32a7c clean, and finalize lodash migration
ymh <ymh.work@gmail.com>
parents: 420
diff changeset
    88
        </div>
0d5998b32a7c clean, and finalize lodash migration
ymh <ymh.work@gmail.com>
parents: 420
diff changeset
    89
    </p>
420
22393cbf4467 export the templates of nodeeditor to html files
rougeronj
parents:
diff changeset
    90
<% if (options.allow_image_upload) { %>
434
0d5998b32a7c clean, and finalize lodash migration
ymh <ymh.work@gmail.com>
parents: 420
diff changeset
    91
    <p>
0d5998b32a7c clean, and finalize lodash migration
ymh <ymh.work@gmail.com>
parents: 420
diff changeset
    92
        <label><%-renkan.translate("Choose Image File:")%></label>
0d5998b32a7c clean, and finalize lodash migration
ymh <ymh.work@gmail.com>
parents: 420
diff changeset
    93
        <input class="Rk-Edit-Image-File" type="file" accept="image/*" />
0d5998b32a7c clean, and finalize lodash migration
ymh <ymh.work@gmail.com>
parents: 420
diff changeset
    94
    </p>
420
22393cbf4467 export the templates of nodeeditor to html files
rougeronj
parents:
diff changeset
    95
<% }%><% } %> <% if (options.show_node_editor_creator && node.has_creator) { %>
434
0d5998b32a7c clean, and finalize lodash migration
ymh <ymh.work@gmail.com>
parents: 420
diff changeset
    96
    <p>
0d5998b32a7c clean, and finalize lodash migration
ymh <ymh.work@gmail.com>
parents: 420
diff changeset
    97
        <span class="Rk-Editor-Label"><%-renkan.translate("Created by:")%></span>
0d5998b32a7c clean, and finalize lodash migration
ymh <ymh.work@gmail.com>
parents: 420
diff changeset
    98
        <span class="Rk-UserColor" style="background: <%-node.created_by_color%>;"></span>
0d5998b32a7c clean, and finalize lodash migration
ymh <ymh.work@gmail.com>
parents: 420
diff changeset
    99
        <%- shortenText(node.created_by_title, 25) %>
0d5998b32a7c clean, and finalize lodash migration
ymh <ymh.work@gmail.com>
parents: 420
diff changeset
   100
    </p>
420
22393cbf4467 export the templates of nodeeditor to html files
rougeronj
parents:
diff changeset
   101
<% } %> <% if (options.change_shapes) { %>
434
0d5998b32a7c clean, and finalize lodash migration
ymh <ymh.work@gmail.com>
parents: 420
diff changeset
   102
    <p>
0d5998b32a7c clean, and finalize lodash migration
ymh <ymh.work@gmail.com>
parents: 420
diff changeset
   103
        <label><%-renkan.translate("Shapes available")%>:</label>
0d5998b32a7c clean, and finalize lodash migration
ymh <ymh.work@gmail.com>
parents: 420
diff changeset
   104
        <select class="Rk-Edit-Shape">
458
423bdf56d103 migrated to style, added dash style to client + small refactoring for shapes + triangle
ymh <ymh.work@gmail.com>
parents: 441
diff changeset
   105
          <% _.each(shapes, function(shape) { %>
423bdf56d103 migrated to style, added dash style to client + small refactoring for shapes + triangle
ymh <ymh.work@gmail.com>
parents: 441
diff changeset
   106
            <option class="Rk-Edit-Vocabulary-Property" value="<%- shape %>"<% if (node.shape === shape) { %> selected<% } %>>
423bdf56d103 migrated to style, added dash style to client + small refactoring for shapes + triangle
ymh <ymh.work@gmail.com>
parents: 441
diff changeset
   107
                <%- renkan.translate(shape.charAt(0).toUpperCase() + shape.substring(1)) %>
434
0d5998b32a7c clean, and finalize lodash migration
ymh <ymh.work@gmail.com>
parents: 420
diff changeset
   108
            </option>
458
423bdf56d103 migrated to style, added dash style to client + small refactoring for shapes + triangle
ymh <ymh.work@gmail.com>
parents: 441
diff changeset
   109
          <% }); %>
434
0d5998b32a7c clean, and finalize lodash migration
ymh <ymh.work@gmail.com>
parents: 420
diff changeset
   110
        </select>
0d5998b32a7c clean, and finalize lodash migration
ymh <ymh.work@gmail.com>
parents: 420
diff changeset
   111
    </p>
420
22393cbf4467 export the templates of nodeeditor to html files
rougeronj
parents:
diff changeset
   112
<% } %>