aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Gemfile6
-rw-r--r--Gemfile.lock21
-rw-r--r--app/assets/stylesheets/lines.css.scss64
-rw-r--r--app/assets/stylesheets/pagination.css.scss17
-rw-r--r--app/controllers/lines_controller.rb4
-rw-r--r--app/views/lines/_line.erb16
-rw-r--r--app/views/lines/index.html.erb50
7 files changed, 134 insertions, 44 deletions
diff --git a/Gemfile b/Gemfile
index 941a7bff5..4fad5fc98 100644
--- a/Gemfile
+++ b/Gemfile
@@ -5,8 +5,7 @@ gem 'rails', '3.1.3'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
-#gem 'user_interface', :path => '~/projects/user_interface'
-gem 'user_interface', :git => 'git://sim.dryade.priv/user_interface'
+gem 'user_interface', :git => 'git://sim.dryade.priv/user_interface'#, :path => '~/Projects/UserInterfaceDryade'
gem 'apartment', :git => 'git://github.com/dryade/apartment.git'
@@ -53,8 +52,7 @@ gem 'will_paginate', '~> 3.0'
gem 'ransack'
gem 'squeel'
-gem 'chouette-ninoxe', :git => 'git://chouette.dryade.priv/ninoxe'
-#gem 'chouette-ninoxe', :path => '/home/luc/projects/ninoxe'
+gem 'chouette-ninoxe', :git => 'git://chouette.dryade.priv/ninoxe'#, :path => '~/Projects/Ninoxe'
group :development do
gem 'autotest-rails'
diff --git a/Gemfile.lock b/Gemfile.lock
index dd20a98b4..acda1dfbd 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -1,4 +1,14 @@
GIT
+ remote: git://chouette.dryade.priv/ninoxe
+ revision: 5ffbe157e7d72379da01834a6f0830f0500d7526
+ specs:
+ chouette-ninoxe (0.0.8)
+ GeoRuby
+ activerecord
+ composite_primary_keys
+ geokit
+
+GIT
remote: git://github.com/dryade/activerecord-jdbc-adapter.git
revision: 5b45a0a417e146e92db8c57b5c600cdeb9e957bf
specs:
@@ -38,20 +48,11 @@ GIT
GIT
remote: git://sim.dryade.priv/user_interface
- revision: a39cfb15f31e4ed5825b9c91bd2f5e2acdcdcc70
+ revision: 1653986271d0b186d1fd7691c90d6f8cd8ab51de
specs:
user_interface (0.0.1)
rails (~> 3.1.0)
-PATH
- remote: /home/luc/projects/ninoxe
- specs:
- chouette-ninoxe (0.0.8)
- GeoRuby
- activerecord
- composite_primary_keys
- geokit
-
GEM
remote: http://rubygems.org/
specs:
diff --git a/app/assets/stylesheets/lines.css.scss b/app/assets/stylesheets/lines.css.scss
index 2ba770492..b40633086 100644
--- a/app/assets/stylesheets/lines.css.scss
+++ b/app/assets/stylesheets/lines.css.scss
@@ -33,10 +33,25 @@
font-weight: normal;
line-height: 14px;
margin-top: 5px;
-
+
a {
display:inline;
- color: #095495;
+ color: #777;
+ }
+
+ .actions {
+ margin-top: 14px;
+ a {
+ color: #666;
+ padding-left: 12px;
+ }
+
+ a.edit {
+ background: url(image-path('user_interface/ui/edit-small.png')) no-repeat 0% 50%;
+ }
+ a.remove {
+ background: url(image-path('user_interface/ui/remove-small.png')) no-repeat 0% 50%;
+ }
}
p {
@@ -62,15 +77,30 @@
.line:after {
@include after_div_for_object;
}
+
+ .lines {
+ margin-top: 20px;
+ }
+
+ .lines:after {
+ @include content_to_clear;
+ }
.line {
@include div_for_object;
-
+
+ /* to create multi-column index */
+ width: 350px;
+ float: left;
+ padding-right: 10px;
+
.color {
width: 64px;
height: 64px;
float: left;
margin-right: 10px;
+ border: 1px solid #999;
+
a {
text-decoration: none;
}
@@ -79,12 +109,10 @@
.number {
font-size: 16px;
text-align: center;
- color: white;
font-weight: bold;
padding-top: 21px;
}
}
-
}
#workspace.lines.edit, #workspace.lines.new
@@ -114,3 +142,29 @@
text-decoration: none;
}
}
+
+/* FIXME a déplacer dans layout */
+
+#sidebar ul {
+ padding: 0 8px;
+
+ li {
+ margin: 4px 0;
+ }
+}
+
+#sidebar ul.selection li {
+ a {
+ padding-left: 20px;
+ }
+ a.current {
+ text-decoration: none;
+ color: black !important;
+ background: url(image-path('user_interface/ui/accept.png')) no-repeat;
+ }
+ a.all {
+ background-image: none;
+ }
+}
+
+
diff --git a/app/assets/stylesheets/pagination.css.scss b/app/assets/stylesheets/pagination.css.scss
index 53937fcb6..66b4b9fbe 100644
--- a/app/assets/stylesheets/pagination.css.scss
+++ b/app/assets/stylesheets/pagination.css.scss
@@ -1,8 +1,9 @@
.pagination {
- background: white;
cursor: default;
- > a, > span, > em{
+ margin: 10px 0;
+
+ > a, > span, > em {
padding: 0.2em 0.5em;
display: block;
float: left;
@@ -11,28 +12,28 @@
> .disabled{
color: #999999;
- border: 1px solid #dddddd;
+ /* border: 1px solid #dddddd; */
}
> .current{
font-style: normal;
font-weight: bold;
- background: #2e6ab1;
+ background: #666;
color: white;
- border: 1px solid #2e6ab1;
+ border: 1px solid #666;
}
> a{
text-decoration: none;
- color: #105cb6;
- border: 1px solid #9aafe5;
+ color: #666;
+ border: 1px solid #ddd;
&:hover, &:focus{
color: #000033;
border-color: #000033;
}
}
- .page_info{
+ .paginated_content {
padding: 0.4em 0.6em
}
diff --git a/app/controllers/lines_controller.rb b/app/controllers/lines_controller.rb
index 6968618b8..4845b6bfb 100644
--- a/app/controllers/lines_controller.rb
+++ b/app/controllers/lines_controller.rb
@@ -8,8 +8,8 @@ class LinesController < ChouetteController
protected
def collection
- @q = Chouette::Line.search(params[:q])
- @lines ||= @q.result(:distinct => true).paginate(:page => params[:page], :per_page => 10)
+ @q = referential.lines.search(params[:q])
+ @lines ||= @q.result(:distinct => true).order(:number).paginate(:page => params[:page], :per_page => 10).includes([:network, :company])
end
def sort_column
diff --git a/app/views/lines/_line.erb b/app/views/lines/_line.erb
index 2a8fe4683..66b6b8529 100644
--- a/app/views/lines/_line.erb
+++ b/app/views/lines/_line.erb
@@ -1,15 +1,19 @@
<%= div_for(line) do %>
- <%= link_to([@referential, line], :class => "preview") do %>
- <div class="color" style="background-color: grey ">
+ <%= link_to([@referential, line], :class => "preview", :title => "Ligne #{line.number}") do %>
+ <div class="color">
+ <% if line.number.length <= 3 %>
<div class="number"><%= line.number %></div>
+ <% end %>
</div>
<% end %>
- <%= link_to line.name, [@referential, line] %>
+ <%= link_to truncate(line.name, :length => 30), [@referential, line], :title => "Ligne #{line.name}" %>
<div class="info">
- <p><%= link_to_if( line.network, line.network.name, referential_network_path(@referential, line.network), :title => "Réseau : #{line.network.name}" ) %> | <%= link_to_if( line.company, line.company.name, referential_company_path(@referential, line.company), :title => "Transporteur : #{line.company.name}" ) %> </p>
- <p>
+ Réseau <%= link_to_if( line.network, line.network.name, referential_network_path(@referential, line.network), :title => "Réseau : #{line.network.name}" ) %> -
+ Transporteur <%= link_to_if( line.company, line.company.name, referential_company_path(@referential, line.company), :title => "Transporteur : #{line.company.name}" ) %>
+
+ <div class="actions">
<%= link_to "Modifier", edit_referential_line_path(@referential, line), :class => "edit" %> |
<%= link_to "Supprimer", referential_line_path(@referential, line), :method => :delete, :confirm => t('lines.actions.destroy_confirm'), :class => "remove" %>
- </p>
+ </div>
</div>
<% end %>
diff --git a/app/views/lines/index.html.erb b/app/views/lines/index.html.erb
index a8fb79d0f..aa36bfb99 100644
--- a/app/views/lines/index.html.erb
+++ b/app/views/lines/index.html.erb
@@ -3,24 +3,56 @@
<%= search_form_for @q, :url => referential_lines_path(@referential), :html => {:method => :get} do |f| %>
<%= f.label :name_or_number_cont %>
<%= f.text_field :name_or_number_cont %>
- <%= f.submit %>
+
+ <%= f.hidden_field :company_id_eq %>
+ <%= f.hidden_field :network_id_eq %>
+
+ <%= f.submit %> ou
+ <%= link_to "annuler", referential_lines_path(@referential) %>
+<% end %>
+
+<% if @q.company_id_eq.present? %>
+<p>
+ Transporteur : <%= @referential.companies.find(@q.company_id_eq).name %>
+</p>
<% end %>
-<div class="digg_pagination">
- <%= will_paginate @lines %>
- <div class="page_info">
- <%= render :partial => "line", :collection => @lines %>
- </div>
- <%= will_paginate @lines %>
+<% if @q.network_id_eq.present? %>
+<p>
+ Réseau : <%= @referential.networks.find(@q.network_id_eq).name %>
+</p>
+<% end %>
+
+
+<%#= will_paginate @lines %>
+<div class="lines paginated_content">
+ <%= render :partial => "line", :collection => @lines %>
</div>
+<%= will_paginate @lines %>
<% content_for :sidebar do %>
<ul class="actions">
<li><%= link_to t('lines.actions.new'), new_referential_line_path(@referential), :class => "add" %></li>
- <br>
</ul>
-<ul>
+<h3>Sélection</h3>
+
+<h4><%= Chouette::Company.model_name.human.pluralize %></h4>
+
+<ul class="selection">
+<% @referential.companies.each do |company| %>
+<li><%= link_to company.name, params.deep_merge("q" => {"company_id_eq" => company.id}), :class => ("current" if @q.company_id_eq == company.id) %></li>
+<% end %>
+<li><%= link_to "Toutes", params.deep_merge("q" => {"company_id_eq" => nil}), :class => ["all", ("current" if @q.company_id_eq.blank?)].compact.join(" ") %></li>
+</ul>
+
+<h4><%= Chouette::Network.model_name.human.pluralize %></h4>
+
+<ul class="selection">
+<% @referential.networks.each do |network| %>
+<li><%= link_to network.name, params.deep_merge("q" => {"network_id_eq" => network.id}), :class => ("current" if @q.network_id_eq == network.id) %></li>
+<% end %>
+<li><%= link_to "Tous", params.deep_merge("q" => {"network_id_eq" => nil}), :class => ["all", ("current" if @q.network_id_eq.blank?)].compact.join(" ") %></li>
</ul>
<% end %>