Skip to content

Commit

Permalink
Merge pull request sakaiproject#195 from ottenhoff/SAM-2493
Browse files Browse the repository at this point in the history
SAM-2493 authoring pages to use the updated 2.1.17 tablesorter
  • Loading branch information
ottenhoff committed Feb 18, 2015
2 parents 9690da8 + 3a7d78e commit 6bb84ef
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 125 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ selected_groups=Selected Groups
selected_group=Selected Group

header_last_modified=Last Modified
header_last_modified_date=Modified Date

global_nav_assessmt=Assessments
global_nav_pools=Question Pools
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,6 @@ correct=Correct
action_preview=Preview
action_print=Print
action_duplicate=Duplicate
action_select=Select
action_select=-- Select Action --
action_save=Save
action_save_pair=Save Pairing
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,6 @@ public class AuthorActionListener
private static Log log = LogFactory.getLog(AuthorActionListener.class);
private HashMap<String, ArrayList<String>> groupUsersIdMap = new HashMap<String, ArrayList<String>>();
private ArrayList<String> siteUsersIdList = new ArrayList<String>();
private String display_dateFormat= ContextUtil.getLocalizedString("org.sakaiproject.tool.assessment.bundle.GeneralMessages","output_data_picker_w_sec");
private SimpleDateFormat displayFormat = new SimpleDateFormat(display_dateFormat, new ResourceLoader().getLocale());
private TimeUtil tu = new TimeUtil();

