Hoptoad + blank platforms#index

This commit is contained in:
Alexey Nayden 2011-03-09 22:27:51 +03:00
parent f90dea3d72
commit af3c9b52be
12 changed files with 499 additions and 4 deletions

View File

@ -0,0 +1,46 @@
class PlatformsController < ApplicationController
before_filter :authenticate_user!
def index
@platforms = Platform.all
end
def show
@platform = Platform.find params[:id]
end
def new
@platform = Platform.new
end
def edit
@platform = Platform.find params[:id]
end
def create
@platform = Platform.new params[:platform]
if @platform.save
flash[:notice] = 'Платформа успешно добавлена'
redirect_to @platform
else
flash[:error] = 'Не удалось создать платформу'
render :action => :new
end
end
def update
@platform = Platform.find params[:id]
if @platform.update_attributes(params[:platform])
flash[:notice] = 'Платформа успешно обновлена'
redirect_to @platform
else
flash[:error] = 'Не удалось обновить платформу'
render :action => :edit
end
end
def destroy
Platform.destroy params[:id]
redirect_to root_path
end
end

View File

@ -0,0 +1,2 @@
module PlatformsHelper
end

View File

@ -4,7 +4,7 @@ class Platform < ActiveRecord::Base
before_validation :generate_unixname
validate :validate_unixname
has_many :projects
has_many :projects, :dependent => :destroy
has_one :parent, :class_name => 'Platform', :foreign_key => 'parent_platform_id'
protected

View File

@ -2,7 +2,7 @@
-# http://paulirish.com/2008/conditional-stylesheets-vs-css-hacks-answer-neither
-ie_html :class => 'no-js' do
= render :partial => 'layouts/head'
%body{ :lang => 'en', :class => "#{controller.controller_name}" }
%body{ :lang => 'ru', :class => "#{controller.controller_name}" }
#container
%header#header
= render :partial => 'layouts/header'

View File

View File

@ -19,4 +19,6 @@ role :db, "your slave db-server here"
# task :restart, :roles => :app, :except => { :no_release => true } do
# run "#{try_sudo} touch #{File.join(current_path,'tmp','restart.txt')}"
# end
# end
# end
require 'config/boot'
require 'hoptoad_notifier/capistrano'

View File

@ -0,0 +1,3 @@
HoptoadNotifier.configure do |config|
config.api_key = '935538a0dedb9e56947e27269285299e'
end

View File

@ -10,7 +10,23 @@
#
# It's strongly recommended to check this file into your version control system.
ActiveRecord::Schema.define(:version => 20110309144736) do
ActiveRecord::Schema.define(:version => 20110309173421) do
create_table "platforms", :force => true do |t|
t.string "name"
t.string "unixname"
t.integer "parent_platform_id"
t.datetime "created_at"
t.datetime "updated_at"
end
create_table "projects", :force => true do |t|
t.string "name"
t.string "unixname"
t.integer "platform_id"
t.datetime "created_at"
t.datetime "updated_at"
end
create_table "users", :force => true do |t|
t.string "name"

View File

@ -0,0 +1,11 @@
/* line 1, ../../../app/stylesheets/handheld.scss */
* {
float: none;
background: #fff;
color: #000;
}
/* line 8, ../../../app/stylesheets/handheld.scss */
body {
font-size: 80%;
}

View File

