Files @ 31f510a88584
Branch filter:

Location: kallithea/rhodecode/templates/base/default_perms_box.html - annotation

Bradley M. Kuhn
Update minified YUI to version 2.9 built from Source.

yui.2.9.js used to be a minified version of YUI 2.9 until 5143b8df576c updated
it to something else and applied more aggresive minification. We stick to a
clean but minified version 2.9.

The license of YUI is BSD 3-clause, as described on
http://yuilibrary.com/license/ .

Since the minified version combines with GPLv3'd Javascript, it is only GPLv3'd
compliant to distribute this Object Code version with the Corresponding Source
(or offer therefor).

This yui.2.9.js is built from Source this way:
git clone https://github.com/yui/builder
git clone https://github.com/yui/yui2
cd yui2/
git checkout hudson-yui2-2800
ln -sf JumpToPageDropDown.js src/paginator/js/JumpToPageDropdown.js # work around inconsistent casing
rm -f tmp.js
for m in yahoo event dom connection animation dragdrop element datasource autocomplete container event-delegate json datatable paginator; do
rm -f build/$m/$m.js; ( cd src/$m && ant build deploybuild ) && sed -e 's,@VERSION@,2.9.0,g' -e 's,@BUILD@,2800,g' build/$m/$m.js >> tmp.js
done
java -jar ../builder/componentbuild/lib/yuicompressor/yuicompressor-2.4.4.jar tmp.js -o yui.2.9.js

The source is mirrored and available on https://kallithea-scm.org/repos/mirror .
## snippet for displaying default permission box
## usage:
##    <%namespace name="dpb" file="/base/default_perms_box.html"/>
##    ${dpb.default_perms_box(<url_to_form>)}


<%def name="default_perms_box(form_url)">
${h.form(form_url, method='put')}
    <div class="form">
        <!-- fields -->
        <div class="fields">
             <div class="field">
                <div class="label label-checkbox">
                    <label for="inherit_default_permissions">${_('Inherit from defaults')}:</label>
                </div>
                <div class="checkboxes">
                    ${h.checkbox('inherit_default_permissions',value=True)}
                    <span class="help-block">
                    ${h.literal(_('Select to inherit permissions from %s permissions settings, and default IP address whitelist.')
                                % h.link_to('default global', url('admin_permissions')))}
                    </span>
                </div>
             </div>

             <div id="inherit_overlay">
             <div class="field">
                <div class="label label-checkbox">
                    <label for="create_repo_perm">${_('Create repositories')}:</label>
                </div>
                <div class="checkboxes">
                    ${h.checkbox('create_repo_perm',value=True)}
                    <span class="help-block">
                    ${h.literal(_('Select this option to allow repository creation for this user'))}
                    </span>
                </div>
             </div>

             <div class="field">
                <div class="label label-checkbox">
                    <label for="create_user_group_perm">${_('Create user groups')}:</label>
                </div>
                <div class="checkboxes">
                    ${h.checkbox('create_user_group_perm',value=True)}
                    <span class="help-block">
                        ${h.literal(_('Select this option to allow user group creation for this user'))}
                    </span>
                </div>
             </div>

             <div class="field">
                <div class="label label-checkbox">
                    <label for="fork_repo_perm">${_('Fork repositories')}:</label>
                </div>
                <div class="checkboxes">
                    ${h.checkbox('fork_repo_perm',value=True)}
                    <span class="help-block">
                        ${h.literal(_('Select this option to allow repository forking for this user'))}
                    </span>
                </div>
             </div>

            </div>
            <div class="buttons">
              ${h.submit('save',_('Save'),class_="btn")}
              ${h.reset('reset',_('Reset'),class_="btn")}
            </div>
        </div>
    </div>
${h.end_form()}

## JS
<script>
YUE.onDOMReady(function(e){

    var show_custom_perms = function(inherit_default){
        if(inherit_default){
            YUD.setStyle('inherit_overlay', 'display', 'none');
        }
        else{
            YUD.setStyle('inherit_overlay', 'display', '');
        }
    }

    var defaults = YUD.get('inherit_default_permissions').checked;
    show_custom_perms(defaults);
    YUE.on('inherit_default_permissions', 'change', function(e){
        if(YUD.get('inherit_default_permissions').checked){
            show_custom_perms(true);
        }
        else{
            show_custom_perms(false);
        }
    })
})
</script>

</%def>