diff options
author | mr <mr@mrautenberg.de> | 2011-09-23 10:34:34 +0200 |
---|---|---|
committer | mr <mr@mrautenberg.de> | 2011-09-23 10:34:34 +0200 |
commit | fad3229cca5d31670f1c1d99542f3d563e226d99 (patch) | |
tree | 79549e5f252358f1a7f5aa260912c7d53becbe1e /views | |
parent | 038c4563032f65f935f38ef6bffe426b2dd14c0c (diff) |
endpoint selection for create model form
Diffstat (limited to 'views')
-rw-r--r-- | views/create.haml | 30 | ||||
-rw-r--r-- | views/model_echa.haml | 4 | ||||
-rw-r--r-- | views/style.sass | 40 |
3 files changed, 67 insertions, 7 deletions
diff --git a/views/create.haml b/views/create.haml index da85382..acfa098 100644 --- a/views/create.haml +++ b/views/create.haml @@ -1,3 +1,30 @@ +:javascript + $(document).ready(function() { + $(".endpoint_list").click(function() { + elem = this.id; + title = $("label#label_" + elem).html(); + if($("ul#list_" + elem)) { + if ($("ul#list_" + elem).is(":hidden")) { + $("ul#list_" + elem).slideDown("slow"); + } else { + $("ul#list_" + elem).slideUp("slow"); + } + } + $("span#endpoint_label").html(title); + }); + $("#endpoint_list_button").click(function() { + if ($("div#div_endpoint").is(":hidden")) { + $("div#div_endpoint").slideDown("slow"); + $("input#endpoint_list_button").val("OK"); + $("input#endpoint_list_button").toggleClass("ok_button", true); + } else { + $("div#div_endpoint").slideUp("slow"); + $("input#endpoint_list_button").val("select endpoint"); + $("input#endpoint_list_button").toggleClass("ok_button", false); + } + }); + }); + .input %p @@ -25,7 +52,8 @@ format: %input{:type => 'file', :name => 'file', :id => 'file', :size => '41'} %br - -# = haml :model_echa, :layout => false + = haml :model_echa, :layout => false + %br %input{ :type => "submit", :value => "Create model"} =# link_to "Cancel", '/create' diff --git a/views/model_echa.haml b/views/model_echa.haml index 257a28a..4815c35 100644 --- a/views/model_echa.haml +++ b/views/model_echa.haml @@ -1,2 +1,2 @@ -Select an endpoint: -= endpoint_option_list
\ No newline at end of file +For endpoint: += endpoint_option_list()
\ No newline at end of file diff --git a/views/style.sass b/views/style.sass index c2a74cb..0c1f48c 100644 --- a/views/style.sass +++ b/views/style.sass @@ -5,6 +5,7 @@ $ot_purple: #5d308a $body_color: white $text_color: black $notice_border: red +$mouseover: #FFFF69 body min-width: 30em @@ -288,12 +289,43 @@ dl .thin font-weight: 100 +ul.endpoint + list-style-type: none + margin-left: 0px + padding-left: 0px + +ul.level_2 + display: none +ul.level_3 + display: none +ul.level_4 + display: none + .level_1 - padding-left: 10px + margin-left: 0px font-weight: bold .level_2 - padding-left: 20px + margin-left: 20px + font-weight: normal .level_3 - padding-left: 30px + margin-left: 40px + font-weight: normal .level_4 - padding-left: 40px + margin-left: 60px + font-weight: normal + +#endpoint_label + font-weight: bold + margin: 0 10px + +ul.endpoint + label:hover, label:active + background-color: $mouseover + border-bottom: solid #999 1px + border-top: solid #999 1px + +#div_endpoint + display: none + +.ok_button + background-color: $mouseover |