From f15300dd765252003da9f112775b9caed065c921 Mon Sep 17 00:00:00 2001 From: Luc Donnet Date: Fri, 6 Jan 2012 17:48:53 +0100 Subject: Initialize chouette2 --- app/assets/images/rails.png | Bin 0 -> 6646 bytes app/assets/javascripts/application.js | 9 ++ app/assets/stylesheets/application.css | 8 ++ app/assets/stylesheets/application.css~ | 7 ++ app/assets/stylesheets/legacy.css.scss | 203 ++++++++++++++++++++++++++++++ app/assets/stylesheets/legacy.css.scss~ | 195 ++++++++++++++++++++++++++++ app/assets/stylesheets/lines.css.scss | 3 + app/assets/stylesheets/welcome.css.scss | 3 + app/controllers/application_controller.rb | 3 + app/controllers/lines_controller.rb | 4 + app/controllers/lines_controller.rb~ | 2 + app/controllers/welcome_controller.rb | 4 + app/controllers/welcome_controller.rb~ | 2 + app/helpers/application_helper.rb | 7 ++ app/helpers/application_helper.rb~ | 2 + app/helpers/lines_helper.rb | 2 + app/helpers/title_helper.rb | 15 +++ app/helpers/title_helper.rb~ | 11 ++ app/helpers/welcome_helper.rb | 2 + app/mailers/.gitkeep | 0 app/models/.gitkeep | 0 app/views/layouts/application.html.erb | 35 ++++++ app/views/layouts/application.html.erb~ | 36 ++++++ app/views/lines/_form.erb | 11 ++ app/views/lines/_form.erb~ | 13 ++ app/views/lines/_line.erb | 11 ++ app/views/lines/_line.erb~ | 16 +++ app/views/lines/edit.html.erb | 3 + app/views/lines/index.html.erb | 10 ++ app/views/lines/index.html.erb~ | 18 +++ app/views/lines/new.html.erb | 3 + app/views/lines/show.html.erb | 27 ++++ app/views/lines/show.html.erb~ | 45 +++++++ app/views/welcome/index.html.erb | 0 app/views/welcome/index.html.erb~ | 0 35 files changed, 710 insertions(+) create mode 100644 app/assets/images/rails.png create mode 100644 app/assets/javascripts/application.js create mode 100644 app/assets/stylesheets/application.css create mode 100644 app/assets/stylesheets/application.css~ create mode 100644 app/assets/stylesheets/legacy.css.scss create mode 100644 app/assets/stylesheets/legacy.css.scss~ create mode 100644 app/assets/stylesheets/lines.css.scss create mode 100644 app/assets/stylesheets/welcome.css.scss create mode 100644 app/controllers/application_controller.rb create mode 100644 app/controllers/lines_controller.rb create mode 100644 app/controllers/lines_controller.rb~ create mode 100644 app/controllers/welcome_controller.rb create mode 100644 app/controllers/welcome_controller.rb~ create mode 100644 app/helpers/application_helper.rb create mode 100644 app/helpers/application_helper.rb~ create mode 100644 app/helpers/lines_helper.rb create mode 100644 app/helpers/title_helper.rb create mode 100644 app/helpers/title_helper.rb~ create mode 100644 app/helpers/welcome_helper.rb create mode 100644 app/mailers/.gitkeep create mode 100644 app/models/.gitkeep create mode 100644 app/views/layouts/application.html.erb create mode 100644 app/views/layouts/application.html.erb~ create mode 100644 app/views/lines/_form.erb create mode 100644 app/views/lines/_form.erb~ create mode 100644 app/views/lines/_line.erb create mode 100644 app/views/lines/_line.erb~ create mode 100644 app/views/lines/edit.html.erb create mode 100644 app/views/lines/index.html.erb create mode 100644 app/views/lines/index.html.erb~ create mode 100644 app/views/lines/new.html.erb create mode 100644 app/views/lines/show.html.erb create mode 100644 app/views/lines/show.html.erb~ create mode 100644 app/views/welcome/index.html.erb create mode 100644 app/views/welcome/index.html.erb~ (limited to 'app') diff --git a/app/assets/images/rails.png b/app/assets/images/rails.png new file mode 100644 index 000000000..d5edc04e6 Binary files /dev/null and b/app/assets/images/rails.png differ diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js new file mode 100644 index 000000000..37c7bfcdb --- /dev/null +++ b/app/assets/javascripts/application.js @@ -0,0 +1,9 @@ +// This is a manifest file that'll be compiled into including all the files listed below. +// Add new JavaScript/Coffee code in separate files in this directory and they'll automatically +// be included in the compiled file accessible from http://example.com/assets/application.js +// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the +// the compiled file. +// +//= require jquery +//= require jquery_ujs +//= require_tree . diff --git a/app/assets/stylesheets/application.css b/app/assets/stylesheets/application.css new file mode 100644 index 000000000..9b2c7f92e --- /dev/null +++ b/app/assets/stylesheets/application.css @@ -0,0 +1,8 @@ +/* + * This is a manifest file that'll automatically include all the stylesheets available in this directory + * and any sub-directories. You're free to add application-wide styles to this file and they'll appear at + * the top of the compiled file, but it's generally better to create a new file per style scope. + *= require_self + *= require user_interface + *= require_tree . +*/ \ No newline at end of file diff --git a/app/assets/stylesheets/application.css~ b/app/assets/stylesheets/application.css~ new file mode 100644 index 000000000..fc25b5723 --- /dev/null +++ b/app/assets/stylesheets/application.css~ @@ -0,0 +1,7 @@ +/* + * This is a manifest file that'll automatically include all the stylesheets available in this directory + * and any sub-directories. You're free to add application-wide styles to this file and they'll appear at + * the top of the compiled file, but it's generally better to create a new file per style scope. + *= require_self + *= require_tree . +*/ \ No newline at end of file diff --git a/app/assets/stylesheets/legacy.css.scss b/app/assets/stylesheets/legacy.css.scss new file mode 100644 index 000000000..2db0a3fa4 --- /dev/null +++ b/app/assets/stylesheets/legacy.css.scss @@ -0,0 +1,203 @@ +@mixin div_for_object { + margin-bottom: 20px; + + a.preview { + text-decoration: none; + } + + img { + float: left; + margin-right: 10px; + } + a { + display:block; + text-decoration: underline; + margin-bottom: 3px; + } + .info { + font-size: 12px; + color: #777; + font-weight: normal; + line-height: 18px; + + a { + display:inline; + color: #095495; + } + } +} + +@mixin after_div_for_object { + content: " "; + display: block; + height: 0; + clear: left; + visibility: hidden; +} + +.line, .line_group, .stop_area, .service_link, .network, .service_link_stop_point, .indicator { + @include div_for_object; +} + +.line:after, .line_group:after, .stop_area:after, .service_link:after, .network:after, .service_link_stop_point:after, .journey_pattern:after, .indicator:after { + @include after_div_for_object; +} + +.line_show .summary{ + height: 250px; + min-height: 250px; +} + +.line { + .color { + width: 64px; + height: 64px; + float: left; + margin-right: 10px; + a { + text-decoration: none; + } + } + + .code { + font-size: 16px; + text-align: center; + color: white; + font-weight: bold; + padding-top: 21px; + } + + .number { + font-size: 16px; + text-align: center; + color: white; + font-weight: bold; + padding-top: 21px; + } +} + +.journey_pattern{ + float: left; + padding: 10px; + + .headers{ + background-color: #b78db7; + text-align: center; + padding: 5px; + + img{ + vertical-align: text-bottom; + margin-left: 5px; + } + } + + .even{ + background-color: #eed7f1; + padding: 5px; + + img{ + vertical-align: text-bottom; + margin-right: 5px; + } + } + + .odd{ + padding: 5px; + + img{ + vertical-align: text-bottom; + margin-right: 5px; + } + } +} + +.network +{ + .map{ + width: 50px; + height: 50px; + float: left; + margin-right: 10px; + background: url("../images/icons/viewer.png") no-repeat; + } + + a.viewer { + background: url("../images/icons/viewer.png") no-repeat; + } +} + +.stop_area { + .info { + .warning { + background: url("../images/icons/warning.png") 0 100% no-repeat; + padding-left: 20px; + } + } +} + +#map.stop_area, #map.service_link, #map.line { + float: right; + width: 400px; + height: 250px; +} + +.service_link { + + #service_link_stop_points { + li { + margin-bottom: 1.5em; + } + li.stop_area { + padding-left: 26px; + } + fieldset > ol > li { + margin-bottom: 0; + } + } + + a { + display: inline; + } + + a.remove { + float: left; + img { + margin: 4px 10px 0 0; + } + } + + .buttons{ + margin-top: 20px; + } + + +} + +.indicator{ + +} + +div.auto_complete { + width: 350px; + background: #fff; + + ul { + border:1px solid #888; + margin:0; + padding:0; + width:100%; + list-style-type:none; + } + ul li { + margin:0; + padding:3px; + } + ul li.selected { + background-color: #ffb; + } + ul strong.highlight { + color: #800; + margin:0; + padding:0; + } +} diff --git a/app/assets/stylesheets/legacy.css.scss~ b/app/assets/stylesheets/legacy.css.scss~ new file mode 100644 index 000000000..c0a62056d --- /dev/null +++ b/app/assets/stylesheets/legacy.css.scss~ @@ -0,0 +1,195 @@ +.div_for_object() { + margin-bottom: 20px; + + a.preview { + text-decoration: none; + } + + img { + float: left; + margin-right: 10px; + } + a { + display:block; + text-decoration: underline; + margin-bottom: 3px; + } + .info { + font-size: 12px; + color: #777; + font-weight: normal; + line-height: 18px; + + a { + display:inline; + color: #095495; + } + } +} + +.after_div_for_object() { + content: " "; + display: block; + height: 0; + clear: left; + visibility: hidden; +} + +.line, .line_group, .stop_area, .service_link, .network, .service_link_stop_point, .indicator { + .div_for_object; +} + +.line:after, .line_group:after, .stop_area:after, .service_link:after, .network:after, .service_link_stop_point:after, .journey_pattern:after, .indicator:after { + .after_div_for_object; +} + +.line_show .summary{ + height: 250px; + min-height: 250px; +} + +.line { + .color { + width: 64px; + height: 64px; + float: left; + margin-right: 10px; + a { + text-decoration: none; + } + } + + .code { + font-size: 16px; + text-align: center; + color: white; + font-weight: bold; + padding-top: 21px; + } +} + +.journey_pattern{ + float: left; + padding: 10px; + + .headers{ + background-color: #b78db7; + text-align: center; + padding: 5px; + + img{ + vertical-align: text-bottom; + margin-left: 5px; + } + } + + .even{ + background-color: #eed7f1; + padding: 5px; + + img{ + vertical-align: text-bottom; + margin-right: 5px; + } + } + + .odd{ + padding: 5px; + + img{ + vertical-align: text-bottom; + margin-right: 5px; + } + } +} + +.network +{ + .map{ + width: 50px; + height: 50px; + float: left; + margin-right: 10px; + background: url("../images/icons/viewer.png") no-repeat; + } + + a.viewer { + background: url("../images/icons/viewer.png") no-repeat; + } +} + +.stop_area { + .info { + .warning { + background: url("../images/icons/warning.png") 0 100% no-repeat; + padding-left: 20px; + } + } +} + +#map.stop_area, #map.service_link, #map.line { + float: right; + width: 400px; + height: 250px; +} + +.service_link { + + #service_link_stop_points { + li { + margin-bottom: 1.5em; + } + li.stop_area { + padding-left: 26px; + } + fieldset > ol > li { + margin-bottom: 0; + } + } + + a { + display: inline; + } + + a.remove { + float: left; + img { + margin: 4px 10px 0 0; + } + } + + .buttons{ + margin-top: 20px; + } + + +} + +.indicator{ + +} + +div.auto_complete { + width: 350px; + background: #fff; + + ul { + border:1px solid #888; + margin:0; + padding:0; + width:100%; + list-style-type:none; + } + ul li { + margin:0; + padding:3px; + } + ul li.selected { + background-color: #ffb; + } + ul strong.highlight { + color: #800; + margin:0; + padding:0; + } +} diff --git a/app/assets/stylesheets/lines.css.scss b/app/assets/stylesheets/lines.css.scss new file mode 100644 index 000000000..59ec845d3 --- /dev/null +++ b/app/assets/stylesheets/lines.css.scss @@ -0,0 +1,3 @@ +// Place all the styles related to the lines controller here. +// They will automatically be included in application.css. +// You can use Sass (SCSS) here: http://sass-lang.com/ diff --git a/app/assets/stylesheets/welcome.css.scss b/app/assets/stylesheets/welcome.css.scss new file mode 100644 index 000000000..77ce11a74 --- /dev/null +++ b/app/assets/stylesheets/welcome.css.scss @@ -0,0 +1,3 @@ +// Place all the styles related to the welcome 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/application_controller.rb b/app/controllers/application_controller.rb new file mode 100644 index 000000000..e8065d950 --- /dev/null +++ b/app/controllers/application_controller.rb @@ -0,0 +1,3 @@ +class ApplicationController < ActionController::Base + protect_from_forgery +end diff --git a/app/controllers/lines_controller.rb b/app/controllers/lines_controller.rb new file mode 100644 index 000000000..3a986b27c --- /dev/null +++ b/app/controllers/lines_controller.rb @@ -0,0 +1,4 @@ +class LinesController < InheritedResources::Base + defaults :resource_class => Chouette::Line + +end diff --git a/app/controllers/lines_controller.rb~ b/app/controllers/lines_controller.rb~ new file mode 100644 index 000000000..81710ab8f --- /dev/null +++ b/app/controllers/lines_controller.rb~ @@ -0,0 +1,2 @@ +class LinesController < ApplicationController +end diff --git a/app/controllers/welcome_controller.rb b/app/controllers/welcome_controller.rb new file mode 100644 index 000000000..f9b859b9c --- /dev/null +++ b/app/controllers/welcome_controller.rb @@ -0,0 +1,4 @@ +class WelcomeController < ApplicationController + def index + end +end diff --git a/app/controllers/welcome_controller.rb~ b/app/controllers/welcome_controller.rb~ new file mode 100644 index 000000000..d8c85ab84 --- /dev/null +++ b/app/controllers/welcome_controller.rb~ @@ -0,0 +1,2 @@ +class WelcomeController < ApplicationController +end diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb new file mode 100644 index 000000000..a16d32d46 --- /dev/null +++ b/app/helpers/application_helper.rb @@ -0,0 +1,7 @@ +module ApplicationHelper + + def chouette_line_path(line) + line_path(line) + end + +end diff --git a/app/helpers/application_helper.rb~ b/app/helpers/application_helper.rb~ new file mode 100644 index 000000000..de6be7945 --- /dev/null +++ b/app/helpers/application_helper.rb~ @@ -0,0 +1,2 @@ +module ApplicationHelper +end diff --git a/app/helpers/lines_helper.rb b/app/helpers/lines_helper.rb new file mode 100644 index 000000000..a03868a0a --- /dev/null +++ b/app/helpers/lines_helper.rb @@ -0,0 +1,2 @@ +module LinesHelper +end diff --git a/app/helpers/title_helper.rb b/app/helpers/title_helper.rb new file mode 100644 index 000000000..f5219276b --- /dev/null +++ b/app/helpers/title_helper.rb @@ -0,0 +1,15 @@ +module TitleHelper + + def title(title = nil) + if title + @title = title + else + @title + end + end + + def title_tag(title, options = nil) + content_tag :h2, title(title), options + end + +end diff --git a/app/helpers/title_helper.rb~ b/app/helpers/title_helper.rb~ new file mode 100644 index 000000000..aba7cc490 --- /dev/null +++ b/app/helpers/title_helper.rb~ @@ -0,0 +1,11 @@ +module TitleHelper + + def title(title = nil) + if title + @title = title + else + @title + end + end + +end diff --git a/app/helpers/welcome_helper.rb b/app/helpers/welcome_helper.rb new file mode 100644 index 000000000..eeead45fc --- /dev/null +++ b/app/helpers/welcome_helper.rb @@ -0,0 +1,2 @@ +module WelcomeHelper +end diff --git a/app/mailers/.gitkeep b/app/mailers/.gitkeep new file mode 100644 index 000000000..e69de29bb diff --git a/app/models/.gitkeep b/app/models/.gitkeep new file mode 100644 index 000000000..e69de29bb diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb new file mode 100644 index 000000000..048347894 --- /dev/null +++ b/app/views/layouts/application.html.erb @@ -0,0 +1,35 @@ + + + + CHOUETTE - <%= title %> + <%= stylesheet_link_tag :application %> + <%= javascript_include_tag :application %> + <%= csrf_meta_tag %> + + + + + +
+
+ <% flash_tag flash %> +
+
+ <%= yield %> +
+ +
+ + diff --git a/app/views/layouts/application.html.erb~ b/app/views/layouts/application.html.erb~ new file mode 100644 index 000000000..183dd3b57 --- /dev/null +++ b/app/views/layouts/application.html.erb~ @@ -0,0 +1,36 @@ + + + + Kyriel - <%= title %> + <%= stylesheet_link_tag :application %> + <%= javascript_include_tag :application %> + <%= csrf_meta_tag %> + + + + + +
+
+ <% flash.each_pair do |type, message| %> + <%= content_tag :div, message, :class => type %> + <% end %> +
+
+ <%= yield %> +
+ +
+ + diff --git a/app/views/lines/_form.erb b/app/views/lines/_form.erb new file mode 100644 index 000000000..4d1a049b2 --- /dev/null +++ b/app/views/lines/_form.erb @@ -0,0 +1,11 @@ +<% semantic_form_for @line do |form| %> + <% form.inputs do %> + <%= form.input :name %> + <%= form.input :number %> + <% end %> + + <% form.buttons do %> + <%= form.commit_button %> + ou <%= link_to "revenir", @line %> + <% end %> +<% end %> diff --git a/app/views/lines/_form.erb~ b/app/views/lines/_form.erb~ new file mode 100644 index 000000000..b4c702187 --- /dev/null +++ b/app/views/lines/_form.erb~ @@ -0,0 +1,13 @@ +<% semantic_form_for [@network, @line] do |form| %> + <% form.inputs do %> + <%= form.input :name %> + <%= form.input :code %> + <%= form.input :priority, :as => :select, :collection => Potimart::Line.priorities %> + <%= form.input :color, :input_html => {:onclick => "startColorPicker(this)", :onkeyup => "maskedHex(this)"}%> + <% end %> + + <% form.buttons do %> + <%= form.commit_button %> + ou <%= link_to "revenir", [@network, @line] %> + <% end %> +<% end %> diff --git a/app/views/lines/_line.erb b/app/views/lines/_line.erb new file mode 100644 index 000000000..7fd0daded --- /dev/null +++ b/app/views/lines/_line.erb @@ -0,0 +1,11 @@ +<%= div_for(line) do %> + <%= link_to(line, :class => "preview") do %> +
+
<%= line.number %>
+
+ <% end %> + <%= link_to line.name, line %> +
+ +
+<% end %> diff --git a/app/views/lines/_line.erb~ b/app/views/lines/_line.erb~ new file mode 100644 index 000000000..82873971a --- /dev/null +++ b/app/views/lines/_line.erb~ @@ -0,0 +1,16 @@ +<% div_for(line) do %> + <% link_to(line, :class => "preview") do %> +
<%= line.code%>
+ <% end %> + <%= link_to line.name, line %> +
+ <% if !line.journey_patterns.main.nil? %> +

