From 0e9525af814c4d5059e23b2bec1f9458a129b129 Mon Sep 17 00:00:00 2001 From: Andreas Stephanides Date: Fri, 17 Jul 2015 13:03:05 +0200 Subject: [PATCH] AutoCommit Fre Jul 17 13:03:05 CEST 2015 --- app/assets/stylesheets/layout.css.scss | 12 +- app/inputs/checkbox_autocomplete_input.rb | 28 +++++ app/views/lvas/_form.html.erb | 142 ++++++++++------------ app/views/lvas/edit.html.erb | 2 +- app/views/moduls/_form.html.erb | 4 +- 5 files changed, 108 insertions(+), 80 deletions(-) create mode 100644 app/inputs/checkbox_autocomplete_input.rb diff --git a/app/assets/stylesheets/layout.css.scss b/app/assets/stylesheets/layout.css.scss index 7c655ed..79299b6 100755 --- a/app/assets/stylesheets/layout.css.scss +++ b/app/assets/stylesheets/layout.css.scss @@ -210,4 +210,14 @@ float:clear; } a.flag-true { color: $color_schema_3_dark} a.flag-true.flag-goodquality-true { color: green} -a.flag-false { color: #CCC} \ No newline at end of file +a.flag-false { color: #CCC} + +ul.ui-menu +{list-style-type:none; +} + +ul.ui-menu > li > a +{padding:2px; +padding-left:10px; +cursor: pointer; +} \ No newline at end of file diff --git a/app/inputs/checkbox_autocomplete_input.rb b/app/inputs/checkbox_autocomplete_input.rb new file mode 100644 index 0000000..c320d72 --- /dev/null +++ b/app/inputs/checkbox_autocomplete_input.rb @@ -0,0 +1,28 @@ +class CheckboxAutocompleteInput < FormtasticBootstrap::Inputs::CheckboxInput + def input_html_options + super + #super.merge(:class => "input-append date") + end + def html_options + super + #super.merge(:default => Date.today) + end + def wrapper_html_options + super.merge(:class=>"") + #super.merge(:class=>"datepicker",'date-date-format'.to_sym=>"%d.%m.%Y") + end + def controls_wrapper_html_options + super.merge(:class=> "datepicker date input-append", 'data-date'.to_sym =>I18n.l(Date.today()).to_s, 'data-date-format'.to_sym=>I18n.t('date.formats.default-picker')) + end + def to_html + bootstrap_wrapping do + builder.text_field(method, input_html_options) + 'sdf' + end + end + def options + super +#d.merge(:class=>"datepicker") + #super.merge(:append_content=>''') + end +end diff --git a/app/views/lvas/_form.html.erb b/app/views/lvas/_form.html.erb index e173776..acec0dc 100755 --- a/app/views/lvas/_form.html.erb +++ b/app/views/lvas/_form.html.erb @@ -1,88 +1,76 @@ - -<%= semantic_form_for @lva do |f| %> -
- <%= f.inputs do %> - -
-
-
-
-
- <%= f.input :typ, :as=>:select, :include_blank=>false, :collection=>Lva::ERLAUBTE_TYPEN, :wrapper_html=>{:class=>'span2'}%> - - <%= f.input :name, :wrapper_html=>{:class=>'span10'}%> +
+ <%= semantic_form_for @lva do |f| %> +
+ <%= f.inputs do %> +
+ <%= f.input :typ, :as=>:select, :include_blank=>false, :collection=>Lva::ERLAUBTE_TYPEN , :input_html=>{:style => "width:7em" } , :wrapper_html=> {style: "float: left"}%> + <%= f.input :name , :input_html=>{:style => "width:14em" }%> +
-
-
- <%= f.input :lvanr, :wrapper_html=>{:class=>'span4'}%> +
- <%= f.input :ects, :wrapper_html=>{:class=>'span4'} %> - <%= f.input :stunden, :wrapper_html=>{:class=>'span4'} %> -
- -
- <%= f.input :forumlink, :wrapper_html=>{:class=>'span12'}%> -
+ <%= f.input :lvanr, :input_html=>{:style => "width:9em" } , :wrapper_html=> {style: "float: left"}%> + <%= f.input :ects , :input_html=>{:style => "width:5em" } , :wrapper_html=> {style: "float: left"}%> + <%= f.input :stunden, :input_html=>{:style => "width:5em" } , :wrapper_html=> {style: "float: left"} %> + +
-
-
-
-
- <%= f.input :desc , :as=>:tinymce_text %> - <%= f.input :pruefungsinformation %> - <%= f.input :lernaufwand %> -
-
-
- -
-

BILD

- "> - <%= f.input :modul, :as => :check_boxes, :member_label=>:name, :collection => @lva.modul %> - - - <% f.input :modul, :as=>:check_boxes%> - - - - <% f.input :semester, :as=>:check_boxes, :collection=>@semester%> - - "> - <%= f.input :semester, :as => :check_boxes, :member_label=>:name, :collection => @lva.semester %> - - - "> - <%= f.input :lecturers, :as => :check_boxes, :member_label=>:name, :collection => @lva.lecturers %> - - - - <% f.input :lecturers, :as=>:check_boxes%> -
- <% end %> - <%= f.actions do %> - <%= f.action :submit, :as => :input %> - <% end %> -<% end %> +
+ <%= f.input :forumlink, :wrapper_html=>{:class=>'span12'}%> +
+
+
+ + <%= f.input :desc , :as=>:tinymce_text %> + <%= f.input :pruefungsinformation %> + <%= f.input :lernaufwand %> +
+ + +
+

BILD

+ "> + <%= f.input :modul, :as => :check_boxes, :member_label=>:name, :collection => @lva.modul %> + <% f.input :modul, :as=>:check_boxes%> + <% f.input :semester, :as=>:check_boxes, :collection=>@semester%> + + "> + <%= f.input :semester, :as => :check_boxes, :member_label=>:name, :collection => @lva.semester %> + + "> + <%= f.input :lecturers, :as => :check_boxes, :member_label=>:name, :collection => @lva.lecturers %> + + + + <% f.input :lecturers, :as=>:check_boxes%> +
+
+ <% end %> + <%= f.actions do %> + <%= f.action :submit, :as => :input %> + <% end %> + <% end %> +