mirror of
https://github.com/openSUSE/osem.git
synced 2026-08-13 19:54:02 +00:00
fix sorting in events#index with button functionality and add color/text to switch buttons
This commit is contained in:
parent
b8b3703175
commit
fbdec2a58e
5 changed files with 26 additions and 19 deletions
|
|
@ -35,6 +35,7 @@
|
||||||
//= require osem-datatables
|
//= require osem-datatables
|
||||||
//= require osem-tickets
|
//= require osem-tickets
|
||||||
//= require bootstrap-switch
|
//= require bootstrap-switch
|
||||||
|
//= require osem-switch
|
||||||
|
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
$('a[disabled=disabled]').click(function(event){
|
$('a[disabled=disabled]').click(function(event){
|
||||||
|
|
|
||||||
16
app/assets/javascripts/osem-switch.js
Normal file
16
app/assets/javascripts/osem-switch.js
Normal file
|
|
@ -0,0 +1,16 @@
|
||||||
|
$(function () {
|
||||||
|
$(document).ready(function() {
|
||||||
|
$("[class='switch-checkbox']").bootstrapSwitch();
|
||||||
|
|
||||||
|
$('input[class="switch-checkbox"]').on('switchChange.bootstrapSwitch', function(event, state) {
|
||||||
|
url = "/admin/conference/" + this.name + "/events/" + this.value
|
||||||
|
|
||||||
|
$.ajax({
|
||||||
|
url: url,
|
||||||
|
type: 'PATCH',
|
||||||
|
data: { event: { is_highlight: state } },
|
||||||
|
dataType: 'script'
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
@ -33,7 +33,10 @@
|
||||||
%b Highlight
|
%b Highlight
|
||||||
%td
|
%td
|
||||||
= check_box_tag @conference.short_title, @event.id, @event.is_highlight, class: 'switch-checkbox',
|
= check_box_tag @conference.short_title, @event.id, @event.is_highlight, class: 'switch-checkbox',
|
||||||
data: { size: "small" }
|
data: { size: "small",
|
||||||
|
off_color: 'warning',
|
||||||
|
on_text: 'Yes',
|
||||||
|
off_text: 'No' }
|
||||||
|
|
||||||
%tr
|
%tr
|
||||||
%td
|
%td
|
||||||
|
|
|
||||||
|
|
@ -74,7 +74,10 @@
|
||||||
Unknown speaker
|
Unknown speaker
|
||||||
%td{'data-order' => "#{event.is_highlight}"}
|
%td{'data-order' => "#{event.is_highlight}"}
|
||||||
= check_box_tag @conference.short_title, event.id, event.is_highlight, class: 'switch-checkbox',
|
= check_box_tag @conference.short_title, event.id, event.is_highlight, class: 'switch-checkbox',
|
||||||
data: { size: "small" }
|
data: { size: "small",
|
||||||
|
off_color: 'warning',
|
||||||
|
on_text: 'Yes',
|
||||||
|
off_text: 'No' }
|
||||||
|
|
||||||
%td
|
%td
|
||||||
.btn-group
|
.btn-group
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,7 @@
|
||||||
%meta{:content => "", :name => "author"}
|
%meta{:content => "", :name => "author"}
|
||||||
= stylesheet_link_tag "application", :media => "all"
|
= stylesheet_link_tag "application", :media => "all"
|
||||||
= javascript_include_tag "application"
|
= javascript_include_tag "application"
|
||||||
|
|
||||||
= csrf_meta_tags
|
= csrf_meta_tags
|
||||||
:javascript
|
:javascript
|
||||||
window.liveSettings = {
|
window.liveSettings = {
|
||||||
|
|
@ -15,23 +16,6 @@
|
||||||
detectlang: true,
|
detectlang: true,
|
||||||
autocollect: true
|
autocollect: true
|
||||||
};
|
};
|
||||||
|
|
||||||
$(document).ready(function() {
|
|
||||||
$("[class='switch-checkbox']").bootstrapSwitch();
|
|
||||||
});
|
|
||||||
|
|
||||||
$(document).ready(function() {
|
|
||||||
$('input[class="switch-checkbox"]').on('switchChange.bootstrapSwitch', function(event, state) {
|
|
||||||
url = "/admin/conference/" + this.name + "/events/" + this.value
|
|
||||||
|
|
||||||
$.ajax({
|
|
||||||
url: url,
|
|
||||||
type: 'PATCH',
|
|
||||||
data: { event: { is_highlight: state } },
|
|
||||||
dataType: "script"
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
|
||||||
= content_for(:script_head)
|
= content_for(:script_head)
|
||||||
=# javascript_include_tag "//cdn.transifex.com/live.js"
|
=# javascript_include_tag "//cdn.transifex.com/live.js"
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue