Auth source custom ratings
editor support for adding/updating rating
workingCopy.dataType = null;
}
- $: ratingsByKey = _
+ $: ratings = _
.chain($enumCall.data)
.filter(d => d.type === "AuthoritativenessRating")
- .keyBy(d => d.key)
+ .sortBy("position", "display_name")
.value();
</script>
<label for="rating">Rating:</label>
<div id="rating"
class="form-group">
+ {#each ratings as rating}
+ <div class="radio">
<label>
<input type=radio
bind:group={workingCopy.rating}
- value='PRIMARY'>
- {_.get(ratingsByKey, ["PRIMARY", "name"], "-")}
- </label>
- <label>
- <input type=radio
- bind:group={workingCopy.rating}
- value='SECONDARY'>
- {_.get(ratingsByKey, ["SECONDARY", "name"], "-")}
+ value={rating.key}>
+ <div style="display: inline-block; width: 1em; height: 1.1em; border: 1px solid #aaa; border-radius: 2px; background-color: {rating.iconColor}">&nbsp;</div>
+ {rating.name}
+ <span class="help-block">{rating.description}</span>
</label>
+ </div>
+ {/each}
<p class="text-muted">Select an authority statement for this source</p>
</div>
