Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Word Break for long words #92

Merged
merged 1 commit into from
Dec 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/main/resources/static/css/globals.css
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,10 @@ input[type="range"]:focus {
box-shadow: 0 0 5px 1px var(--yellow);
}

.form-title-break, form *:not(.range-option), .results-table .responses {
word-break: break-all;
}

/* header */
header .header-contents {
margin: 0 auto;
Expand Down Expand Up @@ -524,6 +528,10 @@ header .header-contents nav .btn {

.survey-form .range-option span {
height: fit-content;
width: 2rem;
text-align: center;
word-break: keep-all;
overflow: hidden;
}

.survey-form .range-option input[type="range"]{
Expand Down
4 changes: 2 additions & 2 deletions src/main/resources/static/scripts/getSavedResponses.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const displayResponses = (res) => {
let responseHTML = `
<div class="user-response">
<p class="title">Response #: ${r}</p>
<p class="survey-title">Survey Title: ${response["surveyTitle"]}</p>
<p class="survey-title">Survey Title: <span class="form-title-break">${response["surveyTitle"]}</span></p>
<table class="results-table">
<tr>
<th>Question</th>
Expand All @@ -25,7 +25,7 @@ const displayResponses = (res) => {

for(let q of Object.keys(response["answers"])) {
let answerHTML = `
<tr>
<tr class="responses">
<td>${response["answers"][q]["prompt"]}</td>
<td>${response["answers"][q]["answer"]}</td>
</tr>
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/templates/answerSurvey.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<div class="container">
<h1>Answering Survey#<span th:text="${surveyId}"></span></h1>
<form class="survey-form answer-survey-form md-box-shadow" th:action="@{/api/v1/createSurvey}" method="POST" id="answer-survey-form">
<h2 class="form-title"><span th:text="${surveyTitle}"></span></h2>
<h2 class="form-title form-title-break"><span th:text="${surveyTitle}"></span></h2>
<div th:each="i : ${#numbers.sequence(1, numberOfQuestions)}">
<div th:if="${longAnswerQuestions.get(i) != null}" class="text-questions">
<label class="question" th:text="${longAnswerQuestions.get(i).getPrompt()}"></label>
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/templates/createSurvey.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ <h1>Create a Survey</h1>
</div>
<div class="form-container">
<form class="survey-form md-box-shadow" th:action="@{/api/v1/createSurvey}" method="post" id="survey-container">
<h2 contenteditable="true" class="form-title">Form Title</h2>
<h2 contenteditable="true" class="form-title form-title-break">Form Title</h2>
<table id="survey">

</table>
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/templates/editSurvey.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ <h1>Editing Survey#<span th:text="${surveyId}" id="surveyId"></span></h1>

<div class="form-container">
<form class="survey-form md-box-shadow" th:action="@{/api/v1/createSurvey}" method="post" id="survey-container">
<h2 contenteditable="true" class="form-title" th:text="${surveyTitle}"></h2>
<h2 contenteditable="true" class="form-title form-title-break" th:text="${surveyTitle}"></h2>
<table id="survey">
</table>
<button type="submit" id="update-survey" class="btn create-edit-submit-btn flex">
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ <h1>Welcome To OpinionOwl</h1>
<h2>Surveys Available</h2>
<ul th:if="${surveys.size() > 0}">
<li th:each="survey : ${surveys}">
<h3>Name: <span th:text="${survey.getTitle()}"></span></h3>
<h3>Name: <span th:text="${survey.getTitle()}" class="form-title-break"></span></h3>
<p>Questions: <span th:text="${survey.getQuestions().size()}"></span></p>
<a href="/answerSurvey" th:href="@{/answerSurvey(surveyId=${survey.getId()})}" class="btn flex">
Fill Survey
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/templates/manageSurvey.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<h1>Manage Surveys</h1>
<div class="grid-auto-fit user-survey-lst">
<div class="user-survey" th:each="survey : ${surveys}">
<p class="title">Survey #<span th:text="${survey.getId()}"></span>: <span th:text="${survey.getTitle()}"></span></p>
<p class="title">Survey #<span th:text="${survey.getId()}"></span>: <span th:text="${survey.getTitle()}" class="form-title-break"></span></p>
<p class="num-questions">Number of Questions: <span th:text="${survey.getQuestions().size()}"></span></p>
<p class="num-responses">Number of Responses: <span th:text="${survey.getResponses().size()}"></span></p>
<div class="button-container">
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/templates/viewResponse.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<body>
<div th:replace="~{fragments/header :: header}"></div>
<div class="container view-response-page">
<h1>Responses for Survey#<span id="surveyId" th:text="${surveyId}"></span>: <span th:text="${surveyTitle}"></span></h1>
<h1>Responses for Survey#<span id="surveyId" th:text="${surveyId}"></span>: <span th:text="${surveyTitle}" class="form-title-break"></span></h1>
<h2>Long Answer Questions</h2>
<div class="question-container">
<ul id="text-container">
Expand Down