Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added moves scaffold and integrated custom mstar webfont
- Loading branch information
Showing
29 changed files
with
1,123 additions
and
0 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Place all the behaviors and hooks related to the matching controller here. | ||
# All this logic will automatically be available in application.js. | ||
# You can use CoffeeScript in this file: http://jashkenas.github.com/coffee-script/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
/* Wingdings 3 web font from: http://code.google.com/p/libble/ */ | ||
@font-face { | ||
font-family: 'Wingdings 3'; | ||
src: url('Mstar.eot'); | ||
src: url('Mstar.eot?iefix') format('eot'), | ||
url('Mstar.woff') format('woff'), | ||
url('Mstar.otf') format('opentype'), | ||
url('Mstar.svg') format('svg'); | ||
} | ||
|
||
.sequence { | ||
font-family: 'Wingdings 3', Verdana, Helvetica, Arial, sans-serif; | ||
font-size: 32px; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
// Place all the styles related to the Moves controller here. | ||
// They will automatically be included in application.css. | ||
// You can use Sass (SCSS) here: http://sass-lang.com/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
body { | ||
background-color: #fff; | ||
color: #333; | ||
font-family: verdana, arial, helvetica, sans-serif; | ||
font-size: 13px; | ||
line-height: 18px; | ||
} | ||
|
||
p, ol, ul, td { | ||
font-family: verdana, arial, helvetica, sans-serif; | ||
font-size: 13px; | ||
line-height: 18px; | ||
} | ||
|
||
pre { | ||
background-color: #eee; | ||
padding: 10px; | ||
font-size: 11px; | ||
} | ||
|
||
a { | ||
color: #000; | ||
&:visited { | ||
color: #666; | ||
} | ||
&:hover { | ||
color: #fff; | ||
background-color: #000; | ||
} | ||
} | ||
|
||
div { | ||
&.field, &.actions { | ||
margin-bottom: 10px; | ||
} | ||
} | ||
|
||
#notice { | ||
color: green; | ||
} | ||
|
||
.field_with_errors { | ||
padding: 2px; | ||
background-color: red; | ||
display: table; | ||
} | ||
|
||
#error_explanation { | ||
width: 450px; | ||
border: 2px solid red; | ||
padding: 7px; | ||
padding-bottom: 0; | ||
margin-bottom: 20px; | ||
background-color: #f0f0f0; | ||
h2 { | ||
text-align: left; | ||
font-weight: bold; | ||
padding: 5px 5px 5px 15px; | ||
font-size: 12px; | ||
margin: -7px; | ||
margin-bottom: 0px; | ||
background-color: #c00; | ||
color: #fff; | ||
} | ||
ul li { | ||
font-size: 12px; | ||
list-style: square; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
class MovesController < ApplicationController | ||
# GET /moves | ||
# GET /moves.json | ||
def index | ||
@moves = Move.all | ||
|
||
respond_to do |format| | ||
format.html # index.html.erb | ||
format.json { render json: @moves } | ||
end | ||
end | ||
|
||
# GET /moves/1 | ||
# GET /moves/1.json | ||
def show | ||
@move = Move.find(params[:id]) | ||
|
||
respond_to do |format| | ||
format.html # show.html.erb | ||
format.json { render json: @move } | ||
end | ||
end | ||
|
||
# GET /moves/new | ||
# GET /moves/new.json | ||
def new | ||
@move = Move.new | ||
|
||
respond_to do |format| | ||
format.html # new.html.erb | ||
format.json { render json: @move } | ||
end | ||
end | ||
|
||
# GET /moves/1/edit | ||
def edit | ||
@move = Move.find(params[:id]) | ||
end | ||
|
||
# POST /moves | ||
# POST /moves.json | ||
def create | ||
@move = Move.new(params[:move]) | ||
|
||
respond_to do |format| | ||
if @move.save | ||
format.html { redirect_to @move, notice: 'Move was successfully created.' } | ||
format.json { render json: @move, status: :created, location: @move } | ||
else | ||
format.html { render action: "new" } | ||
format.json { render json: @move.errors, status: :unprocessable_entity } | ||
end | ||
end | ||
end | ||
|
||
# PUT /moves/1 | ||
# PUT /moves/1.json | ||
def update | ||
@move = Move.find(params[:id]) | ||
|
||
respond_to do |format| | ||
if @move.update_attributes(params[:move]) | ||
format.html { redirect_to @move, notice: 'Move was successfully updated.' } | ||
format.json { head :no_content } | ||
else | ||
format.html { render action: "edit" } | ||
format.json { render json: @move.errors, status: :unprocessable_entity } | ||
end | ||
end | ||
end | ||
|
||
# DELETE /moves/1 | ||
# DELETE /moves/1.json | ||
def destroy | ||
@move = Move.find(params[:id]) | ||
@move.destroy | ||
|
||
respond_to do |format| | ||
format.html { redirect_to moves_url } | ||
format.json { head :no_content } | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
module MovesHelper | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
class Move < ActiveRecord::Base | ||
attr_accessible :mstar_id, :sequence | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
= form_for @move do |f| | ||
- if @move.errors.any? | ||
#error_explanation | ||
%h2= "#{pluralize(@move.errors.count, "error")} prohibited this move from being saved:" | ||
%ul | ||
- @move.errors.full_messages.each do |msg| | ||
%li= msg | ||
|
||
.field | ||
= f.label :mstar_id | ||
= f.text_field :mstar_id | ||
.field | ||
= f.label :sequence | ||
= f.text_field :sequence, class: 'sequence' | ||
.actions | ||
= f.submit 'Save' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
%h1 Editing move | ||
|
||
= render 'form' | ||
|
||
= link_to 'Show', @move | ||
\| | ||
= link_to 'Back', moves_path |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
%h1 Listing moves | ||
|
||
%table | ||
%tr | ||
%th Mstar | ||
%th Sequence | ||
%th | ||
%th | ||
%th | ||
|
||
- @moves.each do |move| | ||
%tr | ||
%td= move.mstar_id | ||
%td.sequence= move.sequence | ||
%td= link_to 'Show', move | ||
%td= link_to 'Edit', edit_move_path(move) | ||
%td= link_to 'Destroy', move, method: :delete, data: { confirm: 'Are you sure?' } | ||
|
||
%br | ||
|
||
= link_to 'New Move', new_move_path |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
%h1 New move | ||
|
||
= render 'form' | ||
|
||
= link_to 'Back', moves_path |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
%p#notice= notice | ||
|
||
%p | ||
%b Mstar: | ||
= @move.mstar_id | ||
%p | ||
%b Sequence: | ||
.sequence | ||
= @move.sequence | ||
|
||
= link_to 'Edit', edit_move_path(@move) | ||
\| | ||
= link_to 'Back', moves_path |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
class CreateMoves < ActiveRecord::Migration | ||
def change | ||
create_table :moves do |t| | ||
t.integer :mstar_id | ||
t.string :sequence | ||
|
||
t.timestamps | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# encoding: UTF-8 | ||
# This file is auto-generated from the current state of the database. Instead | ||
# of editing this file, please use the migrations feature of Active Record to | ||
# incrementally modify your database, and then regenerate this schema definition. | ||
# | ||
# Note that this schema.rb definition is the authoritative source for your | ||
# database schema. If you need to create the application database on another | ||
# system, you should be using db:schema:load, not running all the migrations | ||
# from scratch. The latter is a flawed and unsustainable approach (the more migrations | ||
# you'll amass, the slower it'll run and the greater likelihood for issues). | ||
# | ||
# It's strongly recommended to check this file into your version control system. | ||
|
||
ActiveRecord::Schema.define(:version => 20121221065617) do | ||
|
||
create_table "moves", :force => true do |t| | ||
t.integer "mstar_id" | ||
t.string "sequence" | ||
t.datetime "created_at", :null => false | ||
t.datetime "updated_at", :null => false | ||
end | ||
|
||
end |
Oops, something went wrong.