chg: [tags] remove old flask blueprint

pull/594/head
Terrtia 2023-04-05 11:06:21 +02:00
parent 885bdb115b
commit 99ea742a59
No known key found for this signature in database
GPG Key ID: 1E1B1F50D84613D0
9 changed files with 12 additions and 876 deletions

View File

@ -256,7 +256,7 @@
$(document).ready(function () { $(document).ready(function () {
$("#page-items-submit").addClass("active"); $("#page-items-submit").addClass("active");
$.getJSON("{{ url_for('Tags.get_all_tags_taxonomies') }}", $.getJSON("{{ url_for('tags_ui.get_all_taxonomies_customs_tags') }}",
function (data) { function (data) {
ltags = $('#ltags').tagSuggest({ ltags = $('#ltags').tagSuggest({
@ -267,7 +267,7 @@
}); });
}); });
$.getJSON("{{ url_for('Tags.get_all_tags_galaxy') }}", $.getJSON("{{ url_for('tags_ui.tag_galaxies_tags_enabled_json') }}",
function (data) { function (data) {
ltagsgalaxies = $('#ltagsgalaxies').tagSuggest({ ltagsgalaxies = $('#ltagsgalaxies').tagSuggest({
@ -306,7 +306,7 @@
<script> <script>
jQuery("#all-tags-taxonomies").on("click", function (e) { jQuery("#all-tags-taxonomies").on("click", function (e) {
//change input tags list //change input tags list
$.getJSON("{{ url_for('Tags.get_all_tags_taxonomies') }}", $.getJSON("{{ url_for('tags_ui.get_all_taxonomies_customs_tags') }}",
function (data) { function (data) {
ltags.setData(data) ltags.setData(data)
}); });
@ -315,7 +315,7 @@
</script> </script>
<script> <script>
jQuery("#all-tags-galaxies").on("click", function (e) { jQuery("#all-tags-galaxies").on("click", function (e) {
$.getJSON("{{ url_for('Tags.get_all_tags_galaxy') }}", $.getJSON("{{ url_for('tags_ui.tag_galaxies_tags_enabled_json') }}",
function (data) { function (data) {
ltagsgalaxies.setData(data) ltagsgalaxies.setData(data)
}); });
@ -323,7 +323,7 @@
{% for taxo in active_taxonomies %} {% for taxo in active_taxonomies %}
jQuery("#{{ taxo }}-id{{ loop.index0 }}").on("click", function (e) { jQuery("#{{ taxo }}-id{{ loop.index0 }}").on("click", function (e) {
$.getJSON("{{ url_for('Tags.get_tags_taxonomie') }}?taxonomie={{ taxo }}", $.getJSON("{{ url_for('tags_ui.tag_taxonomie_tags_enabled_json') }}?taxonomie={{ taxo }}",
function (data) { function (data) {
ltags.setData(data) ltags.setData(data)
}); });
@ -333,7 +333,7 @@
<script> <script>
{% for galaxy in active_galaxies %} {% for galaxy in active_galaxies %}
jQuery("#{{ galaxy }}-idgalax{{ loop.index0 }}").on("click", function (e) { jQuery("#{{ galaxy }}-idgalax{{ loop.index0 }}").on("click", function (e) {
$.getJSON("{{ url_for('Tags.get_tags_galaxy') }}?galaxy={{ galaxy }}", $.getJSON("{{ url_for('tags_ui.tag_galaxy_tags_enabled_json') }}?galaxy={{ galaxy }}",
function (data) { function (data) {
ltagsgalaxies.setData(data) ltagsgalaxies.setData(data)
}); });

View File

@ -1,168 +0,0 @@
#!/usr/bin/env python3
# -*-coding:UTF-8 -*
'''
Flask functions and routes for the trending modules page
'''
import redis
from flask import Flask, render_template, jsonify, request, Blueprint, redirect, url_for
from Role_Manager import login_admin, login_analyst, login_read_only
from flask_login import login_required
import json
import datetime
from pytaxonomies import Taxonomies
from pymispgalaxies import Galaxies, Clusters
# ============ VARIABLES ============
import Flask_config
app = Flask_config.app
baseUrl = Flask_config.baseUrl
r_serv_tags = Flask_config.r_serv_tags
Tags = Blueprint('Tags', __name__, template_folder='templates')
# ============ FUNCTIONS ============
# TODO:
# TODO:
# TODO:
# TODO:
# TODO:
# TODO:
# # TODO: replace me with get_tag_selector_dict()
def get_tags_with_synonyms(tag):
str_synonyms = ' - synonyms: '
synonyms = r_serv_tags.smembers('synonym_tag_' + tag)
# synonyms to display
for synonym in synonyms:
str_synonyms = str_synonyms + synonym + ', '
# add real tag
if str_synonyms != ' - synonyms: ':
return {'name':tag + str_synonyms,'id':tag}
else:
return {'name':tag,'id':tag}
# ============= ROUTES ==============
@Tags.route("/Tags/get_all_tags_taxonomies")
@login_required
@login_read_only
def get_all_tags_taxonomies():
active_taxonomie = r_serv_tags.smembers('active_taxonomies')
list_tags = []
for taxonomie in active_taxonomie:
# l_tags = taxonomies.get(taxonomie).machinetags()
l_tags = r_serv_tags.smembers('active_tag_' + taxonomie)
for tag in l_tags:
list_tags.append( tag )
return jsonify(list_tags)
@Tags.route("/Tags/get_all_tags_galaxies")
@login_required
@login_read_only
def get_all_tags_galaxy():
active_galaxies = r_serv_tags.smembers('active_galaxies')
list_tags = []
for galaxy in active_galaxies:
l_tags = r_serv_tags.smembers('active_tag_galaxies_' + galaxy)
for tag in l_tags:
list_tags.append(get_tags_with_synonyms(tag))
return jsonify(list_tags)
@Tags.route("/Tags/get_tags_taxonomie")
@login_required
@login_read_only
def get_tags_taxonomie():
taxonomie = request.args.get('taxonomie')
taxonomies = Taxonomies()
list_taxonomies = list(taxonomies.keys())
active_taxonomie = r_serv_tags.smembers('active_taxonomies')
#verify input
if taxonomie in list_taxonomies:
if taxonomie in active_taxonomie:
list_tags = []
l_tags = r_serv_tags.smembers('active_tag_' + taxonomie)
for tag in l_tags:
list_tags.append( tag )
return jsonify(list_tags)
else:
return 'this taxonomie is disable'
else:
return 'INCORRECT INPUT'
@Tags.route("/Tags/get_tags_galaxy")
@login_required
@login_read_only
def get_tags_galaxy():
galaxy = request.args.get('galaxy')
active_galaxies = r_serv_tags.smembers('active_galaxies')
#verify input
if galaxy in active_galaxies:
list_tags = []
l_tags = r_serv_tags.smembers('active_tag_galaxies_' + galaxy)
for tag in l_tags:
list_tags.append(get_tags_with_synonyms(tag))
return jsonify(list_tags)
else:
return 'this galaxy is disable'
# @Tags.route("/Tags/tag_validation")
# @login_required
# @login_analyst
# def tag_validation():
#
# path = request.args.get('paste')
# tag = request.args.get('tag')
# status = request.args.get('status')
#
# if (status == 'fp' or status == 'tp') and r_serv_tags.sismember('list_tags', tag):
#
# if status == 'tp':
# r_serv_statistics.sadd('tp:'+tag, path)
# r_serv_statistics.srem('fp:'+tag, path)
# else:
# r_serv_statistics.sadd('fp:'+tag, path)
# r_serv_statistics.srem('tp:'+tag, path)
#
# return redirect(url_for('objects_item.showItem', id=path))
# else:
# return 'input error'
# ========= REGISTRATION =========
app.register_blueprint(Tags, url_prefix=baseUrl)

View File

@ -1,175 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Edit Galaxy - AIL</title>
<link rel="icon" href="{{ url_for('static', filename='image/ail-icon.png') }}">
<!-- Core CSS -->
<link href="{{ url_for('static', filename='css/bootstrap.min.css') }}" rel="stylesheet">
<link href="{{ url_for('static', filename='font-awesome/css/font-awesome.css') }}" rel="stylesheet">
<link href="{{ url_for('static', filename='css/sb-admin-2.css') }}" rel="stylesheet">
<link href="{{ url_for('static', filename='css/dataTables.bootstrap.css') }}" rel="stylesheet" type="text/css" />
<!-- JS -->
<script type="text/javascript" src="{{ url_for('static', filename='js/dygraph-combined.js') }}"></script>
<script language="javascript" src="{{ url_for('static', filename='js/jquery.js') }}"></script>
<script src="{{ url_for('static', filename='js/bootstrap.min.js') }}"></script>
<script src="{{ url_for('static', filename='js/jquery.dataTables.min.js') }}"></script>
<script src="{{ url_for('static', filename='js/dataTables.bootstrap.js') }}"></script>
<style>
.tooltip-inner {
text-align: left;
height: 200%;
width: 200%;
max-width: 500px;
max-height: 500px;
font-size: 13px;
}
xmp {
white-space:pre-wrap;
word-wrap:break-word;
}
.test thead{
background: #d91f2d;
color: #fff;
}
</style>
</head>
<body>
{% include 'navbar.html' %}
<div id="page-wrapper">
<div class="row">
<div class="col-lg-12">
<a href="{{ url_for('Tags.galaxies') }}" class="btn btn-light pull-left">
<i class="fa fa-arrow-left fa"></i> List Galaxies
</a>
</div>
<!-- /.col-lg-12 -->
</div>
<!-- /.row -->
<div class="panel panel-primary">
<div class="panel-heading">{{ name }}
{% if active %}
<span class="label label-success pull-right"> Enabled</span>
<span class="pull-right">&nbsp;&nbsp;&nbsp;</span>
<span class="badge badge-light pull-right">{{ badge }}</span>
{% endif %}
{% if not active %}
<span class="label label-danger pull-right"> Disabled</span>
{% endif %}
</div>
<div class="panel-body">
{{ description }}
<br><br>
Version: {{ version }}
{% if active %}
<a href="{{ url_for('Tags.disable_galaxy') }}?galaxy={{ id }}" class="btn btn-danger pull-right">
<i class="fa fa-times fa"></i> Disable Galaxy
</a>
{% endif %}
{% if not active %}
<a href="{{ url_for('Tags.active_galaxy') }}?galaxy={{ id }}" class="btn btn-success pull-right">
<i class="fa fa-check-square-o fa"></i> Enable Galaxy
</a>
{% endif %}
</div>
</div>
<form action="{{ url_for('Tags.edit_galaxy_tag') }}" id="checkboxForm">
<input type="hidden" value="{{ id }}" name="galaxy" />
<table class="test table table-striped table-bordered table-hover table-responsive " id="myTable_">
<thead>
<tr>
<th></th>
<th style="max-width: 800px;">Tag</th>
<th style="max-width: 800px;">Description</th>
<th>Enabled</th>
</tr>
</thead>
<tbody>
{% for tag in tags %}
<tr>
<td>
{% if status[loop.index0] %}
<div style="display:none;">Enabled</div>
<input type="checkbox" value="{{ tag[0] }}" id="{{ tag[0] }}" name="tag_enabled" checked>
{% endif %}
{% if not status[loop.index0] %}
<div style="display:none;">Disabled</div>
<input type="checkbox" value="{{ tag[0] }}" id="{{ tag[0] }}" name="tag_disabled" >
{% endif %}
</td>
<td>
<a href="{{ url_for('Tags.tag_galaxy_info') }}?galaxy={{ request.args.get('galaxy') }}&tag={{ tag[0] }}">{{ tag[0] }}</a>
</td>
<td>{{ tag[1] }}</td>
<td style="text-align: center;">
{% if status[loop.index0] %}
<div style="display:none;">Enabled</div>
<div style="color:Green; display:inline-block"><i class="fa fa-check-circle fa-2x"></i></div>
{% endif %}
{% if not status[loop.index0] %}
<div style="display:none;">Disabled</div>
<div style="color:Red; display:inline-block"><i class="fa fa-times-circle fa-2x"></i></div>
{% endif %}
</td>
</tr>
{% endfor %}
</tbody>
</table>
<div class="input-group-btn">
<button class="btn btn-primary btn-lg" onclick="submitActiveTags()">
<i class="fa fa-check-square-o fa"></i>
Update Tags
</button>
</div>
</form>
</div>
<!-- /#page-wrapper -->
</body>
<script>
var table
$(document).ready(function(){
table = $('#myTable_').DataTable(
{
"aLengthMenu": [[5, 10, 15, 20, -1], [5, 10, 15, 20, "All"]],
"iDisplayLength": 10,
"order": [[ 3, "desc" ]]
}
);
});
</script>
<script>
function submitActiveTags(){
table.destroy()
table = $('#myTable_').DataTable(
{
"iDisplayLength": -1,
}
);
}
</script>
</html>

View File

@ -1,173 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Edit Taxonomie - AIL</title>
<link rel="icon" href="{{ url_for('static', filename='image/ail-icon.png') }}">
<!-- Core CSS -->
<link href="{{ url_for('static', filename='css/bootstrap.min.css') }}" rel="stylesheet">
<link href="{{ url_for('static', filename='font-awesome/css/font-awesome.css') }}" rel="stylesheet">
<link href="{{ url_for('static', filename='css/sb-admin-2.css') }}" rel="stylesheet">
<link href="{{ url_for('static', filename='css/dataTables.bootstrap.css') }}" rel="stylesheet" type="text/css" />
<!-- JS -->
<script type="text/javascript" src="{{ url_for('static', filename='js/dygraph-combined.js') }}"></script>
<script language="javascript" src="{{ url_for('static', filename='js/jquery.js')}}"></script>
<script src="{{ url_for('static', filename='js/bootstrap.min.js')}}"></script>
<script src="{{ url_for('static', filename='js/dataTables.bootstrap.js')}}"></script>
<script src="{{ url_for('static', filename='js/jquery.dataTables.min.js')}}"></script>
<style>
.tooltip-inner {
text-align: left;
height: 200%;
width: 200%;
max-width: 500px;
max-height: 500px;
font-size: 13px;
}
xmp {
white-space:pre-wrap;
word-wrap:break-word;
}
.test thead{
background: #d91f2d;
color: #fff;
}
</style>
</head>
<body>
{% include 'navbar.html' %}
<div id="page-wrapper">
<div class="row">
<div class="col-lg-12">
<a href="{{ url_for('Tags.taxonomies') }}" class="btn btn-light pull-left">
<i class="fa fa-arrow-left fa"></i> List Taxonomies
</a>
</div>
<!-- /.col-lg-12 -->
</div>
<!-- /.row -->
<div class="panel panel-primary">
<div class="panel-heading">{{ name }}
{% if active %}
<span class="label label-success pull-right"> Enabled</span>
<span class="pull-right">&nbsp;&nbsp;&nbsp;</span>
<span class="badge badge-light pull-right">{{ badge }}</span>
{% endif %}
{% if not active %}
<span class="label label-danger pull-right"> Disabled</span>
{% endif %}
</div>
<div class="panel-body">
{{ description }}
<br><br>
Version: {{ version }}
{% if active %}
<a href="{{ url_for('Tags.disable_taxonomie') }}?taxonomie={{ id }}" class="btn btn-danger pull-right">
<i class="fa fa-times fa"></i> Disable Taxonomie
</a>
{% endif %}
{% if not active %}
<a href="{{ url_for('Tags.active_taxonomie') }}?taxonomie={{ id }}" class="btn btn-success pull-right">
<i class="fa fa-check-square-o fa"></i> Enable Taxonomie
</a>
{% endif %}
</div>
</div>
<form action="{{ url_for('Tags.edit_taxonomie_tag') }}" id="checkboxForm">
<input type="hidden" value="{{ id }}" name="taxonomie" />
<table class="test table table-striped table-bordered table-hover table-responsive " id="myTable_">
<thead>
<tr>
<th></th>
<th style="max-width: 800px;">Tag</th>
<th style="max-width: 800px;">Description</th>
<th>Enabled</th>
</tr>
</thead>
<tbody>
{% for tag in all_tags %}
<tr>
<td>
{% if status[loop.index0] %}
<div style="display:none;">Enabled</div>
<input type="checkbox" value="{{ tag }}" id="{{ tag }}" name="tag_enabled" checked>
{% endif %}
{% if not status[loop.index0] %}
<div style="display:none;">Disabled</div>
<input type="checkbox" value="{{ tag }}" id="{{ tag }}" name="tag_disabled" >
{% endif %}
</td>
<td>{{ tag }}</td>
<td>{{ list_tag_desc[loop.index0] }}</td>
<td style="text-align: center;">
{% if status[loop.index0] %}
<div style="display:none;">Enabled</div>
<div style="color:Green; display:inline-block"><i class="fa fa-check-circle fa-2x"></i></div>
{% endif %}
{% if not status[loop.index0] %}
<div style="display:none;">Disabled</div>
<div style="color:Red; display:inline-block"><i class="fa fa-times-circle fa-2x"></i></div>
{% endif %}
</td>
</tr>
{% endfor %}
</tbody>
</table>
<div class="input-group-btn">
<button class="btn btn-primary btn-lg" onclick="submitActiveTags()">
<i class="fa fa-check-square-o fa"></i>
Update Tags
</button>
</div>
</form>
</div>
<!-- /#page-wrapper -->
</body>
<script>
var table
$(document).ready(function(){
table = $('#myTable_').DataTable(
{
"aLengthMenu": [[5, 10, 15, 20, -1], [5, 10, 15, 20, "All"]],
"iDisplayLength": 10,
"order": [[ 3, "desc" ]]
}
);
});
</script>
<script>
function submitActiveTags(){
table.destroy()
table = $('#myTable_').DataTable(
{
"iDisplayLength": -1,
}
);
}
</script>
</html>

View File

@ -1,121 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Galaxies - AIL</title>
<link rel="icon" href="{{ url_for('static', filename='image/ail-icon.png') }}">
<!-- Core CSS -->
<link href="{{ url_for('static', filename='css/bootstrap.min.css') }}" rel="stylesheet">
<link href="{{ url_for('static', filename='font-awesome/css/font-awesome.css') }}" rel="stylesheet">
<link href="{{ url_for('static', filename='css/sb-admin-2.css') }}" rel="stylesheet">
<link href="{{ url_for('static', filename='css/dataTables.bootstrap.css') }}" rel="stylesheet" type="text/css" />
<!-- JS -->
<script type="text/javascript" src="{{ url_for('static', filename='js/dygraph-combined.js') }}"></script>
<script language="javascript" src="{{ url_for('static', filename='js/jquery.js') }}"></script>
<script src="{{ url_for('static', filename='js/bootstrap.min.js') }}"></script>
<script src="{{ url_for('static', filename='js/jquery.dataTables.min.js') }}"></script>
<script src="{{ url_for('static', filename='js/dataTables.bootstrap.js') }}"></script>
<style>
.tooltip-inner {
text-align: left;
height: 200%;
width: 200%;
max-width: 500px;
max-height: 500px;
font-size: 13px;
}
xmp {
white-space:pre-wrap;
word-wrap:break-word;
}
.test thead{
background: #d91f2d;
color: #fff;
}
</style>
</head>
<body>
{% include 'navbar.html' %}
<div id="page-wrapper">
<div class="row">
<div class="col-lg-12">
<h1 class="page-header">Galaxies</h1>
</div>
<!-- /.col-lg-12 -->
</div>
<!-- /.row -->
<table class="test table table-striped table-bordered table-hover table-responsive " id="myTable_">
<thead>
<tr>
<th>Name</th>
<th style="max-width: 800px;">Description</th>
<th>Namespace</th>
<th>Version</th>
<th>Enabled</th>
<th>Active Tags</th>
</tr>
</thead>
<tbody>
{% for type in all_type %}
<tr>
<td>
{{ name[loop.index0] }}
<div>
<i class="fa fa-{{ icon[loop.index0] }}"></i>
</div>
</td>
<td>{{ description[loop.index0] }}</td>
<td>{{ namespace[loop.index0] }}</td>
<td>{{ version[loop.index0] }}</td>
<td style="text-align: center;">
{% if enabled[loop.index0] %}
<div style="display:none;">Enabled</div>
<div style="color:Green; display:inline-block"><i class="fa fa-check-circle fa-2x"></i></div>
{% endif %}
{% if not enabled[loop.index0] %}
<div style="display:none;">Disabled</div>
<div style="color:Red; display:inline-block"><i class="fa fa-times-circle fa-2x"></i></div>
{% endif %}
</td>
<td style="text-align: center;">
<div style="display:none;">{{ n_tags[loop.index0] }}</div>
<a class="btn btn-primary" href="{{ url_for('Tags.edit_galaxy') }}?galaxy={{ type }}">Active Tags <span class="badge">{{ n_tags[loop.index0] }}</span></a>
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
<!-- /#page-wrapper -->
</body>
<script>
$(document).ready(function(){
//search_table = $('#myTable_').DataTable({ "order": [[ 2, "desc" ]] });
$('#myTable_').DataTable(
{
"aLengthMenu": [[5, 10, 15, 20, -1], [5, 10, 15, 20, "All"]],
"iDisplayLength": 15,
}
);
});
</script>
</html>

View File

@ -1 +0,0 @@
<li id='page-Tags'><a href="{{ url_for('tags_ui.tags_search_items') }}"><i class="fa fa-tag "></i> Tags </a></li>

View File

@ -1,114 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Galaxy Tag Info - AIL</title>
<link rel="icon" href="{{ url_for('static', filename='image/ail-icon.png') }}">
<!-- Core CSS -->
<link href="{{ url_for('static', filename='css/bootstrap.min.css') }}" rel="stylesheet">
<link href="{{ url_for('static', filename='font-awesome/css/font-awesome.css') }}" rel="stylesheet">
<link href="{{ url_for('static', filename='css/sb-admin-2.css') }}" rel="stylesheet">
<link href="{{ url_for('static', filename='css/dataTables.bootstrap.css') }}" rel="stylesheet" type="text/css" />
<!-- JS -->
<script type="text/javascript" src="{{ url_for('static', filename='js/dygraph-combined.js') }}"></script>
<script language="javascript" src="{{ url_for('static', filename='js/jquery.js') }}"></script>
<script src="{{ url_for('static', filename='js/bootstrap.min.js') }}"></script>
<script src="{{ url_for('static', filename='js/jquery.dataTables.min.js') }}"></script>
<script src="{{ url_for('static', filename='js/dataTables.bootstrap.js') }}"></script>
<style>
.tooltip-inner {
text-align: left;
height: 200%;
width: 200%;
max-width: 500px;
max-height: 500px;
font-size: 13px;
}
xmp {
white-space:pre-wrap;
word-wrap:break-word;
}
.test thead{
background: #d91f2d;
color: #fff;
}
</style>
</head>
<body>
{% include 'navbar.html' %}
<div id="page-wrapper">
<div class="row">
<div class="col-lg-12">
<a href="{{ url_for('Tags.edit_galaxy') }}?galaxy={{ request.args.get('galaxy') }}" class="btn btn-light pull-left">
<i class="fa fa-arrow-left fa"></i> {{ request.args.get('galaxy') }} Galaxy
</a>
</div>
<!-- /.col-lg-12 -->
</div>
<!-- /.row -->
<div class="panel panel-primary">
<div class="panel-heading">{{ title }}
{% if active %}
<span class="label label-success pull-right"> Enabled</span>
{% endif %}
{% if not active %}
<span class="label label-danger pull-right"> Disabled</span>
{% endif %}
</div>
<div class="panel-body">
{{ description }}
<br><br>
Source: {{ source }}
{% if metadata %}
<div class="panel panel-info pull-right" style="width: 60%;">
<div class="panel-heading"> Metadata :
<ul class="list-group">
{% for meta in list_metadata %}
<li class="list-group-item">{{ meta }}</li>
{% endfor %}
</ul>
</div>
</div>
{% endif %}
{% if bool_synonyms %}
<br><br>
<ul class="list-group" style="width: 30%;">
<li class="list-group-item active">synonyms :</li>
{% for synonym in synonyms %}
<li class="list-group-item">{{ synonym }}</li>
{% endfor %}
</ul>
{% endif %}
</div>
</div>
</div>
<!-- /#page-wrapper -->
</body>
<script>
$(document).ready(function(){
$('#myTable_').DataTable(
{
"aLengthMenu": [[5, 10, 15, 20, -1], [5, 10, 15, 20, "All"]],
"iDisplayLength": 15,
}
);
});
</script>
</html>

View File

@ -1,112 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Taxonomies - AIL</title>
<link rel="icon" href="{{ url_for('static', filename='image/ail-icon.png') }}">
<!-- Core CSS -->
<link href="{{ url_for('static', filename='css/bootstrap.min.css') }}" rel="stylesheet">
<link href="{{ url_for('static', filename='font-awesome/css/font-awesome.css') }}" rel="stylesheet">
<link href="{{ url_for('static', filename='css/sb-admin-2.css') }}" rel="stylesheet">
<link href="{{ url_for('static', filename='css/dataTables.bootstrap.css') }}" rel="stylesheet" type="text/css" />
<!-- JS -->
<script type="text/javascript" src="{{ url_for('static', filename='js/dygraph-combined.js') }}"></script>
<script language="javascript" src="{{ url_for('static', filename='js/jquery.js') }}"></script>
<script src="{{ url_for('static', filename='js/bootstrap.min.js') }}"></script>
<script src="{{ url_for('static', filename='js/jquery.dataTables.min.js') }}"></script>
<script src="{{ url_for('static', filename='js/dataTables.bootstrap.js') }}"></script>
<style>
.tooltip-inner {
text-align: left;
height: 200%;
width: 200%;
max-width: 500px;
max-height: 500px;
font-size: 13px;
}
xmp {
white-space:pre-wrap;
word-wrap:break-word;
}
.test thead{
background: #d91f2d;
color: #fff;
}
</style>
</head>
<body>
{% include 'navbar.html' %}
<div id="page-wrapper">
<div class="row">
<div class="col-lg-12">
<h1 class="page-header">Taxonomies</h1>
</div>
<!-- /.col-lg-12 -->
</div>
<!-- /.row -->
<table class="test table table-striped table-bordered table-hover table-responsive " id="myTable_">
<thead>
<tr>
<th>Name</th>
<th style="max-width: 800px;">Description</th>
<th>Version</th>
<th>Enabled</th>
<th>Active Tags</th>
</tr>
</thead>
<tbody>
{% for name in all_name %}
<tr>
<td>{{ name }}</td>
<td>{{ description[loop.index0] }}</td>
<td>{{ version[loop.index0] }}</td>
<td style="text-align: center;">
{% if enabled[loop.index0] %}
<div style="display:none;">Enabled</div>
<div style="color:Green; display:inline-block"><i class="fa fa-check-circle fa-2x"></i></div>
{% endif %}
{% if not enabled[loop.index0] %}
<div style="display:none;">Disabled</div>
<div style="color:Red; display:inline-block"><i class="fa fa-times-circle fa-2x"></i></div>
{% endif %}
</td>
<td style="text-align: center;">
<div style="display:none;">{{ n_tags[loop.index0] }}</div>
<a class="btn btn-primary" href="{{ url_for('Tags.edit_taxonomie') }}?taxonomie={{ id[loop.index0] }}">Active Tags <span class="badge">{{ n_tags[loop.index0] }}</span></a>
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
<!-- /#page-wrapper -->
</body>
<script>
$(document).ready(function(){
$('#myTable_').DataTable(
{
"aLengthMenu": [[5, 10, 15, 20, -1], [5, 10, 15, 20, "All"]],
"iDisplayLength": 15,
}
);
});
</script>
</html>

View File

@ -70,7 +70,7 @@
var ltags; var ltags;
var ltagsgalaxies; var ltagsgalaxies;
$.getJSON("{{ url_for('Tags.get_all_tags_taxonomies') }}", $.getJSON("{{ url_for('tags_ui.get_all_taxonomies_customs_tags') }}",
function(data) { function(data) {
ltags = $('#ltags').tagSuggest({ ltags = $('#ltags').tagSuggest({
@ -80,7 +80,7 @@ $.getJSON("{{ url_for('Tags.get_all_tags_taxonomies') }}",
}); });
}); });
$.getJSON("{{ url_for('Tags.get_all_tags_galaxy') }}", $.getJSON("{{ url_for('tags_ui.tag_galaxies_tags_enabled_json') }}",
function(data) { function(data) {
ltagsgalaxies = $('#ltagsgalaxies').tagSuggest({ ltagsgalaxies = $('#ltagsgalaxies').tagSuggest({
@ -92,14 +92,14 @@ $.getJSON("{{ url_for('Tags.get_all_tags_galaxy') }}",
jQuery("#all-tags-taxonomies").click(function(e){ jQuery("#all-tags-taxonomies").click(function(e){
//change input tags list //change input tags list
$.getJSON("{{ url_for('Tags.get_all_tags_taxonomies') }}", $.getJSON("{{ url_for('tags_ui.get_all_taxonomies_customs_tags') }}",
function(data) { function(data) {
ltags.setData(data) ltags.setData(data)
}); });
}); });
jQuery("#all-tags-galaxies").click(function(e){ jQuery("#all-tags-galaxies").click(function(e){
$.getJSON("{{ url_for('Tags.get_all_tags_galaxy') }}", $.getJSON("{{ url_for('tags_ui.tag_galaxies_tags_enabled_json') }}",
function(data) { function(data) {
ltagsgalaxies.setData(data) ltagsgalaxies.setData(data)
}); });
@ -107,7 +107,7 @@ jQuery("#all-tags-galaxies").click(function(e){
{% for taxo in modal_add_tags['active_taxonomies'] %} {% for taxo in modal_add_tags['active_taxonomies'] %}
jQuery("#{{ taxo }}-id{{ loop.index0 }}").click(function(e){ jQuery("#{{ taxo }}-id{{ loop.index0 }}").click(function(e){
$.getJSON("{{ url_for('Tags.get_tags_taxonomie') }}?taxonomie={{ taxo }}", $.getJSON("{{ url_for('tags_ui.tag_taxonomie_tags_enabled_json') }}?taxonomie={{ taxo }}",
function(data) { function(data) {
ltags.setData(data) ltags.setData(data)
}); });
@ -116,7 +116,7 @@ jQuery("#all-tags-galaxies").click(function(e){
{% for galaxy in modal_add_tags['active_galaxies'] %} {% for galaxy in modal_add_tags['active_galaxies'] %}
jQuery("#{{ galaxy }}-idgalax{{ loop.index0 }}").click(function(e){ jQuery("#{{ galaxy }}-idgalax{{ loop.index0 }}").click(function(e){
$.getJSON("{{ url_for('Tags.get_tags_galaxy') }}?galaxy={{ galaxy }}", $.getJSON("{{ url_for('tags_ui.tag_galaxy_tags_enabled_json') }}?galaxy={{ galaxy }}",
function(data) { function(data) {
ltagsgalaxies.setData(data) ltagsgalaxies.setData(data)
}); });