diff --git a/app/assets/javascripts/statistics.js.coffee b/app/assets/javascripts/statistics.js.coffee new file mode 100644 index 000000000..761567942 --- /dev/null +++ b/app/assets/javascripts/statistics.js.coffee @@ -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/ diff --git a/app/assets/stylesheets/scaffolds.css.scss b/app/assets/stylesheets/scaffolds.css.scss new file mode 100644 index 000000000..6ec6a8ff5 --- /dev/null +++ b/app/assets/stylesheets/scaffolds.css.scss @@ -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; + } +} diff --git a/app/assets/stylesheets/statistics.css.scss b/app/assets/stylesheets/statistics.css.scss new file mode 100644 index 000000000..8ccb96220 --- /dev/null +++ b/app/assets/stylesheets/statistics.css.scss @@ -0,0 +1,3 @@ +// Place all the styles related to the statistics controller here. +// They will automatically be included in application.css. +// You can use Sass (SCSS) here: http://sass-lang.com/ diff --git a/app/controllers/statistics_controller.rb b/app/controllers/statistics_controller.rb new file mode 100644 index 000000000..1d22bd5eb --- /dev/null +++ b/app/controllers/statistics_controller.rb @@ -0,0 +1,83 @@ +class StatisticsController < ApplicationController + # GET /statistics + # GET /statistics.json + def index + @statistics = Statistic.all + + respond_to do |format| + format.html # index.html.erb + format.json { render json: @statistics } + end + end + + # GET /statistics/1 + # GET /statistics/1.json + def show + @statistic = Statistic.find(params[:id]) + + respond_to do |format| + format.html # show.html.erb + format.json { render json: @statistic } + end + end + + # GET /statistics/new + # GET /statistics/new.json + def new + @statistic = Statistic.new + + respond_to do |format| + format.html # new.html.erb + format.json { render json: @statistic } + end + end + + # GET /statistics/1/edit + def edit + @statistic = Statistic.find(params[:id]) + end + + # POST /statistics + # POST /statistics.json + def create + @statistic = Statistic.new(params[:statistic]) + + respond_to do |format| + if @statistic.save + format.html { redirect_to @statistic, notice: 'Statistic was successfully created.' } + format.json { render json: @statistic, status: :created, location: @statistic } + else + format.html { render action: "new" } + format.json { render json: @statistic.errors, status: :unprocessable_entity } + end + end + end + + # PUT /statistics/1 + # PUT /statistics/1.json + def update + @statistic = Statistic.find(params[:id]) + + respond_to do |format| + if @statistic.update_attributes(params[:statistic]) + format.html { redirect_to @statistic, notice: 'Statistic was successfully updated.' } + format.json { head :no_content } + else + format.html { render action: "edit" } + format.json { render json: @statistic.errors, status: :unprocessable_entity } + end + end + end + + # DELETE /statistics/1 + # DELETE /statistics/1.json + def destroy + @statistic = Statistic.find(params[:id]) + @statistic.destroy + + respond_to do |format| + format.html { redirect_to statistics_url } + format.json { head :no_content } + end + end +end diff --git a/app/helpers/statistics_helper.rb b/app/helpers/statistics_helper.rb new file mode 100644 index 000000000..2d25d41c5 --- /dev/null +++ b/app/helpers/statistics_helper.rb @@ -0,0 +1,2 @@ +module StatisticsHelper +end diff --git a/app/models/statistic.rb b/app/models/statistic.rb new file mode 100644 index 000000000..b3f6d00e7 --- /dev/null +++ b/app/models/statistic.rb @@ -0,0 +1,3 @@ +class Statistic < ActiveRecord::Base + attr_accessible :description, :name, :status, :user_id +end diff --git a/app/views/layouts/_logined_header.html.erb b/app/views/layouts/_logined_header.html.erb index 6d9ad618f..60049f5a8 100644 --- a/app/views/layouts/_logined_header.html.erb +++ b/app/views/layouts/_logined_header.html.erb @@ -22,6 +22,9 @@ + <% if hidden_unproject_infos %>