Skip to content

Commit

Permalink
added missing qoutes in script and added routes expose parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
Simonas Šerlinskas committed Sep 5, 2016
1 parent a308105 commit 760e287
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 5 deletions.
12 changes: 12 additions & 0 deletions Resources/config/routing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,20 @@ ongr_settings_search_page:
ongr_settings_profiles:
path: /profiles
defaults: { _controller: ONGRSettingsBundle:Profiles:list }
options:
expose: true

ongr_settings_profiles_get_all:
path: /profiles/get_all
defaults: { _controller: ONGRSettingsBundle:Profiles:getAllProfiles }
options:
expose: true

ongr_settings_profiles_toggle:
path: /profiles/toggle
defaults: { _controller: ONGRSettingsBundle:Profiles:toggleProfile }
options:
expose: true

ongr_settings_profiles_get_all_detailed:
path: /profiles/get_all_detailed
Expand All @@ -33,10 +39,14 @@ ongr_settings_profiles_get_all_detailed:
ongr_settings_settings:
path: /settings
defaults: { _controller: ONGRSettingsBundle:Settings:list }
options:
expose: true

ongr_settings_setting_submit:
path: /settings/submit
defaults: { _controller: ONGRSettingsBundle:Settings:submit }
options:
expose: true

ongr_settings_settings_update_value:
path: /settings/update-value
Expand All @@ -47,6 +57,8 @@ ongr_settings_settings_update_value:
ongr_settings_settings_delete:
path: /settings/delete/{id}
defaults: { _controller: ONGRSettingsBundle:Settings:delete }
options:
expose: true

#ongr_settings_profiles_fallback:
# path: /profiles/{url}
Expand Down
9 changes: 5 additions & 4 deletions Resources/js/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,9 @@ $(document).ready(function () {
$('#settings_filter').append(newSettingButton.prop('outerHTML'));

function appendNewProfile(element, check) {
var checked = '';
if (check) {
var checked = 'checked="checked';
checked = 'checked="checked"';
}
var input = '<label class="profile-choice"><input type="checkbox" '+checked+' name="setting[profile][]" value="'+element+'">'+element+'</label>';
$('#profiles-container .checkbox').append(input);
Expand All @@ -71,10 +72,10 @@ $(document).ready(function () {
$.post(Routing.generate('ongr_settings_profiles_get_all'), function (data) {
$('#profiles-loader').hide();
data.forEach(function (element) {
if ($.inArray(element, select)) {
appendNewProfile(element);
} else {
if ($.inArray(element, select) > -1) {
appendNewProfile(element, true);
} else {
appendNewProfile(element, false);
}
});
})
Expand Down
2 changes: 1 addition & 1 deletion Resources/public/script.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 760e287

Please sign in to comment.