client/templates/nodeeditor.html
author rougeronj
Tue, 22 Sep 2015 15:14:10 +0200
changeset 543 5f7bebdcfc0d
parent 530 9823b527c3a1
child 600 e12243191095
permissions -rw-r--r--
Improve the way we init the view. The data loader send a "loaded" event, hooked by the scene.py and initializing the backbone.history and the view. We don't use redraw_active in save-once and full-json, because it was making the view initialization dependent of these file which are externals. Small fix to hide the "set saved view" button when there is only one view.
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>
530
9823b527c3a1 add rich text editor on title
rougeronj
parents: 482
diff changeset
     7
    <% if (options.show_node_editor_title_richtext) { %>
9823b527c3a1 add rich text editor on title
rougeronj
parents: 482
diff changeset
     8
        <div class="Rk-Edit-Title" contenteditable="true"><%=node.title%></div>
9823b527c3a1 add rich text editor on title
rougeronj
parents: 482
diff changeset
     9
    <% } else { %>
9823b527c3a1 add rich text editor on title
rougeronj
parents: 482
diff changeset
    10
        <input class="Rk-Edit-Title" type="text" value="<%-node.title%>" />
9823b527c3a1 add rich text editor on title
rougeronj
parents: 482
diff changeset
    11
    <% } %>    
420
22393cbf4467 export the templates of nodeeditor to html files
rougeronj
parents:
diff changeset
    12
</p>
22393cbf4467 export the templates of nodeeditor to html files
rougeronj
parents:
diff changeset
    13