+ <%= line.journey_patterns.main.departure %> - <%= line.journey_patterns.main.arrival %> +

+ <% end %> +

+ <%= line.journey_patterns.count %> missions +

+
+<% end %> diff --git a/app/views/lines/edit.html.erb b/app/views/lines/edit.html.erb new file mode 100644 index 000000000..491a821fa --- /dev/null +++ b/app/views/lines/edit.html.erb @@ -0,0 +1,3 @@ +<%= title_tag "Modifier la Ligne #{@line.name}" %> + +<%= render "form" %> diff --git a/app/views/lines/index.html.erb b/app/views/lines/index.html.erb new file mode 100644 index 000000000..d76172269 --- /dev/null +++ b/app/views/lines/index.html.erb @@ -0,0 +1,10 @@ +<%= title_tag "Lignes" %> + +<%= render :partial => "line", :collection => @lines %> + +<% content_for :sidebar do %> + +<% end %> diff --git a/app/views/lines/index.html.erb~ b/app/views/lines/index.html.erb~ new file mode 100644 index 000000000..f357772fa --- /dev/null +++ b/app/views/lines/index.html.erb~ @@ -0,0 +1,18 @@ +
+ Trier par + <%= link_to_order "Code", "code" %> | + <%= link_to_order "Priorité", "priority" %> | + <%= link_to_order "Nom", "name" %> +
+ +<%= title_tag "Lignes" %> + +<%= render :partial => "line", :collection => @lines %> + +<% content_for :sidebar do %> + +<% end %> diff --git a/app/views/lines/new.html.erb b/app/views/lines/new.html.erb new file mode 100644 index 000000000..d580a2aae --- /dev/null +++ b/app/views/lines/new.html.erb @@ -0,0 +1,3 @@ +<%= title_tag "Créer la Ligne" %> + +<%= render "form" %> diff --git a/app/views/lines/show.html.erb b/app/views/lines/show.html.erb new file mode 100644 index 000000000..cf60567f1 --- /dev/null +++ b/app/views/lines/show.html.erb @@ -0,0 +1,27 @@ +<%= title_tag "Ligne #{@line.name}" %> + +
+ +
+

