Skip to content

Commit

Permalink
display accessible private ontologies in user account settings
Browse files Browse the repository at this point in the history
  • Loading branch information
imadbourouche committed Dec 20, 2024
1 parent afd56c0 commit b5c897a
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 1 deletion.
1 change: 1 addition & 0 deletions app/controllers/users_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ def show
@user_ontologies ||= []

@admin_ontologies = @ontologies.select {|o| o.administeredBy.include? @user.id }
@accessed_ontologies = @ontologies.select {|o| o.acl.include? @user.id }

projects = LinkedData::Client::Models::Project.all;
@user_projects = projects.select {|p| p.creator.include? @user.id }
Expand Down
14 changes: 14 additions & 0 deletions app/views/users/show.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,20 @@
.account-page-submitted-ontology{data: {controller: 'tooltip'}, title: ont.name}
%a{href: "/ontologies/#{view.match(/\/([^\/]+)$/)[1]}"}= view.match(/\/([^\/]+)$/)[1]

.account-page-card
%h4.account-page-card-title= t('users.show.accessible_semantic_resources')
.account-page-small-cards-container
- if @accessed_ontologies.nil? || @accessed_ontologies.empty?
= t('users.show.no_accessible_resources')
- else
- @accessed_ontologies.each do |ont|
.account-page-submitted-ontology{data: {controller: 'tooltip'}, title: ont.name}
%a{href: "/ontologies/#{ont.acronym}"}= ont.acronym
- unless ont.views.nil? || ont.views.empty?
- ont.views.each do |view|
.account-page-submitted-ontology{data: {controller: 'tooltip'}, title: ont.name}
%a{href: "/ontologies/#{view.match(/\/([^\/]+)$/)[1]}"}= view.match(/\/([^\/]+)$/)[1]

.account-page-card
%h4.account-page-card-title= t('users.show.projects_created')
.account-page-small-cards-container
Expand Down
2 changes: 2 additions & 0 deletions config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -879,13 +879,15 @@ en:
save_custom_semantic_resources: Save custom ontologies
not_subscribed: Not subscribed to any ontology
submitted_semantic_resources: Submitted Ontologies
accessible_semantic_resources: Accessible Ontologies
upload_semantic_resources: Upload Ontologies
projects_created: Projects Created
no_project_created: No project created
unsubscribe: Unsubscribe
subscribe: Subscribe
subscriptions: Subscriptions
no_uploaded_resources: You didn't upload any ontology yet
no_accessible_resources: You do not have access to other ontologies. You can only access ontologies you own.
notes: Notes
search:
no_search_class_provided: No search class provided
Expand Down
4 changes: 3 additions & 1 deletion config/locales/fr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -892,14 +892,16 @@ fr:
note_feature_logged_in: "Note : cette fonctionnalité ne fonctionne que lorsque vous êtes connecté."
save_custom_semantic_resources: Sauvegarder les ontologies personnalisées
not_subscribed: Non abonné à aucune ontologie
submitted_semantic_resources: Ressources Ontologies
submitted_semantic_resources: Ontologies Soumises
accessible_semantic_resources: Ontologies Accessibles
upload_semantic_resources: Télécharger ontologies
projects_created: Projets Créés
no_project_created: Aucun projet créé
unsubscribe: Se désabonner
subscribe: S'abonner
subscriptions: Abonnements
no_uploaded_resources: Vous n'avez encore téléchargé aucune ontologie
no_accessible_resources: Vous n'avez pas accès aux d'autres ontologies. Vous ne pouvez accéder qu'aux ontologies dont vous êtes propriétaire.
notes: Notes

search:
Expand Down

0 comments on commit b5c897a

Please sign in to comment.