diff options
| author | Alon Levy <alon@pobox.com> | 2014-12-16 17:14:32 +0200 |
|---|---|---|
| committer | Alon Levy <alon@pobox.com> | 2014-12-16 17:14:32 +0200 |
| commit | c7d026b1d504323a8c61d51b726e5e8d2337fc4b (patch) | |
| tree | 75607d07c90beb8024e34afd2bab3503dcaccda4 /res | |
| parent | dff765d765085fe2ee172abc606f4f8b25a39c27 (diff) | |
| parent | 38078c537f642806e4849dc99c07d679f816fe23 (diff) | |
Merging rhizi-server into rhizi, back to a single repo
Merge remote-tracking branch 'old-server/master' into wip/map-nodes-by-id_minimize-name-use
Diffstat (limited to 'res')
| -rw-r--r-- | res/etc/rhizi-server.conf | 9 | ||||
| -rw-r--r-- | res/neo4j/reset-db__single_link.cypher | 15 | ||||
| -rw-r--r-- | res/templates/index.html | 128 | ||||
| -rw-r--r-- | res/templates/login.html | 72 |
4 files changed, 224 insertions, 0 deletions
diff --git a/res/etc/rhizi-server.conf b/res/etc/rhizi-server.conf new file mode 100644 index 00000000..f5e3c2d3 --- /dev/null +++ b/res/etc/rhizi-server.conf @@ -0,0 +1,9 @@ +listen_address = 127.0.0.1 +listen_port = 8080 +development_mode = True +neo4j_url = http://127.0.0.1:7474 +log_path = rhizi-server.log +access_control = False + +SERVER_NAME = rhizi.local:8080 +DEBUG = True diff --git a/res/neo4j/reset-db__single_link.cypher b/res/neo4j/reset-db__single_link.cypher new file mode 100644 index 00000000..39dcf6e4 --- /dev/null +++ b/res/neo4j/reset-db__single_link.cypher @@ -0,0 +1,15 @@ +// Flush +match (n) optional match (n)-[r]-() delete n,r; + +// +// Constraints +// +// FIXME: use wildcard constraint when supported +// +create constraint on (x:Person) assert x.name is unique; +create constraint on (x:Skill) assert x.name is unique; + +// Data +create (x:Person {name:'Bob', id: 'p_0', description: 'Bob is ...' }); +create (x:Skill {name:'Kung-Fu', id: 's_0', description: 'Kung-Fu is ...'}); +match (m:Person {id: 'p_0'}),(n:Skill {id: 's_0'}) create (m)-[:Knows {id: 'l_0'}]->(n); diff --git a/res/templates/index.html b/res/templates/index.html new file mode 100644 index 00000000..67467877 --- /dev/null +++ b/res/templates/index.html @@ -0,0 +1,128 @@ +<!DOCTYPE html> +<head> + <title>Rhizi Prototype </title> + <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> + <link href="res/css/style.css" rel="stylesheet" type="text/css"> + <link rel="shortcut icon" href="res/img/favicon2.ico" /> + + <script src="src/local_config.js"></script> + <script data-main='src/app.js' src="lib/require.js"></script> + +</head> + +<body> + <div id="chromeinputbugworkaround" style="position:fixed; top:0px; left:0px; width:100%"> + <span id="measure-node" class="graph nodetext" style="position: absolute; display: inline; top: -300px; left: 0px;">suicide squade, attack!</span> + <span id="measure-link" class="graph linklabel" style="position: absolute; display: inline; top: -300px; left: 0px;">those who are about to cry, we kaput you.</span> + <div class="top-bar"> + <h3 class="doc-title">Server test</h3> + <div class="user-area"> + <div class="username"> + <div class="profile-circle"></div> + <span class="profile-initials">UH</span> + <div class="profile-username">Welcome <span id="user_id">{{ username }}</span>!<span id="logout-button" class="button">Logout</span></div> + </div> + <img class="organization-logo" src="res/img/CRI-logo.png"> + </div> + </div> + <div class="search-bar"> + <div class="search-input"> + <input id="search" placeholder="Search for nodes and relationships"/> + </div> + <div id="search-suggestion" class="suggestion" style="display: none"> + </div> + <div class="export"> + <a href="#">Export</a> + </div> + </div> + <div id="intro-task" class="task-alert" style="display:none"> + <h3 class="task-desc">Connect between <span>yourself</span> and the <span> clubs,</span><span> internship proposals,</span><span> skills,</span><span> and</span><span> scientific interests</span></span> you have: + </h3> + <div class="task-close-button">got it</div> + </div> + <div class="graph-view"> + <div class="input-container"> + <form> + <input class="input-bar" id="textanalyser" placeholder="Add nodes and relationships"/> + <button class="add-button"></button> + </form> + <div id="input-suggestion" class="suggestion" style="display: none"> + </div> + </div> + <div class="info-container"> + <div class="edge_info" style="display:none">Title: <span id="edgetitle"></span><br/> + <button id="deleteedge">Delete</button> + </div> + <div class="info" style="display:none"> + <form id="editbox"> + <p class="info-card-attr">Name</p><p class="info-card-attr-val"><input id="editformname"></p> + <label class="info-card-attr">Type</label> + <select id="edittype" class="select-dropdown"> + <option value="person">Person</option><option value="club">Club</option><option value="skill">Skill</option><option value="interest">Interest</option><option value="third-internship-proposal">Third-internship-proposal</option><option value="internship">Internship</option> + </select><br/> + <div id="status"> + <label class="info-card-attr">Status</label><select id="editstatus"> + <option value="waiting">Waiting</option><option value="approved">Approved</option><option value="notapproved">Not Approved</option> + </select><br/> + </div> + <div id="startdate"><label class="info-card-attr">Start date</label><input id="editstartdate"/></br></div> + <div id="enddate"><label class="info-card-attr">End date:</label><input id="editenddate"/></div> + <div id="desc"><label>Description</label><input id="editdescription"/></div> + <div id="url"><p class="info-card-attr">URL</p><p class="info-card-attr-val info-card-url"><input id="editurl"></p></div> + <hr> + <button id="edit-node-dialog__save" class="btn-regular btn-regular-outline">Save</button> + <button id="edit-node-dialog__delete" class="btn-regular btn-regular-outline">Delete</button> + </form> + </div> + </div> + + <div class="typeselection" style="display:none"> + <table> + <tr id="intro"><td>Pick a type with [TAB] key</td></tr> + <tr id="chosentypelabel"><td>Chosen Type: <span id="chosentypename"/></td></tr> + <tr id="chosentypedesc"><td></td></tr> + </table> + </div> + + <div class="debug-ui"> + <div class="debug-ui-row"> + <div class="debug-ui-left"> + <a class="save-history" href="#">Save history</a> + </div> + <div class="debug-ui-right"> + <a id="replay-history" style="display: none" href="#">Replay history</a> + </div> + </div> + <div class="debug-ui-row"> + <div class="debug-ui-left"> + <div class="save"> + <a href="#">Save</a> + </div> + </div> + </div> + <div class="debug-ui-row"> + <div class="debug-ui-left"> + <div class="local-storage-load"> + <a href="#">Load</a> + </div> + </div> + <div class="debug-ui-right"> + <div class="url-copy"> + <a href="#">Copy to URL</a> + </div> + </div> + </div> + <div class="debug-ui-row"> + Import <input type="file" class="file-import" /> + </div> + </div> + + </div> + + <div class="rhizi-logo"><a href="http://www.rhizi.org"> + <img src="res/img/rhizi-logo.png"/></a> + </div> + </div> + +</body> +</html> diff --git a/res/templates/login.html b/res/templates/login.html new file mode 100644 index 00000000..186d6cd4 --- /dev/null +++ b/res/templates/login.html @@ -0,0 +1,72 @@ +<!DOCTYPE html> +<head> +<meta charset="UTF-8"> +<title>Welcome to Rhizi</title> +<link href="/res/css/style.css" rel="stylesheet" type="text/css"> +<script src="/static/lib/jquery.js" type="text/javascript"></script> +<script type="text/javascript"> + function submit_login_form() { + var data = { + username : $('#login_username').val(), + password : $('#login_password').val() + }; + + // TODO: validate + + $.ajax({ + type : "POST", + url: '/login', + async : false, + cache : false, + data : JSON.stringify(data), + dataType : 'json', + contentType : "application/json; charset=utf-8" + }); + } +</script> +</head> + +<body> +<h1> Welcome to Rhizi!</h1> + + <p>Rhizi is a collaborative knowledge editor. We are using it to create an interactome of AIV M2 students, their skills, interests, clubs and internships.</p> + <p>This version is meant for you to add yourself in the interactome and share how it went. </p> + <p><a href="mailto:dor.garbash@gmail.com">Send us an Email</a> about your experience, especially if you encountered any problem!</p> + <h2>Disclaimer</h2> + <ul> + <li>The content here may be deleted at any time.</li> + <li>You can export your work as a JSON, but we don't guarantee we will continue to support it later on.</li> + <li>We will implement a feature to generate your own Rhizi-doc in the coming months. Until then, you will not be able to launch your own Rhizi-doc.</li> + </ul> + <div id="login_form_panel"> + <form + onsubmit="submit_login_form();" + id="login_form"> + <h2 id="login_form__heading">Login</h2> + <br> + <div class="login_form__key">Username:</div> + <div class="login_form__value"> + <input + type="text" + id="login_username"> + </div> + <br> + <div class="login_form__key">Password:</div> + <div class="login_form__value"> + <input + type="password" + id="login_password"> + </div> + <p> + <input + type="submit" + value="Login"> + </p> + </form> + <div id="failed-login"> + {% if login_failed %}<b>Login Failed</b>{% endif %} + </div> + </div> + +</body> +</html> |
