Skip to content
This repository has been archived by the owner on Jun 5, 2024. It is now read-only.

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
sennierer committed Jul 5, 2017
0 parents commit fda1d19
Show file tree
Hide file tree
Showing 30 changed files with 920 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__pycache__
Empty file added __init__.py
Empty file.
3 changes: 3 additions & 0 deletions admin.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from django.contrib import admin

# Register your models here.
16 changes: 16 additions & 0 deletions forms.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# -*- coding: utf-8 -*-
from django import forms
from crispy_forms.helper import FormHelper
from crispy_forms.layout import Submit
from django.core.urlresolvers import reverse
from crispy_forms.layout import Layout, Fieldset, ButtonHolder, Submit, Div


class form_user_login(forms.Form):
username = forms.CharField(label='Username',widget=forms.TextInput)
password = forms.CharField(label='Password',widget=forms.PasswordInput)

def __init__(self, *args, **kwargs):
super(form_user_login, self).__init__(*args, **kwargs)
self.helper = FormHelper()
self.helper.add_input(Submit('submit','Login'))
3 changes: 3 additions & 0 deletions models.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from django.db import models

# Create your models here.
154 changes: 154 additions & 0 deletions static/webpage/apis.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,154 @@
a.list-group-item {
cursor: pointer;
}

div.txt {
line-height: 2em;
}

[data-entity-class] {
line-height: 1;
display: inline-block;
background: transparent;
padding: 0 0.15em 0.15em 0.15em;
position: relative;
cursor: help;
border-bottom: 3px solid;
white-space: pre;
}

[data-entity-class]:after {
box-sizing: border-box;
content: attr(data-user-added) '*' attr(data-entity-class);
line-height: 1;
display: inline-block;
font-size: 0.65em;
font-weight: bold;
text-transform: uppercase;
position: absolute;
bottom: -1.5em;
left: 0;
-webkit-transition: opacity 0.25s ease;
transition: opacity 0.25s ease;
}

[data-entity-class="PersonPlace"] ~ [data-entity-class="PersonPlace"]:after {
opacity: 0;
}

[data-entity-class="PersonPlace"] ~ [data-entity-class="PersonPlace"]:hover:after {
opacity: 1;
}

[data-entity-class="PersonInstitution"] ~ [data-entity-class="PersonInstitution"]:after {
opacity: 0;
}

[data-entity-class="PersonInstitution"] ~ [data-entity-class="PersonInstitution"]:hover:after {
opacity: 1;
}

[data-entity-class="PersonPerson"] ~ [data-entity-class="PersonPerson"]:after {
opacity: 0;
}

[data-entity-class="PersonPerson"] ~ [data-entity-class="PersonPerson"]:hover:after {
opacity: 1;
}

[data-entity-class][data-entity-class="PersonPlace"] {
border-bottom-color: #394bf4;
}

[data-entity-class][data-entity-class="PersonPlace"]:after {
color: #394bf4;
}

[data-entity-class][data-entity-class="PersonInstitution"] {
border-bottom-color: hsla(120, 100%, 50%, 0.8);
}

[data-entity-class][data-entity-class="PersonInstitution"]:after {
color: hsla(120, 100%, 50%, 0.8);
}

[data-entity-class][data-entity-class="PersonPerson"] {
border-bottom-color: hsla(356, 86%, 50%, 0.8);
}

[data-entity-class][data-entity-class="PersonPerson"]:after {
color: hsla(356, 86%, 50%, 0.8);
}

mark.hl_text_complex {
border-bottom-color: hsla(57, 100%, 55%, 0.87);
cursor: help;
}

mark.complex:after {
color: hsla(57, 100%, 55%, 0.87);
}

.top-buffer { margin-top:20px; }

span.autocomplete-light-widget {
display: block;
}

.yourlabs-autocomplete [data-value] {
white-space: normal;
word-wrap: break-word;
}

span.autocomplete-light-text-widget {
max-width: 500px;
}

span.autocomp_span {
width: auto;
}

ul.pagination li.current {
padding-left: 10px;
padding-right: 10px;
}

ul.annotations_list {
list-style-type: none;
padding: 0.5em;
line-height: 2.5em;
}

