Skip to content

Commit

Permalink
Merge pull request #4706 from archesproject/4665_remove_disco_widgets…
Browse files Browse the repository at this point in the history
…_from_core

Removes disco widgets from core
  • Loading branch information
chiatt authored Mar 20, 2019
2 parents 903ec18 + 6ac0c2d commit ad9856b
Show file tree
Hide file tree
Showing 13 changed files with 106 additions and 1,495 deletions.
24 changes: 19 additions & 5 deletions arches/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,27 @@
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.models import DLanguage, MapLayer, MapSource, TileserverLayer, IIIFManifest, Geocoder, MapMarker, DDataType, Widget, Plugin, UserProfile, GraphModel

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


class PluginAdmin(GuardedModelAdmin):
pass
pass

admin.site.register([DLanguage, MapLayer, MapSource, TileserverLayer, IIIFManifest, Geocoder, MapMarker, DDataType, Widget, UserProfile, GraphModel])
admin.site.register(Plugin, PluginAdmin)

admin.site.register([
models.DLanguage,
models.MapLayer,
models.MapSource,
models.TileserverLayer,
models.Geocoder,
models.MapMarker,
models.DDataType,
models.Widget,
models.UserProfile,
models.GraphModel
])

admin.site.register(models.Plugin, PluginAdmin)
58 changes: 0 additions & 58 deletions arches/app/datatypes/datatypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -1224,64 +1224,6 @@ def process_mobile_data(self, tile, node, db, couch_doc, node_value):
pass
return node_value

class CSVChartJsonDataType(FileListDataType):
def __init__(self, model=None):
super(CSVChartJsonDataType, self).__init__(model=model)

def handle_request(self, current_tile, request, node):
try:
previously_saved_tile = models.TileModel.objects.filter(pk=current_tile.tileid)
if previously_saved_tile.count() == 1:
for previously_saved_file in previously_saved_tile[0].data[str(node.pk)]['files']:
previously_saved_file_has_been_removed = True
for incoming_file in current_tile.data[str(node.pk)]['files']:
if previously_saved_file['file_id'] == incoming_file['file_id']:
previously_saved_file_has_been_removed = False
if previously_saved_file_has_been_removed:
deleted_file = models.File.objects.get(pk=previously_saved_file["file_id"])
deleted_file.delete()

files = request.FILES.getlist('file-list_' + str(node.pk), [])
for file_data in files:
file_model = models.File()
file_model.path = file_data
file_model.save()
for file_json in current_tile.data[str(node.pk)]['files']:
if file_json["name"] == file_data.name and file_json["url"] is None:
file_json["file_id"] = str(file_model.pk)
file_json["url"] = str(file_model.path.url)
file_json["status"] = 'uploaded'
except Exception as e:
print e


class IIIFDrawingDataType(BaseDataType):
def get_strings(self, nodevalue):
string_list = [nodevalue['manifestLabel']]
for feature in nodevalue['features']:
if feature['properties']['name'] != '':
string_list.append(feature['properties']['name'])
return string_list

def append_to_document(self, document, nodevalue, nodeid, tile, provisional=False):
string_list = self.get_strings(nodevalue)
for string_item in string_list:
document['strings'].append({'string': string_item, 'nodegroup_id': tile.nodegroup_id})
for feature in nodevalue['features']:
if feature['properties']['type'] is not None:
valueid = feature['properties']['type']
value = models.Value.objects.get(pk=valueid)
document['domains'].append({'label': value.value, 'conceptid': value.concept_id, 'valueid': valueid, 'nodegroup_id': tile.nodegroup_id, 'provisional': provisional})

def get_search_terms(self, nodevalue, nodeid=None):
terms = []
string_list = self.get_strings(nodevalue)
for string_item in string_list:
if string_item is not None:
if settings.WORDS_PER_SEARCH_TERM == None or (len(string_item.split(' ')) < settings.WORDS_PER_SEARCH_TERM):
terms.append(string_item)
return terms


