Skip to content

Commit 9367a9f

Browse files
author
Gaurav SinghaRoy
committed
added a back button in generic download
1 parent 74e2859 commit 9367a9f

3 files changed

Lines changed: 22 additions & 8 deletions

File tree

app/assets/javascripts/resources/querybuilder.js

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -704,7 +704,22 @@ QueryBuilder = {
704704
}
705705
}
706706
return index_pairs;
707-
}
707+
},
708+
initiate_download : function(){
709+
$(".div-configured-download").show("fast");
710+
$("#btn_group_download").hide("fast");
711+
$("#btn_download_configured_convert_template").attr("href","/query/configured_convert_template?selected_properties="+QueryBuilder.properties.get_checked_properties());
712+
},
713+
hide_download : function(motion){
714+
if(motion != undefined && motion != ""){
715+
$(".div-configured-download").hide("fast");
716+
$("#btn_group_download").show("fast");
717+
}
718+
else{
719+
$(".div-configured-download").hide();
720+
$("#btn_group_download").show();
721+
}
722+
}
708723
} // end configured
709724
} // end convert
710725

app/assets/javascripts/resources/sparql.js

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -88,11 +88,6 @@ SPARQL = {
8888
window.open(download_url);
8989
}
9090

91-
},
92-
initiate_configured_download : function(){
93-
$(".div-configured-download").show("fast");
94-
$("#btn_group_download").hide("fast");
95-
$("#btn_download_configured_convert_template").attr("href","/query/configured_convert_template?selected_properties="+QueryBuilder.properties.get_checked_properties());
9691
}
9792

9893

app/views/query/_search_results.html.erb

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,15 @@
4242
<button type="button" class="btn btn-default btn-info" onclick="SPARQL.download.json()"><span class="glyphicon glyphicon-road"></span>&nbsp;JSON</button>
4343
<button type="button" class="btn btn-default btn-warning" onclick="SPARQL.download.pdf()"><span class="glyphicon glyphicon-file"></span>&nbsp;PDF</button>
4444
<%if in_query_builder_action?%>
45-
<button class="btn btn-default btn-danger" onclick="SPARQL.initiate_configured_download()"><span class="glyphicon glyphicon-glass"></span>&nbsp;Generic</button>
45+
<button class="btn btn-default btn-danger" onclick="QueryBuilder.convert.configured.initiate_download()"><span class="glyphicon glyphicon-glass"></span>&nbsp;Generic</button>
4646
<%end%>
4747
</div>
4848
<%if in_query_builder_action?%>
4949
<div class="div-configured-download row" style="display:none;">
5050
<div class="col-md-12">
51+
<p>
52+
<button class="btn btn-danger btn-xs" type="button" onclick="QueryBuilder.convert.configured.hide_download('fast')"><span class="glyphicon glyphicon-chevron-left"></span>&nbsp;back</button>
53+
</p>
5154
<p>
5255
<strong>STEP 1 :</strong> You need to write your template in <strong>.txt</strong> file.
5356
</p>
@@ -59,9 +62,10 @@
5962
<strong>STEP 2 : </strong> Ready with the template file ? Awesome !! Now all you have to do is upload that file below.
6063
</p>
6164
<p>
62-
<input type="file" id="configured_template_files" name="files[]" multiple class="btn btn-primary btn-xs col-md-12"/>
65+
<input type="file" id="configured_template_files" name="files[]" multiple class="btn btn-warning btn-xs col-md-12"/>
6366
<output id="list"></output>
6467
</p>
68+
6569
</div>
6670
</div>
6771
<div class="div-configured-download row" style="display:none;">

0 commit comments

Comments
 (0)