diff options
author | Steffen van Bergerem <svbergerem@online.de> | 2014-10-11 18:56:34 +0400 |
---|---|---|
committer | Steffen van Bergerem <svbergerem@online.de> | 2014-10-11 21:18:13 +0400 |
commit | 42a3e702e68595af66540aad3ad7b0720fce884e (patch) | |
tree | f8f6eae6453e0ff556f72c6322c26e5d889f251e /app | |
parent | d44300c7a2b7bc8bd33ab880134695d0dc75d490 (diff) |
Fix poll for Bootstrap publisher
Diffstat (limited to 'app')
7 files changed, 36 insertions, 36 deletions
diff --git a/app/assets/javascripts/app/views/publisher/poll_creator_view.js b/app/assets/javascripts/app/views/publisher/poll_creator_view.js index ebc6755aa..f443801c5 100644 --- a/app/assets/javascripts/app/views/publisher/poll_creator_view.js +++ b/app/assets/javascripts/app/views/publisher/poll_creator_view.js @@ -71,15 +71,14 @@ app.views.PublisherPollCreator = app.views.Base.extend({ }, validateInput: function(input){ - var wrapper = input.parents('.control-group'); var isValid = this.isValidInput(input); if(isValid){ - wrapper.removeClass('error'); + input.removeClass('error'); return true; } else { - wrapper.addClass('error'); + input.addClass('error'); return false; } }, diff --git a/app/assets/javascripts/app/views/publisher_view.js b/app/assets/javascripts/app/views/publisher_view.js index 2f20a3b44..a14b55df7 100644 --- a/app/assets/javascripts/app/views/publisher_view.js +++ b/app/assets/javascripts/app/views/publisher_view.js @@ -123,7 +123,7 @@ app.views.Publisher = Backbone.View.extend({ this.view_uploader.on('change', this.checkSubmitAvailability, this); this.view_poll_creator = new app.views.PublisherPollCreator({ - el: this.$('#publisher-poll-creator') + el: this.$('#poll_creator_container') }); this.view_poll_creator.on('change', this.checkSubmitAvailability, this); this.view_poll_creator.render(); diff --git a/app/assets/stylesheets/publisher.css.scss b/app/assets/stylesheets/publisher.css.scss index 696f573d6..6326d8ea1 100644 --- a/app/assets/stylesheets/publisher.css.scss +++ b/app/assets/stylesheets/publisher.css.scss @@ -50,7 +50,7 @@ border-radius: 3px; border: 1px solid $border-dark-grey; - input[type='text'] { + input[type='text']#status_message_text { border: none; box-shadow: none; margin: none; @@ -87,13 +87,22 @@ border-top: 1px dashed $border-grey; } - #poll_creator_wrapper { - display:none; + .row-fluid#poll_creator_container { + display: none; border-top: 1px dashed $border-grey; padding:4px 6px 4px 6px; box-sizing: border-box; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; + .remove-answer.entypo.cross { + display: none; + color: lighten($black,75%); + &.active { display: block; } + &:hover { color: $black; } + line-height: 30px; + font-size: 18px; + cursor: pointer; + } } &.with_location .row-fluid#location_container { diff --git a/app/assets/stylesheets/publisher_blueprint.css.scss b/app/assets/stylesheets/publisher_blueprint.css.scss index 97dd3b56d..95ea2ac45 100644 --- a/app/assets/stylesheets/publisher_blueprint.css.scss +++ b/app/assets/stylesheets/publisher_blueprint.css.scss @@ -344,7 +344,7 @@ } } -#publisher-poll-creator { +#poll_creator_container { border: 1px solid $border-dark-grey; padding: 5px; margin-top: 5px; @@ -379,19 +379,18 @@ } } .poll-answer { + .span1, .span11 { display: inline-block; } + .span11 { width: 96%; } input { - width: 96%; + width: 100%; display: inline-block; vertical-align: bottom; } .remove-answer { - width: 14px; - height: 14px; @include opacity(0.4); cursor: pointer; - vertical-align: top; - margin-top: 7px; display: none; + line-height: 27px; &:hover { @include opacity(1); diff --git a/app/assets/templates/poll_creator_tpl.jst.hbs b/app/assets/templates/poll_creator_tpl.jst.hbs index f71d46f01..ea5ce6207 100644 --- a/app/assets/templates/poll_creator_tpl.jst.hbs +++ b/app/assets/templates/poll_creator_tpl.jst.hbs @@ -1,20 +1,21 @@ <div class="poll-question control-group"> - <div class="controls"> - <input class="span12" placeholder="{{t 'publisher.question' }}" type="text" name="poll_question"> - </div> + <input class="input-block-level" placeholder="{{t 'publisher.question' }}" type="text" name="poll_question"> </div> <div class="poll-answers"> - <div class="poll-answer control-group"> - <div class="controls"> - <input type="text" name="poll_answers[]" placeholder="{{t 'publisher.option' }}"> - <div class="remove-answer icons-deletelabel"></div> + <div class="poll-answer row-fluid"> + <div class="span11"> + <input type="text" class="input-block-level" name="poll_answers[]" placeholder="{{t 'publisher.option' }}"> + </div> + <div class="span1"> + <i class="remove-answer entypo cross"></i> </div> </div> - <div class="poll-answer control-group"> - <div class="controls"> - <input type="text" name="poll_answers[]" placeholder="{{t 'publisher.option' }}"> - <div class="remove-answer icons-deletelabel"></div> + <div class="poll-answer row-fluid"> + <div class="span11"> + <input type="text" class="input-block-level" name="poll_answers[]" placeholder="{{t 'publisher.option' }}"> + </div> + <div class="span1"> + <i class="remove-answer entypo cross"></i> </div> </div> </div> - diff --git a/app/views/publisher/_publisher_blueprint.html.haml b/app/views/publisher/_publisher_blueprint.html.haml index b54a3e716..b43ea5512 100644 --- a/app/views/publisher/_publisher_blueprint.html.haml +++ b/app/views/publisher/_publisher_blueprint.html.haml @@ -37,7 +37,7 @@ = image_tag 'icons/camera.png', :alt => t('shared.publisher.upload_photos').titleize, :class => 'publisher_image' = hidden_field :location, :coords #location_container - #publisher-poll-creator + #poll_creator_container - if publisher_public = hidden_field_tag 'aspect_ids[]', "public" diff --git a/app/views/publisher/_publisher_bootstrap.html.haml b/app/views/publisher/_publisher_bootstrap.html.haml index 627f7258e..77c506702 100644 --- a/app/views/publisher/_publisher_bootstrap.html.haml +++ b/app/views/publisher/_publisher_bootstrap.html.haml @@ -22,16 +22,8 @@ %ul#photodropzone .row-fluid#location_container = hidden_field :location, :coords - .row-fluid#poll_creator_wrapper - #poll_question_wrapper{:class => "input-block-level"} - %input{:id => 'poll_question', :placeholder => t('shared.publisher.poll.question'), :name => 'poll_question', :class=> "form-control"} - .poll_answer - %input{:class => 'form-control poll_answer_input', :placeholder => t('shared.publisher.poll.option'), :name => 'poll_answers[]'} - .remove_poll_answer.btn.btn-link{:title => t('shared.publisher.poll.remove_poll_answer')} - %i.entypo.trash - #add_poll_answer_wrapper - #add_poll_answer{:class => 'btn btn-default'} - = t('shared.publisher.poll.add_poll_answer') + .row-fluid#poll_creator_container + -# handlebars template .row-fluid#button_container #publisher-images.pull-right #poll_creator.btn.btn-link{:title => t('shared.publisher.poll.add_a_poll')} |