From 2caf81d08e00e405d3dcb741ba38764abf59f14e Mon Sep 17 00:00:00 2001 From: nilsding Date: Mon, 8 Dec 2014 16:01:27 +0100 Subject: [PATCH] ayyyy vodka --- app/views/inbox/show.html.haml | 8 ++++---- app/views/shared/_answerbox.html.haml | 2 +- app/views/shared/_answerbox_buttons.html.haml | 8 ++++---- app/views/shared/_comments.html.haml | 4 ++-- app/views/shared/_modal_ask_followers.html.haml | 2 +- app/views/shared/_questionbox.html.haml | 2 +- app/views/static/index.html.haml | 2 +- app/views/user/_actions.html.haml | 4 ++-- app/views/user/show.html.haml | 2 +- 9 files changed, 17 insertions(+), 17 deletions(-) diff --git a/app/views/inbox/show.html.haml b/app/views/inbox/show.html.haml index d51c6138..9e2d01a1 100644 --- a/app/views/inbox/show.html.haml +++ b/app/views/inbox/show.html.haml @@ -1,7 +1,7 @@ .container.j2-page = render 'layouts/messages' - @inbox.each do |i| - .panel.inbox-box{'data-id' => i.id, class: "panel-#{i.new? ? 'primary' : 'default'}" } + .panel.inbox-box{class: "panel-#{i.new? ? 'primary' : 'default'}", data: { id: i.id }} .panel-heading .media - unless i.question.author_is_anonymous @@ -20,11 +20,11 @@ #{i.question.answer_count} response(s) %p.answerbox-question-text= i.question.content .panel-body - %textarea.form-control{name: 'ib-answer', 'data-id' => i.id} + %textarea.form-control{name: 'ib-answer', data: { id: i.id }} %br/ - %button.btn.btn-success{name: 'ib-answer', 'data-ib-id' => i.id} + %button.btn.btn-success{name: 'ib-answer', data: { id: i.id }} Answer - %button.btn.btn-danger{name: 'ib-destroy', 'data-ib-id' => i.id} + %button.btn.btn-danger{name: 'ib-destroy', data: { id: i.id }} Delete - if @inbox.empty? diff --git a/app/views/shared/_answerbox.html.haml b/app/views/shared/_answerbox.html.haml index 8350dfdb..b8b9592a 100644 --- a/app/views/shared/_answerbox.html.haml +++ b/app/views/shared/_answerbox.html.haml @@ -1,4 +1,4 @@ -.panel.panel-default.answer-box{'data-id' => a.id} +.panel.panel-default.answer-box{data: { id: a.id }} - if @question.nil? .panel-heading .media diff --git a/app/views/shared/_answerbox_buttons.html.haml b/app/views/shared/_answerbox_buttons.html.haml index 869ce3c2..d2b05016 100644 --- a/app/views/shared/_answerbox_buttons.html.haml +++ b/app/views/shared/_answerbox_buttons.html.haml @@ -5,16 +5,16 @@ users smiled this - if user_signed_in? - if current_user.smiled? a - %button.btn.btn-info.btn-sm{type: :button, name: 'ab-smile', 'data-a-id' => a.id, 'data-action' => 'unsmile'} + %button.btn.btn-info.btn-sm{type: :button, name: 'ab-smile', data: { a_id: a.id, action: :unsmile }} %i.fa.fa-frown-o %span{id: "ab-smile-count-#{a.id}"}= a.smile_count - else - %button.btn.btn-info.btn-sm{type: :button, name: 'ab-smile', 'data-a-id' => a.id, 'data-action' => 'smile'} + %button.btn.btn-info.btn-sm{type: :button, name: 'ab-smile', data: { a_id: a.id, action: :smile }} %i.fa.fa-smile-o %span{id: "ab-smile-count-#{a.id}"}= a.smile_count -%button.btn.btn-primary.btn-sm{type: :button, name: 'ab-comments', 'data-a-id' => a.id, 'data-state' => :hidden} +%button.btn.btn-primary.btn-sm{type: :button, name: 'ab-comments', data: { a_id: a.id, state: :hidden }} %i.fa.fa-comments %span{id: "ab-comment-count-#{a.id}"}= a.comment_count - if privileged? a.user - %button.btn.btn-danger.btn-sm{name: 'ab-destroy', 'data-a-id' => a.id} + %button.btn.btn-danger.btn-sm{name: 'ab-destroy', data: { a_id: a.id }} %i.fa.fa-trash-o \ No newline at end of file diff --git a/app/views/shared/_comments.html.haml b/app/views/shared/_comments.html.haml index 05a495be..1d1a1099 100644 --- a/app/views/shared/_comments.html.haml +++ b/app/views/shared/_comments.html.haml @@ -3,11 +3,11 @@ - else # TODO: some design guy (i.e. pixeldesu) should make some black magic here %ul.comments - a.comments.all.each do |comment| - %li{'data-comment-id' => comment.id} + %li{data: { comment_id: comment.id }} %img.img-answerbox-small{src: gravatar_url(comment.user)} %b= user_screen_name comment.user = comment.content - if user_signed_in? .form-group.has-feedback{name: 'ab-comment-new-group', 'data-a-id' => a.id} - %input.form-control{type: :text, placeholder: 'Comment...', name: 'ab-comment-new', 'data-a-id' => a.id} + %input.form-control{type: :text, placeholder: 'Comment...', name: 'ab-comment-new', data: {a_id: a.id }} %span.text-muted.form-control-feedback.comment-count{id: "ab-comment-charcount-#{a.id}"} 160 \ No newline at end of file diff --git a/app/views/shared/_modal_ask_followers.html.haml b/app/views/shared/_modal_ask_followers.html.haml index cd17c711..597fc28a 100644 --- a/app/views/shared/_modal_ask_followers.html.haml +++ b/app/views/shared/_modal_ask_followers.html.haml @@ -10,4 +10,4 @@ %textarea.form-control{:name => "qb-all-question", :placeholder => "Type your question hereā€¦"} .modal-footer %button.btn.btn-default{"data-dismiss" => "modal", :type => "button"} Cancel - %button.btn.btn-primary{name: 'qb-all-ask', 'data-loading-text' => "Asking...", :type => "button"} Ask \ No newline at end of file + %button.btn.btn-primary{name: 'qb-all-ask', :type => "button", data: {loading_text: 'Asking...' }} Ask \ No newline at end of file diff --git a/app/views/shared/_questionbox.html.haml b/app/views/shared/_questionbox.html.haml index 7662547c..dfaff539 100644 --- a/app/views/shared/_questionbox.html.haml +++ b/app/views/shared/_questionbox.html.haml @@ -19,7 +19,7 @@ .col-xs-6 %p.pull-right %input{name: 'qb-to', type: 'hidden', :value => @user.id}/ - %button.btn.btn-primary{name: 'qb-ask', 'data-loading-text' => "Asking...", "data-promote" => user_signed_in? ? "false" : "true", :type => "button"} Ask + %button.btn.btn-primary{name: 'qb-ask', :type => "button", data: {loading_text: 'Asking...', promote: user_signed_in? ? "false" : "true" }} Ask - unless user_signed_in? #question-box-promote.row{:style => "display: none;"} .row diff --git a/app/views/static/index.html.haml b/app/views/static/index.html.haml index eefe36a5..9fb44882 100644 --- a/app/views/static/index.html.haml +++ b/app/views/static/index.html.haml @@ -44,7 +44,7 @@ #pagination= will_paginate @timeline, renderer: BootstrapPagination::Rails, page_links: false - if @timeline.next_page - %button#load-more-btn.btn.btn-default{type: :button, 'data-current-page' => @timeline.current_page} + %button#load-more-btn.btn.btn-default{type: :button, data: { current_page: @timeline.current_page }} Load more .visible-xs= render 'shared/links' - else diff --git a/app/views/user/_actions.html.haml b/app/views/user/_actions.html.haml index 584a1de1..6941970f 100644 --- a/app/views/user/_actions.html.haml +++ b/app/views/user/_actions.html.haml @@ -3,8 +3,8 @@ %a.btn.btn-default.btn-block{href: edit_user_profile_path} Edit profile - else - if current_user.following? @user - %button#editprofile.btn.btn-default.btn-block{type: :button, name: 'user-action', 'data-action' => :unfollow, 'data-target' => @user.screen_name} + %button#editprofile.btn.btn-default.btn-block{type: :button, name: 'user-action', data: { action: :unfollow, target: @user.screen_name }} Unfollow - else - %button#editprofile.btn.btn-primary.btn-block{type: :button, name: 'user-action', 'data-action' => :follow, 'data-target' => @user.screen_name} + %button#editprofile.btn.btn-primary.btn-block{type: :button, name: 'user-action', data: { action: :follow, target: @user.screen_name }} Follow \ No newline at end of file diff --git a/app/views/user/show.html.haml b/app/views/user/show.html.haml index 88e11535..e0e95543 100644 --- a/app/views/user/show.html.haml +++ b/app/views/user/show.html.haml @@ -50,6 +50,6 @@ #pagination= will_paginate @answers, renderer: BootstrapPagination::Rails, page_links: false - if @answers.next_page - %button#load-more-btn.btn.btn-default{type: :button, 'data-current-page' => @answers.current_page} + %button#load-more-btn.btn.btn-default{type: :button, data: { current_page: @answers.current_page }} Load more .visible-xs= render 'shared/links'