johnnyleung / issues-test

0 stars 0 forks source link

ES6 #61

Open johnnyleung opened 9 years ago

johnnyleung commented 9 years ago
Template.viewer.helpers({
    issue: function () {
        let currentIssue = Gitssues.settings.currentIssue.get();
        if (!currentIssue) {
            return null;
        }
        return Gitssues.issues.collection.findOne({
            _id: currentIssue.id
        });
    },
    renderMarkdown: function (markdown) {
        if (!markdown) {
            return null;
        }
        let html = marked(markdown);
        return html;
    },
    comments: function () {
        let currentIssue = Gitssues.settings.currentIssue.get(), currentRepoId = Gitssues.settings.currentRepo.get();
        return Gitssues.comments.collection.find({ repo_id: currentRepoId, issue_number: currentIssue.number }, {
            sort: {
                created_at: 1
            }
        });
    },
    formattedCreationDate: function () {
        return Gitssues.helpers.time.formatDateTime(new Date(this.created_at));
    }
});

Change to Python:

@requires_authorization
def somefunc(param1='', param2=0):
    r'''A docstring'''
    if param1 > param2: # interesting
        print 'Gre\'ater'
    return (param2 - param1 + 1) or None

class SomeClass:
    pass

>>> message = '''interpreter
... prompt'''
johnnyleung commented 9 years ago

Comment:

.btn-panel-selector {
    border-radius: 0;
    color: #ccc;

    &.active {
        color: #337ab7;
        border-top: 1px solid #337ab7;
    }

    &:hover,
    &:active,
    &:focus {
        text-decoration: none;
        outline: 0 !important;
    }
}