Skip to content

Commit

Permalink
version 1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
PENGZhaoqing committed Sep 10, 2016
1 parent 9418620 commit 3b52479
Show file tree
Hide file tree
Showing 16 changed files with 48 additions and 196 deletions.
12 changes: 6 additions & 6 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
source 'https://gems.ruby-china.org'


gem 'bootstrap-sass','~> 3.3.7'
gem 'bcrypt','~> 3.1.11'
gem 'faker','~> 1.6.3'
gem 'rails_admin','~> 0.8.1'

# gem 'carrierwave'
# gem 'paperclip'
gem 'bootstrap-sass'
# gem 'will_paginate'
gem 'bootstrap-will_paginate'
# gem 'bootstrap-will_paginate'
# gem 'roo'
# gem 'roo-xls'
gem 'bcrypt'
gem 'faker'
gem 'rails_admin'
# gem 'paper_trail'

# gem 'rubyzip', '~> 1.1.0'
# gem 'axlsx', '2.1.0.pre'
# gem 'axlsx_rails'
Expand Down
12 changes: 4 additions & 8 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,6 @@ GEM
bootstrap-sass (3.3.7)
autoprefixer-rails (>= 5.2.1)
sass (>= 3.3.4)
bootstrap-will_paginate (0.0.10)
will_paginate
builder (3.2.2)
byebug (9.0.5)
coffee-rails (4.1.1)
Expand Down Expand Up @@ -180,22 +178,20 @@ GEM
binding_of_caller (>= 0.7.2)
railties (>= 4.0)
sprockets-rails (>= 2.0, < 4.0)
will_paginate (3.1.0)

PLATFORMS
ruby

DEPENDENCIES
bcrypt
bootstrap-sass
bootstrap-will_paginate
bcrypt (~> 3.1.11)
bootstrap-sass (~> 3.3.7)
byebug
coffee-rails (~> 4.1.0)
faker
faker (~> 1.6.3)
jbuilder (~> 2.0)
jquery-rails
rails (= 4.2.5.2)
rails_admin
rails_admin (~> 0.8.1)
sass-rails (~> 5.0)
sdoc (~> 0.4.0)
spring
Expand Down
129 changes: 0 additions & 129 deletions app/assets/javascripts/bootstrap.file-input.js

This file was deleted.

15 changes: 4 additions & 11 deletions app/assets/stylesheets/application.scss
Original file line number Diff line number Diff line change
Expand Up @@ -24,21 +24,20 @@
background-color: #C0C0C0;
}


footer {
background-color: #555;
color: white;
padding: 10px;
}

body{
//background-image: image-url("background.jpg");
//background-color: #18BC9C;
.body-background{
background-image: image-url('background.jpg');
//background-color: #DADADA;
//background-repeat: no-repeat;
//background-size: 100% 100%;
}

body {
body{
padding-top: 50px;
padding-bottom: 100px;
}
Expand All @@ -48,12 +47,6 @@ html {
}


.pagination {
font-size: 11px;
margin-top: 0px;
margin-bottom: 0px;
}




Expand Down
2 changes: 1 addition & 1 deletion app/controllers/grades_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ class GradesController < ApplicationController
def update
@grade=Grade.find_by_id(params[:id])
if @grade.update_attributes!(:grade => params[:grade][:grade])
flash={:success => "成绩上传成功"}
flash={:success => "#{@grade.user.name} #{@grade.course.name}的成绩已成功修改为 #{@grade.grade}"}
else
flash={:danger => "上传失败.请重试"}
end
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/sessions_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ def create
if user && user.authenticate(params[:session][:password])
log_in user
params[:session][:remember_me] == '1' ? remember_user(user) : forget_user(user)
flash= {:info => "欢迎登录: #{user.name} :)"}
flash= {:info => "欢迎回来: #{user.name} :)"}
else
flash= {:danger => '账号或密码错误'}
end
Expand Down
2 changes: 1 addition & 1 deletion app/views/courses/edit.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<%= render "shared/sidenav" %>
</div>

<div class="col-md-offset-2 col-sm-6">
<div class="col-md-offset-1 col-sm-6">
<div class="panel panel-success">
<div class="panel-heading">
<h3 class="text-center">更改课程: <%= @course.name %></h3>
Expand Down
5 changes: 3 additions & 2 deletions app/views/courses/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@

<div class="panel panel-primary filterable">
<div class="panel-heading">
<h3 class="panel-title">已选择课程</h3>
<% if teacher_logged_in? %><h3 class="panel-title">授课列表</h3><% end %>
<% if student_logged_in? %><h3 class="panel-title">已选课程</h3><% end %>
</div>

<div class="panel-body">
Expand All @@ -36,7 +37,7 @@
<% if teacher_logged_in? %>
<td><%= link_to "编辑", edit_course_url(course), class: 'btn btn-xs btn-info' %></td>
<td><%= link_to "删除", course_path(course), :method => "delete", class: 'btn btn-xs btn-danger', :data => {confirm: '确定要删除此课程?'} %></td>
<% else %>
<% elsif student_logged_in? %>
<td><%= link_to "删除", quit_course_path(course), class: 'btn-sm btn-danger' %></td>
<% end %>
</tr>
Expand Down
7 changes: 2 additions & 5 deletions app/views/courses/list.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,11 @@

</div>
<div class="col-sm-10">
<div class="panel panel-default">
<div class="panel panel-primary">
<div class="panel-heading">
<h3 class="panel-title">控制面板</h3>
<h3 class="panel-title">选修课程</h3>
</div>
<div class="panel-body" style="min-height: 450px">
<h4 class="text-muted">用户管理</h4>
<hr>

<table class="table table-striped table-hover">
<thead>

Expand Down
2 changes: 1 addition & 1 deletion app/views/courses/new.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<%= render "shared/sidenav" %>
</div>

<div class="col-md-offset-2 col-sm-6">
<div class="col-md-offset-1 col-sm-6">
<div class="panel panel-success">
<div class="panel-heading">
<h3 class="text-center">新课程</h3>
Expand Down
12 changes: 4 additions & 8 deletions app/views/grades/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,12 @@

</div>
<div class="col-sm-10">
<div class="panel panel-default">
<div class="panel panel-primary">
<div class="panel-heading">
<h3 class="panel-title">控制面板</h3>
<% if teacher_logged_in? %><h3 class="panel-title">成绩管理: <%=@course.name%></h3><% end %>
<% if student_logged_in? %><h3 class="panel-title">成绩列表</h3><% end %>
</div>
<div class="panel-body" style="min-height: 450px">
<h4 class="text-muted">用户管理</h4>
<hr>

<table class="table table-striped table-hover">
<thead>

Expand All @@ -23,8 +21,6 @@
<th>培养单位</th>
<th>课程</th>
<th>目前分数</th>
<th>更新</th>


</tr>
</thead>
Expand All @@ -40,7 +36,7 @@
<td><%= grade.grade %></td>

<% if teacher_logged_in? %>
<%= form_for grade, url: grade_path(id: grade.id, course_id: grade.course.id), method: "patch" do |f| %>
<%= form_for grade, url: grade_url(id: grade.id, course_id: grade.course.id), method: :patch do |f| %>
<td><%= f.text_field :grade %></td>
<td><%= f.submit "提交", class: "btn btn-success btn-xs" %></td>
<% end %>
Expand Down
Loading

0 comments on commit 3b52479

Please sign in to comment.