+ + <%= @line.name %> +

+

+ + <%= @line.number %> +

+

+ + <%= @line.registrationnumber %> +

+
+
+ +<% content_for :sidebar do %> + +<% end %> diff --git a/app/views/lines/show.html.erb~ b/app/views/lines/show.html.erb~ new file mode 100644 index 000000000..fe9ddaca6 --- /dev/null +++ b/app/views/lines/show.html.erb~ @@ -0,0 +1,45 @@ +<%= title_tag "Ligne #{@line.name}" %> + +
+ <%= @map.to_html %> + +
+

+ + <%= @line.name %> +

+

+ + <%= @line.code %> +

+

+ + <%= @line.priority %> +

+ + + <%= @line.color %> + +

+

+ + <%= @line.chouette_id %> +

+
+
+

Missions

+ <%= render :partial => "journey_patterns/journey_pattern", :collection => @line.journey_patterns %> +
+
+ +<% content_for :sidebar do %> + +<% end %> diff --git a/app/views/welcome/index.html.erb b/app/views/welcome/index.html.erb new file mode 100644 index 000000000..e69de29bb diff --git a/app/views/welcome/index.html.erb~ b/app/views/welcome/index.html.erb~ new file mode 100644 index 000000000..e69de29bb -- cgit v1.2.3