Skip to content

Commit

Permalink
more refactoring, re #4771
Browse files Browse the repository at this point in the history
  • Loading branch information
apeters committed May 1, 2019
1 parent 312d9bc commit 99ae7c0
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 29 deletions.
43 changes: 22 additions & 21 deletions arches/admin.py
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
'''
ARCHES - a program developed to inventory and manage immovable cultural heritage.
Copyright (C) 2013 J. Paul Getty Trust and World Monuments Fund
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
'''
'''
ARCHES - a program developed to inventory and manage immovable cultural heritage.
Copyright (C) 2013 J. Paul Getty Trust and World Monuments Fund
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
'''

from app.models import models
from django.contrib import admin
from guardian.admin import GuardedModelAdmin


class PluginAdmin(GuardedModelAdmin):
pass


pass


admin.site.register([
models.DLanguage,
models.MapLayer,
Expand All @@ -35,7 +35,8 @@ class PluginAdmin(GuardedModelAdmin):
models.DDataType,
models.Widget,
models.UserProfile,
models.GraphModel
models.GraphModel,
models.SearchComponent,
])

admin.site.register(models.Plugin, PluginAdmin)
7 changes: 3 additions & 4 deletions arches/app/media/js/views/search.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,9 @@ define([

var CommonSearchViewModel = function() {
this.filters = {};
this.filtersList = [];
searchData.search_components.forEach(function(component) {
this.filters[component.name] = ko.observable(null);
this.filtersList.push(component);
this.filtersList = SearchComponents;
SearchComponents.forEach(function(component) {
this.filters[component.componentname] = ko.observable(null);
}, this);
this.tags = ko.observableArray();
this.selectedTab = ko.observable('map-filter');
Expand Down
4 changes: 3 additions & 1 deletion arches/app/templates/javascript.htm
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,9 @@
});

define('search-components', [{% for component in search_components %}'{{ component.componentpath }}',{% endfor %}], function () {
return;
return {% autoescape off %}[{% for component in search_components %}
{{component.toJSON}},
{% endfor %}]{% endautoescape %};
});

define('leaflet-draw-local', [
Expand Down
8 changes: 5 additions & 3 deletions arches/app/templates/views/search.htm
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@

<div class="" style="margin-top: 0px;">
<div class="" data-bind="foreach: {data: sharedStateObject.filtersList, as: 'filter'}">
<!-- ko if: filter.type === 'filter' -->
<!-- ko if: filter.type === 'filter' && filter.enabled -->
{% if user|can_read_resource_instance %}
<button class="btn search-type-btn relative" data-bind="css: {'active': $parent.sharedStateObject.selectedTab() === filter.name}, click: function(){sharedStateObject.selectedTab('related-resource-manager')}">
<button class="btn search-type-btn relative" data-bind="css: {'active': $parent.sharedStateObject.selectedTab() === filter.name}, click: function(){sharedStateObject.selectedTab(filter.componentname)}">
<i class="fa fa-code-fork"></i>
<p data-bind="text: filter.name"></p>
</button>
Expand All @@ -63,12 +63,14 @@
<!-- Card Container -->
<div class="card-form-preview-container">
<div class="tab-content relative" data-bind="foreach: {data: sharedStateObject.filtersList, as: 'filter'}">
<!-- ko if: filter.type === 'filter' && filter.enabled -->
<div class="tab-pane map-filter-panel" data-bind="css: {'active': $parent.sharedStateObject.selectedTab() === filter.name}">
<div data-bind="component: {
name: filter.name,
name: filter.componentname,
params: $parent.sharedStateObject
}"></div>
</div>
<!-- /ko -->
</div>
</div>
</div>
Expand Down

0 comments on commit 99ae7c0

Please sign in to comment.