Coder Social home page Coder Social logo

hudson's People

Contributors

alex031029 avatar davidsun avatar irachex avatar jiangliyang avatar scapefish avatar soshkt avatar zinccopper avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

Forkers

soshkt

hudson's Issues

数据统计

原话:
作为管理员用户,我可以完成一些信息发布的统计工作(比如一星期内和某内容相关的微博总数),从而更好地管理网站。

Follow test

测试 Follow 功能,Follow 需要登录,同时是不能关注自己的。

关注和被关注的列表

如果关注(粉丝)的人数超过5人,关注列表显示“全部关注”和“全部粉丝”,接着弹出 Model,显示所有的关注(粉丝)。
需要加一组获取 follower 和 followee 的 API,定义为
GET /users/:userId/followers
GET /users/:userId/followees

PostComment Model

File: sns/models/post_comment.py
Class: PostComment
Method: (Not Assigned)

PostLike Model

File: sns/models/post_like.py
Class: PostLike
Method: (Not Assigned)

个人信息编辑

Template: templates/sns/users/edit.haml
Forms: sns/views/forms/users.py#Edit
Views: sns/views/users.py#edit (GET, POST)

Follow RESTful design of URL.

可在好友列表里面直接关注好友

“我的关注”和“我的粉丝”列表里面的每一项内容右边显示“关注”和“已关注”链接,可以直接关注(或取消关注)此用户。

给 post 添加评论

包括两个部分:

  1. 前端的显示:呈现最近的评论,以及评论框
  2. js提交评论
    评论的提交已经完成了,见 posts.py。

注意,保证代码的简洁,主要的部分加到 site.js 当中去。

Post 搜索

Views: sns/views/posts.py#search
Templates: templates/sns/posts/search.haml

使用MySQL的like “%Keyword%” 进行搜索。

Post test

为 Posts 添加测试。注意检查:未登录、长度、空的情况。

标签

可以给状态加上标签。
添加 PostTag Model,关联 User/Post。每个用户只能打一个标签。

查看所有 notificaion

显示一个用户的所有 notificaion。
templates: notifications/index.haml
views: notificaions.py#index

Notification Model

File: sns/models/notification.py
Class: Notification
Method: (Not Assigned)

@好友 功能

在输入评论时支持@好友。
@好友的时候,弹出选择框。选择框的好友排序优先级为:

  1. 前缀匹配的
  2. 最近聊天过的(5条记录)
  3. 其他好友

在前端显示评论的时候,让@的内容可点击。点击后到用户的个人主页。

收藏的 Post 列表

Views: sns/views/posts.py#liked
Templates: templates/sns/posts/liked.haml

请先看一下首页的 Post 列表是怎么实现的。

个人主页

Templates: templates/sns/users/show.haml
Views: sns/views/users.py#show

显示内容:
左侧:留言按钮、关注按钮,该用户的新鲜事
右侧:他关注的人,以及关注他的人

Message Model

File: sns/models/message.py
Class: Message
Method: (Not Assigned)

Message test

测试 Message 的 POST 是否合法。注意,有没有登录、过长和空的情况。

重构js控件

现在收藏等功能内容重复,需要合并、整合文件。

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.