// UVa, per SAK-2438
Expand Down Expand Up @@ -204,7 +202,7 @@ public void prepareAssessmentsList(AuthorBean author, AssessmentService assessme
AssessmentFacade assessmentFacade= (AssessmentFacade) iter.next();
assessmentFacade.setTitle(FormattedText.convertFormattedTextToPlaintext(assessmentFacade.getTitle()));
try {
String lastModifiedDateDisplay = tu.getDisplayDateTime(displayFormat, assessmentFacade.getLastModifiedDate());
String lastModifiedDateDisplay = tu.getIsoDateWithLocalTime(assessmentFacade.getLastModifiedDate());
assessmentFacade.setLastModifiedDateForDisplay(lastModifiedDateDisplay);
}
catch (Exception ex) {
Expand Down Expand Up @@ -318,7 +316,7 @@ public ArrayList getTakeableList(ArrayList assessmentList, GradingService gradin
inActiveList.add(f);
}
try {
String lastModifiedDateDisplay = tu.getDisplayDateTime(displayFormat, f.getLastModifiedDate());
String lastModifiedDateDisplay = tu.getIsoDateWithLocalTime(f.getLastModifiedDate());
f.setLastModifiedDateForDisplay(lastModifiedDateDisplay);
}
catch (Exception ex) {
Expand Down
32 changes: 2 additions & 30 deletions samigo/samigo-app/src/webapp/css/tool_sam.css
Original file line number Diff line number Diff line change
Expand Up @@ -165,39 +165,11 @@ font-size:1.2em
}

.titlePending {
width: 67%;
width: 50%;
}

.titlePub {
width: 30%;
}

.lastModified {
width: 23%;
}

.releaseTo {
width: 11%;
}

.status {
width: 8%;
}

.inProgress {
width: 6%;
}

.submitted {
width: 6%;
}

.releaseDate {
width: 8%;
}

.dueDate {
width: 8%;
width: 28%;
}

.listAssessments th{
Expand Down
63 changes: 19 additions & 44 deletions samigo/samigo-app/src/webapp/jsf/author/authorIndex.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,6 @@
<div class="portletBody">

<script type="text/javascript" src="/samigo-app/js/info.js"></script>
<script type="text/javascript" src="/library/js/jquery/tablesorter/2.0.3/jquery.tablesorter-2.0.3.min.js"></script>
<link type="text/css" href="/samigo-app/css/tool_sam.css" rel="stylesheet" media="all"/>
<script type="text/JavaScript">
function clickPendingSelectActionLink(field){
Expand Down Expand Up @@ -125,44 +123,12 @@ $(document).ready(function() {
}
);
$.tablesorter.addParser({
id: 'dlt',
is: function (s){ return false },
format: function(value, table, cell){
return cell.innerHTML.split('<br>')[0];
},
type: 'text'
});
$("#authorIndexForm\\:coreAssessments").tablesorter( {
sortList: [[1,0],[2,0]],
headers: {
0: {
sorter: false
},
2: {
sorter: 'dlt'
}
}
sortList: [[1,0]]
});
$("#authorIndexForm\\:published-assessments").tablesorter( {
sortList: [[2,0], [1,0], [8,0]],
headers: {
0: {
sorter: false
},
3: {
sorter: false
},
4: {
sorter: false
},
8: {
sorter: 'dlt'
}
}
sortList: [[2,0], [1,0]]
});
});
</script>
Expand Down Expand Up @@ -260,7 +226,7 @@ $(document).ready(function() {
<!-- CORE ASSESSMENTS-->
<h:outputText escape="false" rendered="#{authorization.createAssessment}" value="<div id=\"tabs-1\">"/>
<t:dataTable cellpadding="0" cellspacing="0" rowClasses="list-row-even,list-row-odd" styleClass="tablesorter" id="coreAssessments" value="#{author.assessments}" var="coreAssessment" rendered="#{authorization.adminCoreAssessment}" summary="#{authorFrontDoorMessages.sum_coreAssessment}">
<t:column headerstyleClass="selectAction" styleClass="selectAction">
<t:column headerstyleClass="selectAction sorter-false" styleClass="selectAction">
<f:facet name="header" >
<h:outputText value="#{authorFrontDoorMessages.select_action}"/>
</f:facet>
Expand Down Expand Up @@ -299,7 +265,12 @@ $(document).ready(function() {
<h:outputText value="#{authorFrontDoorMessages.header_last_modified}"/>
</f:facet>
<h:outputText value="#{coreAssessment.lastModifiedBy}" />
<h:outputText escape="false" value="<br />"/>
</t:column>

<t:column headerstyleClass="lastModifiedDate" styleClass="lastModifiedDate">
<f:facet name="header">
<h:outputText value="#{authorFrontDoorMessages.header_last_modified_date}"/>
</f:facet>
<h:outputText value="#{coreAssessment.lastModifiedDateForDisplay}"/>
</t:column>
</t:dataTable>
Expand All @@ -326,7 +297,7 @@ $(document).ready(function() {

<t:dataTable id="published-assessments" rowClasses="list-row-even,list-row-odd" cellpadding="0" cellspacing="0" styleClass="tablesorter" rendered="#{authorization.adminPublishedAssessment}"
value="#{author.publishedAssessments}" var="publishedAssessment" summary="#{authorFrontDoorMessages.sum_publishedAssessment}">
<t:column headerstyleClass="selectAction" styleClass="selectAction">
<t:column headerstyleClass="selectAction sorter-false" styleClass="selectAction">
<f:facet name="header" >
<h:outputText value="#{authorFrontDoorMessages.select_action}"/>
</f:facet>
Expand Down Expand Up @@ -457,26 +428,30 @@ $(document).ready(function() {
<h:outputText value="#{authorFrontDoorMessages.assessment_date} " />
</f:facet>
<h:outputText value="#{publishedAssessment.startDate}" >
<f:convertDateTime pattern="#{generalMessages.output_date_picker}"/>
</h:outputText>
<f:convertDateTime pattern="yyyy-MM-dd"/>
</h:outputText>
</t:column>

<t:column headerstyleClass="dueDate" styleClass="dueDate">
<f:facet name="header">
<h:outputText value="#{authorFrontDoorMessages.assessment_due} " />
</f:facet>
<h:outputText value="#{publishedAssessment.dueDate}" >
<f:convertDateTime pattern="#{generalMessages.output_date_picker}"/>
<f:convertDateTime pattern="yyyy-MM-dd"/>
</h:outputText>
</t:column>

<t:column headerstyleClass="lastModified" styleClass="lastModified">
<f:facet name="header">
<h:outputText value="#{authorFrontDoorMessages.header_last_modified}"/>
</f:facet>

<h:outputText value="#{publishedAssessment.lastModifiedBy}" />
<h:outputText escape="false" value="<br />"/>
</t:column>

<t:column headerstyleClass="lastModifiedDate" styleClass="lastModifiedDate">
<f:facet name="header">
<h:outputText value="#{authorFrontDoorMessages.header_last_modified_date}"/>
</f:facet>
<h:outputText value="#{publishedAssessment.lastModifiedDateForDisplay}"/>
</t:column>

Expand Down
67 changes: 21 additions & 46 deletions samigo/samigo-app/src/webapp/jsf/author/authorIndex_noHeader.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@
<div class="portletBody">

<script type="text/javascript" src="/samigo-app/js/info.js"></script>
<script type="text/javascript" src="/library/js/jquery/tablesorter/2.0.3/jquery.tablesorter-2.0.3.min.js"></script>
<link type="text/css" href="/samigo-app/css/tool_sam.css" rel="stylesheet" media="all"/>
<script type="text/JavaScript">
function clickPendingSelectActionLink(field){
Expand Down Expand Up @@ -121,44 +119,12 @@ $(document).ready(function() {
}
);
$.tablesorter.addParser({
id: 'dlt',
is: function (s){ return false },
format: function(value, table, cell){
return cell.innerHTML.split('<br>')[0];
},
type: 'text'
});
$("#authorIndexForm\\:coreAssessments").tablesorter( {
sortList: [[1,0],[2,0]],
headers: {
0: {
sorter: false
},
2: {
sorter: 'dlt'
}
}
sortList: [[1,0]]
});
$("#authorIndexForm\\:published-assessments").tablesorter( {
sortList: [[2,0], [1,0], [8,0]],
headers: {
0: {
sorter: false
},
3: {
sorter: false
},
4: {
sorter: false
},
8: {
sorter: 'dlt'
}
}
sortList: [[2,0], [1,0]]
});
});
</script>
Expand Down Expand Up @@ -241,13 +207,13 @@ $(document).ready(function() {

<div id="tabs">
<ul>
<h:outputText escape="false" value="<li><a href=\"#tabs-1\">" rendered="#{authorization.adminCoreAssessment}"/>
<h:outputText escape="false" value="<li><a href=\"#tabs-1\" onclick=\"resizeFrame();\">" rendered="#{authorization.adminCoreAssessment}"/>
<h:outputText escape="false" value="#{authorFrontDoorMessages.assessment_pending}:" rendered="#{authorization.adminCoreAssessment}"/>
<h:outputText escape="false" value="<span class=\"samigo-tab-sub\">" rendered="#{authorization.adminCoreAssessment}"/>
<h:outputText escape="false" value="#{authorFrontDoorMessages.assessment_pending_sub}" rendered="#{authorization.adminCoreAssessment}"/>
<h:outputText escape="false" value="</span></a></li>" rendered="#{authorization.adminCoreAssessment}"/>

<h:outputText escape="false" value="<li><a href=\"#tabs-2\">" rendered="#{authorization.adminPublishedAssessment}"/>
<h:outputText escape="false" value="<li><a href=\"#tabs-2\" onclick=\"resizeFrame();\">" rendered="#{authorization.adminPublishedAssessment}"/>
<h:outputText escape="false" value="#{authorFrontDoorMessages.assessment_pub}:" rendered="#{authorization.adminPublishedAssessment}"/>
<h:outputText escape="false" value="<span class=\"samigo-tab-sub\">" rendered="#{authorization.adminPublishedAssessment}"/>
<h:outputText escape="false" value="#{authorFrontDoorMessages.assessment_pub_sub}" rendered="#{authorization.adminPublishedAssessment}"/>
Expand All @@ -256,7 +222,7 @@ $(document).ready(function() {
<!-- CORE ASSESSMENTS-->
<h:outputText escape="false" rendered="#{authorization.createAssessment}" value="<div id=\"tabs-1\">"/>
<t:dataTable cellpadding="0" cellspacing="0" rowClasses="list-row-even,list-row-odd" styleClass="tablesorter" id="coreAssessments" value="#{author.assessments}" var="coreAssessment" rendered="#{authorization.adminCoreAssessment}" summary="#{authorFrontDoorMessages.sum_coreAssessment}">
<t:column headerstyleClass="selectAction" styleClass="selectAction">
<t:column headerstyleClass="selectAction sorter-false" styleClass="selectAction">
<f:facet name="header" >
<h:outputText value="#{authorFrontDoorMessages.select_action}"/>
</f:facet>
Expand Down Expand Up @@ -295,7 +261,12 @@ $(document).ready(function() {
<h:outputText value="#{authorFrontDoorMessages.header_last_modified}"/>
</f:facet>
<h:outputText value="#{coreAssessment.lastModifiedBy}" />
<h:outputText escape="false" value="<br />"/>
</t:column>

<t:column headerstyleClass="lastModifiedDate" styleClass="lastModifiedDate">
<f:facet name="header">
<h:outputText value="#{authorFrontDoorMessages.header_last_modified_date}"/>
</f:facet>
<h:outputText value="#{coreAssessment.lastModifiedDateForDisplay}"/>
</t:column>
</t:dataTable>
Expand All @@ -322,7 +293,7 @@ $(document).ready(function() {

<t:dataTable id="published-assessments" rowClasses="list-row-even,list-row-odd" cellpadding="0" cellspacing="0" styleClass="tablesorter" rendered="#{authorization.adminPublishedAssessment}"
value="#{author.publishedAssessments}" var="publishedAssessment" summary="#{authorFrontDoorMessages.sum_publishedAssessment}">
<t:column headerstyleClass="selectAction" styleClass="selectAction">
<t:column headerstyleClass="selectAction sorter-false" styleClass="selectAction">
<f:facet name="header" >
<h:outputText value="#{authorFrontDoorMessages.select_action}"/>
</f:facet>
Expand Down Expand Up @@ -449,26 +420,30 @@ $(document).ready(function() {
<h:outputText value="#{authorFrontDoorMessages.assessment_date} " />
</f:facet>
<h:outputText value="#{publishedAssessment.startDate}" >
<f:convertDateTime pattern="#{generalMessages.output_date_picker}"/>
</h:outputText>
<f:convertDateTime pattern="yyyy-MM-dd"/>
</h:outputText>
</t:column>

<t:column headerstyleClass="dueDate" styleClass="dueDate">
<f:facet name="header">
<h:outputText value="#{authorFrontDoorMessages.assessment_due} " />
</f:facet>
<h:outputText value="#{publishedAssessment.dueDate}" >
<f:convertDateTime pattern="#{generalMessages.output_date_picker}"/>
<f:convertDateTime pattern="yyyy-MM-dd"/>
</h:outputText>
</t:column>

<t:column headerstyleClass="lastModified" styleClass="lastModified">
<f:facet name="header">
<h:outputText value="#{authorFrontDoorMessages.header_last_modified}"/>
</f:facet>

<h:outputText value="#{publishedAssessment.lastModifiedBy}" />
<h:outputText escape="false" value="<br />"/>
</t:column>

<t:column headerstyleClass="lastModifiedDate" styleClass="lastModifiedDate">
<f:facet name="header">
<h:outputText value="#{authorFrontDoorMessages.header_last_modified_date}"/>
</f:facet>
<h:outputText value="#{publishedAssessment.lastModifiedDateForDisplay}"/>
</t:column>

Expand Down

0 comments on commit 6bb84ef

Please sign in to comment.