diff --git a/app/controllers/admin/education/diplomas_controller.rb b/app/controllers/admin/education/diplomas_controller.rb index f6ef994b2d969633a98889cc2fa57a3fa3ade32d..0898fac6fb041c9feb6d6f988a22f869d4f2aa96 100644 --- a/app/controllers/admin/education/diplomas_controller.rb +++ b/app/controllers/admin/education/diplomas_controller.rb @@ -14,7 +14,6 @@ class Admin::Education::DiplomasController < Admin::Education::ApplicationContro def static @about = @diploma @website = @diploma.websites&.first - @programs = @website.education_programs.root.ordered render layout: false end diff --git a/app/models/research/publication.rb b/app/models/research/publication.rb index 3fd2eaa29a0b8c495040f8e428a20a62b17b40dd..7c97f2d40bd3ecfc8ba0ff593dfb8905d2e33b7f 100644 --- a/app/models/research/publication.rb +++ b/app/models/research/publication.rb @@ -40,7 +40,7 @@ class Research::Publication < ApplicationRecord def self.create_from(doc) publication = where(docid: doc.docid).first_or_create puts "pub-- #{where(docid: doc.docid).count}" - publication.title = doc.title_s.first + publication.title = Osuny::Sanitizer.sanitize doc.title_s.first, 'string' publication.ref = doc.attributes['citationRef_s'] publication.hal_url = doc.attributes['uri_s'] publication.doi = doc.attributes['doiId_s'] diff --git a/app/views/admin/education/diplomas/_form.html.erb b/app/views/admin/education/diplomas/_form.html.erb index 1e542c819cf933bcd281e47a8e1402d6dea8e16b..9529814c64d934fd97369f8f605d0a5cabd59e18 100644 --- a/app/views/admin/education/diplomas/_form.html.erb +++ b/app/views/admin/education/diplomas/_form.html.erb @@ -3,29 +3,24 @@ <%= f.error_notification message: f.object.errors[:base].to_sentence if f.object.errors[:base].present? %> <div class="row"> <div class="col-lg-8"> - <div class="card flex-fill w-100"> - <div class="card-header"> - <h5 class="card-title mb-0"><%= t('metadata') %></h5> - </div> - <div class="card-body"> - <%= f.input :name %> - <div class="row"> - <div class="col-lg-6"> - <%= f.input :short_name %> - </div> - <div class="col-lg-6"> - <%= f.input :level, include_blank: false %> - </div> - <div class="col-lg-6"> - <%= f.input :ects %> - </div> - <div class="col-lg-6"> - <%= f.input :duration, as: :string %> - </div> + <%= osuny_panel t('metadata') do %> + <%= f.input :name %> + <div class="row"> + <div class="col-lg-6"> + <%= f.input :short_name %> + </div> + <div class="col-lg-6"> + <%= f.input :level, include_blank: false %> + </div> + <div class="col-lg-6"> + <%= f.input :ects %> + </div> + <div class="col-lg-6"> + <%= f.input :duration, as: :string %> </div> - <%= render 'admin/application/summary/form', f: f, about: diploma %> </div> - </div> + <%= render 'admin/application/summary/form', f: f, about: diploma %> + <% end %> </div> </div> <% content_for :action_bar_right do %> diff --git a/app/views/admin/education/diplomas/_programs.html.erb b/app/views/admin/education/diplomas/_programs.html.erb index b7797ebc549728663f1489e58f4841180682a6e9..45c74bd2cbea1feb291dd7e1cdea7371008537c8 100644 --- a/app/views/admin/education/diplomas/_programs.html.erb +++ b/app/views/admin/education/diplomas/_programs.html.erb @@ -9,6 +9,6 @@ indentation = ' ' * depth <% children = program.children.ordered %> <% if children.any? %> <%= indentation %> children: -<%= render 'programs', programs: program.children.ordered, depth: depth + 4 %> +<%= render 'admin/education/diplomas/programs', programs: program.children.ordered, depth: depth + 4 %> <% end %> <% end %> diff --git a/app/views/admin/education/diplomas/static.html.erb b/app/views/admin/education/diplomas/static.html.erb index 75b42d0fb92aed18ecb0a2aff1647a281231b229..38deaae71596f480531d5c7a4a93cf8c55948c33 100644 --- a/app/views/admin/education/diplomas/static.html.erb +++ b/app/views/admin/education/diplomas/static.html.erb @@ -1,10 +1,15 @@ --- title: > <%= prepare_text_for_static @about.name %> -<%= render 'admin/application/static/permalink' %> +<%= render 'admin/application/static/permalink' if @website %> <%= render 'admin/application/static/design', full_width: true, toc_offcanvas: true %> +<% +if @website + @programs = @website.education_programs.root.ordered +%> programs: -<%= render 'programs', programs: @programs, depth: 2 %> +<%= render 'admin/education/diplomas/programs', programs: @programs, depth: 2 %> +<% end %> short_name: > <%= prepare_text_for_static @about.short_name %> <%= render 'admin/application/summary/static' %> diff --git a/app/views/admin/research/publications/_list.html.erb b/app/views/admin/research/publications/_list.html.erb index a322967bcde498495da9481bb226e380be1a5057..c39bd0e123ac0f1387fbb77d86e96c0e0f928119 100644 --- a/app/views/admin/research/publications/_list.html.erb +++ b/app/views/admin/research/publications/_list.html.erb @@ -14,6 +14,7 @@ <td><%= l publication.publication_date %></td> <td> <% publication.researchers.each do |researcher| %> + <% next if researcher.university != current_university %> <%= link_to_if researcher.university == current_university, researcher, admin_research_researcher_path(researcher) %> diff --git a/app/views/admin/research/publications/show.html.erb b/app/views/admin/research/publications/show.html.erb index 8662fabbebe06b0ead060be57366ab811a779a0f..2488cf5326df5745a8b76d81b3debd9336944a3a 100644 --- a/app/views/admin/research/publications/show.html.erb +++ b/app/views/admin/research/publications/show.html.erb @@ -24,6 +24,7 @@ </div> <div class="col-lg-4"> <% @publication.research_people.each do |person| %> + <% next if person.university != current_university %> <article class="mb-4 d-flex align-items-center position-relative"> <div style="width: 80px"> <%= kamifusen_tag person.best_picture, width: 80, class: 'img-circle' if person.best_picture.attached? %> diff --git a/cron.json b/cron.json new file mode 100644 index 0000000000000000000000000000000000000000..72d6dd6fd1eec1d1f7467c88ec588957bb912877 --- /dev/null +++ b/cron.json @@ -0,0 +1,7 @@ +{ + "jobs": [ + { + "command": "0 1 * * * rails auto:update_publications_from_hal" + } + ] +} \ No newline at end of file