Skip to content

Commit

Permalink
Merge pull request #1312 from torinfo/troy-features
Browse files Browse the repository at this point in the history
Several fixes for new features
  • Loading branch information
torinfo authored Aug 23, 2024
2 parents 4bb53d6 + 8aee4d7 commit 756af99
Show file tree
Hide file tree
Showing 10 changed files with 62 additions and 40 deletions.
16 changes: 16 additions & 0 deletions languages/en-GB/website_code/php/management/users.inc
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@

define("USERS_MANAGE_ROLES", "Manage user roles");

// admin roles human names -------------------------------------------
define("USERS_ROLE_SUPER", "Super Admin");

define("USERS_ROLE_SYSTEM", "System Admin");
Expand All @@ -48,3 +49,18 @@
define("USERS_ROLE_PROJECTADMIN", "Project Admin");

define("USERS_ROLE_HARVESTADMIN", "Harvest Admin");
// admin roles info -------------------------------------------
define("USERS_ROLE_SUPER_INFO", "Super Admin Uitleg");

define("USERS_ROLE_SYSTEM_INFO", "System Admin Uitleg");

define("USERS_ROLE_TEMPLATEADMIN_INFO", "Template Admin Uitleg");

define("USERS_ROLE_METAADMIN_INFO", "Meta Admin Uitleg");

define("USERS_ROLE_USERADMIN_INFO", "User Admin Uitleg");

define("USERS_ROLE_PROJECTADMIN_INFO", "Project Admin Uitleg");

define("USERS_ROLE_HARVESTADMIN_INFO", "Harvest Admin Uitleg");

