Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added edit metadata wizard #6

Merged
merged 1 commit into from
Jan 17, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 17 additions & 22 deletions geonode/layers/templates/layers/layer_metadata.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

<style>
.xxs-font-size{
font-size: 10px;
font-size: 10px;
}
textarea{
width:100%;
Expand All @@ -29,7 +29,7 @@
width:100%;
}
.test-class{
background-color: red;
background-color: red;
}
table{
table-layout:fixed;
Expand All @@ -49,56 +49,51 @@
right: 0;
}

.tab-pane{
height:650px;
overflow-y:scroll;
}

.fancy-checkbox input[type="radio"],
.fancy-checkbox input[type="checkbox"],
.fancy-checkbox .checked {
display: none;
}

.fancy-checkbox input[type="radio"]:checked ~ .checked,
.fancy-checkbox input[type="checkbox"]:checked ~ .checked {
display: inline-block;
color:red;
}

.fancy-checkbox input[type="radio"]:checked ~ .unchecked,
.fancy-checkbox input[type="checkbox"]:checked ~ .unchecked {
display: none;
}

.tokenfield,
#id_resource-title {
width: 95% !important;
}

.leaflet-container { /* all maps */
height: 250px !important;
}

.map-overlay {
display: none !important;
}

#regions_multiselect_container.content {
position: absolute;
}

.fstControls {
width: 100% !important;
}

.fstElement {
font-size: 0.8em !important;
}

.fstResultItem {
font-size: 1.2em !important;
}
}
</style>
{{ block.super }}
{% endblock %}
Expand Down Expand Up @@ -178,7 +173,7 @@ <h2 class="page-title">{% trans "Edit Metadata" %}&nbsp;{% blocktrans with layer
{% form layer_form using "layouts/panels.html" %}
{# layer_form|as_bootstrap #}
</div>

<div class="row">
<div class="col-md-12 grid-spacer">
<fieldset class="form-controls modal-forms modal hide fade" id="poc_form" >
Expand All @@ -194,7 +189,7 @@ <h2>{% trans "Metadata Provider" %}</h2>

{% if not layer.metadata_uploaded_preserve %}
<div class="form-actions">
<input type="button" id="btn_back_dwn" class="btn btn-primary" value="{% trans "<< Back" %}"/>
<input type="button" id="btn_back_dwn" class="btn btn-primary" style="display: none" value="{% trans "<< Back" %}"/>
<input type="submit" id="btn_upd_md_dwn" class="btn btn-primary" value="{% trans "Update" %}"/>
<input type="button" id="btn_next_dwn" class="btn btn-primary" value="{% trans "Next >>" %}"/>
</div>
Expand Down Expand Up @@ -226,15 +221,15 @@ <h2>{% trans "Metadata Provider" %}</h2>
});
});
</script> -->

<!-- <script type="text/javascript">
$(document).ready(function() {
$('#id_resource-regions').treeMultiselect({
startCollapsed: true
});
});
</script> -->

<!-- Doc & Examples: http://dbrekalo.github.io/fastselect/ -->
<script type="text/javascript">
$(document).ready(function() {
Expand All @@ -243,4 +238,4 @@ <h2>{% trans "Metadata Provider" %}</h2>
});
</script>

{% endblock %}
{% endblock %}
160 changes: 127 additions & 33 deletions geonode/layers/templates/layouts/panels.html
Original file line number Diff line number Diff line change
@@ -1,37 +1,135 @@
{% load floppyforms %}
{% load i18n %}
<style>
#mdeditor_form > .tab-content > .tab-pane {
overflow: auto;
height: auto;
overflow-x: hidden;
}

#regions_multiselect_container .fstElement {
min-width: 300px;
}
</style>
<style>
/* metadata edit workflow wizard */
.wizard--progress {
list-style: none;
margin: 0;
padding: 0;
display: table;
table-layout: fixed;
width: 100%;
color: #849397;
}
.wizard--progress > li {
position: relative;
display: table-cell;
text-align: center;
font-size: 0.8em;
}
.wizard--progress > li:hover {
cursor: pointer;
}
.wizard--progress > li:before {
transition: background 0.5s ease 0.1s;
content: attr(data-step);
display: block;
margin: 0 auto;
background: #DFE3E4;
width: 3em;
height: 3em;
text-align: center;
margin-bottom: 0.25em;
line-height: 3em;
border-radius: 100%;
position: relative;
z-index: 1000;
}
.wizard--progress > li:after {
transition: background 1s ease;
content: '';
position: absolute;
display: block;
background: #DFE3E4;
width: 100%;
height: 0.5em;
top: 1.25em;
left: 50%;
margin-left: 1.5em\9;
z-index: -1;
}
.wizard--progress > li:last-child:after {
display: none;
}
.wizard--progress > li.is-complete {
color: #2ECC71;
}
.wizard--progress > li.is-complete:before, .wizard--progress > li.is-complete:after {
color: #FFF;
background: #2ECC71;
}
.wizard--progress > li.is-complete:before {
z-index: 1;
}
.wizard--progress > li.is-complete:after {
z-index: 0;
}
.wizard--progress > li.is-active {
color: #3498DB;
}
.wizard--progress > li.is-active:before {
color: #FFF;
background: #3498DB;
}

/**
* Needed for IE8
*/
.wizard--progress__last:after {
display: none !important;
}

/**
* Size Extensions
*/
.wizard--progress--medium {
font-size: 1.5em;
}

