Permalink
Browse files

Merge branch 'development'

  • Loading branch information...
mjy committed Sep 24, 2018
2 parents fb088f8 + a835d54 commit 71d5c9cbab87a206e0ed8463bb6a1e3d6e75cc5d
Showing with 1,584 additions and 3,712 deletions.
  1. +1 −1 app/assets/javascripts/views/georeferences/geolocate/_geolocate_iframe.js
  2. +2 −2 app/controllers/alternate_values_controller.rb
  3. +22 −17 app/controllers/citations_controller.rb
  4. +10 −2 app/controllers/confidences_controller.rb
  5. +1 −1 app/controllers/data_attributes_controller.rb
  6. +2 −2 app/controllers/notes_controller.rb
  7. +2 −1 app/controllers/otus_controller.rb
  8. +10 −10 app/controllers/sources_controller.rb
  9. +2 −2 app/controllers/tags_controller.rb
  10. +2 −8 app/controllers/tasks/nomenclature/by_source_controller.rb
  11. +22 −11 app/helpers/README.md
  12. +2 −1 app/helpers/annotations_helper.rb
  13. +16 −1 app/helpers/confidences_helper.rb
  14. +7 −0 app/helpers/otus_helper.rb
  15. +5 −0 app/helpers/taxon_names_helper.rb
  16. +32 −0 app/helpers/workbench/display_helper.rb
  17. +1 −1 app/javascript/packs/application.js
  18. +2 −3 app/javascript/vue/browse_annotations/components/annotation_for.vue
  19. +0 −69 app/javascript/vue/tasks/digitize/app.vue
  20. +0 −47 app/javascript/vue/tasks/digitize/components/collectionEvent/components/GeographyLayout.vue
  21. +0 −38 app/javascript/vue/tasks/digitize/components/collectionEvent/components/geography/collectors.vue
  22. +0 −121 app/javascript/vue/tasks/digitize/components/collectionEvent/components/geography/dates.vue
  23. +0 −82 app/javascript/vue/tasks/digitize/components/collectionEvent/components/geography/elevation.vue
  24. +0 −25 app/javascript/vue/tasks/digitize/components/collectionEvent/components/geography/geography.vue
  25. +0 −97 app/javascript/vue/tasks/digitize/components/collectionEvent/components/geography/group.vue
  26. +0 −126 app/javascript/vue/tasks/digitize/components/collectionEvent/components/geography/times.vue
  27. +0 −27 app/javascript/vue/tasks/digitize/components/collectionEvent/components/map/depictions.vue
  28. +0 −44 app/javascript/vue/tasks/digitize/components/collectionEvent/components/map/main.vue
  29. +0 −60 app/javascript/vue/tasks/digitize/components/collectionEvent/components/map/map.vue
  30. +0 −43 app/javascript/vue/tasks/digitize/components/collectionEvent/components/map/printLabel.vue
  31. +0 −27 app/javascript/vue/tasks/digitize/components/collectionEvent/components/verbatim/collectors.vue
  32. +0 −27 app/javascript/vue/tasks/digitize/components/collectionEvent/components/verbatim/date.vue
  33. +0 −27 app/javascript/vue/tasks/digitize/components/collectionEvent/components/verbatim/datum.vue
  34. +0 −27 app/javascript/vue/tasks/digitize/components/collectionEvent/components/verbatim/elevation.vue
  35. +0 −27 ...ript/vue/tasks/digitize/components/collectionEvent/components/verbatim/geolocationUncertainty.vue
  36. +0 −27 app/javascript/vue/tasks/digitize/components/collectionEvent/components/verbatim/habitat.vue
  37. +0 −27 app/javascript/vue/tasks/digitize/components/collectionEvent/components/verbatim/label.vue
  38. +0 −27 app/javascript/vue/tasks/digitize/components/collectionEvent/components/verbatim/latitude.vue
  39. +0 −27 app/javascript/vue/tasks/digitize/components/collectionEvent/components/verbatim/locality.vue
  40. +0 −27 app/javascript/vue/tasks/digitize/components/collectionEvent/components/verbatim/longitude.vue
  41. +0 −27 app/javascript/vue/tasks/digitize/components/collectionEvent/components/verbatim/method.vue
  42. +0 −27 app/javascript/vue/tasks/digitize/components/collectionEvent/components/verbatim/tripIdentifier.vue
  43. +0 −67 app/javascript/vue/tasks/digitize/components/collectionEvent/components/verbatimLayout.vue
  44. +0 −58 app/javascript/vue/tasks/digitize/components/collectionEvent/main.vue
  45. +0 −172 app/javascript/vue/tasks/digitize/components/collectionObject/bioclassification.vue
  46. +0 −60 app/javascript/vue/tasks/digitize/components/collectionObject/bufferedData.vue
  47. +0 −102 app/javascript/vue/tasks/digitize/components/collectionObject/catalogNumber.vue
  48. +0 −69 app/javascript/vue/tasks/digitize/components/collectionObject/main.vue
  49. +0 −88 app/javascript/vue/tasks/digitize/components/collectionObject/repository.vue
  50. +0 −122 app/javascript/vue/tasks/digitize/components/shared/depictionImage.vue
  51. +0 −132 app/javascript/vue/tasks/digitize/components/shared/depictions.vue
  52. +0 −23 app/javascript/vue/tasks/digitize/components/shared/validate.vue
  53. +0 −48 app/javascript/vue/tasks/digitize/components/taskHeader/main.vue
  54. +0 −128 app/javascript/vue/tasks/digitize/components/taxonDetermination/main.vue
  55. +0 −118 app/javascript/vue/tasks/digitize/components/typeMaterial/typeMaterial.vue
  56. +0 −38 app/javascript/vue/tasks/digitize/main.js
  57. +0 −187 app/javascript/vue/tasks/digitize/request/resources.js
  58. +0 −11 app/javascript/vue/tasks/digitize/store/actions/actionNames.js
  59. +0 −20 app/javascript/vue/tasks/digitize/store/actions/actions.js
  60. +0 −8 app/javascript/vue/tasks/digitize/store/actions/getCollectionObject.js
  61. +0 −9 app/javascript/vue/tasks/digitize/store/actions/getTaxon.js
  62. +0 −12 app/javascript/vue/tasks/digitize/store/actions/loadDigitalization.js
  63. +0 −22 app/javascript/vue/tasks/digitize/store/actions/saveCollectionEvent.js
  64. +0 −27 app/javascript/vue/tasks/digitize/store/actions/saveCollectionObject.js
  65. +0 −26 app/javascript/vue/tasks/digitize/store/actions/saveDetermination.js
  66. +0 −13 app/javascript/vue/tasks/digitize/store/actions/saveDigitalization.js
  67. +0 −27 app/javascript/vue/tasks/digitize/store/actions/saveIdentifier.js
  68. +0 −26 app/javascript/vue/tasks/digitize/store/actions/saveTypeMaterial.js
  69. +0 −3 app/javascript/vue/tasks/digitize/store/getters/getCollectionEvent.js
  70. +0 −3 app/javascript/vue/tasks/digitize/store/getters/getCollectionEventLabel.js
  71. +0 −3 app/javascript/vue/tasks/digitize/store/getters/getCollectionObject.js
  72. +0 −3 app/javascript/vue/tasks/digitize/store/getters/getDepictions.js
  73. +0 −3 app/javascript/vue/tasks/digitize/store/getters/getIdentifier.js
  74. +0 −3 app/javascript/vue/tasks/digitize/store/getters/getTaxonDetermination.js
  75. +0 −3 app/javascript/vue/tasks/digitize/store/getters/getTypeMaterial.js
  76. +0 −32 app/javascript/vue/tasks/digitize/store/getters/getters.js
  77. +0 −3 app/javascript/vue/tasks/digitize/store/mutations/CollectionEvent/setCollectionEvent.js
  78. +0 −3 app/javascript/vue/tasks/digitize/store/mutations/CollectionEvent/setCollectionEventCollectors.js
  79. +0 −3 app/javascript/vue/tasks/digitize/store/mutations/CollectionEvent/setCollectionEventDate.js
  80. +0 −3 app/javascript/vue/tasks/digitize/store/mutations/CollectionEvent/setCollectionEventDatum.js
  81. +0 −3 app/javascript/vue/tasks/digitize/store/mutations/CollectionEvent/setCollectionEventDocumentLabel.js
  82. +0 −3 app/javascript/vue/tasks/digitize/store/mutations/CollectionEvent/setCollectionEventElevation.js
  83. +0 −3 ...script/vue/tasks/digitize/store/mutations/CollectionEvent/setCollectionEventElevationPrecision.js
  84. +0 −3 app/javascript/vue/tasks/digitize/store/mutations/CollectionEvent/setCollectionEventEndDateDay.js
  85. +0 −3 app/javascript/vue/tasks/digitize/store/mutations/CollectionEvent/setCollectionEventEndDateMonth.js
  86. +0 −3 app/javascript/vue/tasks/digitize/store/mutations/CollectionEvent/setCollectionEventEndDateYear.js
  87. +0 −3 app/javascript/vue/tasks/digitize/store/mutations/CollectionEvent/setCollectionEventGeolocation.js
  88. +0 −3 app/javascript/vue/tasks/digitize/store/mutations/CollectionEvent/setCollectionEventHabitat.js
  89. +0 −3 app/javascript/vue/tasks/digitize/store/mutations/CollectionEvent/setCollectionEventLabel.js
  90. +0 −3 app/javascript/vue/tasks/digitize/store/mutations/CollectionEvent/setCollectionEventLatitude.js
  91. +0 −3 app/javascript/vue/tasks/digitize/store/mutations/CollectionEvent/setCollectionEventLocality.js
  92. +0 −3 app/javascript/vue/tasks/digitize/store/mutations/CollectionEvent/setCollectionEventLongitude.js
  93. +0 −3 app/javascript/vue/tasks/digitize/store/mutations/CollectionEvent/setCollectionEventMaxMa.js
  94. +0 −3 ...vascript/vue/tasks/digitize/store/mutations/CollectionEvent/setCollectionEventMaximumElevation.js
  95. +0 −3 app/javascript/vue/tasks/digitize/store/mutations/CollectionEvent/setCollectionEventMethod.js
  96. +0 −3 app/javascript/vue/tasks/digitize/store/mutations/CollectionEvent/setCollectionEventMinMa.js
  97. +0 −3 ...vascript/vue/tasks/digitize/store/mutations/CollectionEvent/setCollectionEventMinimumElevation.js
  98. +0 −3 app/javascript/vue/tasks/digitize/store/mutations/CollectionEvent/setCollectionEventPrintLabel.js
  99. +0 −3 app/javascript/vue/tasks/digitize/store/mutations/CollectionEvent/setCollectionEventStartDateDay.js
  100. +0 −3 ...javascript/vue/tasks/digitize/store/mutations/CollectionEvent/setCollectionEventStartDateMonth.js
  101. +0 −3 app/javascript/vue/tasks/digitize/store/mutations/CollectionEvent/setCollectionEventStartDateYear.js
  102. +0 −3 app/javascript/vue/tasks/digitize/store/mutations/CollectionEvent/setCollectionEventTimeEndHour.js
  103. +0 −3 app/javascript/vue/tasks/digitize/store/mutations/CollectionEvent/setCollectionEventTimeEndMinute.js
  104. +0 −3 app/javascript/vue/tasks/digitize/store/mutations/CollectionEvent/setCollectionEventTimeEndSecond.js
  105. +0 −3 app/javascript/vue/tasks/digitize/store/mutations/CollectionEvent/setCollectionEventTimeStartHour.js
  106. +0 −3 ...avascript/vue/tasks/digitize/store/mutations/CollectionEvent/setCollectionEventTimeStartMinute.js
  107. +0 −3 ...avascript/vue/tasks/digitize/store/mutations/CollectionEvent/setCollectionEventTimeStartSecond.js
  108. +0 −3 ...javascript/vue/tasks/digitize/store/mutations/CollectionEvent/setCollectionEventTripIdentifier.js
  109. +0 −3 app/javascript/vue/tasks/digitize/store/mutations/CollectionObject/setCollectionObject.js
  110. +0 −3 ...vue/tasks/digitize/store/mutations/CollectionObject/setCollectionObjectBufferedCollectionEvent.js
  111. +0 −3 .../vue/tasks/digitize/store/mutations/CollectionObject/setCollectionObjectBufferedDeterminations.js
  112. +0 −3 ...ript/vue/tasks/digitize/store/mutations/CollectionObject/setCollectionObjectBufferedOtherLabel.js
  113. +0 −3 ...e/tasks/digitize/store/mutations/CollectionObject/setCollectionObjectCollectionEventAttributes.js
  114. +0 −3 app/javascript/vue/tasks/digitize/store/mutations/CollectionObject/setCollectionObjectConteiner.js
  115. +0 −3 ...cript/vue/tasks/digitize/store/mutations/CollectionObject/setCollectionObjectDeaccessionReason.js
  116. +0 −3 ...ascript/vue/tasks/digitize/store/mutations/CollectionObject/setCollectionObjectDeaccessionedAt.js
  117. +0 −3 app/javascript/vue/tasks/digitize/store/mutations/CollectionObject/setCollectionObjectEventId.js
  118. +0 −3 ...avascript/vue/tasks/digitize/store/mutations/CollectionObject/setCollectionObjectPreparationId.js
  119. +0 −3 app/javascript/vue/tasks/digitize/store/mutations/CollectionObject/setCollectionObjectRangeLotId.js
  120. +0 −3 ...javascript/vue/tasks/digitize/store/mutations/CollectionObject/setCollectionObjectRepositoryId.js
  121. +0 −3 app/javascript/vue/tasks/digitize/store/mutations/CollectionObject/setCollectionObjectTotal.js
  122. +0 −3 app/javascript/vue/tasks/digitize/store/mutations/Identifier/setIdentifier.js
  123. +0 −3 app/javascript/vue/tasks/digitize/store/mutations/Identifier/setIdentifierIdentifier.js
  124. +0 −3 app/javascript/vue/tasks/digitize/store/mutations/Identifier/setIdentifierNamespaceId.js
  125. +0 −3 app/javascript/vue/tasks/digitize/store/mutations/Identifier/setIdentifierObjectId.js
  126. +0 −3 app/javascript/vue/tasks/digitize/store/mutations/TaxonDetermination/setTaxonDetermination.js
  127. +0 −3 ...script/vue/tasks/digitize/store/mutations/TaxonDetermination/setTaxonDeterminationBiologicalId.js
  128. +0 −3 app/javascript/vue/tasks/digitize/store/mutations/TaxonDetermination/setTaxonDeterminationDay.js
  129. +0 −3 app/javascript/vue/tasks/digitize/store/mutations/TaxonDetermination/setTaxonDeterminationMonth.js
  130. +0 −3 app/javascript/vue/tasks/digitize/store/mutations/TaxonDetermination/setTaxonDeterminationOtuId.js
  131. +0 −3 app/javascript/vue/tasks/digitize/store/mutations/TaxonDetermination/setTaxonDeterminationRoles.js
  132. +0 −3 app/javascript/vue/tasks/digitize/store/mutations/TaxonDetermination/setTaxonDeterminationYear.js
  133. +0 −3 app/javascript/vue/tasks/digitize/store/mutations/TypeMaterial/setTypeMaterial.js
  134. +0 −3 app/javascript/vue/tasks/digitize/store/mutations/TypeMaterial/setTypeMaterialBiologicalObjectId.js
  135. +0 −3 app/javascript/vue/tasks/digitize/store/mutations/TypeMaterial/setTypeMaterialCollectionObject.js
  136. +0 −3 app/javascript/vue/tasks/digitize/store/mutations/TypeMaterial/setTypeMaterialCollectionObjectId.js
  137. +0 −3 app/javascript/vue/tasks/digitize/store/mutations/TypeMaterial/setTypeMaterialDesignatorRoles.js
  138. +0 −3 app/javascript/vue/tasks/digitize/store/mutations/TypeMaterial/setTypeMaterialProtonymId.js
  139. +0 −3 app/javascript/vue/tasks/digitize/store/mutations/TypeMaterial/setTypeMaterialRoles.js
  140. +0 −3 app/javascript/vue/tasks/digitize/store/mutations/TypeMaterial/setTypeMaterialTaxon.js
  141. +0 −3 app/javascript/vue/tasks/digitize/store/mutations/TypeMaterial/setTypeMaterialType.js
  142. +0 −218 app/javascript/vue/tasks/digitize/store/mutations/mutations.js
  143. +0 −117 app/javascript/vue/tasks/digitize/store/store.js
  144. +0 −4 app/javascript/vue/tasks/digitize/validations/determination.js
  145. +0 −5 app/javascript/vue/tasks/digitize/validations/typeMaterial.js
  146. +106 −0 app/javascript/vue/tasks/nomenclature/by_source/app.vue
  147. +43 −0 app/javascript/vue/tasks/nomenclature/by_source/components/asserted_distributions.vue
  148. +45 −0 app/javascript/vue/tasks/nomenclature/by_source/components/biological_associations.vue
  149. +101 −0 app/javascript/vue/tasks/nomenclature/by_source/components/cite_taxon_name.vue
  150. +97 −0 app/javascript/vue/tasks/nomenclature/by_source/components/nomen_source.vue
  151. +54 −0 app/javascript/vue/tasks/nomenclature/by_source/components/otus_by_match.vue
  152. +131 −0 app/javascript/vue/tasks/nomenclature/by_source/components/otus_match_proxy.vue
  153. +47 −0 app/javascript/vue/tasks/nomenclature/by_source/components/tables/otu_row_component.vue
  154. +29 −0 app/javascript/vue/tasks/nomenclature/by_source/components/tables/otu_table.vue
  155. +76 −0 app/javascript/vue/tasks/nomenclature/by_source/components/tables/row_components.vue
  156. +51 −0 app/javascript/vue/tasks/nomenclature/by_source/components/tables/table.vue
  157. +46 −0 app/javascript/vue/tasks/nomenclature/by_source/components/taxon_name_classifications.vue
  158. +45 −0 app/javascript/vue/tasks/nomenclature/by_source/components/taxon_name_relationships.vue
  159. +57 −0 app/javascript/vue/tasks/nomenclature/by_source/components/taxon_names.vue
  160. +33 −0 app/javascript/vue/tasks/nomenclature/by_source/main.js
  161. +8 −6 app/models/biological_association.rb
  162. +5 −1 app/models/citation.rb
  163. +4 −0 app/models/confidence.rb
  164. +6 −6 app/models/georeference/geo_locate.rb
  165. +14 −1 app/models/identifier/global/doi.rb
  166. +3 −0 app/models/note.rb
  167. +11 −1 app/models/project_source.rb
  168. +1 −0 app/models/protocol.rb
  169. +0 −9 app/models/protonym.rb
  170. +25 −4 app/models/source.rb
  171. +3 −0 app/models/tag.rb
  172. +0 −32 app/models/taxon_name_relationship/original_combination/original_section.rb
  173. +0 −32 app/models/taxon_name_relationship/original_combination/original_series.rb
  174. +0 −33 app/models/taxon_name_relationship/original_combination/original_subsection.rb
  175. +0 −33 app/models/taxon_name_relationship/original_combination/original_subseries.rb
  176. +7 −11 app/views/georeferences/geo_locates/_geolocate_iframe.html.erb
  177. +3 −0 app/views/shared/data/all/_metadata.json.jbuilder
  178. +0 −1 app/views/tasks/accessions/comprehensive/index.html.erb
  179. +3 −3 app/views/tasks/bibliography/verbatim_reference/new.html.erb
  180. +7 −3 app/views/tasks/bibliography/verbatim_reference/preview.html.erb
  181. +1 −0 app/views/tasks/nomenclature/by_source/index.html
  182. 0 app/views/tasks/nomenclature/by_source/{index.html.erb → old_index.html.erb}
  183. +42 −35 app/views/users/_form.html.erb
  184. +0 −9 config/interface/hub/user_tasks.yml
  185. +7 −1 config/routes.rb
  186. +6 −30 lib/queries/citation/filter.rb
  187. +34 −0 lib/queries/concerns/polymorphic.rb
  188. +8 −10 lib/queries/confidence/filter.rb
  189. +4 −4 lib/queries/otu/filter.rb
  190. +8 −1 lib/queries/person/filter.rb
  191. +1 −1 lib/tasks/import/3i/3i.rake
  192. +94 −11 lib/tasks/import/sf/sf_import_all.rake
  193. +26 −25 lib/tasks/import/sf/sf_specimens.rake
  194. +1 −1 lib/tasks/import/sf/sf_supplementary.rake
  195. +38 −0 spec/lib/queries/confidence/filter_spec.rb
  196. +9 −0 spec/lib/queries/otu/filter_spec.rb
  197. +8 −6 spec/lib/queries/person/filter_spec.rb
  198. +6 −6 spec/models/collecting_event/geo_spec.rb
  199. +7 −7 spec/models/geographic_area_spec.rb
  200. +13 −1 spec/models/identifier/global/doi_spec.rb
  201. +11 −1 spec/models/project_source_spec.rb
  202. +6 −0 spec/models/source/human_spec.rb
  203. +52 −16 spec/models/source_spec.rb