4 changes: 2 additions & 2 deletions modules/site/parent_templates/site/common/js/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -1546,7 +1546,7 @@ function parseContent(pageRef, sectionNum, contentNum, addHistory) {
$(data).find('page').each(function(index, value) {
var $page = $(this);
var $pageIndex = index;
if (pageID == $page.attr('linkID') || pageID == $page.attr('customLinkID')) {
if (pageID === $page.attr('linkID') || pageID === $page.attr('customLinkID')) {
// an ID match has been found for a page
pageIndex = index;
found = true;
Expand All @@ -1557,7 +1557,7 @@ function parseContent(pageRef, sectionNum, contentNum, addHistory) {

$page.find('section').each(function (index, value) {
var $section = $(this);
if (pageID == $section.attr('linkID') || pageID == $section.attr('customLinkID')) {
if (pageID === $section.attr('linkID') || pageID === $section.attr('customLinkID')) {
//an ID match has been found for a section
pageIndex = $pageIndex;
found = true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -705,6 +705,10 @@ button.ui-button-icon-only .ui-icon[class*=" fa-"] {


/* --PASSWORD PROTECTION BLOCK-------------------------------------------------------------- */
.x_pswdInfo {
margin-bottom: 2vmin;
}

.x_pswdInput:not(.old) {
width: 90vmin;
display: flex;
Expand Down Expand Up @@ -850,6 +854,11 @@ input#x_pagePswd.old {
font-size: 3.5vmin;
}

.vault .numberbtn, .vault #resetbtn, .vault input {
color: white;
font-weight: bold;
}

.vault input:focus, .vault input:hover{
border: 2px solid #ffffff;
outline: none;
Expand Down Expand Up @@ -1387,4 +1396,4 @@ a:focus .wcagLogo {

[data-cke-editorplaceholder]::before {
padding: 0.3em;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,8 @@ optional: feedback page synch play enable
// no feedback needed so do change page / play / change media current time immediately
} else if (action >= 0) {
doAction(action);
} else {
$continueBtn.show();
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4425,12 +4425,12 @@ function x_scaleImg(img, maxW, maxH, scale, firstScale, setH, enlarge) {
imgH = $img.data("origSize")[1];
}

if (enlarge == false) {
maxW = Math.min(maxW, imgW);
maxH = Math.min(maxH, imgH);
}
if (enlarge === false) {
maxW = Math.min(maxW, imgW);
maxH = Math.min(maxH, imgH);
}

if (imgW > maxW || imgH > maxH || firstScale != true || enlarge == true) {
if (imgW > maxW || imgH > maxH || firstScale != true || enlarge !== false) {
var scaleW = maxW / imgW,
scaleH = maxH / imgH,
scaleFactor = Math.min(scaleW, scaleH);
Expand Down
18 changes: 18 additions & 0 deletions modules/xerte/parent_templates/Nottingham/models_html5/dialog.html
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,24 @@
if($pageContents.data("currentQ")+1 == $(x_currentPageXML).children().length){
XTSetPageScore(x_currentPage, 100 * (correctAnswers / $(x_currentPageXML).children().length), x_currentPageXML.getAttribute("trackinglabel"));
}
if(!judge){
$feedback.html("");
$("#pageContents .question:eq(" + ($pageContents.data("currentQ") + 1) + ")").fadeIn();
$this
.data({
"attempt": 0,
"state": 0
})
.button({ label: $("#pageContents").data("submitTxt") });

var qNo = $pageContents.data("currentQ");

$("#pageContents .question:eq(" + (qNo + 1) + ") input").focus();
let question = $(x_currentPageXML).children()[qNo + 1];
let answers = question.getAttribute("answer").split(answerDelimeter);
XTEnterInteraction(x_currentPage, qNo + 1, 'fill-in', question.getAttribute("question"), answers, answers, null /* never used*/, x_currentPageXML.getAttribute("grouping"));
$pageContents.data("currentQ", qNo + 1);
}
} else { // incorrect
$this.data("attempt", $this.data("attempt") + 1);
var currentAttempt = $this.data("attempt"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@
right: 10px;
}

.holder.sized{
border: gray solid 2px;
border-radius: 10px;
}

#slider_handle{
background: grey;
position: relative;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
if(x_browserInfo.mobile){
mobileHeightComp = $("#x_headerBlock").height();
}
console.log(x_browserInfo, mobileHeightComp);
$("#x_pageHolder").css("top", mobileHeightComp);
let pageHeight = $("#x_pageHolder").height() - mobileHeightComp - 20;
let pageWidth = $("#x_pageHolder").width() - 20;
Expand Down Expand Up @@ -57,10 +56,10 @@
let img2Elem = $("#img2");
let slider = $("#slider");
if(this.isVertical){
img2Elem.css("clip-path", "inset("+ this.position + "% 0% 0% 0%)");
img2Elem.css("clip-path", "inset("+ this.position + "% -50% -50% -50%)");
slider.css("top", this.position + "%");
}else {
img2Elem.css("clip-path", "inset(0% 0% 0%"+ this.position + "%)");
img2Elem.css("clip-path", "inset(-50% -50% -50% "+ this.position + "%)");
slider.css("left", this.position + "%");
}
}
Expand All @@ -75,33 +74,6 @@
let text = x_currentPageXML.getAttribute("text");
this.textPosition = x_currentPageXML.getAttribute("textPosition");

/* let pageHeight = $("#x_pageHolder").height() - 20;
let pageWidth = $("#x_pageHolder").width() - 20;
let holder = $(".holder");
if(imageSize !== 1){
holder.addClass("sized");
let textElem = $(".text");
let textSize = 1.0-imageSize;
console.log(textSize);
if(textPosition == "top"){
holder.width(pageWidth);
holder.height(pageHeight*imageSize)
holder.css("margin-top", pageHeight*textSize)
textElem.width(pageWidth);
textElem.height(pageHeight*textSize)
}else{
holder.width(pageWidth*imageSiz);
holder.height(pageHeight)
holder.css("margin-left", pageWidth*textSize)
textElem.width(pageWidth*textSize);
textElem.height(pageHeight)
}
textElem.html(textElem);
}else {
holder.width(pageWidth);
holder.height(pageHeight)
$(".text").remove();
} */
let textElem = $(".text");
if(this.sizePercentage !== 1){
$(".holder").addClass("sized");
Expand Down
2 changes: 1 addition & 1 deletion website_code/php/management/get_user_roles.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ function changeuserselection_roles($userid){
if(!$isSuper && in_array($role["roleid"], array(1, 2)))
$disabled = "disabled";
$input = "<input name=\"" . $role["name"] . "\" type=\"checkbox\" " . (in_array($role["roleid"], $user_roles)? "checked" : "") . " " . $disabled . "/>";
echo "<p>" . constant("USERS_ROLE_".strtoupper($role["name"])) . "</p> " . $input;
echo "<p title=\"" . constant("USERS_ROLE_". strtoupper($role["name"]) . "_INFO") . "\">" . constant("USERS_ROLE_".strtoupper($role["name"])) . "</p> <i class=\"fa fa-info-circle\" title=\"" . constant("USERS_ROLE_". strtoupper($role["name"]) . "_INFO") . "\"></i> " . $input;
}


Expand Down
2 changes: 1 addition & 1 deletion website_code/styles/management.css
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ form[name='user_templates'] {

.grid{
display: grid;
grid-template-columns: min-content min-content;
grid-template-columns: min-content min-content min-content;
white-space: nowrap;
}

Expand Down

0 comments on commit 756af99

Please sign in to comment.