table thead th{
background-repeat: no-repeat;
background-position: center left;
cursor: pointer;
}
.asc{
background-image: url(django_tables2/themes/paleblue/img/arrow-active-up.png);
}
.desc{
background-image: url(django_tables2/themes/paleblue/img/arrow-active-down.png);
}

a {
padding-left: 5px;
}

.tooltipster-base div {
height: auto;
}

#accordion { margin-right:10px; }
.panel-collapse>.list-group .list-group-item:first-child {border-top-right-radius: 0;border-top-left-radius: 0;}
.panel-collapse>.list-group .list-group-item {border-width: 1px 0;}
.panel-collapse>.list-group {margin-bottom: 0;}
.panel-collapse .list-group-item {border-radius:0;}

.panel-collapse .list-group .list-group {margin: 0;margin-top: 10px;}
.panel-collapse .list-group-item li.list-group-item {margin: 0 -15px;border-top: 1px solid #ddd !important;border-bottom: 0;padding-left: 30px;}
.panel-collapse .list-group-item li.list-group-item:last-child {padding-bottom: 0;}

.panel-collapse div.list-group div.list-group{margin: 0;}
.panel-collapse div.list-group .list-group a.list-group-item {border-top: 1px solid #ddd !important;border-bottom: 0;padding-left: 30px;}
.panel-collapse .list-group-item li.list-group-item {border-top: 1px solid #DDD !important;}
183 changes: 183 additions & 0 deletions static/webpage/apis_highlighter.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,183 @@
function find_related_object(elem, data) {
for (i = 0; i < data.length; i++) {
if (elem === data[i]['id']) {
return data[i]
}
}
}

function get_menu_object(elem) {
if (elem['kind'] == 'txt') {
var res = '<a class="list-group-item">'+elem['name']+'</a>'}
else if (elem['kind'] == 'frm') {
var res = '<a class="list-group-item" onclick=GetFormAjaxHighl("'+elem.api.api_endpoint+'")>'+elem['name']+'</a>'
} else if (elem['kind'] == 'fn') {
var res = '<a class="list-group-item" onclick='+elem.api.api_endpoint+'>'+elem['name']+'</a>'
}

return res
}

function updateObject(object, newValue, path){

var stack = path.split('>');

while (stack.length>1) {
object = object[stack.shift()];
}

object[stack.shift()] = newValue;

}

function create_nested_menu(data, data_list) {
//console.log(data)
var res = ''
for (x in data) {

// res += '<li class="list-group-item">'+data_list[x]['name']
if (data[x] instanceof Object && Object.keys(data[x]).length > 0) {
res += '<a href="#HighlighterMenu'+data_list[x]['id']+'" class="list-group-item" data-toggle="collapse" data-parent="#HighlighterMenu'+data_list[x]['id']+'">'+data_list[x]['name']+'<i class="fa fa-caret-down"></i></a>\
<div class="collapse list-group-submenu list-group-submenu-1" id="HighlighterMenu'+data_list[x]['id']+'">'
res += create_nested_menu(data[x], data_list)
res += '</div>'
} else {
//console.log(data_list[x])
res += get_menu_object(data_list[x])
}
}
return res
}

function create_apis_menu(data) {
var lst_m = []
var len = 0
for (i = 0; i < data['menuentry_set'].length; i++) {
//console.log(data['menuentry_set'][i]);
var lst = []
var elem = data['menuentry_set'][i]
lst.push(elem)
while (elem.parent) {
if (!(elem.parent instanceof Object)) {
elem.parent = find_related_object(elem.parent, data['menuentry_set'])}
lst.push(elem.parent)
elem = elem.parent
}
lst_m.push(lst.reverse());
if (lst.length > len) {
len = lst.length
}
}
var menu_2 = {}
var menu_2_lst = {}
for (x = 0; x < lst_m.length; x++) {
var s_n = menu_2
for (u = 0; u < lst_m[x].length; u++) {
if (!(lst_m[x][u]['id'] in menu_2_lst)) {
s_n[lst_m[x][u]['id']] = {}
menu_2_lst[lst_m[x][u]['id']] = lst_m[x][u]
}
s_n = s_n[lst_m[x][u]['id']]}
}
var menu_html = create_nested_menu(menu_2, menu_2_lst)
menu_html += '</div>'
menu_html = '<div class="panel list-group" id="accordion">' + menu_html
return menu_html
}


function get_selected_text(txt_id) {
var element = document.getElementById(txt_id);
var start = 0, end = 0;
var sel, range, priorRange;
if (typeof window.getSelection != "undefined") {
range = window.getSelection().getRangeAt(0);
priorRange = range.cloneRange();
priorRange.selectNodeContents(element);
priorRange.setEnd(range.startContainer, range.startOffset);
start = priorRange.toString().length;
end = start + range.toString().length;
} else if (typeof document.selection != "undefined" &&
(sel = document.selection).type != "Control") {
range = sel.createRange();
priorRange = document.body.createTextRange();
priorRange.moveToElementText(element);
priorRange.setEndPoint("EndToStart", range);
start = priorRange.text.length;
end = start + range.text.length;
}
return {
start: start,
end: end,
rect: range.getBoundingClientRect()
};
};


function init_apis_highlighter(project_id, entity_id) {
$.get("/api/HLProjects/"+project_id.toString()+"/", function(data){
//menu = create_apis_menu(data.results[0])
//$( "#test_menu" ).append(menu)
//console.log(data)
$.ApisHigh = {}
$.ApisHigh.entity_id = entity_id
var lst_class = []
for (i=0; i < data['texthigh_set'].length; i++) {
lst_class.push('.'+data['texthigh_set'][i]['text_class'])
}
var cl_2 = lst_class.join(', ')
$(cl_2).bind('mouseup',function() {
$.ApisHigh.selected_text = get_selected_text($(this).attr('id'))
$.ApisHigh.selected_text.id = $(this).attr('id')
})
$(cl_2).tooltipster({
content: 'Loading...',
contentAsHTML: true,
interactive: true,
trigger: 'click',
theme: 'tooltipster-light',
side: ['bottom'],

functionPosition: function(instance, helper, position){
//console.log(position)
position.coord.top = ($.ApisHigh.selected_text.rect.top + (position.distance + $.ApisHigh.selected_text.rect.height));
position.coord.left = ($.ApisHigh.selected_text.rect.left - ((position.size.width/2)-($.ApisHigh.selected_text.rect.width/2)));
position.target = $.ApisHigh.selected_text.rect.left + ($.ApisHigh.selected_text.rect.width/2)
position.size.height = 'auto'
//console.log(position.target)
return position;
},
// 'instance' is basically the tooltip. More details in the "Object-oriented Tooltipster" section.
functionBefore: function(instance, helper) {
if ($.ApisHigh.high_complex){
$.ApisHigh.high_complex.close();
};
if ($.ApisHigh.selected_text.start == $.ApisHigh.selected_text.end) {
return false
}
var $origin = $(helper.origin);
// we set a variable so the data is only loaded once via Ajax, not every time the tooltip opens
if ($origin.data('loaded') !== true) {

menu = create_apis_menu(data)

// call the 'content' method to update the content of our tooltip with the returned data
instance.content(menu);


// to remember that the data has been loaded
$origin.data('loaded', true);
$.ApisHigh.data_original = menu;

} else {//console.log('fired');

instance.content($.ApisHigh.data_original);}
$.ApisHigh.tt_instance = instance
},

});

//$.ApisHigh.tt_instance = $(cl_2).tooltipster('instance');
})
}

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/webpage/img/INZ-Logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/webpage/img/INZ-Logo_orig.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/webpage/img/ISR_logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/webpage/img/apis.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/webpage/img/dach_3et.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/webpage/img/fassadehauptgebaeude.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/webpage/img/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/webpage/img/network.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/webpage/img/places.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
26 changes: 26 additions & 0 deletions static/webpage/libraries/bower.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"name": "libraries",
"description": "libraries for APIS",
"main": "libraries",
"license": "MIT",
"homepage": "",
"private": true,
"ignore": [
"**/.*",
"node_modules",
"bower_components",
"test",
"tests"
],
"dependencies": {
"jquery": "^3.2.1",
"bootstrap": "^3.3.7",
"bootstrap-multiselect": "^0.9.13",
"bootstrap-datepicker": "^1.7.0",
"jquery-tablesort": "^0.0.11",
"leaflet": "^1.1.0",
"tooltipster": "^4.2.5",
"leaflet.markercluster": "Leaflet.markercluster#^1.0.6",
"linkurious.js": "Linkurious/linkurious.js#^1.5.1"
}
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit fda1d19

Please sign in to comment.