This repository has been archived by the owner on Nov 9, 2017. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Alex Eng
committed
Feb 13, 2014
1 parent
fca2020
commit 811bb92
Showing
4 changed files
with
161 additions
and
294 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
275 changes: 150 additions & 125 deletions
275
zanata-war/src/main/webapp/WEB-INF/layout/copy_trans_inline.xhtml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,136 +1,161 @@ | ||
<s:div xmlns:s="http://jboss.org/schema/seam/taglib" | ||
<ui:composition xmlns="http://www.w3.org/1999/xhtml" | ||
xmlns:ui="http://java.sun.com/jsf/facelets" | ||
xmlns:f="http://java.sun.com/jsf/core" | ||
xmlns:h="http://java.sun.com/jsf/html" | ||
xmlns:rich="http://richfaces.org/rich" | ||
xmlns:a4j="http://richfaces.org/a4j"> | ||
xmlns:s="http://jboss.org/schema/seam/taglib"> | ||
|
||
<script type="text/javascript"> | ||
function actionSelected(radio, cellId) { | ||
var cell = jQuery('#' + cellId); | ||
var radioButton = jQuery(radio); | ||
|
||
if (radioButton.val() == 'REJECT') { | ||
jQuery(cell).attr('class', 'reject_action'); | ||
jQuery(cell).html("#{messages['jsf.iteration.CopyTrans.Action.reject']}"); | ||
} | ||
else if (radioButton.val() == 'DOWNGRADE_TO_FUZZY') { | ||
jQuery(cell).attr('class', 'downgrade_action'); | ||
jQuery(cell).html("#{messages['jsf.iteration.CopyTrans.Action.short.downgradeToFuzzy']}"); | ||
} | ||
else if (radioButton.val() == 'IGNORE') { | ||
jQuery(cell).attr('class', 'ignore_action'); | ||
jQuery(cell).html("#{messages['jsf.iteration.CopyTrans.Action.short.ignore']}"); | ||
} | ||
else { | ||
jQuery(cell).attr('class', ''); | ||
jQuery(cell).html(''); | ||
} | ||
function onValueChanged(checkbox) { | ||
bindCopyTransValue(jQuery(checkbox).attr("name"), | ||
jQuery(checkbox).attr("value")) | ||
} | ||
|
||
// initialize selected option colours | ||
jQuery(function () { | ||
actionSelected(jQuery("input[name='#{rich:clientId('projectMismatchAction')}']:checked"), | ||
'projectMismatchCell'); | ||
actionSelected(jQuery("input[name='#{rich:clientId('contextMismatchAction')}']:checked"), | ||
'contextMismatchCell'); | ||
actionSelected(jQuery("input[name='#{rich:clientId('documentIdMismatchAction')}']:checked"), | ||
'documentIdMismatchCell'); | ||
}); | ||
</script> | ||
|
||
<!-- Simply needed to load jQuery --> | ||
<rich:jQuery query="jquery"/> | ||
|
||
<a4j:outputPanel id="copyTransOptionsPanel"> | ||
<rich:panel> | ||
<ol class="list--slat"> | ||
<li> | ||
<div class="g--tighter"> | ||
<div class="g__item w--3-8 l--push-bottom-quarter"> | ||
<p class="list__title"> | ||
#{messages['jsf.iteration.CopyTrans.Condition.onContentMismatch']}</p> | ||
|
||
<table border="0" class="copy_trans_options_table" width="100%" | ||
cellspacing="3px"> | ||
<tr> | ||
<th>#{messages['jsf.iteration.CopyTrans.Condition']}</th> | ||
<th colspan="2">#{messages['jsf.iteration.CopyTrans.Action']}</th> | ||
</tr> | ||
<tr> | ||
<td | ||
width="25%">1. #{messages['jsf.iteration.CopyTrans.Condition.onContentMismatch']}</td> | ||
<td class="reject_action" width="15%"> | ||
<p class="txt--meta"> | ||
#{messages['jsf.iteration.CopyTrans.Condition.onContentMismatch.details']}</p> | ||
</div> | ||
<div class="g__item w--5-8 txt--align-right l--push-bottom-quarter"> | ||
<button class="button button--small button--danger" disabled=""> | ||
#{messages['jsf.iteration.CopyTrans.Action.reject']} | ||
</td> | ||
<td width="60%"> | ||
</td> | ||
</tr> | ||
<tr> | ||
<td>2. #{messages['jsf.iteration.CopyTrans.Condition.onContextMismatch']}</td> | ||
<td id="contextMismatchCell"> | ||
</td> | ||
<td> | ||
<h:selectOneRadio id="contextMismatchAction" | ||
value="#{copyTransOptionsModel.contextMismatchAction}" | ||
onchange="actionSelected(this, 'contextMismatchCell');"> | ||
<f:selectItem | ||
itemLabel="#{messages['jsf.iteration.CopyTrans.Action.reject']}" | ||
itemValue="REJECT"/> | ||
<f:selectItem | ||
itemLabel="#{messages['jsf.iteration.CopyTrans.Action.downgradeToFuzzy']}" | ||
itemValue="DOWNGRADE_TO_FUZZY"/> | ||
<f:selectItem | ||
itemLabel="#{messages['jsf.iteration.CopyTrans.Action.ignore']}" | ||
itemValue="IGNORE"/> | ||
</h:selectOneRadio> | ||
</td> | ||
</tr> | ||
<tr> | ||
<td>3. #{messages['jsf.iteration.CopyTrans.Condition.onProjectMismatch']}</td> | ||
<td id="projectMismatchCell"> | ||
</td> | ||
<td> | ||
<h:selectOneRadio id="projectMismatchAction" | ||
value="#{copyTransOptionsModel.projectMismatchAction}" | ||
onchange="actionSelected(this, 'projectMismatchCell');"> | ||
<f:selectItem | ||
itemLabel="#{messages['jsf.iteration.CopyTrans.Action.reject']}" | ||
itemValue="REJECT"/> | ||
<f:selectItem | ||
itemLabel="#{messages['jsf.iteration.CopyTrans.Action.downgradeToFuzzy']}" | ||
itemValue="DOWNGRADE_TO_FUZZY"/> | ||
<f:selectItem | ||
itemLabel="#{messages['jsf.iteration.CopyTrans.Action.ignore']}" | ||
itemValue="IGNORE"/> | ||
</h:selectOneRadio> | ||
</td> | ||
</tr> | ||
<tr> | ||
<td>4. #{messages['jsf.iteration.CopyTrans.Condition.onDocIdMismatch']}</td> | ||
<td id="documentIdMismatchCell"> | ||
</td> | ||
<td> | ||
<h:selectOneRadio id="documentIdMismatchAction" | ||
value="#{copyTransOptionsModel.docIdMismatchAction}" | ||
onchange="actionSelected(this, 'documentIdMismatchCell');"> | ||
<f:selectItem | ||
itemLabel="#{messages['jsf.iteration.CopyTrans.Action.reject']}" | ||
itemValue="REJECT"/> | ||
<f:selectItem | ||
itemLabel="#{messages['jsf.iteration.CopyTrans.Action.downgradeToFuzzy']}" | ||
itemValue="DOWNGRADE_TO_FUZZY"/> | ||
<f:selectItem | ||
itemLabel="#{messages['jsf.iteration.CopyTrans.Action.ignore']}" | ||
itemValue="IGNORE"/> | ||
</h:selectOneRadio> | ||
</td> | ||
</tr> | ||
<tr> | ||
<td>5. #{messages['jsf.iteration.CopyTrans.Condition.final']}</td> | ||
<td class="translated_action"> | ||
#{messages['jsf.Translated']} | ||
</td> | ||
<td> | ||
</td> | ||
</tr> | ||
</table> | ||
</button> | ||
</div> | ||
</div> | ||
</li> | ||
|
||
<li> | ||
<div class="g--tighter"> | ||
<div class="g__item w--3-8 l--push-bottom-quarter"> | ||
<p class="list__title"> | ||
#{messages['jsf.iteration.CopyTrans.Condition.onContextMismatch']} | ||
</p> | ||
|
||
<p class="txt--meta"> | ||
#{messages['jsf.iteration.CopyTrans.Condition.onContextMismatch.details']} | ||
</p> | ||
</div> | ||
<div class="g__item w--5-8 txt--align-right l--push-bottom-quarter"> | ||
<div class="button--group"> | ||
<ui:repeat value="#{copyTransOptionsModel.ruleActions}" | ||
var="ruleAction"> | ||
<s:fragment | ||
rendered="#{copyTransOptionsModel.contextMismatchAction ne ruleAction.action}"> | ||
<input id="contextMismatch--#{ruleAction.action}" | ||
name="contextMismatch" | ||
onclick="onValueChanged(this)" | ||
value="#{ruleAction.action}" type="radio" | ||
class="form__item__input"/> | ||
</s:fragment> | ||
<s:fragment | ||
rendered="#{copyTransOptionsModel.contextMismatchAction eq ruleAction.action}"> | ||
<input id="contextMismatch--#{ruleAction.action}" | ||
name="contextMismatch" | ||
onclick="onValueChanged(this)" | ||
value="#{ruleAction.action}" type="radio" | ||
class="form__item__input" | ||
checked="true"/> | ||
</s:fragment> | ||
<label for="contextMismatch--#{ruleAction.action}" | ||
class="button button--small #{ruleAction.css}"> | ||
#{ruleAction.displayText} | ||
</label> | ||
</ui:repeat> | ||
</div> | ||
</div> | ||
</div> | ||
</li> | ||
<li> | ||
<div class="g--tighter"> | ||
<div class="g__item w--3-8 l--push-bottom-quarter"> | ||
<p class="list__title"> | ||
#{messages['jsf.iteration.CopyTrans.Condition.onProjectMismatch']} | ||
</p> | ||
|
||
<p class="txt--meta"> | ||
#{messages['jsf.iteration.CopyTrans.Condition.onProjectMismatch.details']} | ||
</p> | ||
</div> | ||
<div class="g__item w--5-8 txt--align-right l--push-bottom-quarter"> | ||
<div class="button--group"> | ||
<ui:repeat value="#{copyTransOptionsModel.ruleActions}" | ||
var="ruleAction"> | ||
<s:fragment | ||
rendered="#{copyTransOptionsModel.projectMismatchAction ne ruleAction.action}"> | ||
<input id="projectMismatch--#{ruleAction.action}" | ||
name="projectMismatch" | ||
onclick="onValueChanged(this)" | ||
value="#{ruleAction.action}" type="radio" | ||
class="form__item__input"/> | ||
</s:fragment> | ||
<s:fragment | ||
rendered="#{copyTransOptionsModel.projectMismatchAction eq ruleAction.action}"> | ||
<input id="projectMismatch--#{ruleAction.action}" | ||
name="projectMismatch" | ||
onclick="onValueChanged(this)" | ||
value="#{ruleAction.action}" type="radio" | ||
class="form__item__input" | ||
checked="true"/> | ||
</s:fragment> | ||
<label for="projectMismatch--#{ruleAction.action}" | ||
class="button button--small #{ruleAction.css}"> | ||
#{ruleAction.displayText} | ||
</label> | ||
</ui:repeat> | ||
</div> | ||
</div> | ||
</div> | ||
</li> | ||
|
||
|
||
</rich:panel> | ||
</a4j:outputPanel> | ||
<li> | ||
<div class="g--tighter"> | ||
<div class="g__item w--3-8 l--push-bottom-quarter"> | ||
<p class="list__title"> | ||
#{messages['jsf.iteration.CopyTrans.Condition.onDocIdMismatch']} | ||
</p> | ||
|
||
</s:div> | ||
<p class="txt--meta"> | ||
#{messages['jsf.iteration.CopyTrans.Condition.onDocIdMismatch.details']} | ||
</p> | ||
</div> | ||
<div class="g__item w--5-8 txt--align-right l--push-bottom-quarter"> | ||
<div class="button--group"> | ||
<ui:repeat value="#{copyTransOptionsModel.ruleActions}" | ||
var="ruleAction"> | ||
<s:fragment | ||
rendered="#{copyTransOptionsModel.docIdMismatchAction ne ruleAction.action}"> | ||
<input id="docIdMismatch--#{ruleAction.action}" | ||
name="docIdMismatch" | ||
onclick="onValueChanged(this)" | ||
value="#{ruleAction.action}" type="radio" | ||
class="form__item__input"/> | ||
</s:fragment> | ||
<s:fragment | ||
rendered="#{copyTransOptionsModel.docIdMismatchAction eq ruleAction.action}"> | ||
<input id="docIdMismatch--#{ruleAction.action}" | ||
name="docIdMismatch" | ||
onclick="onValueChanged(this)" | ||
value="#{ruleAction.action}" type="radio" | ||
class="form__item__input" | ||
checked="true"/> | ||
</s:fragment> | ||
<label for="docIdMismatch--#{ruleAction.action}" | ||
class="button button--small #{ruleAction.css}"> | ||
#{ruleAction.displayText} | ||
</label> | ||
</ui:repeat> | ||
</div> | ||
</div> | ||
</div> | ||
</li> | ||
<li> | ||
<p class="list__title">#{messages['jsf.CopyTrans.Action.message']}</p> | ||
<p class="txt--meta">#{messages['jsf.CopyTrans.Action.message2']}</p> | ||
</li> | ||
</ol> | ||
</ui:composition> |
Oops, something went wrong.