@@ -1,7 +1,7 @@
function displayMessage(event) {
message = undefined;
if (event.origin !== "http://www.museum.tulane.edu") {
if (event.origin !== "http://www.geo-locate.org") {
message = "iframe url does not have permision to interact with me";
}
else {
@@ -15,8 +15,8 @@ def index
render '/shared/data/all/index'
}
format.json {
@alternate_values = Queries::AlternateValue::Filter.new(params).all.limit(500)
.where(project_id: sessions_current_project_id).order(:id)
@alternate_values = Queries::AlternateValue::Filter.new(params).all
.where(project_id: sessions_current_project_id).page(param[:page]).per(500)
}
end
end
@@ -42,11 +42,11 @@ def create
@citation = Citation.new(citation_params)
respond_to do |format|
if @citation.save
format.html { redirect_to url_for(@citation.citation_object.metamorphosize), notice: 'Citation was successfully created.' }
format.json { render :show, status: :created, location: @citation }
format.html {redirect_to url_for(@citation.citation_object.metamorphosize), notice: 'Citation was successfully created.'}
format.json {render :show, status: :created, location: @citation}
else
format.html {redirect_back(fallback_location: (request.referer || root_path), notice: 'Citation was NOT successfully created.')}
format.json { render json: @citation.errors, status: :unprocessable_entity }
format.json {render json: @citation.errors, status: :unprocessable_entity}
end
end
end
@@ -56,11 +56,11 @@ def create
def update
respond_to do |format|
if @citation.update(citation_params)
format.html { redirect_to url_for(@citation.citation_object.metamorphosize), notice: 'Citation was successfully updated.' }
format.json { render :show, location: @citation }
format.html {redirect_to url_for(@citation.citation_object.metamorphosize), notice: 'Citation was successfully updated.'}
format.json {render :show, location: @citation}
else
format.html {redirect_back(fallback_location: (request.referer || root_path), notice: 'Citation was NOT successfully updated.')}
format.json { render json: @citation.errors, status: :unprocessable_entity }
format.json {render json: @citation.errors, status: :unprocessable_entity}
end
end
end
@@ -70,8 +70,13 @@ def update
def destroy
@citation.destroy
respond_to do |format|
format.html {redirect_back(fallback_location: (request.referer || root_path), notice: 'Citation was successfully destroyed.')}
format.json { head :no_content }
if @citation.destroyed?
format.html {redirect_back(fallback_location: (request.referer || root_path), notice: 'Citation was successfully destroyed.')}
format.json {head :no_content}
else
format.html {redirect_back(fallback_location: (request.referer || root_path), notice: 'Citation was not destroyed, ' + errors.messages)}
format.json {render json: @citation.errors, status: :unprocessable_entity}
end
end
end
@@ -112,8 +117,8 @@ def download
def filter_params
params.permit(
:citation_object_type, :citation_object_id, :source_id,
Citation.related_foreign_keys.map(&:to_sym)
:citation_object_type, :citation_object_id, :source_id,
Citation.related_foreign_keys.map(&:to_sym)
).merge(project_id: sessions_current_project_id)
end
@@ -123,13 +128,13 @@ def set_citation
def citation_params
params.require(:citation).permit(
:citation_object_type, :citation_object_id, :source_id, :pages, :is_original,
:annotated_global_entity,
citation_topics_attributes: [
:id, :_destroy, :pages, :topic_id,
topic_attributes: [:id, :_destroy, :name, :definition]
],
topics_attributes: [:name, :definition]
:citation_object_type, :citation_object_id, :source_id, :pages, :is_original,
:annotated_global_entity,
citation_topics_attributes: [
:id, :_destroy, :pages, :topic_id,
topic_attributes: [:id, :_destroy, :name, :definition]
],
topics_attributes: [:name, :definition]
)
end
end
@@ -13,12 +13,13 @@ def index
render '/shared/data/all/index'
}
format.json {
@confidences = Queries::Confidence::Filter.new(params).all.limit(500)
.where(project_id: sessions_current_project_id)
@confidences = Queries::Confidence::Filter.new(filter_params).all
.where(project_id: sessions_current_project_id).page(params[:page]).per(500)
}
end
end
# GET /confidences/new
def new
@confidence_object = confidence_object
@@ -102,6 +103,13 @@ def set_confidence
@confidence = Confidence.find(params[:id])
end
def filter_params
params.permit(
:confidence_level_id, :object_global_id, :confidence_object_type,
Confidence.related_foreign_keys.map(&:to_sym)
)
end
def confidence_params
params.require(:confidence).permit(
:annotated_global_entity,
@@ -13,7 +13,7 @@ def index
}
format.json {
@data_attributes = Queries::DataAttribute::Filter.new(params).all
.where(project_id: sessions_current_project_id).page(params[:page]).per(500)
.where(project_id: sessions_current_project_id).page(params[:page] || 1).per(500)
}
end
end
@@ -13,8 +13,8 @@ def index
render '/shared/data/all/index'
}
format.json {
@notes = Queries::Note::Filter.new(params).all.limit(500)
.where(project_id: sessions_current_project_id)
@notes = Queries::Note::Filter.new(params).all
.where(project_id: sessions_current_project_id).page(param[:page]).per(500)
}
end
end
@@ -246,7 +246,8 @@ def filter_params
params.permit(
:taxon_name_id, :otu_id,
biological_association_ids: [], taxon_name_ids: [], otu_ids: [],
taxon_name_classification_ids: [], taxon_name_relationship_ids: [], asserted_distribution_ids: []
taxon_name_relationship_ids: [],taxon_name_classification_ids: [],
asserted_distribution_ids: []
)
end
@@ -187,16 +187,16 @@ def source_params
:abstract, :copyright, :language, :stated_year, :verbatim,
:bibtex_type, :day, :year, :isbn, :issn, :verbatim_contents,
:verbatim_keywords, :language_id, :translator, :year_suffix, :url, :type,
roles_attributes: [
:id,
:_destroy,
:type,
:person_id,
:position,
person_attributes: [
:last_name, :first_name, :suffix, :prefix
]
],
roles_attributes: [
:id,
:_destroy,
:type,
:person_id,
:position,
person_attributes: [
:last_name, :first_name, :suffix, :prefix
]
],
project_sources_attributes: [:project_id]
)
end
@@ -12,8 +12,8 @@ def index
render '/shared/data/all/index'
}
format.json {
@tags = Queries::Tag::Filter.new(params).all.limit(500)
.where(project_id: sessions_current_project_id)
@tags = Queries::Tag::Filter.new(params).all.where(project_id: sessions_current_project_id).
page(param[:page]).per(500)
}
end
end
@@ -2,13 +2,7 @@ class Tasks::Nomenclature::BySourceController < ApplicationController
include TaskControllerConfiguration
def index
if !ProjectSource.where(project_id: sessions_current_project_id).any?
flash[:notice] = 'Create or add a source to your project first.'
redirect_to sources_path and return
end
@source = Source.find(params[:id]) if !params[:id].blank?
@source ||= Project.find(sessions_current_project_id).project_sources.first.source
# @source = Source.find(params[:id]) unless params[:id].blank?
# @source ||= Project.find(sessions_current_project_id).project_sources.first.source
end
end
View
@@ -1,6 +1,5 @@
Helper Descriptions
===================
@@ -9,6 +8,8 @@ See individual headers at https://github.com/SpeciesFileGroup/taxonworks/tree/ma
Code Organization
=================
TODO: Go over patterns, clean up where no longer pertinent.
```Ruby
class <Model>Helper
@@ -29,30 +30,40 @@ class <Model>Helper
# Exemplar data model helper methods
#
# Return a single line, ideally wrapped in a content_tag(:span, ... ) naming the instance.
def <model_name>_tag(model)
return nil if model.nil
# return some model.attribute of interpolated string of model attributes
# Return a single line, ideally wrapped in a content_tag(:span, ... ) naming the instance.
# Often contains html.
def <model_name>_tag(object)
return nil if object.nil
# return some object.attribute of interpolated string of object attributes
end
# Return a single line, ideally wrapped in a content_tag(:span, ... ) briefly naming the instance.
def <model_name>_short_tag(model)
# May contain html.
def <model_name>_short_tag(object)
end
# Return one or more line, ideally wrapped in a content_tag(:div, ... ) detailing the instance.
def <model_name>_detailed_tag(model)
# Rarely used at present. Often contains html.
def <model_name>_detailed_tag(object)
end
# Return a link_to(model_path) using model_tag
def <model_name>_link(model)
def <model_name>_link(object)
end
# Return a link_to(model_path) using model_short_tag
def model_short_link(model)
def model_short_link(mobject)
end
# Return a content_tag(:li, <model>_tag(object))
def model_select_item(mobject)
end
# Return a content_tag(:li, model_tag(model))
def model_select_item(model)
# Return a String
# An equivalent to object_tag, but never with HTML!
# Same as
# label_for(object)
def label_for_<model>(object)
end
end
@@ -14,7 +14,8 @@ def annotations_summary_tag(object)
data_attribute_list_tag(object),
note_list_tag(object),
tag_list_tag(object),
alternate_values_list_tag(object)
alternate_values_list_tag(object),
confidence_list_tag(object)
].compact.join.html_safe, class: :annotations_summary_list, 'data-annotator-list-object-id' => object.id)
end
@@ -7,7 +7,22 @@ def confidence_tag(confidence)
def confidence_link(confidence)
return nil if confidence.nil?
link_to(confidence_tag(confidence), confidence)
link_to(confidence_tag(confidence), confidence.confidence_object.metamorphosize)
end
# @return [String (html), nil]
# a ul/li of tags for the object
def confidence_list_tag(object)
return nil unless object.has_confidences? && object.confidences.any?
content_tag(:h3, 'Confidences') +
content_tag(:ul, class: 'annotations__confidences_list') do
object.confidences.collect { |a| content_tag(:li, confidence_tag(a)) }.join.html_safe
end
end
def confidence_annotation_confidence(confidence)
return nil if confidence.nil?
content_tag(:span, controlled_vocabulary_term_tag(confidence.confidence_level), class: [:annotation__confidence])
end
def confidences_search_form
@@ -21,6 +21,13 @@ def otu_link(otu)
link_to(otu_tag(otu).html_safe, otu)
end
def label_for_otu(otu)
return nil if otu.nil?
[otu.name,
label_for_taxon_name(otu.taxon_name)
].compact.join(': ')
end
def otus_search_form
render('/otus/quick_search_form')
end
@@ -8,6 +8,11 @@ def taxon_name_tag(taxon_name)
taxon_name.cached_html.try(:html_safe) || taxon_name.name
end
def label_for_taxon_name(taxon_name)
return nil if taxon_name.nil?
[taxon_name.cached, taxon_name.cached_author_year].compact.join(' ')
end
def taxon_name_autocomplete_tag(taxon_name, term)
return nil if taxon_name.nil?
klass = taxon_name.rank_class ? taxon_name.rank_class.nomenclatural_code : nil
@@ -1,6 +1,10 @@
# Generic wrappers around AR instances, these should not include link generation, but may call out to other helpers that do generate links.
# See /app/helpers/README.md for more.
#
module Workbench::DisplayHelper
# General wrapper around individual <model_name>_tag methods
# object_tag(@otu)
def object_tag(object)
@@ -31,6 +35,34 @@ def object_tag_method(object)
end
end
# General wrapper around individual <model_name>_tag methods
# label_for(@otu)
def label_for(object)
return nil if object.nil?
method = label_for_method(object)
if self.respond_to?(method)
string = send(method, object)
return string if string
else
nil
end
end
def label_for_method(object)
return nil if object.nil?
klass_name = object.class.name
method = "label_for_#{klass_name.underscore.gsub('/', '_')}"
if ApplicationController.helpers.respond_to?(method)
method
else
klass_name = metamorphosize_if(object).class.name
"label_for_#{klass_name.underscore}"
end
end
def model_name_title
controller_name.humanize
end
@@ -21,10 +21,10 @@ require('../vue/browse_annotations/main.js')
require('../vue/tasks/descriptor/main.js')
require('../vue/tasks/new_matrix/main.js')
require('../vue/tasks/clipboard/main.js')
require('../vue/tasks/digitize/main.js')
require('../vue/tasks/uniquify/people/main.js')
require('../vue/tasks/uniquify/sources/main.js')
require('../vue/tasks/single_bibtex_source/main.js')
require('../vue/tasks/nomenclature/by_source/main.js')
// Styles
require('../style/application.scss')
Oops, something went wrong.

0 comments on commit 71d5c9c

Please sign in to comment.