.wizard--progress--large {
font-size: 2em;
}

.wizard--progress a {
text-decoration: none;
}
.wizard--progress li:hover {
text-decoration: underline;
}

</style>
<ul id="md_tabs" class="nav nav-tabs">
<li id="first" class="active">
<a data-toggle="tab" href="#mandatory">Let's start > </a>
</li>
<li id="second">
<a data-toggle="tab" href="#advanced">Almost there... > </a>
</li>
<li id="last">
<a data-toggle="tab" href="#ownership">Done!</a>
<li id="metadata_edit_tab" class="active">
<a data-toggle="tab" href="#edit-metadata">Edit</a>
</li>
<li id="preview_tab">
<li id="preview_tab" data-toggle="tab" dhref="#preview">
<a data-toggle="tab" href="#preview">Preview</a>
</li>
</ul>




{% block body_outer %}
<div class="tab-content">

<div id="mandatory" class="tab-pane fade in active" style="">
<div id="edit-metadata" class="tab-content tab-pane fade in active">
<ul class="wizard--progress wizard--progress--medium">
<li data-step="1" id="first" class="is-active" data-toggle="tab" href="#mandatory">
<a>Let's start</a>
</li>
<li data-step="2" id="second" data-toggle="tab" href="#advanced">
<a>Almost there... </a>
</li>
<li data-step="3" id="last" data-toggle="tab" href="#ownership">
<a>Done!</a>
</li>
</ul>
<div id="mandatory" class="tab-pane fade in active">
<!--<br />-->
<div class="panel-group">
<div class="panel panel-default">
Expand All @@ -43,9 +141,6 @@
</div>
</div>
</div>
<div class = "row">
</div>
<hr/>
<div class="row">
<div class="col">
<div id="basicDescriptiveInfo" class="container-fluid">
Expand Down Expand Up @@ -122,7 +217,7 @@
<div class="panel panel-default">
<!-- div class="panel-heading">Metadata info</div -->
<div class="panel-body">
<div class="row" id="mdinfo" style="max-height: 590px">
<div class="row" id="mdinfo">
<div class="row">
<div class="col-lg-4">
<div>
Expand Down Expand Up @@ -183,7 +278,7 @@
<br />
<p>Other, Optional, Metadata</p>
<div class="row">
<div class="col-xs-6 col-lg-5">
<div class="col-xs-12 col-lg-5">
<div>
<span><label for="{{ layer_form.edition|id }}">{{ layer_form.edition.label }}</label></span>
<!--<p class="xxs-font-size">(Version of the cited resource)</p>-->
Expand All @@ -200,7 +295,7 @@
{{ layer_form.supplemental_information }}
</div>
</div>
<div class="col-xs-6 col-lg-6">
<div class="col-xs-12 col-lg-6">

<div class="col-xs-12 col-lg-6">
<div class="input-group date">
Expand Down Expand Up @@ -309,15 +404,14 @@ <h4 class="modal-title" id="exampleModalLabel">Message box</h4>
</div>
</div>
</div>

<div id="preview" class="tab-pane fade" style="overflow: hidden;">
<!-- <iframe id="preview_encoder_iframe" height="100%" width="100%" style="width:0;height:0;border:0;border:none;" src="{% url 'layer_metadata_detail' resource.typename %}"></iframe> -->
{% if metadataxsl %}
<iframe id="preview_encoder_iframe" height="100%" width="100%" style="width:0;height:0;border:0;border:none;" src="/showmetadata/xsl/{{resource.id}}"></iframe>
{% else %}
<iframe id="preview_encoder_iframe" height="100%" width="100%" style="width:0;height:0;border:0;border:none;" src="/catalogue/csw_to_extra_format/{{resource.uuid}}/{{resource.title}}.html"></iframe>
{% endif %}
</div>

</div>
<div id="preview" class="tab-pane fade" style="overflow: hidden;">
<!-- <iframe id="preview_encoder_iframe" height="100%" width="100%" style="width:0;height:0;border:0;border:none;" src="{% url 'layer_metadata_detail' resource.typename %}"></iframe> -->
{% if metadataxsl %}
<iframe id="preview_encoder_iframe" frameborder="0" scrolling="no" onload="if(this.contentWindow.document.body) {$('#preview').height(this.contentWindow.document.body.scrollHeight)}" src="/showmetadata/xsl/{{resource.id}}"></iframe>
{% else %}
<iframe id="preview_encoder_iframe" frameborder="0" scrolling="no" onload="if(this.contentWindow.document.body) {$('#preview').height(this.contentWindow.document.body.scrollHeight)}" src="/catalogue/csw_to_extra_format/{{resource.uuid}}/{{resource.title}}.html"></iframe>
{% endif %}
</div>
</div>
{% endblock %}
4 changes: 3 additions & 1 deletion geonode/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -1063,4 +1063,6 @@
# e.g. THESAURI = [{'name':'inspire_themes', 'required':True, 'filter':True}, {'name':'inspire_concepts', 'filter':True}, ]
# Required: (boolean, optional, default false) mandatory while editing metadata (not implemented yet)
# Filter: (boolean, optional, default false) a filter option on that thesaurus will appear in the main search page
THESAURI = [{'name':'inspire_themes', 'required':True, 'filter':True}]
# THESAURI = [{'name':'inspire_themes', 'required':True, 'filter':True}]
THESAURI = []

Loading