@ -0,0 +1,395 @@
@charset "UTF-8";
/* line 14, ../../../../../.rvm/gems/ruby-1.8.7-p302/gems/html5-boilerplate-0.3.2/stylesheets/html5-boilerplate/_reset.scss */
html, body, div, span, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
abbr, address, cite, code, del, dfn, em, img, ins, kbd, q, samp,
small, strong, sub, sup, var, b, i, dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, figcaption, figure,
footer, header, hgroup, menu, nav, section, summary,
time, mark, audio, video {
margin: 0;
padding: 0;
border: 0;
font-size: 100%;
font: inherit;
vertical-align: baseline;
}
/* line 24, ../../../../../.rvm/gems/ruby-1.8.7-p302/gems/html5-boilerplate-0.3.2/stylesheets/html5-boilerplate/_reset.scss */
article, aside, details, figcaption, figure,
footer, header, hgroup, menu, nav, section {
display: block;
}
/* line 28, ../../../../../.rvm/gems/ruby-1.8.7-p302/gems/html5-boilerplate-0.3.2/stylesheets/html5-boilerplate/_reset.scss */
blockquote, q {
quotes: none;
}
/* line 31, ../../../../../.rvm/gems/ruby-1.8.7-p302/gems/html5-boilerplate-0.3.2/stylesheets/html5-boilerplate/_reset.scss */
blockquote:before, blockquote:after,
q:before, q:after {
content: '';
content: none;
}
/* line 33, ../../../../../.rvm/gems/ruby-1.8.7-p302/gems/html5-boilerplate-0.3.2/stylesheets/html5-boilerplate/_reset.scss */
ins {
background-color: #ff9;
color: #000;
text-decoration: none;
}
/* line 35, ../../../../../.rvm/gems/ruby-1.8.7-p302/gems/html5-boilerplate-0.3.2/stylesheets/html5-boilerplate/_reset.scss */
mark {
background-color: #ff9;
color: #000;
font-style: italic;
font-weight: bold;
}
/* line 37, ../../../../../.rvm/gems/ruby-1.8.7-p302/gems/html5-boilerplate-0.3.2/stylesheets/html5-boilerplate/_reset.scss */
del {
text-decoration: line-through;
}
/* line 39, ../../../../../.rvm/gems/ruby-1.8.7-p302/gems/html5-boilerplate-0.3.2/stylesheets/html5-boilerplate/_reset.scss */
abbr[title], dfn[title] {
border-bottom: 1px dotted;
cursor: help;
}
/* line 41, ../../../../../.rvm/gems/ruby-1.8.7-p302/gems/html5-boilerplate-0.3.2/stylesheets/html5-boilerplate/_reset.scss */
table {
border-collapse: collapse;
border-spacing: 0;
}
/* line 43, ../../../../../.rvm/gems/ruby-1.8.7-p302/gems/html5-boilerplate-0.3.2/stylesheets/html5-boilerplate/_reset.scss */
hr {
display: block;
height: 1px;
border: 0;
border-top: 1px solid #ccc;
margin: 1em 0;
padding: 0;
}
/* line 45, ../../../../../.rvm/gems/ruby-1.8.7-p302/gems/html5-boilerplate-0.3.2/stylesheets/html5-boilerplate/_reset.scss */
input, select {
vertical-align: middle;
}
/* line 11, ../../../../../.rvm/gems/ruby-1.8.7-p302/gems/html5-boilerplate-0.3.2/stylesheets/html5-boilerplate/_fonts.scss */
body {
font-size: 13px;
font-family: sans-serif;
line-height: 1.231;
*font-size: small;
}
/* line 18, ../../../../../.rvm/gems/ruby-1.8.7-p302/gems/html5-boilerplate-0.3.2/stylesheets/html5-boilerplate/_fonts.scss */
select, input, textarea, button {
font: 99% sans-serif;
}
/* line 23, ../../../../../.rvm/gems/ruby-1.8.7-p302/gems/html5-boilerplate-0.3.2/stylesheets/html5-boilerplate/_fonts.scss */
pre, code, kbd, samp {
font-family: monospace, sans-serif;
}
/* line 15, ../../../../../.rvm/gems/ruby-1.8.7-p302/gems/html5-boilerplate-0.3.2/stylesheets/html5-boilerplate/_styles.scss */
html {
overflow-y: scroll;
}
/* line 17, ../../../../../.rvm/gems/ruby-1.8.7-p302/gems/html5-boilerplate-0.3.2/stylesheets/html5-boilerplate/_styles.scss */
ul, ol {
margin-left: 2em;
}
/* line 18, ../../../../../.rvm/gems/ruby-1.8.7-p302/gems/html5-boilerplate-0.3.2/stylesheets/html5-boilerplate/_styles.scss */
ol {
list-style-type: decimal;
}
/* line 20, ../../../../../.rvm/gems/ruby-1.8.7-p302/gems/html5-boilerplate-0.3.2/stylesheets/html5-boilerplate/_styles.scss */
td, td img {
vertical-align: top;
}
/* line 22, ../../../../../.rvm/gems/ruby-1.8.7-p302/gems/html5-boilerplate-0.3.2/stylesheets/html5-boilerplate/_styles.scss */
sub {
font-size: 75%;
line-height: 0;
position: relative;
bottom: -0.25em;
}
/* line 24, ../../../../../.rvm/gems/ruby-1.8.7-p302/gems/html5-boilerplate-0.3.2/stylesheets/html5-boilerplate/_styles.scss */
sup {
font-size: 75%;
line-height: 0;
position: relative;
top: -0.5em;
}
/* line 26, ../../../../../.rvm/gems/ruby-1.8.7-p302/gems/html5-boilerplate-0.3.2/stylesheets/html5-boilerplate/_styles.scss */
textarea {
overflow: auto;
}
/* line 57, ../../../../../.rvm/gems/ruby-1.8.7-p302/gems/html5-boilerplate-0.3.2/stylesheets/html5-boilerplate/_styles.scss */
a:hover, a:active {
outline: none;
}
/* line 62, ../../../../../.rvm/gems/ruby-1.8.7-p302/gems/html5-boilerplate-0.3.2/stylesheets/html5-boilerplate/_styles.scss */
pre {
white-space: pre;
white-space: pre-wrap;
white-space: pre-line;
word-wrap: break-word;
padding: 15px;
}
/* line 71, ../../../../../.rvm/gems/ruby-1.8.7-p302/gems/html5-boilerplate-0.3.2/stylesheets/html5-boilerplate/_styles.scss */
input[type="radio"] {
vertical-align: text-bottom;
}
/* line 72, ../../../../../.rvm/gems/ruby-1.8.7-p302/gems/html5-boilerplate-0.3.2/stylesheets/html5-boilerplate/_styles.scss */
input[type="checkbox"] {
vertical-align: bottom;
}
/* line 73, ../../../../../.rvm/gems/ruby-1.8.7-p302/gems/html5-boilerplate-0.3.2/stylesheets/html5-boilerplate/_styles.scss */
.ie7 input[type="checkbox"] {
vertical-align: baseline;
}
/* line 74, ../../../../../.rvm/gems/ruby-1.8.7-p302/gems/html5-boilerplate-0.3.2/stylesheets/html5-boilerplate/_styles.scss */
.ie6 input {
vertical-align: text-bottom;
}
/* line 79, ../../../../../.rvm/gems/ruby-1.8.7-p302/gems/html5-boilerplate-0.3.2/stylesheets/html5-boilerplate/_styles.scss */
label, input[type="button"], input[type="submit"], input[type="image"], button {
cursor: pointer;
}
/* line 84, ../../../../../.rvm/gems/ruby-1.8.7-p302/gems/html5-boilerplate-0.3.2/stylesheets/html5-boilerplate/_styles.scss */
button, input, select, textarea {
margin: 0;
}
/* line 91, ../../../../../.rvm/gems/ruby-1.8.7-p302/gems/html5-boilerplate-0.3.2/stylesheets/html5-boilerplate/_styles.scss */
::-moz-selection {
background: #ff5e99;
color: white;
text-shadow: none;
}
/* line 92, ../../../../../.rvm/gems/ruby-1.8.7-p302/gems/html5-boilerplate-0.3.2/stylesheets/html5-boilerplate/_styles.scss */
::selection {
background: #ff5e99;
color: white;
text-shadow: none;
}
/* line 97, ../../../../../.rvm/gems/ruby-1.8.7-p302/gems/html5-boilerplate-0.3.2/stylesheets/html5-boilerplate/_styles.scss */
a:link {
-webkit-tap-highlight-color: #ff5e99;
}
/* line 108, ../../../../../.rvm/gems/ruby-1.8.7-p302/gems/html5-boilerplate-0.3.2/stylesheets/html5-boilerplate/_styles.scss */
button {
width: auto;
overflow: visible;
}
/* line 112, ../../../../../.rvm/gems/ruby-1.8.7-p302/gems/html5-boilerplate-0.3.2/stylesheets/html5-boilerplate/_styles.scss */
.ie7 img {
-ms-interpolation-mode: bicubic;
}
/* line 114, ../../../../../.rvm/gems/ruby-1.8.7-p302/gems/html5-boilerplate-0.3.2/stylesheets/html5-boilerplate/_styles.scss */
.ie6 legend, .ie7 legend {
margin-left: -7px;
}
/* line 119, ../../../../../.rvm/gems/ruby-1.8.7-p302/gems/html5-boilerplate-0.3.2/stylesheets/html5-boilerplate/_styles.scss */
nav ul, nav li {
margin: 0;
list-style: none;
list-style-image: none;
}
/* line 10, ../../../../../.rvm/gems/ruby-1.8.7-p302/gems/html5-boilerplate-0.3.2/stylesheets/html5-boilerplate/_helpers.scss */
.ir {
text-indent: -119988px;
overflow: hidden;
text-align: left;
direction: ltr;
background-repeat: no-repeat;
}
/* line 12, ../../../../../.rvm/gems/ruby-1.8.7-p302/gems/html5-boilerplate-0.3.2/stylesheets/html5-boilerplate/_helpers.scss */
.hidden {
display: none;
visibility: hidden;
}
/* line 14, ../../../../../.rvm/gems/ruby-1.8.7-p302/gems/html5-boilerplate-0.3.2/stylesheets/html5-boilerplate/_helpers.scss */
.visuallyhidden {
border: 0;
clip: rect(0 0 0 0);
height: 1px;
margin: -1px;
overflow: hidden;
padding: 0;
position: absolute;
width: 1px;
}
/* line 50, ../../../../../.rvm/gems/ruby-1.8.7-p302/gems/html5-boilerplate-0.3.2/stylesheets/html5-boilerplate/_helpers.scss */
.visuallyhidden.focusable:active, .visuallyhidden.focusable:focus {
clip: auto;
height: auto;
margin: 0;
overflow: visible;
position: static;
width: auto;
}
/* line 16, ../../../../../.rvm/gems/ruby-1.8.7-p302/gems/html5-boilerplate-0.3.2/stylesheets/html5-boilerplate/_helpers.scss */
.clearfix {
*zoom: 1;
}
/* line 22, ../../../../../.rvm/gems/ruby-1.8.7-p302/gems/compass-0.10.6/frameworks/compass/stylesheets/compass/utilities/general/_clearfix.scss */
.clearfix:after {
content: "\0020";
display: block;
height: 0;
clear: both;
overflow: hidden;
visibility: hidden;
}
/* line 8, ../../../app/stylesheets/partials/_page.scss */
body, select, input, textarea {
color: #444444;
}
/* line 15, ../../../app/stylesheets/partials/_page.scss */
h1, h2, h3, h4, h5, h6 {
font-weight: bold;
}
/* line 21, ../../../app/stylesheets/partials/_page.scss */
a, a:active, a:visited {
color: #607890;
}
/* line 22, ../../../app/stylesheets/partials/_page.scss */
a:hover {
color: #003366;
}
/* line 24, ../../../app/stylesheets/partials/_page.scss */
strong, th {
font-weight: bold;
}
/* line 28, ../../../app/stylesheets/partials/_page.scss */
small {
font-size: 85%;
}
/* line 37, ../../../app/stylesheets/partials/_page.scss */
input:invalid, textarea:invalid {
-moz-border-radius: 1px;
-webkit-border-radius: 1px;
-o-border-radius: 1px;
-ms-border-radius: 1px;
-khtml-border-radius: 1px;
border-radius: 1px;
-moz-box-shadow: red 0 0 5px 0;
-webkit-box-shadow: red 0 0 5px 0;
-o-box-shadow: red 0 0 5px 0;
box-shadow: red 0 0 5px 0;
}
/* line 42, ../../../app/stylesheets/partials/_page.scss */
.no-boxshadow input:invalid,
.no-boxshadow textarea:invalid {
background-color: #f0dddd;
}
@media print {
/* line 24, ../../../../../.rvm/gems/ruby-1.8.7-p302/gems/html5-boilerplate-0.3.2/stylesheets/html5-boilerplate/_media.scss */
* {
background: transparent !important;
color: black !important;
text-shadow: none !important;
filter: none !important;
-ms-filter: none !important;
}
/* line 26, ../../../../../.rvm/gems/ruby-1.8.7-p302/gems/html5-boilerplate-0.3.2/stylesheets/html5-boilerplate/_media.scss */
a, a:visited {
color: #444 !important;
text-decoration: underline;
}
/* line 27, ../../../../../.rvm/gems/ruby-1.8.7-p302/gems/html5-boilerplate-0.3.2/stylesheets/html5-boilerplate/_media.scss */
a[href]:after {
content: " (" attr(href) ")";
}
/* line 28, ../../../../../.rvm/gems/ruby-1.8.7-p302/gems/html5-boilerplate-0.3.2/stylesheets/html5-boilerplate/_media.scss */
abbr[title]:after {
content: " (" attr(title) ")";
}
/* line 29, ../../../../../.rvm/gems/ruby-1.8.7-p302/gems/html5-boilerplate-0.3.2/stylesheets/html5-boilerplate/_media.scss */
.ir a:after, a[href^="javascript:"]:after, a[href^="#"]:after {
content: "";
}
/* line 30, ../../../../../.rvm/gems/ruby-1.8.7-p302/gems/html5-boilerplate-0.3.2/stylesheets/html5-boilerplate/_media.scss */
pre, blockquote {
border: 1px solid #999;
page-break-inside: avoid;
}
/* line 31, ../../../../../.rvm/gems/ruby-1.8.7-p302/gems/html5-boilerplate-0.3.2/stylesheets/html5-boilerplate/_media.scss */
thead {
display: table-header-group;
}
/* line 32, ../../../../../.rvm/gems/ruby-1.8.7-p302/gems/html5-boilerplate-0.3.2/stylesheets/html5-boilerplate/_media.scss */
tr, img {
page-break-inside: avoid;
}
@page {
margin: 0.5cm;
}
/* line 34, ../../../../../.rvm/gems/ruby-1.8.7-p302/gems/html5-boilerplate-0.3.2/stylesheets/html5-boilerplate/_media.scss */
p, h2, h3 {
orphans: 3;
widows: 3;
}
/* line 35, ../../../../../.rvm/gems/ruby-1.8.7-p302/gems/html5-boilerplate-0.3.2/stylesheets/html5-boilerplate/_media.scss */
h2, h3 {
page-break-after: avoid;
}
}
@media all and (orientation:portrait) {}
@media all and (orientation:landscape) {}
@media screen and (max-device-width: 480px) {}

View File

@ -0,0 +1,5 @@
require 'spec_helper'
describe PlatformsController do
end

View File

@ -0,0 +1,15 @@
require 'spec_helper'
# Specs in this file have access to a helper object that includes
# the PlatformsHelper. For example:
#
# describe PlatformsHelper do
# describe "string concat" do
# it "concats two strings with spaces" do
# helper.concat_strings("this","that").should == "this that"
# end
# end
# end
describe PlatformsHelper do
pending "add some examples to (or delete) #{__FILE__}"
end