diff --git a/app/controllers/concerns/authentication.rb b/app/controllers/concerns/authentication.rb index f6de47eaa7dc245b8cd0d49fd86cd11847ea7c71..fe691314b73e28ce9e57e450531c33a2095f91ab 100644 --- a/app/controllers/concerns/authentication.rb +++ b/app/controllers/concerns/authentication.rb @@ -11,9 +11,9 @@ module Authentication end def authenticate_user! - user_dict = { "labs_user_id" => decrypt_header(request.headers["X-Auth-Newseye-Token"])[0], - "labs_user_name" => decrypt_header(request.headers["X-Auth-Newseye-Token"])[1] } - # user_dict = { "labs_user_id" => "42", "labs_user_name" => "dummyuser" } + # user_dict = { "labs_user_id" => decrypt_header(request.headers["X-Auth-Newseye-Token"])[0], + # "labs_user_name" => decrypt_header(request.headers["X-Auth-Newseye-Token"])[1] } + user_dict = { "labs_user_id" => "42", "labs_user_name" => "dummyuser" } @user = User.find_by(labs_user_id: user_dict["labs_user_id"]) if @user if !session[:current_user_id] @@ -37,8 +37,8 @@ module Authentication private def current_user - Current.user ||= User.find_by(labs_user_id: decrypt_header(request.headers["X-Auth-Newseye-Token"])[0]) - # Current.user ||= User.find_by(labs_user_id: "42") + # Current.user ||= User.find_by(labs_user_id: decrypt_header(request.headers["X-Auth-Newseye-Token"])[0]) + Current.user ||= User.find_by(labs_user_id: "42") end def decrypt_header(token) diff --git a/app/javascript/packs/application.scss b/app/javascript/packs/application.scss index dc64c74d6656d40118629a765d1049d1a5598300..d3aad5fd2beb3df7a16e8460a4982e1bd3553374 100644 --- a/app/javascript/packs/application.scss +++ b/app/javascript/packs/application.scss @@ -13,6 +13,7 @@ $link-color: $labs-green; $link-hover-color: darken($labs-green, 10%) !default; $component-active-bg: $labs-green; $card-color: black; +$border-color: #69737e; $fa-font-path: '../../../node_modules/@fortawesome/fontawesome-free/webfonts'; diff --git a/app/javascript/packs/controllers/viewer_controller.js b/app/javascript/packs/controllers/viewer_controller.js index 598fe9b4dcec87dac7281401b903ee3de78b601e..f03cad12a65eeb5c06bf89cb92127a9f0e51d784 100644 --- a/app/javascript/packs/controllers/viewer_controller.js +++ b/app/javascript/packs/controllers/viewer_controller.js @@ -18,10 +18,13 @@ export default class extends Controller { this.selectedArticlesValue = [] if (selectedCompoundParam != null) { const compoundParts = $(`#compound-articles-panel li[data-compound-id="${selectedCompoundParam}"]`).data('parts') - this.selectedCompound = {id: selectedCompoundParam, parts: compoundParts} + const compoundTitle = $(`#compound-articles-panel li[data-compound-id="${selectedCompoundParam}"]`).data('title') + this.selectedCompound = {id: selectedCompoundParam, parts: compoundParts, title: compoundTitle} $(`#compound-articles-panel li[data-compound-id="${selectedCompoundParam}"]`).addClass("active") + this.load_named_entities(this.selectedCompound.parts) + } else { + this.load_named_entities([this.issueIdValue]) } - this.load_named_entities([this.issueIdValue]) } else { this.selectedArticlesValue = [selectedParam] @@ -112,7 +115,7 @@ export default class extends Controller { }) // Compound article selection $("#compound_articles_list").on("click", "li", (event) => { - const elt = $(event.target) + const elt = $(event.currentTarget) if(elt.hasClass("active")) this.unselect_compound_article(elt.data('compoundId')) else @@ -123,7 +126,8 @@ export default class extends Controller { select_compound_article(compoundId) { const compoundParts = $(`#compound-articles-panel li[data-compound-id="${compoundId}"]`).data('parts') - this.selectedCompound = {id: compoundId, parts: compoundParts} + const compoundTitle = $(`#compound-articles-panel li[data-compound-id="${compoundId}"]`).data('title') + this.selectedCompound = {id: compoundId, parts: compoundParts, title: compoundTitle} $("#compound-articles-panel li").removeClass("active") $(`#compound-articles-panel li[data-compound-id="${compoundId}"]`).addClass("active") this.unselectArticles() @@ -264,7 +268,7 @@ export default class extends Controller { const art = this.articlesValue.filter(elt => elt.id == article_id)[0] return art.all_text.replaceAll("\"", "").replaceAll("\\n", "<br/>") }).join("\n") - $(this.selectedArticlePanelTarget).find('h5')[0].innerHTML = "" + $(this.selectedArticlePanelTarget).find('h5')[0].innerHTML = this.selectedCompound.title $(this.selectedArticlePanelTarget).find('p')[0].innerHTML = text } else { diff --git a/app/javascript/packs/stylesheets/catalog.scss b/app/javascript/packs/stylesheets/catalog.scss index 3097b0217cac8107c3664c04ad2b7375dc98d182..1f8e54bf686e9deb81c09ad84845226747bc7493 100644 --- a/app/javascript/packs/stylesheets/catalog.scss +++ b/app/javascript/packs/stylesheets/catalog.scss @@ -38,6 +38,10 @@ color: hsl(180, 15%, 30%); } +.accordion-button:not(.collapsed)::after { + background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23212529'%3e%3cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3e%3c/svg%3e"); +} + li.selected_constraint { color: darken(hsl(180, 15%, 30%), 10%); } @@ -179,7 +183,7 @@ li.selected_constraint { ////////////////////// Index Datasets //////////////////// .dataset-item:hover { - background-color: #dfdfdf; + background-color: #EEE; } //////////////////////////////////////////////////////// @@ -188,7 +192,7 @@ li.selected_constraint { padding: 0.5em; } .dataset_document:hover { - background-color: #dfdfdf; + background-color: #EEE; } .dataset_document.selected { border: 2px solid darken(hsl(180, 15%, 30%), 10%); diff --git a/app/views/catalog/_compound_articles_panel.html.erb b/app/views/catalog/_compound_articles_panel.html.erb index dcc4393ec1317dc22de8931d71a39de6454a0115..ffbceabc64c50cd2ce2dd8c3457ffded6ee08d64 100644 --- a/app/views/catalog/_compound_articles_panel.html.erb +++ b/app/views/catalog/_compound_articles_panel.html.erb @@ -7,9 +7,9 @@ <div class="p-0 card-body d-flex align-items-center justify-content-center flex-column"> <ul class="list-group w-100"> <% compound_articles.each do |compound_article| %> - <li class="list-group-item cmpnd-article" data-compound-id="<%= compound_article.id %>" data-parts="<%= compound_article.parts.to_json %>"> + <li class="list-group-item cmpnd-article" data-compound-id="<%= compound_article.id %>" data-parts="<%= compound_article.parts.to_json %>" data-title="<%= compound_article.title %>"> <div class="text_part d-inline"><%= compound_article.title %></div> - <a class="delete_compound_article text-danger float-end" href="#"><span class="fas fa-times"></span></a> + <a class="delete_compound_article text-danger float-end" href="#"><span class="fas fa-trash"></span></a> </li> <% end %> </ul> diff --git a/app/views/catalog/_query_filters.html.erb b/app/views/catalog/_query_filters.html.erb index 4001f2569d98aae566a6d81287aac2c6c6c594c8..7d40cd716e7b9b02ff1f0bde68f4503015f29e53 100644 --- a/app/views/catalog/_query_filters.html.erb +++ b/app/views/catalog/_query_filters.html.erb @@ -5,7 +5,7 @@ <% search_constraints.each do |constraint| %> <% field = t('newspapers.solr_fields').find { |key,value| value == constraint[:label] }[0].to_s %> <% next if field == "doc_type" %> - <span class="btn-group"> + <span class="btn-group btn-group-sm"> <button class="btn btn-sm btn-outline-primary" disabled> <span class="filter_name"> <%= t("newspapers.human_readable_solr_fields." + field) %> @@ -39,9 +39,7 @@ <% else %> <% new_params[:f][constraint[:label].to_sym].delete(constraint[:value]) %> <% end %> - <a class="btn btn-sm btn-outline-primary" href="<%= url_for new_params %>"> - <i class="fas fa-times"></i> - </a> + <a class="btn btn-sm btn-outline-primary" href="<%= url_for new_params %>"><span class="fas fa-times"></span></a> </span> <% end %> </div> diff --git a/app/views/dataset/_datasets_list.html.erb b/app/views/dataset/_datasets_list.html.erb index 885e6da3978e4884855264b6b38ab53f5e857483..8e82b00047c2ec6c349f67ffa7e83abccc8b8d32 100644 --- a/app/views/dataset/_datasets_list.html.erb +++ b/app/views/dataset/_datasets_list.html.erb @@ -16,13 +16,13 @@ </div> <div class="d-inline-flex"> <button type="button" - class="btn btn-sm btn-danger px-2 d-flex align-items-center justify-content-between me-2" + class="btn btn-sm btn-danger text-white px-2 d-flex align-items-center justify-content-between me-2" data-action="click->datasets#deleteDataset"> <i class="me-2 fas fa-trash"></i>Delete </button> <button type="button" data-bs-toggle="modal" data-bs-target="#renameDatasetModal" data-bs-dataset-id="<%= dataset.id %>" - class="btn btn-sm btn-info px-2 d-flex align-items-center justify-content-between"> + class="btn btn-sm btn-info text-white px-2 d-flex align-items-center justify-content-between"> <i class="me-2 fas fa-edit"></i>Rename </button> </div> diff --git a/config/solr.yml b/config/solr.yml index 7f48fec761a611c8f10f852de4917a74d95aea56..5018dace0af917c1182a4d40747d4e56cc4ebcbb 100644 --- a/config/solr.yml +++ b/config/solr.yml @@ -1,6 +1,6 @@ development: # url: http://localhost:8991/solr/hydra-development - url: http://fue-l9.onb.ac.at:8983/solr/newseye_onb + url: http://fue-l9.onb.ac.at:8983/solr/newseye_collection test: url: http://localhost:8991/solr/hydra-development