Github user garrensmith commented on a diff in the pull request:

    https://github.com/apache/couchdb-fauxton/pull/208#discussion_r22057853
  
    --- Diff: app/addons/cors/templates/cors.html ---
    @@ -0,0 +1,31 @@
    +<!--
    +Licensed under the Apache License, Version 2.0 (the "License"); you may not
    +use this file except in compliance with the License. You may obtain a copy 
of
    +the License at
    +
    +  http://www.apache.org/licenses/LICENSE-2.0
    +
    +Unless required by applicable law or agreed to in writing, software
    +distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
    +WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
    +License for the specific language governing permissions and limitations 
under
    +the License.
    +-->
    +
    +<header id="cors-header">
    +  <p><a href="">Cross-Origin Resource Sharing</a> (CORS) lets you connect 
to remote servers directly from the browser, so you can host browser-based apps 
on static pages and talk directly with CouchDB to load your data.</p>
    +</header>
    +
    +<form id="corsForm">
    +
    +  <div class="cors-enable">
    +    <label class="checkbox">
    +      <input type="checkbox" class="enable_cors" name="enable_cors" <% if  
(typeof enable_cors !== 'undefined' && enable_cors =="true") { %> 
checked="checked" <% } %>> Enable CORS
    --- End diff --
    
    Could you move the logic of the if statement into the serialise function 
and then just have a resulting boolean here. So in serialze you would have:
    
        var isCorsEnabled = false;
        if (!_.isUndefined(enable_cors) && enable_cors =="true") {
         isCorsEnabled = true;
        }
        return {
         isCorsEnabled: isCorsEnabled
        };


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to