mirror of
https://github.com/Retrospring/retrospring.git
synced 2025-01-19 18:06:04 +01:00
Merge branch 'inbox-options'
This commit is contained in:
commit
5ce2368310
2 changed files with 32 additions and 5 deletions
|
@ -121,3 +121,18 @@ $(document).on "click", "button[name=ib-destroy]", ->
|
||||||
complete: (jqxhr, status) ->
|
complete: (jqxhr, status) ->
|
||||||
btn.button "reset"
|
btn.button "reset"
|
||||||
$("textarea[name=ib-answer][data-id=#{iid}]").removeAttr "readonly"
|
$("textarea[name=ib-answer][data-id=#{iid}]").removeAttr "readonly"
|
||||||
|
|
||||||
|
# Toggle button
|
||||||
|
$(document).on "click", "button[name=ib-options]", ->
|
||||||
|
btn = $(this)
|
||||||
|
ibid = btn[0].dataset.ib_id
|
||||||
|
state = btn[0].dataset.state
|
||||||
|
optionBox = $("#ib-options-#{ibid}")
|
||||||
|
|
||||||
|
switch state
|
||||||
|
when 'hidden'
|
||||||
|
optionBox.slideDown()
|
||||||
|
btn[0].dataset.state = 'shown'
|
||||||
|
when 'shown'
|
||||||
|
optionBox.slideUp()
|
||||||
|
btn[0].dataset.state = 'hidden'
|
|
@ -23,8 +23,20 @@
|
||||||
Answer
|
Answer
|
||||||
%button.btn.btn-danger{name: 'ib-destroy', data: { ib_id: i.id }}
|
%button.btn.btn-danger{name: 'ib-destroy', data: { ib_id: i.id }}
|
||||||
Delete
|
Delete
|
||||||
- current_user.services.each do |service|
|
%button.btn.btn-default{name: 'ib-options', data: { ib_id: i.id, state: :hidden }}
|
||||||
%label
|
Options
|
||||||
%input{type: 'checkbox', name: 'ib-share', checked: :checked, data: { ib_id: i.id, service: service.provider }}
|
.panel-footer{id: "ib-options-#{i.id}", style: 'display: none'}
|
||||||
Post to
|
%h4 Sharing
|
||||||
= service.provider.capitalize
|
- if @services.count > 0
|
||||||
|
.row
|
||||||
|
- current_user.services.each do |service|
|
||||||
|
.col-md-2.col-sm-4.col-xs-6
|
||||||
|
%label
|
||||||
|
%input{type: 'checkbox', name: 'ib-share', checked: :checked, data: { ib_id: i.id, service: service.provider }}
|
||||||
|
Post to
|
||||||
|
= service.provider.capitalize
|
||||||
|
- else
|
||||||
|
%p
|
||||||
|
You have not connected any services yet. Visit your
|
||||||
|
= link_to "service settings", services_path
|
||||||
|
to connect one.
|
Loading…
Reference in a new issue