Skip to content

Commit

Permalink
SAM-3133 redo extended time layout to use new accordion panel (sakaip…
Browse files Browse the repository at this point in the history
…roject#3921)

* SAM-3133 redo some of the bootstrap classes to remove scrollbars

* SAM-3133 add subheading to published settings page

* starting to re-do layout

* SAM-3133 moving extended time to its own tab

* SAM-3133 more date manipulation

* SAM-3133 move tabs to spaces

* SAM-3133 added sessionStorage use for staying on same accordion panel
  • Loading branch information
ottenhoff authored and jonespm committed Feb 16, 2017
1 parent bdedf35 commit 35bd261
Show file tree
Hide file tree
Showing 9 changed files with 304 additions and 221 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -202,48 +202,26 @@

.extendedTimeDataTable {
margin-bottom: .5em;
}

.extendedTimeDataTable thead tr th {
padding-left: .5em;
border-bottom: 1px solid black;
}

.extendedTime-user {
min-width: 130px;
}
select {
max-width: 150px;
}

.extendedTime-group {
min-width: 130px;
}
thead tr th {
border-bottom: 1px solid black;
}

.extendedTime-start {
min-width: 250px;
}
.extendedTime-due {
min-width: 250px;
}
.extendedTime-retract {
min-width: 250px;
}
.extendedTime-hours {
min-width: 70px;
}
.extendedTime-mins {
min-width: 70px;
}
tr {
border-bottom: 1px solid lightgrey;
}

.extendedTimeDataTable tr {
border-bottom: 1px solid lightgrey;
}
.extendedTime-user, .extendedTime-group {
max-width: 160px;
}

.extendedTimeDataTable tr td {
padding-left: .25em;
padding-right: .25em;
.extendedTime-mins {
min-width: 70px;
}
}

.extendedTimeEntryTable tr td {
padding-left: .25em;
padding-right: .25em;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ heading_metadata=Metadata
heading_about=About this Assessment
heading_availability=Availability and Submissions
heading_grading_feedback=Grading and Feedback
heading_extended_time=Exceptions to Time Limit and Delivery Date
heading_layout=Layout and Appearance
heading_background=Change background?
clear_calendar_alt=Clear Date
Expand All @@ -36,6 +37,7 @@ assessment_available=It is available
assessment_due=It is due
has_time_limit=and has a time limit of
late_accept=Late submissions accepted?
late_accept_until=Late submissions accepted until?
late_accept_help=Students get one chance to submit after due date if they haven't already submitted.
no_late=No, not after due date
yes_late=Yes, until
Expand Down Expand Up @@ -305,9 +307,11 @@ less_than_two_columns=columns field need to have at least two inputs, separated
selectFromFavorites=Select from Favorites

# Extended time
extendedTimeHeading=Exceptions to Time Limit and Delivery Date
extendedTimeAdd=Add a Time Limit/Delivery Date Exception
extendedTimeEdit=Update a Time Limit / Delivery Date Exception
extendedTimeNew=Add New Exception
extendedTimeExisting=Existing Exceptions
extendedTimeInstruction=You must click the 'Add an Exception' button to add individual exception(s) before saving settings
extendedTimeAdd=Add an Exception
extendedTimeEdit=Update an Exception
extendedTimeCancel=Cancel
header_extendedTime_user=User
header_extendedTime_group=Group
Expand All @@ -318,6 +322,9 @@ header_extendedTime_hours=Hours
header_extendedTime_minutes=Minutes
header_extendedTime_delete=Delete
header_extendedTime_edit=Edit
extendedTimeUser=Exception for User
extendedTimeGroup=Exception for Group
extendedTime_select_User=Select User
extendedTime_select_group=Select Group
extendedTime_select_User=Select User
extendedTime_data_table_title=Extended time entry data table.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1717,7 +1717,7 @@ public ExtendedTime getExtendedTime() {
}

public String getExtendedTimeStartString() {
return getDisplayFormatFromDate(this.extendedTime.getStartDate());
return tu.getDateTimeWithTimezoneConversion(this.extendedTime.getStartDate());
}

public void setExtendedTimeStartString(String exTimeStartString) {
Expand All @@ -1728,7 +1728,7 @@ public void setExtendedTimeStartString(String exTimeStartString) {
}

public String getExtendedTimeDueString() {
return getDisplayFormatFromDate(this.extendedTime.getDueDate());
return tu.getDateTimeWithTimezoneConversion(this.extendedTime.getDueDate());
}

public void setExtendedTimeDueString(String exTimeDueString) {
Expand All @@ -1739,7 +1739,7 @@ public void setExtendedTimeDueString(String exTimeDueString) {
}

public String getExtendedTimeRetractString() {
return getDisplayFormatFromDate(this.extendedTime.getRetractDate());
return tu.getDateTimeWithTimezoneConversion(this.extendedTime.getRetractDate());
}

public void setExtendedTimeRetractString(String exTimeRetractString) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1608,7 +1608,7 @@ public ExtendedTime getExtendedTime() {
}

public String getExtendedTimeStartString() {
return getDisplayFormatFromDate(this.extendedTime.getStartDate());
return tu.getDateTimeWithTimezoneConversion(this.extendedTime.getStartDate());
}

public void setExtendedTimeStartString(String exTimeStartString) {
Expand All @@ -1619,7 +1619,7 @@ public void setExtendedTimeStartString(String exTimeStartString) {
}

public String getExtendedTimeDueString() {
return getDisplayFormatFromDate(this.extendedTime.getDueDate());
return tu.getDateTimeWithTimezoneConversion(this.extendedTime.getDueDate());
}

public void setExtendedTimeDueString(String exTimeDueString) {
Expand All @@ -1630,7 +1630,7 @@ public void setExtendedTimeDueString(String exTimeDueString) {
}

public String getExtendedTimeRetractString() {
return getDisplayFormatFromDate(this.extendedTime.getRetractDate());
return tu.getDateTimeWithTimezoneConversion(this.extendedTime.getRetractDate());
}

public void setExtendedTimeRetractString(String exTimeRetractString) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.joda.time.DateTime;
import org.joda.time.DateTimeZone;
import org.joda.time.format.DateTimeFormat;
import org.joda.time.format.DateTimeFormatter;
import org.joda.time.format.ISODateTimeFormat;
Expand Down Expand Up @@ -166,6 +167,20 @@ public String getIsoDateWithLocalTime(Date dateToConvert) {
DateTimeFormatter localFmtTime = fmtTime.withLocale(new ResourceLoader().getLocale());
return dt.toString(localFmt) + " " + dt.toString(localFmtTime);
}

public String getDateTimeWithTimezoneConversion(Date dateToConvert) {
DateTime dt = new DateTime(dateToConvert);
DateTimeFormatter fmt = ISODateTimeFormat.yearMonthDay();
DateTimeFormatter fmtTime = ISODateTimeFormat.hourMinuteSecond();

// If the client browser is in a different timezone than server, need to modify date
if (m_client_timezone !=null && m_server_timezone!=null && !m_client_timezone.hasSameRules(m_server_timezone)) {
DateTimeZone dateTimeZone = DateTimeZone.forTimeZone(m_client_timezone);
fmt = fmt.withZone(dateTimeZone);
fmtTime = fmtTime.withZone(dateTimeZone);
}
return dt.toString(fmt) + " " + dt.toString(fmtTime);
}

/*
* SAM-2323: the jquery-ui datepicker provides a hidden field with ISO-8601 date/time
Expand Down
35 changes: 25 additions & 10 deletions samigo/samigo-app/src/webapp/jsf/author/authorSettings.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,20 @@
<script type="text/javascript">
$(document).ready(function() {
// set up the accordion for settings
$("#jqueryui-accordion").accordion({ heightStyle: "content", collapsible: true, active: 1 });
var accordionPanel = 1;
if (window.sessionStorage && window.sessionStorage.getItem('samigo_assessmentsettings')) {
accordionPanel = parseInt(window.sessionStorage.getItem('samigo_assessmentsettings'));
}
$("#jqueryui-accordion").accordion({
heightStyle: "content",
activate: function(event, ui) {
if (window.sessionStorage) {
window.sessionStorage.setItem('samigo_assessmentsettings', $("#jqueryui-accordion").accordion("option", "active"));
}
},
active: accordionPanel,
collapsible: true
});
// This is a sub-accordion inside of the About the Assessment Panel
$("#jqueryui-accordion-metadata").accordion({ heightStyle: "content",collapsible: true,active: false });
// This is a sub-accordion inside of the Availability and Submission Panel
Expand Down Expand Up @@ -92,27 +105,27 @@
ashidden: { iso8601: 'feedbackDateISO8601' }
});
localDatePicker({
input: '#assessmentSettingsAction\\:extendedTimeTable\\:newEntry-start_date',
input: '#assessmentSettingsAction\\:newEntry-start_date',
useTime: 1,
parseFormat: 'YYYY-MM-DD HH:mm:ss',
allowEmptyDate: true,
val: '',
val: '<h:outputText value="#{assessmentSettings.extendedTimeStartString}"/>',
ashidden: { iso8601: 'newEntry-start_date-iso8601' }
});
localDatePicker({
input: '#assessmentSettingsAction\\:extendedTimeTable\\:newEntry-due_date',
input: '#assessmentSettingsAction\\:newEntry-due_date',
useTime: 1,
parseFormat: 'YYYY-MM-DD HH:mm:ss',
allowEmptyDate: true,
val: '',
val: '<h:outputText value="#{assessmentSettings.extendedTimeDueString}"/>',
ashidden: { iso8601: 'newEntry-due_date-iso8601' }
});
localDatePicker({
input: '#assessmentSettingsAction\\:extendedTimeTable\\:newEntry-retract_date',
input: '#assessmentSettingsAction\\:newEntry-retract_date',
useTime: 1,
parseFormat: 'YYYY-MM-DD HH:mm:ss',
allowEmptyDate: true,
val: '',
val: '<h:outputText value="#{assessmentSettings.extendedTimeRetractString}"/>',
ashidden: { iso8601: 'newEntry-retract_date-iso8601' }
});
Expand Down Expand Up @@ -383,9 +396,6 @@
</div>
</h:panelGroup>

<!-- Extended Time -->
<%@ include file="inc/extendedTime.jspf"%>

<!-- AUTOMATIC SUBMISSION -->
<h:panelGroup styleClass="form-group row" layout="block" rendered="#{assessmentSettings.valueMap.automaticSubmission_isInstructorEditable==true}">
<h:outputLabel styleClass="col-md-2" value="#{assessmentSettingsMessages.auto_submit}" />
Expand Down Expand Up @@ -495,6 +505,11 @@

</samigo:hideDivision><!-- END the Availabity and Submissions category -->

<samigo:hideDivision title="#{assessmentSettingsMessages.heading_extended_time}" >
<!-- Extended Time -->
<%@ include file="inc/extendedTime.jspf"%>
</samigo:hideDivision>

<samigo:hideDivision title="#{assessmentSettingsMessages.heading_grading_feedback}" >

<!-- *** GRADING *** -->
Expand Down
Loading

0 comments on commit 35bd261

Please sign in to comment.