Permalink
Browse files

Added a UI for the fixed-width import panel

  • Loading branch information...
1 parent 4731266 commit a80c012512777483aa4a6e73600125c69f0ebc47 @danpaulsmith danpaulsmith committed Apr 3, 2012
@@ -0,0 +1,68 @@
+<div class="grid-layout layout-full parser-panel">
+
+ <div class="fixed-width-details">
+ <p>The file that has been uploaded has been detected as a fixed-width data file.</p>
+ <p>We've tried to guess the location of the columns in the data, but you may need to manually hover over the data and splice it into columns yourself.</p>
+
+ <ul>
+ <li><span>Column widths:</span> <input bind="columnWidthsInput" /><span class="note">comma separated numbers</span></li>
+ <li><span>Column names:</span> <input bind="columnNamesInput" /><span class="note">optional, comma separated</span></li>
+ </ul>
+ </div>
+
+ <a class="question">Has the correct encoding been used?</a>
+ <div class="grid-layout layout-tightest question-input encoding">
+ <ul>
+ <li><span>Character encoding</span> <input bind="encodingInput"></input></li>
+ </ul>
+ </div>
+
+ <a class="question">Have the correct number of rows been captured?</a>
+ <div class="grid-layout layout-tightest question-input">
+
+ <ul>
+ <li><input type="checkbox" bind="ignoreCheckbox" /><span>Ignore
+ first</span> <input bind="ignoreInput" type="text" class="lightweight"
+ size="2" value="0" /><span>line(s) at beginning of file</span></li>
+ <li><input type="checkbox" bind="headerLinesCheckbox" /><span>Parse
+ next</span> <input bind="headerLinesInput" type="text" class="lightweight"
+ size="2" value="1" /><span>line(s) as column headers</span></li>
+ <li><input type="checkbox" bind="skipCheckbox" /><span>Discard
+ initial</span> <input bind="skipInput" type="text" class="lightweight"
+ size="2" value="0" /><span>row(s) of data</span></li>
+ <li><input type="checkbox" bind="limitCheckbox" /><span>Load
+ at most</span> <input bind="limitInput" type="text" class="lightweight"
+ size="2" value="0" /><span>row(s) of data</span></li>
+ </ul>
+
+ </div>
+
+ <a class="question">Have value types (i.e. numbers and dates) been
+ detected correctly?</a>
+ <div class="grid-layout layout-tightest question-input">
+ <ul>
+ <li><input type="checkbox" bind="guessCellValueTypesCheckbox" /><span>Parse
+ cell text into numbers, dates, ...</span></li>
+ </ul>
+ </div>
+
+ <a class="question">Other</a>
+ <div class="grid-layout layout-tightest question-input">
+ <ul>
+ <li><input type="checkbox" bind="storeBlankRowsCheckbox" /><span>Store
+ blank rows</span></li>
+ <li><input type="checkbox" bind="storeBlankCellsAsNullsCheckbox" /><span>Store
+ blank cells as nulls</span></li>
+ <li><input type="checkbox" bind="includeFileSourcesCheckbox" /><span>Store
+ file source (file names, URLs) in each row</span></li>
+ </ul>
+ </div>
+
+</div>
+
+<div class="primary-buttons">
+ <button class="button" bind="previewButton">Update&nbsp;Preview</button>
+ <button class="button create-project">
+ <strong>Create Project &raquo;</strong>
+ </button>
+</div>
@@ -551,6 +551,11 @@ var LG = {
$.getScript(ModuleWirings["linkedgov"] + 'scripts/index/'+pageName+'.js');
break;
+
+ case 'fixed-width-parser-ui' :
+
+ $.getScript(ModuleWirings["linkedgov"] + 'scripts/index/'+pageName+'.js');
+ break;
case 'feedback-form' :
//$.getScript(ModuleWirings["linkedgov"] + 'scripts/feedback.js');
@@ -585,6 +590,9 @@ DOM.loadHTML = function(module, path) {
} else if(path == "scripts/index/parser-interfaces/separator-based-parser-ui.html"){
module = "linkedgov";
path = "html/index/separator-based-parser-ui.html";
+ } else if(path == "scripts/index/parser-interfaces/fixed-width-parser-ui.html"){
+ module = "linkedgov";
+ path = "html/index/fixed-width-parser-ui.html";
}
var fullPath = ModuleWirings[module] + path;
@@ -656,18 +664,8 @@ Refine.CreateProjectUI.prototype.pollImportJob = function(start, jobID, timerID,
*/
if(typeof job.config.projectID != 'undefined'){
- log("jobID = "+jobID);
-
- log("job.config.projectID = "+job.config.projectID);
-
-
-
LG.saveMetadata(jobID, job.config.projectID, function(jobID, projectID){
- log("jobID 2 = "+jobID);
-
- log("projectID = "+projectID);
-
Refine.CreateProjectUI.cancelImportingJob(jobID);
document.location = "project?project=" + projectID;
});
@@ -0,0 +1,21 @@
+// DS - Question expanding javascript
+$('a.question').live("click", function(){
+ if($(this).hasClass("exp")){
+ $(this).removeClass("exp");
+ $(this).next('div.question-input').slideUp();
+ }else{
+ $('div.question-input').slideUp();
+ $('a.question.exp').removeClass("exp");
+ $(this).next('div.question-input').slideDown();
+ $(this).addClass("exp");
+ }
+});
+
+/*
+ * Simulate a click on our own button when the user
+ * clicks "Create project".
+ */
+$("button.create-project").live("click",function(){
+ $("button.yes-success").click();
+});
+
@@ -473,7 +473,51 @@ body.lg td.default-importing-parsing-control-panel-options-panel div.parser-pane
border:1px solid #444444;
}
-
+body.lg td.default-importing-parsing-control-panel-options-panel div.parser-panel div.fixed-width-details {
+ background-color:#EBEEF8;
+ border: 1px solid #BBCCFF;
+ color: #444444;
+ margin-right: 5px;
+ margin-top: 5px;
+ padding: 10px;
+}
+body.lg td.default-importing-parsing-control-panel-options-panel div.parser-panel div.fixed-width-details p {
+ margin-bottom:10px;
+}
+body.lg td.default-importing-parsing-control-panel-options-panel div.parser-panel div.fixed-width-details ul li {
+ margin-left: 0;
+ width: 100%;
+}
+body.lg td.default-importing-parsing-control-panel-options-panel div.parser-panel div.fixed-width-details ul li input {
+ float: none;
+ margin: 0;
+ width: 98%;
+}
+body.lg td.default-importing-parsing-control-panel-options-panel div.parser-panel div.fixed-width-details ul li span {
+ display: block;
+ margin-bottom: 3px;
+}
+body.lg td.default-importing-parsing-control-panel-options-panel div.parser-panel div.fixed-width-details ul li span.note {
+ color: #6A6A6A;
+ float: right;
+ font-size: 11px;
+ font-style: italic;
+ margin-bottom: 0px;
+}
+body.lg td.default-importing-parsing-control-panel-options-panel div.parser-panel div.encoding ul li {
+ margin-left: 0;
+ width: 100%;
+}
+body.lg td.default-importing-parsing-control-panel-options-panel div.parser-panel div.encoding ul li span {
+ display: block;
+ margin-bottom: 3px;
+}
+body.lg td.default-importing-parsing-control-panel-options-panel div.parser-panel div.encoding ul li input {
+ float: none;
+ margin: 0;
+ width: 98%;
+}
+
/**** Feedback form ****/
body.lg #header #send-feedback {

0 comments on commit a80c012

Please sign in to comment.