preston/bittorious

View on GitHub
app/views/feeds/_form.html.slim

Summary

Maintainability
Test Coverage
form#update_feed_form role="form" name="update_feed_form"

    .form-group
        label for="feed_name" Name
        input#feed_name.form-control type="text" placeholder="My Awesome Data Feed" required="true" ng-model="selectedFeed.name"
                
    .form-group
        label for="feed_description" Description
        textarea#feed_description.form-control placeholder="Nullam id dolor id nibh ultricies vehicula ut id elit. Morbi leo risus, porta acconsectetur ac, vestibulum at eros." rows="4" required="true" ng-model="selectedFeed.description"

    .checkbox
        label
            input#form_enable_public_archiving type="checkbox" name="form[enable_public_archiving]" ng-model="selectedFeed.enable_public_archiving"
                p
                    b Enable Public Archiving
                    br
                    | All feed data will replicate to anonymous volunteer peers, which is roughly equivalent to granting #{Permission::SUBSCRIBER_ROLE} permissions to all anonymous users. 
                    b When changing these settings, users may have to reimport the torrent files into their client(s) to receive the new settings
                    | , depending on if they're subscribed to the RSS feed and have their client configured to automatically apply torrent updates.

    .form-group ng-show="selectedFeed.enable_public_archiving"
        label for="feed_replication_percentage" Target Replication Percentage
        input#feed_replication_percentage.form-control type="number" min="1" max="100" step="1" required="required" ng-model="selectedFeed.replication_percentage"

    
.row
    .col-md-9
        button.btn.btn-primary.btn-lg type="submit" ng-click="updateFeed()" ng-disabled="update_feed_form.$invalid" ng-show="selectedFeed.can_update"
            = text_with_icon('Save', 'floppy-disk')
    .col-md-3
        button.btn.btn-lg.btn-danger ng-click="deleteFeed(selectedFeed)" ng-confirm-click="This will permanently delete the feed and all torrents from the system. Existing subscribers will no longer receive data. This cannot be undone. Are you completely 100% sure you want to delete this feed?" ng-show="selectedFeed.can_delete"
            = text_with_icon('Delete this feed forever!', 'trash')