diff options
| author | Michel Etienne | 2012-10-09 16:03:11 +0200 |
|---|---|---|
| committer | Michel Etienne | 2012-10-09 16:03:11 +0200 |
| commit | 72de1c47254ca70d7be04a96b5b11dfed8f79df6 (patch) | |
| tree | c4ccd9fb97779edd589071570596779f266b990d /app/views/group_of_lines | |
| parent | 04835501dbf267b2046d24e65400e23c927d4ab3 (diff) | |
| download | chouette-core-72de1c47254ca70d7be04a96b5b11dfed8f79df6.tar.bz2 | |
add group_of_line managment
Diffstat (limited to 'app/views/group_of_lines')
| -rw-r--r-- | app/views/group_of_lines/_form.erb | 27 | ||||
| -rw-r--r-- | app/views/group_of_lines/_group_of_line.erb | 9 | ||||
| -rw-r--r-- | app/views/group_of_lines/_lines_detail.html.erb | 10 | ||||
| -rw-r--r-- | app/views/group_of_lines/edit.html.erb | 3 | ||||
| -rw-r--r-- | app/views/group_of_lines/index.html.erb | 26 | ||||
| -rw-r--r-- | app/views/group_of_lines/new.html.erb | 3 | ||||
| -rw-r--r-- | app/views/group_of_lines/show.html.erb | 48 | ||||
| -rw-r--r-- | app/views/group_of_lines/show.js.erb | 4 | ||||
| -rw-r--r-- | app/views/group_of_lines/show.kml.erb | 13 |
9 files changed, 143 insertions, 0 deletions
diff --git a/app/views/group_of_lines/_form.erb b/app/views/group_of_lines/_form.erb new file mode 100644 index 000000000..0dcdc9379 --- /dev/null +++ b/app/views/group_of_lines/_form.erb @@ -0,0 +1,27 @@ +<%= semantic_form_for [@referential, @group_of_line] do |form| %> + <%= form.inputs do %> + <%= form.input :name %> + <%= form.input :comment %> + <%= form.input :objectid, :required => !@group_of_line.new_record?, :input_html => { :disabled => !@group_of_line.new_record? } %> + <% end %> + + <%= form.inputs do %> + <%= form.input :line_tokens, :label => t('.lines'), :as => :text, :input_html => { :"data-pre" => ( @group_of_line.lines.map { |line| { :id => line.id, :name => line.published_name } } ).to_json } %> + <% end %> + + <%= form.actions do %> + <%= form.action :submit, :as => :button %> + <%= form.action :cancel, :as => :link %> + <% end %> +<% end %> + +<script> + $(function() { + $( "#group_of_line_line_tokens" ).tokenInput('<%= name_filter_referential_lines_path(@referential, :format => :json) %>', { + crossDomain: false, + prePopulate: $('#line_tokens').data('pre'), + minChars: 3, + preventDuplicates: true, + }); + }); +</script> diff --git a/app/views/group_of_lines/_group_of_line.erb b/app/views/group_of_lines/_group_of_line.erb new file mode 100644 index 000000000..b3a9099d8 --- /dev/null +++ b/app/views/group_of_lines/_group_of_line.erb @@ -0,0 +1,9 @@ +<%= div_for(group_of_line) do %> + <%= link_to group_of_line.name, [@referential, group_of_line] %> + <div class="info"> + <div class="actions"> + <%= link_to t("actions.edit"), edit_referential_group_of_line_path(@referential, group_of_line), :class => "edit" %> | + <%= link_to t("actions.destroy"), referential_group_of_line_path(@referential, group_of_line), :method => :delete, :confirm => t('group_of_lines.actions.destroy_confirm'), :class => "remove" %> + </div> + </div> +<% end %> diff --git a/app/views/group_of_lines/_lines_detail.html.erb b/app/views/group_of_lines/_lines_detail.html.erb new file mode 100644 index 000000000..4d4058540 --- /dev/null +++ b/app/views/group_of_lines/_lines_detail.html.erb @@ -0,0 +1,10 @@ + <div class="page_info"> + <span class="search"> <%= t("will_paginate.page_entries_info.list") %></span> <%= page_entries_info @lines %> + </div> + <div class="lines paginated_content"> + <%= render :partial => "lines/line", :collection => @lines %> + </div> + <div class="pagination"> + <%= will_paginate @lines, :container => false %> + </div> + diff --git a/app/views/group_of_lines/edit.html.erb b/app/views/group_of_lines/edit.html.erb new file mode 100644 index 000000000..541e708ca --- /dev/null +++ b/app/views/group_of_lines/edit.html.erb @@ -0,0 +1,3 @@ +<%= title_tag t('group_of_lines.edit.title', :group_of_line => @group_of_line.name) %> + +<%= render "form" %> diff --git a/app/views/group_of_lines/index.html.erb b/app/views/group_of_lines/index.html.erb new file mode 100644 index 000000000..6f01455b8 --- /dev/null +++ b/app/views/group_of_lines/index.html.erb @@ -0,0 +1,26 @@ +<%= title_tag t('group_of_lines.index.title') %> + +<%= search_form_for @q, :url => referential_group_of_lines_path(@referential), :html => {:method => :get} do |f| %> + <%= f.label :name_cont, "#{t('.name')} :" %> + <%= f.text_field :name_cont %> + + <%= f.submit t('actions.search') %> <%= t("or") %> + <%= link_to t("cancel"), referential_group_of_lines_path(@referential) %> +<% end %> + +<div class="page_info"> + <span class="search"> <%= t("will_paginate.page_entries_info.search") %></span> <%= page_entries_info @group_of_lines %> +</div> +<div class="group_of_lines paginated_content"> + <%= render :partial => "group_of_line", :collection => @group_of_lines %> +</div> +<div class="pagination"> + <%= will_paginate @group_of_lines, :container => false %> +</div> + +<% content_for :sidebar do %> +<ul class="actions"> + <li><%= link_to t('group_of_lines.actions.new'), new_referential_group_of_line_path(@referential), :class => "add" %></li> + <br> +</ul> +<% end %> diff --git a/app/views/group_of_lines/new.html.erb b/app/views/group_of_lines/new.html.erb new file mode 100644 index 000000000..a2da652af --- /dev/null +++ b/app/views/group_of_lines/new.html.erb @@ -0,0 +1,3 @@ +<%= title_tag t('group_of_lines.new.title') %> + +<%= render "form" %> diff --git a/app/views/group_of_lines/show.html.erb b/app/views/group_of_lines/show.html.erb new file mode 100644 index 000000000..01084fb74 --- /dev/null +++ b/app/views/group_of_lines/show.html.erb @@ -0,0 +1,48 @@ +<%= title_tag t('group_of_lines.show.title', :group_of_line => @group_of_line.name )%> + +<div class="group_of_line_show"> + <%= @map.to_html %> + <div class="summary"> + <p> + <label><%= @group_of_line.human_attribute_name("name") %>: </label> + <%= @group_of_line.name %> + </p> + <p> + <label><%= @group_of_line.human_attribute_name("comment") %>: </label> + <%= @group_of_line.comment %> + </p> + <p> + <label><%= @group_of_line.human_attribute_name("objectid") %>: </label> + <%= @group_of_line.objectid %> + </p> + <p> + <label><%= @group_of_line.human_attribute_name("creation_time") %>: </label> + <%= l @group_of_line.creation_time %> + </p> + <p> + <label><%= @group_of_line.human_attribute_name("creator_id") %>: </label> + <%= @group_of_line.creator_id %> + </p> + </div> + + <p class="after_map" /> + <h3 class="group_of_line_lines"> + <a class="lines"><%= t('.lines') %> + <%= image_tag("icons/plus.png" , :class => "switcher") %> + <%= image_tag("icons/minus.png" , :class => "switcher" , :style => "display: none;") %> + </a> + </h3> + <div class="lines_detail" style="display: none;"> + <%= render :partial => "lines_detail" %> + </div> + + +</div> + +<% content_for :sidebar do %> +<ul class="actions"> + <li><%= link_to t('group_of_lines.actions.edit'), edit_referential_group_of_line_path(@referential, @group_of_line), :class => "edit" %></li> + <li><%= link_to t('group_of_lines.actions.destroy'), referential_group_of_line_path(@referential, @group_of_line), :method => :delete, :confirm => t('group_of_lines.actions.destroy_confirm'), :class => "remove" %></li> + <br> +</ul> +<% end %> diff --git a/app/views/group_of_lines/show.js.erb b/app/views/group_of_lines/show.js.erb new file mode 100644 index 000000000..bd8ac5a7f --- /dev/null +++ b/app/views/group_of_lines/show.js.erb @@ -0,0 +1,4 @@ +$(function (){ + $(".lines_detail").html("<%= escape_javascript(render(:partial => "lines_detail")) %>"); +}); + diff --git a/app/views/group_of_lines/show.kml.erb b/app/views/group_of_lines/show.kml.erb new file mode 100644 index 000000000..6b1a34688 --- /dev/null +++ b/app/views/group_of_lines/show.kml.erb @@ -0,0 +1,13 @@ +<?xml version="1.0" encoding="UTF-8"?> +<kml xmlns="http://www.opengis.net/kml/2.2"> + <Document> + <% @group_of_line.commercial_stop_areas.each do |stop_area| %> + <Placemark id="<%= stop_area.id %>" > + <name><%= stop_area.name %></name> + <stop_area_type><%= stop_area.area_type.underscore %></stop_area_type> + <%= (stop_area.position or stop_area.default_position).kml_representation.html_safe %> + </Placemark> + <% end %> + </Document> +</kml> + |
