Skip to content

Commit

Permalink
fixed order
Browse files Browse the repository at this point in the history
  • Loading branch information
Johan Roxendal committed Sep 2, 2024
1 parent aa1dca5 commit 7b0374b
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 11 deletions.
5 changes: 4 additions & 1 deletion app/scripts/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,8 @@ window.littb = angular
templateUrl: require("../views/library.html"),
controller: "libraryCtrl",
reloadOnSearch: false,
title: "E-böcker för nedladdning"
title: "E-böcker för nedladdning",
isEpub: true
})
.when("/ljudarkivet", {
templateUrl: require("../views/audiolist.html"),
Expand Down Expand Up @@ -714,6 +715,8 @@ littb.run(function ($rootScope, $location, $rootElement, $q, $timeout, bkgConf)

if (newRoute.isReader) {
$rootElement.addClass(`page-reading`)
} else if (newRoute.isEpub) {
$rootElement.addClass("page-epub")
} else if (newRoute.controller != null ? newRoute.controller.replace : undefined) {
$rootElement.addClass(`page-${newRoute.controller.replace("Ctrl", "")}`)
}
Expand Down
7 changes: 6 additions & 1 deletion app/scripts/library_controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,12 @@ littb.controller(

s.keywords_aux = $location.search().keywords_aux?.split(",") || []

s.onKeywordAuxChange = keywords => {
console.log("🚀 ~ keywords:", keywords, s.keyword_aux)
s.keywords_aux = keywords
s.refreshData()
}

s.onSliderChange = () => {
$location.search("intervall", s.filters["sort_date_imprint.date:range"].join(","))
s.parts_page.current = 1
Expand Down Expand Up @@ -711,7 +717,6 @@ littb.controller(
try {
let { titles, hits, suggest } = await backend.relevanceSearch(
"etext,faksimil,pdf,etext-part,faksimil-part,author,presentations,sol,litteraturkartan,wordpress",
// "etext,faksimil,pdf,etext-part,faksimil-part,author",
{
filter_string: s.rowfilter,
keyword_aux: [...s.keywords_aux, ...maybeHide1800],
Expand Down
4 changes: 2 additions & 2 deletions app/scripts/search_controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -466,8 +466,8 @@ littb.controller(
args.include_modernized = false
}

// args.sort_field = "sortfield"
args.sort_field = null
args.sort_field = "sortfield"
// args.sort_field = null

return args
}
Expand Down
6 changes: 3 additions & 3 deletions app/scripts/services.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ import { fromFilters } from "./query.ts"
const littb = angular.module("littbApp")
let SIZE_VALS = [625, 750, 1100, 1500, 2050]

// let STRIX_URL = "http://" + location.host.split(":")[0] + ":5001"
let STRIX_URL = "http://" + location.host.split(":")[0] + ":5001"
// let STRIX_URL = "https://litteraturbanken.se/api"
let STRIX_URL = "/api"
// let STRIX_URL = "/api"

if (
_.str.startsWith(location.host, "red.l") ||
Expand Down Expand Up @@ -1273,7 +1273,7 @@ littb.factory("SearchData", function (backend, $q, $http, $location) {
delete params.query
$http({
url: `${STRIX_URL}/search_count/${query}`,
params: _.omit(params, "number_of_fragments", "from", "to"),
params: _.omit(params, "number_of_fragments", "from", "to", "sort_field"),
cache: true
}).then(response => {
c.log("count all", response)
Expand Down
1 change: 0 additions & 1 deletion app/scripts/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,6 @@ littb.factory("util", function util($location, $filter) {
return output
}),
getKeywordTextfilter(filterObj) {
console.log("🚀 ~ file: util.js:153 ~ filterObj", filterObj)
// sample
// {
// gender: "main_author.gender:female",
Expand Down
15 changes: 14 additions & 1 deletion app/styles/styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2234,7 +2234,7 @@ body > .header {
}
}

.page-library {
.page-library, .page-epub {

display : inline-flex;
width : 100%;
Expand Down Expand Up @@ -2714,6 +2714,19 @@ body > .header {
} // #mainview
}

.page-epub {
#leftCorridor {
.mainnav a {
color: white;

&:hover {
color: white;
opacity: 0.5;
}
}
}
}

.page-biblinfo {

#mainview {
Expand Down
4 changes: 2 additions & 2 deletions app/views/library.html
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ <h1 class="text-6xl sm:ml-12">{{:: isLibrary ? 'Botanisera i biblioteket' : 'Hä
class="block"
label="Avgränsa sökningen"
model="keywords_aux"
on-change="keywords_aux = keywords; refreshData()"
on-change="onKeywordAuxChange(keywords)"
></keyword-select>
</div>

Expand All @@ -214,7 +214,7 @@ <h1 class="text-6xl sm:ml-12">{{:: isLibrary ? 'Botanisera i biblioteket' : 'Hä
logiskt OCH iställer för ELLER. Du får färre träffar, som då ingår i alla valda samlingar. </span>
</div> -->
<div class="title_select_container">
<div class="title_select_container" ng-if="isLibrary">
<select
multiple
class="filter_select keyword_select"
Expand Down

0 comments on commit 7b0374b

Please sign in to comment.