class BaseDomainDataType(BaseDataType):
def get_option_text(self, node, option_id):
Expand Down
132 changes: 1 addition & 131 deletions arches/app/media/css/arches.css
Original file line number Diff line number Diff line change
Expand Up @@ -7273,7 +7273,7 @@ a.list-group-item:not(.active):hover, .clear-find:hover, div .switch label:hover
background: #01113c;
border-radius: 50%;
border: none;

}

.btn-file-select {
Expand Down Expand Up @@ -8065,78 +8065,11 @@ h4.report-toolbar-title {
color: grey;
}

.csv-chart {
height: 300px;
margin-left: -10px;
padding-right: 30px;
}

.csv-chart-title {
font-size: 15px;
font-weight: 500;
}

.csv-chart-menubar {
padding-bottom: 15px;
margin-top: 5px;
}

.csv-chart-menubar-item {
padding: 5px 10px;
border: 1px solid #ddd;
}

a .csv-chart-menubar-item {
color: #777;
font-weight: 400;
}

.csv-chart-menubar-item.active {
color: #123;
border-radius: 1px;
background: #f2f2f2;
}

.csv-chart-widget-input {
width: 100%;
padding: 0px 0px 10px;
}

.csv-chart-selection-detail-container {
flex-direction: row;
display: flex;
justify-content: center;
}

.csv-chart-selection-detail {
flex-grow: 1;
flex-shrink: 1;
}

.file-selector {
padding-right: 15px;
padding-top: 15px;
}

.tab-content .csv-chart-panel {
padding-top: 0px;
}

.pad-ver .csv-chart-panel {
padding-top: 0px;
}

.csv-chart-container {
margin-top: -15px;
margin-left: -30px;
margin-right: -45px;
}

.csv-chart-file-selector {
margin-top: 10px;
padding-right: 15px;
}

.map-widget-container {
position: absolute;
top: 6px;
Expand Down Expand Up @@ -8572,19 +8505,6 @@ div.row.widget-wrapper.report-header:hover {
right: 11px;
}

.iiif-wrapper .map-widget-panel {
background-color: rgba(143, 143, 143, 0.2);
border-left: solid rgba(143, 143, 143, 0.6) 1px;
}

.expanded-iiif .map-widget-panel {
position: fixed;
top: 160px;
width: 298px;
bottom: 0;
height: auto;
}

.map-search-container, .map-search-container div .map-widget-panel {
height: calc(100vh - 110px);
}
Expand Down Expand Up @@ -8654,25 +8574,6 @@ div.row.widget-wrapper.report-header:hover {
top: 51px;
}

.iiif-wrapper {
height: 500px;
}

.iiif-wrapper.expanded-iiif {
position: fixed;
top: 106px;
right: 0px;
left: 50px;
bottom: 0;
transition-duration: .3s;
z-index: 100;
height: auto;
}

.leaflet-iiif {
height: 100%;
}

.expanded-resource-menu {
margin-left: -275px;
transition-duration: .3s;
Expand Down Expand Up @@ -9345,28 +9246,6 @@ a.clear-geojson-button:hover {
border-radius: 2px;
}

.iiif-expand-button {
position: absolute;
}

.iiif-toolbar {
border-left: 1px solid #999;
border-right: 1px solid #999;
}

.iiif-widget-panel {
height: 430px;
width: 298px;
right: 11px;
border-bottom: 1px solid #999;
border-right: 1px solid #999;
}

.iiif-widget-panel-title {
width: 297px;
}


/* Hide "Full Screen" button for map tools widget in card manager */

.widget-preview div div div div span .toggle-map-size {
Expand Down Expand Up @@ -9681,15 +9560,6 @@ a.clear-geojson-button:hover {
flex-direction: column;
}

.iiif-widget {
position: relative;
}

.iiif-widget .hover-feature-info {
margin-left: 25px;
height: 220px;
}

.hover-feature-title-bar {
height: 40px;
padding: 10px;
Expand Down
Loading

0 comments on commit ad9856b

Please sign in to comment.