<% if (options.show_node_editor_uri) { %>
434
0d5998b32a7c clean, and finalize lodash migration
ymh <ymh.work@gmail.com>
parents: 420
diff changeset
    14
    <p>
0d5998b32a7c clean, and finalize lodash migration
ymh <ymh.work@gmail.com>
parents: 420
diff changeset
    15
        <label><%-renkan.translate("URI:")%></label>
0d5998b32a7c clean, and finalize lodash migration
ymh <ymh.work@gmail.com>
parents: 420
diff changeset
    16
        <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
    17
        <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
    18
    </p>
482
a55c33989404 add type selector in the node editor
rougeronj
parents: 468
diff changeset
    19
<% } %> <% if (options.change_types) { %>
a55c33989404 add type selector in the node editor
rougeronj
parents: 468
diff changeset
    20
    <p>
a55c33989404 add type selector in the node editor
rougeronj
parents: 468
diff changeset
    21
        <label><%-renkan.translate("Types available")%>:</label>
a55c33989404 add type selector in the node editor
rougeronj
parents: 468
diff changeset
    22
        <select class="Rk-Edit-Type">
a55c33989404 add type selector in the node editor
rougeronj
parents: 468
diff changeset
    23
          <% _.each(types, function(type) { %>
a55c33989404 add type selector in the node editor
rougeronj
parents: 468
diff changeset
    24
            <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
    25
                <%- renkan.translate(type.charAt(0).toUpperCase() + type.substring(1)) %>
a55c33989404 add type selector in the node editor
rougeronj
parents: 468
diff changeset
    26
            </option>
a55c33989404 add type selector in the node editor
rougeronj
parents: 468
diff changeset
    27
          <% }); %>
a55c33989404 add type selector in the node editor
rougeronj
parents: 468
diff changeset
    28
        </select>
a55c33989404 add type selector in the node editor
rougeronj
parents: 468
diff changeset
    29
    </p>
420
22393cbf4467 export the templates of nodeeditor to html files
rougeronj
parents:
diff changeset
    30
<% } %> <% if (options.show_node_editor_description) { %>
434
0d5998b32a7c clean, and finalize lodash migration
ymh <ymh.work@gmail.com>
parents: 420
diff changeset
    31
    <p>
0d5998b32a7c clean, and finalize lodash migration
ymh <ymh.work@gmail.com>
parents: 420
diff changeset
    32
        <label><%-renkan.translate("Description:")%></label>
468
364c367df7fc add rich text editor for description
ymh <ymh.work@gmail.com>
parents: 459
diff changeset
    33
        <% if (options.show_node_editor_description_richtext) { %>
364c367df7fc add rich text editor for description
ymh <ymh.work@gmail.com>
parents: 459
diff changeset
    34
            <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
    35
        <% } else { %>
364c367df7fc add rich text editor for description
ymh <ymh.work@gmail.com>
parents: 459
diff changeset
    36
            <textarea class="Rk-Edit-Description"><%=node.description%></textarea>
364c367df7fc add rich text editor for description
ymh <ymh.work@gmail.com>
parents: 459
diff changeset
    37
        <% } %>
434
0d5998b32a7c clean, and finalize lodash migration
ymh <ymh.work@gmail.com>
parents: 420
diff changeset
    38
    </p>
420
22393cbf4467 export the templates of nodeeditor to html files
rougeronj
parents:
diff changeset
    39
<% } %> <% if (options.show_node_editor_size) { %>
434
0d5998b32a7c clean, and finalize lodash migration
ymh <ymh.work@gmail.com>
parents: 420
diff changeset
    40
    <p>
0d5998b32a7c clean, and finalize lodash migration
ymh <ymh.work@gmail.com>
parents: 420
diff changeset
    41
        <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
    42
        <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
    43
        <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
    44
        <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
    45
    </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
    46
<% } %> <% if (options.show_node_editor_style) { %>
434
0d5998b32a7c clean, and finalize lodash migration
ymh <ymh.work@gmail.com>
parents: 420
diff changeset
    47
    <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
    48
      <% 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
    49
      <div id="Rk-Editor-p-color">
434
0d5998b32a7c clean, and finalize lodash migration
ymh <ymh.work@gmail.com>
parents: 420
diff changeset
    50
        <span class="Rk-Editor-Label">
0d5998b32a7c clean, and finalize lodash migration
ymh <ymh.work@gmail.com>
parents: 420
diff changeset
    51
        <%-renkan.translate("Node color:")%></span>
0d5998b32a7c clean, and finalize lodash migration
ymh <ymh.work@gmail.com>
parents: 420
diff changeset
    52
        <div class="Rk-Edit-ColorPicker-Wrapper">
0d5998b32a7c clean, and finalize lodash migration
ymh <ymh.work@gmail.com>
parents: 420
diff changeset
    53
            <span class="Rk-Edit-Color" style="background: <%-node.color%>;">
0d5998b32a7c clean, and finalize lodash migration
ymh <ymh.work@gmail.com>
parents: 420
diff changeset
    54
                <span class="Rk-Edit-ColorTip"></span>
0d5998b32a7c clean, and finalize lodash migration
ymh <ymh.work@gmail.com>
parents: 420
diff changeset
    55
            </span>
0d5998b32a7c clean, and finalize lodash migration
ymh <ymh.work@gmail.com>
parents: 420
diff changeset
    56
            <%= renkan.colorPicker %>
0d5998b32a7c clean, and finalize lodash migration
ymh <ymh.work@gmail.com>
parents: 420
diff changeset
    57
            <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
    58
        </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
    59
      </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
    60
      <% } %>
98cae534083d add node and edge stroke width + adjust text + arrow placement + conrol arrow visibility
ymh <ymh.work@gmail.com>
parents: 458
diff changeset
    61
      <% 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
    62
      <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
    63
        <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
    64
        <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
    65
      </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
    66
      <% } %>
98cae534083d add node and edge stroke width + adjust text + arrow placement + conrol arrow visibility
ymh <ymh.work@gmail.com>
parents: 458
diff changeset
    67
      <% 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
    68
      <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
    69
          <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
    70
          <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
    71
          <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
    72
          <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
    73
      </div>
98cae534083d add node and edge stroke width + adjust text + arrow placement + conrol arrow visibility
ymh <ymh.work@gmail.com>
parents: 458
diff changeset
    74
      <% } %>
434
0d5998b32a7c clean, and finalize lodash migration
ymh <ymh.work@gmail.com>
parents: 420
diff changeset
    75
    </div>
420
22393cbf4467 export the templates of nodeeditor to html files
rougeronj
parents:
diff changeset
    76
