~sirn/fanboi2

dd409e9a02bd7b4803f2a2ef0152dcaa0c0c4e09 — Kridsada Thanabulpong 6 years ago de58a27 + ca56bbc
Merge branch 'feature/experiment-view2' of github.com:pxfs/fanboi2 into feature/experiment-view2

  Conflicts:
 	Vagrantfile
6 files changed, 29 insertions(+), 30 deletions(-)

M Vagrantfile
M config.coffee
M fanboi2/serializers.py
M fanboi2/tests/test_serializers.py
M package.json
M setup.py
M Vagrantfile => Vagrantfile +1 -1
@@ 60,7 60,7 @@ Vagrant.configure("2") do |config|
    $HOME/pypy3/bin/pip3 install -e .
    $HOME/pypy3/bin/alembic upgrade head

    npm install
    npm install --no-bin-link
    $HOME/nodejs/bin/brunch build
  EOF
end

M config.coffee => config.coffee +9 -1
@@ 3,6 3,13 @@ exports.config =
    public: 'fanboi2/static'
    watched: ['fanboi2/resources']

  plugins:
    postcss:
      processors: [
        require('autoprefixer'),
        require('csswring')
      ]

  files:
    javascripts:
      joinTo:


@@ 13,7 20,8 @@ exports.config =
          'fanboi2/resources/vendor/javascripts/jquery.js',
          'fanboi2/resources/vendor/javascripts/lodash.js',
          'fanboi2/resources/vendor/javascripts/modernizr.js',
          'fanboi2/resources/vendor/javascripts/backbone.js']
          'fanboi2/resources/vendor/javascripts/backbone.js'
        ]

    stylesheets:
      joinTo:

M fanboi2/serializers.py => fanboi2/serializers.py +1 -2
@@ 92,6 92,7 @@ def _post_serializer(obj, request):
        'type': 'post',
        'id': obj.id,
        'body': obj.body,
        'body_formatted': format_post(None, request, obj),
        'bumped': obj.bumped,
        'created_at': obj.created_at,
        'ident': obj.ident,


@@ 104,8 105,6 @@ def _post_serializer(obj, request):
            query=obj.number,
        ),
    }
    if request.params.get('formatted'):
        result['body_formatted'] = format_post(None, request, obj)
    return result



M fanboi2/tests/test_serializers.py => fanboi2/tests/test_serializers.py +1 -11
@@ 122,6 122,7 @@ class TestJSONRendererWithModel(ModelMixin, RegistryMixin, unittest.TestCase):
        response = self._makeOne(post, request=request)
        self.assertEqual(response['type'], 'post')
        self.assertEqual(response['body'], 'Hello, world!')
        self.assertEqual(response['body_formatted'], '<p>Hello, world!</p>')
        self.assertEqual(response['topic_id'], topic.id)
        self.assertEqual(
            response['path'],


@@ 132,17 133,6 @@ class TestJSONRendererWithModel(ModelMixin, RegistryMixin, unittest.TestCase):
        self.assertIn('name', response)
        self.assertIn('number', response)
        self.assertNotIn('ip_address', response)
        self.assertNotIn('body_formatted', response)

    def test_post_with_formatted(self):
        board = self._makeBoard(title='Foobar', slug='foo')
        topic = self._makeTopic(board=board, title='Baz')
        post = self._makePost(topic=topic, body='Hello, world!')
        request = self._makeRequest(params={'formatted': True})
        config = self._makeConfig(request, self._makeRegistry())
        config.add_route('api_topic_posts_scoped', '/topic/{topic}/{query}/')
        response = self._makeOne(post, request=request)
        self.assertEqual(response['body_formatted'], '<p>Hello, world!</p>')


class TestJSONRendererWithTask(

M package.json => package.json +9 -6
@@ 4,11 4,14 @@
    "description": "Assets for Fanboi2 board app",
    "version": "0.2.0",
    "dependencies": {
        "javascript-brunch":    ">= 1.7 < 1.8",
        "css-brunch":           ">= 1.7 < 1.8",
        "stylus-brunch":        ">= 1.7 < 1.8",
        "uglify-js-brunch":     ">= 1.7 < 1.8",
        "autoprefixer-brunch":  ">= 1.7 < 1.8",
        "clean-css-brunch":     ">= 1.7 < 1.8"
        "javascript-brunch":    "^1.7.1",
        "babel-brunch":         "^5.1.2",
        "uglify-js-brunch":     "^1.7.8",

        "css-brunch":           "^1.7.0",
        "stylus-brunch":        "^1.8.1",
        "postcss-brunch":       "^0.4.1",
        "autoprefixer":         "^5.2.0",
        "csswring":             "^3.0.5"
    }
}

M setup.py => setup.py +8 -9
@@ 67,12 67,11 @@ setup(name='fanboi2',
      zip_safe=False,
      test_suite='fanboi2.tests',
      install_requires=requires,
      entry_points="""\
      [paste.app_factory]
      main = fanboi2:main
      [console_scripts]
      fb2_create_board = fanboi2.scripts.create_board:main
      fb2_update_board = fanboi2.scripts.update_board:main
      fb2_celery = fanboi2.scripts.celery:main
      """,
      )
      entry_points={
          "paste.app_factory": ["main = fanboi2:main"],
          "console_scripts": [
              "fb2_create_board = fanboi2.scripts.create_board:main",
              "fb2_update_board = fanboi2.scripts.update_board:main",
              "fb2_celery = fanboi2.scripts.celery:main",
          ]
      })