preston/bittorious

View on GitHub
app/views/welcome/_dialogs.html.slim

Summary

Maintainability
Test Coverage
.modal.fade#create_feed_dialog
    .modal-dialog
        .modal-content
            .modal-header
                button type="button" class="close" data-dismiss="modal" aria-hidden="true" ×
                h1 Create a brand new feed.
            .modal-body

                form#feed_form name="feed_form"
                
                    .form-group
                        label for="name"
                            | Name
                            span.text-muted ng-show='feed_form.name.$error.required'
                                |  (Required)

                        input#feed_name.form-control type="text" name='name' placeholder="My Awesome Data Feed" ng-model="newFeed.name" required="true" autofocus="true"
                                
                    .form-group
                        label for="description"
                            | Description
                            span.text-muted ng-show='feed_form.description.$error.required'
                                |  (Required)
                        textarea#feed_description.form-control name="description" placeholder="Nullam id dolor id nibh ultricies vehicula ut id elit. Morbi leo risus, porta acconsectetur ac, vestibulum at eros." rows="4" ng-model="newFeed.description" required="true"

                    .checkbox
                        label
                            input#form_enable_public_archiving type="checkbox" name="enable_public_archiving" ng-model="newFeed.enable_public_archiving"
                                | Enable public archiving.
                            p.help-block ng-show="newFeed.enable_public_archiving" All torrents published to this feed will be eligible for replication via the anonymous volunteer network. All feed data will effectively become publically accessable. Please be sure to not public sensitive torrents to the feed without encrypting the files!

                    .form-group ng-show="newFeed.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="newFeed.replication_percentage"
                        p.help-block 1-100. This is used by volunteer peer to determine how much of each torrent should be replicated. A higher number provides the maximum amount of redundancy, while a lower number provides the largest amount of network storage capacity.
                        
                    button.btn.btn-primary.btn-lg type="submit" ng-click="createFeed()" ng-disabled="feed_form.$invalid"
                        span.glyphicon.glyphicon-floppy-disk
                        |  Create it!

.modal.fade#create_torrent_dialog
    .modal-dialog
        .modal-content
            .modal-header
                button type="button" class="close" data-dismiss="modal" aria-hidden="true" ×
                h3
                    | Publish a torrent to 
                    span ng-bind="selectedFeed.name"
            .modal-body
                = render partial: 'torrents/form'