<% } %> <% if (options.show_node_editor_image) { %>
434
0d5998b32a7c clean, and finalize lodash migration
ymh <ymh.work@gmail.com>
parents: 420
diff changeset
    77
    <div class="Rk-Edit-ImgWrap">
0d5998b32a7c clean, and finalize lodash migration
ymh <ymh.work@gmail.com>
parents: 420
diff changeset
    78
        <div class="Rk-Edit-ImgPreview">
0d5998b32a7c clean, and finalize lodash migration
ymh <ymh.work@gmail.com>
parents: 420
diff changeset
    79
            <img src="<%-node.image || node.image_placeholder%>" />
0d5998b32a7c clean, and finalize lodash migration
ymh <ymh.work@gmail.com>
parents: 420
diff changeset
    80
            <% if (node.clip_path) { %>
0d5998b32a7c clean, and finalize lodash migration
ymh <ymh.work@gmail.com>
parents: 420
diff changeset
    81
                <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
    82
                    <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
    83
                </svg>
0d5998b32a7c clean, and finalize lodash migration
ymh <ymh.work@gmail.com>
parents: 420
diff changeset
    84
            <% }%>
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
    </div>
0d5998b32a7c clean, and finalize lodash migration
ymh <ymh.work@gmail.com>
parents: 420
diff changeset
    87
    <p>
0d5998b32a7c clean, and finalize lodash migration
ymh <ymh.work@gmail.com>
parents: 420
diff changeset
    88
        <label><%-renkan.translate("Image URL:")%></label>
0d5998b32a7c clean, and finalize lodash migration
ymh <ymh.work@gmail.com>
parents: 420
diff changeset
    89
        <div>
0d5998b32a7c clean, and finalize lodash migration
ymh <ymh.work@gmail.com>
parents: 420
diff changeset
    90
            <a class="Rk-Edit-Image-Del" href="#"></a>
0d5998b32a7c clean, and finalize lodash migration
ymh <ymh.work@gmail.com>
parents: 420
diff changeset
    91
            <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
    92
        </div>
0d5998b32a7c clean, and finalize lodash migration
ymh <ymh.work@gmail.com>
parents: 420
diff changeset
    93
    </p>
420
22393cbf4467 export the templates of nodeeditor to html files
rougeronj
parents:
diff changeset
    94
<% if (options.allow_image_upload) { %>
434
0d5998b32a7c clean, and finalize lodash migration
ymh <ymh.work@gmail.com>
parents: 420
diff changeset
    95
    <p>
0d5998b32a7c clean, and finalize lodash migration
ymh <ymh.work@gmail.com>
parents: 420
diff changeset
    96
        <label><%-renkan.translate("Choose Image File:")%></label>
0d5998b32a7c clean, and finalize lodash migration
ymh <ymh.work@gmail.com>
parents: 420
diff changeset
    97
        <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
    98
    </p>
420
22393cbf4467 export the templates of nodeeditor to html files
rougeronj
parents:
diff changeset
    99
<% }%><% } %> <% 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
   100
    <p>
0d5998b32a7c clean, and finalize lodash migration
ymh <ymh.work@gmail.com>
parents: 420
diff changeset
   101
        <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
   102
        <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
   103
        <%- shortenText(node.created_by_title, 25) %>
0d5998b32a7c clean, and finalize lodash migration
ymh <ymh.work@gmail.com>
parents: 420
diff changeset
   104
    </p>
420
22393cbf4467 export the templates of nodeeditor to html files
rougeronj
parents:
diff changeset
   105
<% } %> <% if (options.change_shapes) { %>
434
0d5998b32a7c clean, and finalize lodash migration
ymh <ymh.work@gmail.com>
parents: 420
diff changeset
   106
    <p>
0d5998b32a7c clean, and finalize lodash migration
ymh <ymh.work@gmail.com>
parents: 420
diff changeset
   107
        <label><%-renkan.translate("Shapes available")%>:</label>
0d5998b32a7c clean, and finalize lodash migration
ymh <ymh.work@gmail.com>
parents: 420
diff changeset
   108
        <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
   109
          <% _.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
   110
            <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
   111
                <%- 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
   112
            </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
   113
          <% }); %>
434
0d5998b32a7c clean, and finalize lodash migration
ymh <ymh.work@gmail.com>
parents: 420
diff changeset
   114
        </select>
0d5998b32a7c clean, and finalize lodash migration
ymh <ymh.work@gmail.com>
parents: 420
diff changeset
   115
    </p>
420
22393cbf4467 export the templates of nodeeditor to html files
rougeronj
parents:
diff changeset
   116
<% } %>