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

Additional Icons and Labels based on Protocol #6101

Closed
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
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,8 @@
return r.protocol.replace('WWW:DOWNLOAD:', '');
} else if (mainType.match(/W([MCF]|MT)S.*|ESRI:REST/)) {
return mainType.replace('SERVICE', '');
} else if (mainType.indexOf('KML') >= 0) {
return mainType;
} else {
return '';
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,10 @@
this.map['DEFAULT'].iconClass;
};

this.getProtocolClassIcon = function (type) {
return type.replace(':','-').replace(' ','-').toLowerCase();
};

this.getLabel = function(mainType, type) {
// Old key before the move to API
var oldKey = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,25 @@ <h2>{{::title}}</h2>
data-ng-if="type && type !== 'thumbnails'">
<div data-ng-init="mainType = config.getType(r, type);
badge = getBadgeLabel(mainType, r);
icon = config.getClassIcon(mainType);"
icon = config.getClassIcon(mainType);
protocolIcon = config.getProtocolClassIcon(r.protocol);"
class="row list-group-item gn-related-item gn-related-{{type}} gn-relation-type-{{mainType}}"
data-ng-repeat="r in items track by $index">
<div class="gn-related-icon-col col-xs-2 col-sm-2 text-center">
<strong>
<div class="clearfix">
<i class="fa"
data-ng-class="icon"/>
data-ng-class="mainType.indexOf('DEFAULT') === 0 ? 'fa-question-circle gn-icon-' + protocolIcon : icon"/>
</div>
<span data-ng-if="badge != ''"
class="label label-default"
data-ng-class="{
'label-primary': icon === 'fa-download' || icon === 'fa-file-pdf-o',
'label-success': icon === 'fa-globe'}">{{badge}}</span>
<span data-ng-if="mainType.indexOf('DEFAULT') === 0"
class="label label-default">
{{r.protocol}}
</span>
</strong>
</div>
<div data-ng-class="mainType === 'MDFCATS' ? 'col-xs-11' : 'col-xs-7 col-sm-7'">
Expand Down Expand Up @@ -73,12 +78,6 @@ <h3 data-ng-if="::(r.title | gnLocalized: lang).length">{{::(r.title | gnLocaliz
data-translate-values="{url:'{{r.url | gnLocalized: lang}}', layer:'{{r.title | gnLocalized: lang}}'}">
wfsLinkDetails</span>
</p>
<div data-ng-if="isLayerProtocol(r)"
data-gn-no-map-wfs-download=""
data-typename="{{r.title | gnLocalized: lang}}"
data-url="{{r.url | gnLocalized: lang}}">
</div>

<p class="text-muted"
data-ng-if="!isLayerProtocol(r)">
<span data-translate=""
Expand Down Expand Up @@ -158,6 +157,10 @@ <h3 data-ng-if="::(r.title | gnLocalized: lang).length">{{::(r.title | gnLocaliz
</div>
</div>

<div data-ng-switch-when="LINKDOWNLOAD-ZIP">
<span ng-bind-html="r.url | gnLocalized: lang | linky:'_blank'"></span>
</div>

<div data-ng-switch-default>
<p class="text-muted"
data-ng-if="mainType.indexOf('MD') == 0 && r.id
Expand Down Expand Up @@ -199,6 +202,12 @@ <h3 data-ng-if="::(r.title | gnLocalized: lang).length">{{::(r.title | gnLocaliz
</span>
</button>

<div data-ng-if="mainType === 'WFS'"
data-gn-no-map-wfs-download=""
data-typename="{{r.title | gnLocalized: lang}}"
data-url="{{r.url | gnLocalized: lang}}">
</div>


<button type="button"
class="btn btn-default btn-sm btn-block gn-btn-addtoexternal text-wrap"
Expand Down
8 changes: 8 additions & 0 deletions web-ui/src/main/resources/catalog/style/gn_icons.less
Original file line number Diff line number Diff line change
Expand Up @@ -74,3 +74,11 @@

.gn-icon-MyFrequentlyUsedRecords:before { content: @fa-var-star }
.gn-icon-WatchingRecords:before { content: @fa-var-bell }
/* protocol icons */
.gn-icon-arcgis-mapservice:before { content: @fa-var-map-o }
.gn-icon-arcgis-featureservice:before { content: @fa-var-cloud }
.gn-icon-csv:before { content: @fa-var-table }
.gn-icon-ogc-gml:before { content: @fa-var-file-code-o }
.gn-icon-json:before { content: @fa-var-file-text-o }
.gn-icon-zip-shape:before { content: @fa-var-file-zip-o }
.gn-icon-doi:before { content: @fa-var-info-circle }
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
padding-left: 0px;
padding-right: 0px;
.fa {
font-size: 2em;
font-size: 1.7em;
}
}
h3 {
Expand All @@ -60,13 +60,30 @@
padding-left: 0;
margin-bottom: 10px;
}
a {
line-break: anywhere;
}
.table-striped td {
padding-left: 8px;
}
.gn-atom {
max-height: 250px;
overflow: auto;
}
.label {
display: inline-block;
padding: 0.4em 0.6em;
white-space: normal;
margin-top: 5px;
}
.col-xs-12.col-sm-3 {
.btn-group {
width: 100%;
.btn {
width: 100%;
}
}
}
}
.gn-md-side {
.gn-img-thumbnail,
Expand Down