Skip to content

Commit

Permalink
Styling
Browse files Browse the repository at this point in the history
  • Loading branch information
csrster committed Nov 9, 2015
1 parent 38b288a commit 8d8371a
Showing 1 changed file with 35 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,12 @@ no parameters.
Iterator<String> templates = dao.getAll(true);
while (templates.hasNext()) {
String name = templates.next();
templateList.add(new TemplateWithActivity(name, true));
boolean isDefaultOrder = Settings.get(HarvesterSettings.DOMAIN_DEFAULT_ORDERXML).equals(name);
if (isDefaultOrder) {
templateList.add(0, new TemplateWithActivity(name, true));
} else {
templateList.add(new TemplateWithActivity(name, true));
}
}
templates = dao.getAll(false);
while (templates.hasNext()) {
Expand Down Expand Up @@ -100,15 +105,27 @@ no parameters.
</script>
<h3 class="page_heading"><fmt:message key="pagetitle;edit.harvest.templates"/></h3>
<button id="hide" onclick="hideInactive();">Hide Inactive</button><button id="show" onclick="showInactive();">Show Inactive</button> </br>
<table>
<table id="templates">
<style>
table[id="templates"] tr.dark td {padding: 3px; background-color: #c4b8c0}
table[id="templates"] tr.light td {padding: 3px; background-color: #b4a8b0}
table[id="templates"] td a {color: black}
</style>
<%
int rowNumber = 0;
for (TemplateWithActivity templateWithActivity: templateList) {
String rowClass;
if (templateWithActivity.isActive) {
rowClass = "active";
} else {
rowClass = "inactive";
}
if (rowNumber%6 < 3) {
rowClass += " light";
} else {
rowClass += " dark";
}
rowNumber++;
%>
<tr class="<%=rowClass%>">
<td><%=templateWithActivity.name%></td>
Expand Down Expand Up @@ -156,6 +173,9 @@ no parameters.
}
String formId = templateWithActivity.name + "flip";
boolean isDefaultOrder = Settings.get(HarvesterSettings.DOMAIN_DEFAULT_ORDERXML).equals(templateWithActivity.name);
if (isDefaultOrder) {
linkText = "Default Template";
}
//TODO Do something clever so the default template cannot be deactivated!!!
%>
<form
Expand All @@ -166,7 +186,18 @@ no parameters.
type="hidden"
name="flipactive"
value="<%=templateWithActivity.name%>"
/><a href="" onclick="document.getElementById('<%=formId%>').submit(); return false;"><%=linkText%></a>
/>
<%
if (!isDefaultOrder) {
%>
<a href="" onclick="document.getElementById('<%=formId%>').submit(); return false;"><%=linkText%></a>
<%
} else {
%>
<a href=""><%=linkText%></a>
<%
}
%>
</form>
</td>
</tr>
Expand All @@ -183,7 +214,7 @@ no parameters.
enctype="multipart/form-data">
<fmt:message key="harvestdefinition.templates.upload.to.create"/><br />
<fmt:message key="harvestdefinition.templates.upload.template.name"/> <input name="order_xml_to_upload" size="<%=Constants.TEMPLATE_NAME_WIDTH %>" value="">
<fmt:message key="prompt;harvestdefinition.templates.upload.select.file"/><input type="file" size="<%=Constants.UPLOAD_FILE_FIELD_WIDTH%>" name="upload_file"/><br/>
<fmt:message key="prompt;harvestdefinition.templates.upload.select.file"/><input type="file" size="<%=Constants.UPLOAD_FILE_FIELD_WIDTH%>" name="upload_file"/>
<input type="submit" name="upload"
value="<fmt:message key="harvestdefinition.templates.upload.create"/>"/>
</form>
Expand Down

0 comments on commit 8d8371a

Please sign in to comment.