Giter Club home page Giter Club logo

project's Introduction

大作业 - 课程系统改进

原项目的 github 地址戳这里

本项目用 cloud9 作为 IDE,项目部署在 Heroku 上,项目地址点这里

项目改进点

  • 添加了课程考试安排的相关信息
  • 对管理员后台进行了汉化

使用

1.学生登陆:

账号:[email protected]

密码:password

2.老师登陆:

账号:[email protected]

密码:password

3.管理员登陆:

账号:[email protected]

密码:password

账号中数字都可以替换成2,3...等等

效果截图

管理员可以在后台的课程编辑页面对每个课程的"考试时间"、"考试地点"信息进行添加、修改、删除

老师在课程管理页面点击左栏的"考试安排"可以看到自己所授课程的考试安排情况

学生在我的课程页面点击左栏的"考试安排"可以看到自己所选课程的考试安排情况

下面三张图是对管理员后台界面各字段进行汉化的结果

项目实现的大致过程

添加考试信息

  1. 修改模型:在 Course 模型( /db/migrate/20160907152104_create_courses.rb )中添加 考试时间(exam_time) 和 考试地点(exam_room) 两个属性字段
  2. 修改控制器:在 courses 控制器( /app/controllers/courses_controller.rb )中定义 exam 方法,并在路由文件( /config/routes.rb )中添加该方法
  3. 修改视图:在 courses 的视图文件夹中添加用来显示考试安排信息的页面文件( /app/views/courses/exam.html.erb ),并在视图公用的显示左栏的页面文件( /app/views/shared/_sidenav.html.erb )中加入"考试安排"元素

管理员界面汉化

  1. 修改应用配置文件( /config/application.rb ),引入 I18n 模块,并设置默认本地化选项为"zh-CN"
  2. 添加 rails_admin.zh-CN.yml 文件(添加路径:/config/locales/rails_admin.zh-CN.yml ),用来汉化 rails_admin 后台界面默认的一些字段元素
  3. 添加 zh-CN.yml 文件(添加路径:/config/locales/zh-CN.yml ),用来汉化各数据模型的属性字段

project's People

Contributors

pengzhaoqing avatar githttt avatar qiaocode avatar lioncruise avatar

Watchers

James Cloos avatar

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.