Skip to content

Commit

Permalink
Feature NMH-65: Collect and use statistics on downloads of model
Browse files Browse the repository at this point in the history
  • Loading branch information
mahmoodbayeshi committed Feb 17, 2022
1 parent 374ed40 commit 2ae46b2
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
7 changes: 5 additions & 2 deletions docs/_frontend/src/models/Sidebar/Sidebar.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,11 @@ const Sidebar = ({ meta, params, onSubmit }) => {
}}
>
<label>Sort By:</label>
<Radio value="date">Date</Radio>
<Radio value="views">Views</Radio>
<div className={styles.radioContainers}>
<Radio value="date" className={styles.radio}>Date</Radio>
<Radio value="views" className={styles.radio}>Views</Radio>
<Radio value="downloads" className={styles.radio}>Downloads</Radio>
</div>
</RadioGroup>
</div>
</div>
Expand Down
8 changes: 8 additions & 0 deletions docs/_frontend/src/models/Sidebar/Sidebar.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,11 @@
.control:not(:last-child) {
margin-bottom: 20px;
}

.radioContainers{
flex-direction: column;
}

.radioContainers .radio{
display: block;
}
5 changes: 5 additions & 0 deletions docs/_plugins/search_index.rb
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,9 @@ def is_latest?(group, model)
},
"url": {
"type": "keyword"
},
"download_link": {
"type": "keyword"
}
}
}
Expand Down Expand Up @@ -341,6 +344,8 @@ def is_latest?(group, model)
model[:type] = models_json[model[:url]][:type]
# Add predicted entities to search models
model[:predicted_entities] = models_json[model[:url]][:predicted_entities]
# Add download_link to search models
model[:download_link] = models_json[model[:url]][:download_link]

if client
if force_reindex || uniq_for_indexing.include?(uniq)
Expand Down

0 comments on commit 2ae46b2

Please sign in to comment.