Cités et régions initialisées
This commit is contained in:
parent
107a34c1a0
commit
12b3be983e
62
Gemfile.lock
62
Gemfile.lock
@ -1,6 +1,6 @@
|
|||||||
GIT
|
GIT
|
||||||
remote: git://github.com/gregbell/active_admin.git
|
remote: git://github.com/gregbell/active_admin.git
|
||||||
revision: 5b4353edc262bcb9df84f5d6f3e35392194d783a
|
revision: 81af5ec7e3ee780f5bf170938fc64e36e96adfe6
|
||||||
specs:
|
specs:
|
||||||
activeadmin (1.0.0.pre)
|
activeadmin (1.0.0.pre)
|
||||||
arbre (~> 1.0)
|
arbre (~> 1.0)
|
||||||
@ -19,25 +19,25 @@ GIT
|
|||||||
GEM
|
GEM
|
||||||
remote: https://rubygems.org/
|
remote: https://rubygems.org/
|
||||||
specs:
|
specs:
|
||||||
actionmailer (4.0.1)
|
actionmailer (4.0.2)
|
||||||
actionpack (= 4.0.1)
|
actionpack (= 4.0.2)
|
||||||
mail (~> 2.5.4)
|
mail (~> 2.5.4)
|
||||||
actionpack (4.0.1)
|
actionpack (4.0.2)
|
||||||
activesupport (= 4.0.1)
|
activesupport (= 4.0.2)
|
||||||
builder (~> 3.1.0)
|
builder (~> 3.1.0)
|
||||||
erubis (~> 2.7.0)
|
erubis (~> 2.7.0)
|
||||||
rack (~> 1.5.2)
|
rack (~> 1.5.2)
|
||||||
rack-test (~> 0.6.2)
|
rack-test (~> 0.6.2)
|
||||||
activemodel (4.0.1)
|
activemodel (4.0.2)
|
||||||
activesupport (= 4.0.1)
|
activesupport (= 4.0.2)
|
||||||
builder (~> 3.1.0)
|
builder (~> 3.1.0)
|
||||||
activerecord (4.0.1)
|
activerecord (4.0.2)
|
||||||
activemodel (= 4.0.1)
|
activemodel (= 4.0.2)
|
||||||
activerecord-deprecated_finders (~> 1.0.2)
|
activerecord-deprecated_finders (~> 1.0.2)
|
||||||
activesupport (= 4.0.1)
|
activesupport (= 4.0.2)
|
||||||
arel (~> 4.0.0)
|
arel (~> 4.0.0)
|
||||||
activerecord-deprecated_finders (1.0.3)
|
activerecord-deprecated_finders (1.0.3)
|
||||||
activesupport (4.0.1)
|
activesupport (4.0.2)
|
||||||
i18n (~> 0.6, >= 0.6.4)
|
i18n (~> 0.6, >= 0.6.4)
|
||||||
minitest (~> 4.2)
|
minitest (~> 4.2)
|
||||||
multi_json (~> 1.3)
|
multi_json (~> 1.3)
|
||||||
@ -75,7 +75,7 @@ GEM
|
|||||||
railties (>= 3.2.6, < 5)
|
railties (>= 3.2.6, < 5)
|
||||||
thread_safe (~> 0.1)
|
thread_safe (~> 0.1)
|
||||||
warden (~> 1.2.3)
|
warden (~> 1.2.3)
|
||||||
devise-i18n (0.10.0)
|
devise-i18n (0.10.2)
|
||||||
em-websocket (0.5.0)
|
em-websocket (0.5.0)
|
||||||
eventmachine (>= 0.12.9)
|
eventmachine (>= 0.12.9)
|
||||||
http_parser.rb (~> 0.5.3)
|
http_parser.rb (~> 0.5.3)
|
||||||
@ -98,7 +98,7 @@ GEM
|
|||||||
guard-bundler (2.0.0)
|
guard-bundler (2.0.0)
|
||||||
bundler (~> 1.0)
|
bundler (~> 1.0)
|
||||||
guard (~> 2.2)
|
guard (~> 2.2)
|
||||||
guard-livereload (2.0.1)
|
guard-livereload (2.1.0)
|
||||||
em-websocket (~> 0.5)
|
em-websocket (~> 0.5)
|
||||||
guard (~> 2.0)
|
guard (~> 2.0)
|
||||||
multi_json (~> 1.8)
|
multi_json (~> 1.8)
|
||||||
@ -107,21 +107,21 @@ GEM
|
|||||||
minitest (>= 3.0)
|
minitest (>= 3.0)
|
||||||
haml (4.0.4)
|
haml (4.0.4)
|
||||||
tilt
|
tilt
|
||||||
haml-rails (0.5.1)
|
haml-rails (0.5.2)
|
||||||
actionpack (~> 4.0.0)
|
actionpack (~> 4.0.1)
|
||||||
activesupport (~> 4.0.0)
|
activesupport (~> 4.0.1)
|
||||||
haml (>= 3.1, < 5.0)
|
haml (>= 3.1, < 5.0)
|
||||||
railties (~> 4.0.0)
|
railties (~> 4.0.1)
|
||||||
has_scope (0.6.0.rc)
|
has_scope (0.6.0.rc)
|
||||||
actionpack (>= 3.2, < 5)
|
actionpack (>= 3.2, < 5)
|
||||||
activesupport (>= 3.2, < 5)
|
activesupport (>= 3.2, < 5)
|
||||||
hike (1.2.3)
|
hike (1.2.3)
|
||||||
http_parser.rb (0.5.3)
|
http_parser.rb (0.5.3)
|
||||||
i18n (0.6.5)
|
i18n (0.6.9)
|
||||||
inherited_resources (1.4.1)
|
inherited_resources (1.4.1)
|
||||||
has_scope (~> 0.6.0.rc)
|
has_scope (~> 0.6.0.rc)
|
||||||
responders (~> 1.0.0.rc)
|
responders (~> 1.0.0.rc)
|
||||||
jbuilder (1.5.2)
|
jbuilder (1.5.3)
|
||||||
activesupport (>= 3.0.0)
|
activesupport (>= 3.0.0)
|
||||||
multi_json (>= 1.2.0)
|
multi_json (>= 1.2.0)
|
||||||
jquery-rails (3.0.4)
|
jquery-rails (3.0.4)
|
||||||
@ -136,7 +136,7 @@ GEM
|
|||||||
kaminari (0.15.0)
|
kaminari (0.15.0)
|
||||||
actionpack (>= 3.0.0)
|
actionpack (>= 3.0.0)
|
||||||
activesupport (>= 3.0.0)
|
activesupport (>= 3.0.0)
|
||||||
listen (2.2.0)
|
listen (2.4.0)
|
||||||
celluloid (>= 0.15.2)
|
celluloid (>= 0.15.2)
|
||||||
rb-fsevent (>= 0.9.3)
|
rb-fsevent (>= 0.9.3)
|
||||||
rb-inotify (>= 0.9)
|
rb-inotify (>= 0.9)
|
||||||
@ -160,20 +160,20 @@ GEM
|
|||||||
rack (1.5.2)
|
rack (1.5.2)
|
||||||
rack-test (0.6.2)
|
rack-test (0.6.2)
|
||||||
rack (>= 1.0)
|
rack (>= 1.0)
|
||||||
rails (4.0.1)
|
rails (4.0.2)
|
||||||
actionmailer (= 4.0.1)
|
actionmailer (= 4.0.2)
|
||||||
actionpack (= 4.0.1)
|
actionpack (= 4.0.2)
|
||||||
activerecord (= 4.0.1)
|
activerecord (= 4.0.2)
|
||||||
activesupport (= 4.0.1)
|
activesupport (= 4.0.2)
|
||||||
bundler (>= 1.3.0, < 2.0)
|
bundler (>= 1.3.0, < 2.0)
|
||||||
railties (= 4.0.1)
|
railties (= 4.0.2)
|
||||||
sprockets-rails (~> 2.0.0)
|
sprockets-rails (~> 2.0.0)
|
||||||
rails-i18n (4.0.0)
|
rails-i18n (4.0.0)
|
||||||
i18n (~> 0.6)
|
i18n (~> 0.6)
|
||||||
rails (~> 4.0.0)
|
rails (~> 4.0.0)
|
||||||
railties (4.0.1)
|
railties (4.0.2)
|
||||||
actionpack (= 4.0.1)
|
actionpack (= 4.0.2)
|
||||||
activesupport (= 4.0.1)
|
activesupport (= 4.0.2)
|
||||||
rake (>= 0.8.7)
|
rake (>= 0.8.7)
|
||||||
thor (>= 0.18.1, < 2.0)
|
thor (>= 0.18.1, < 2.0)
|
||||||
rake (10.1.0)
|
rake (10.1.0)
|
||||||
@ -214,10 +214,10 @@ GEM
|
|||||||
treetop (1.4.15)
|
treetop (1.4.15)
|
||||||
polyglot
|
polyglot
|
||||||
polyglot (>= 0.3.1)
|
polyglot (>= 0.3.1)
|
||||||
turbolinks (1.3.1)
|
turbolinks (2.0.0)
|
||||||
coffee-rails
|
coffee-rails
|
||||||
tzinfo (0.3.38)
|
tzinfo (0.3.38)
|
||||||
uglifier (2.3.1)
|
uglifier (2.3.2)
|
||||||
execjs (>= 0.3.0)
|
execjs (>= 0.3.0)
|
||||||
json (>= 1.8.0)
|
json (>= 1.8.0)
|
||||||
warden (1.2.3)
|
warden (1.2.3)
|
||||||
|
3
app/admin/city.rb
Normal file
3
app/admin/city.rb
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
ActiveAdmin.register City do
|
||||||
|
permit_params :name, :majname, :postalcode, :inseecode, :regioncode, :latitude, :longitude
|
||||||
|
end
|
@ -3,31 +3,26 @@ ActiveAdmin.register_page "Dashboard" do
|
|||||||
menu :priority => 1, :label => proc{ I18n.t("active_admin.dashboard") }
|
menu :priority => 1, :label => proc{ I18n.t("active_admin.dashboard") }
|
||||||
|
|
||||||
content :title => proc{ I18n.t("active_admin.dashboard") } do
|
content :title => proc{ I18n.t("active_admin.dashboard") } do
|
||||||
div :class => "blank_slate_container", :id => "dashboard_default_message" do
|
columns do
|
||||||
span :class => "blank_slate" do
|
column do
|
||||||
span I18n.t("active_admin.dashboard_welcome.welcome")
|
panel "Contributeurs" do
|
||||||
small I18n.t("active_admin.dashboard_welcome.call_to_action")
|
ul do
|
||||||
|
User.all.map do |user|
|
||||||
|
li link_to(user, user)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
column do
|
||||||
|
panel "Contributeurs" do
|
||||||
|
ul do
|
||||||
|
User.all.map do |user|
|
||||||
|
li link_to(user.login, user)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
# Here is an example of a simple dashboard with columns and panels.
|
|
||||||
#
|
|
||||||
# columns do
|
|
||||||
# column do
|
|
||||||
# panel "Recent Posts" do
|
|
||||||
# ul do
|
|
||||||
# Post.recent(5).map do |post|
|
|
||||||
# li link_to(post.title, admin_post_path(post))
|
|
||||||
# end
|
|
||||||
# end
|
|
||||||
# end
|
|
||||||
# end
|
|
||||||
|
|
||||||
# column do
|
|
||||||
# panel "Info" do
|
|
||||||
# para "Welcome to ActiveAdmin."
|
|
||||||
# end
|
|
||||||
# end
|
|
||||||
# end
|
|
||||||
end # content
|
|
||||||
end
|
end
|
||||||
|
17
app/admin/region.rb
Normal file
17
app/admin/region.rb
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
ActiveAdmin.register Region do
|
||||||
|
|
||||||
|
|
||||||
|
# See permitted parameters documentation:
|
||||||
|
# https://github.com/gregbell/active_admin/blob/master/docs/2-resource-customization.md#setting-up-strong-parameters
|
||||||
|
#
|
||||||
|
# permit_params :list, :of, :attributes, :on, :model
|
||||||
|
#
|
||||||
|
# or
|
||||||
|
#
|
||||||
|
# permit_params do
|
||||||
|
# permitted = [:permitted, :attributes]
|
||||||
|
# permitted << :other if resource.something?
|
||||||
|
# permitted
|
||||||
|
# end
|
||||||
|
|
||||||
|
end
|
BIN
app/assets/images/baby_gnu_adl.png
Normal file
BIN
app/assets/images/baby_gnu_adl.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 14 KiB |
@ -1,7 +1,56 @@
|
|||||||
@import "compass"
|
@import "compass"
|
||||||
|
@import "font-awesome"
|
||||||
|
|
||||||
*
|
*
|
||||||
|
margin: 0
|
||||||
|
padding: 0
|
||||||
|
line-height: 1em
|
||||||
@include transition-duration(0.5s)
|
@include transition-duration(0.5s)
|
||||||
|
|
||||||
[class^="fa-"], [class*=" fa-"]
|
[class^="fa-"], [class*=" fa-"]
|
||||||
font-family: FontAwesome, Arial, Helvetica, sans-serif !important
|
font-family: FontAwesome, georgia, serif !important
|
||||||
|
&:before
|
||||||
|
font-style: normal
|
||||||
|
font-weight: normal !important
|
||||||
|
|
||||||
|
html
|
||||||
|
color: #000000
|
||||||
|
line-height: 1.3em
|
||||||
|
font-family: georgia, serif
|
||||||
|
background-color: #9CC5EE
|
||||||
|
|
||||||
|
body
|
||||||
|
margin: 5px 5px 0
|
||||||
|
padding: 10px
|
||||||
|
text-align: center
|
||||||
|
background: url("baby_gnu_adl.png") no-repeat scroll 30px 10px #FFFFFF
|
||||||
|
-moz-border-bottom-colors: none
|
||||||
|
-moz-border-left-colors: none
|
||||||
|
-moz-border-right-colors: none
|
||||||
|
-moz-border-top-colors: none
|
||||||
|
border-image: none
|
||||||
|
border-width: 1px 1px 0
|
||||||
|
border-style: solid solid none
|
||||||
|
border-color: #68A6E5 #68A6E5 -moz-use-text-color
|
||||||
|
|
||||||
|
a:link, a:visited
|
||||||
|
color: #336699
|
||||||
|
font-weight: bold
|
||||||
|
text-decoration: none
|
||||||
|
|
||||||
|
header.top
|
||||||
|
h1
|
||||||
|
margin: 10px 5px 5px
|
||||||
|
padding: 0
|
||||||
|
font-size: 2.1em
|
||||||
|
line-height: 1em
|
||||||
|
letter-spacing: 2px
|
||||||
|
h2
|
||||||
|
font-size: 0.8em
|
||||||
|
margin-top: 10px
|
||||||
|
font-style: italic
|
||||||
|
font-weight: normal
|
||||||
|
padding-bottom: 5px
|
||||||
|
|
||||||
|
main h1
|
||||||
|
margin-top: 1em
|
||||||
|
@ -1,12 +1,32 @@
|
|||||||
|
@import "compass"
|
||||||
|
|
||||||
|
table
|
||||||
|
margin: 1em auto
|
||||||
|
padding: 1em
|
||||||
|
border-spacing: 0
|
||||||
|
@include border-radius(2em, 2em)
|
||||||
|
@include box-shadow(2px 2px 4px black, 0 0 1em gray)
|
||||||
|
th
|
||||||
|
padding: 0.3em 0.6em
|
||||||
|
border-bottom: solid thin grey
|
||||||
|
td
|
||||||
|
padding: 0.3em 0.6em
|
||||||
|
text-align: left
|
||||||
|
tr:nth-child(even) td
|
||||||
|
border-bottom: solid thin #ddf
|
||||||
|
tr:nth-child(odd) td
|
||||||
|
border-bottom: solid thin #fdd
|
||||||
|
|
||||||
.view_link:link, .edit_link:link, .delete_link:link
|
.view_link:link, .edit_link:link, .delete_link:link
|
||||||
font-size: 0
|
font-size: 0
|
||||||
|
font-weight: normal
|
||||||
text-decoration: none
|
text-decoration: none
|
||||||
|
&:hover
|
||||||
|
text-shadow: 0px 0px 16px black
|
||||||
&:before
|
&:before
|
||||||
padding: 0.5em
|
padding: 0.5em
|
||||||
font-size: 20px
|
font-size: 20px
|
||||||
font-family: FontAwesome
|
font-family: FontAwesome
|
||||||
&:hover
|
|
||||||
text-shadow: 0px 0px 16px black
|
|
||||||
.view_link:link:before
|
.view_link:link:before
|
||||||
content: ''
|
content: ''
|
||||||
.edit_link:link:before
|
.edit_link:link:before
|
||||||
|
@ -1,28 +1,3 @@
|
|||||||
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
|
div
|
||||||
&.field, &.actions
|
&.field, &.actions
|
||||||
margin-bottom: 10px
|
margin-bottom: 10px
|
||||||
|
@ -1,2 +1,7 @@
|
|||||||
class CitiesController < InheritedResources::Base
|
class CitiesController < InheritedResources::Base
|
||||||
|
protected
|
||||||
|
# Never trust parameters from the scary internet, only allow the white list through.
|
||||||
|
def permitted_params
|
||||||
|
params.permit city: [:name, :majname, :postalcode, :inseecode, :regioncode, :latitude, :longitude]
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
@ -22,6 +22,6 @@
|
|||||||
%b Longitude:
|
%b Longitude:
|
||||||
= @city.longitude
|
= @city.longitude
|
||||||
|
|
||||||
= link_to 'Edit', edit_city_path(@city)
|
= link_to t('Edit'), edit_city_path(@city)
|
||||||
\|
|
\|
|
||||||
= link_to 'Back', cities_path
|
= link_to t('Back'), cities_path
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
/[if IE]
|
/[if IE]
|
||||||
%html(lang="#{I18n.locale}")
|
%html(lang="#{I18n.locale}")
|
||||||
%head
|
%head
|
||||||
%title AgendaDuLibreRails
|
%title L'Agenda du Libre
|
||||||
|
|
||||||
%meta(http-equiv='Content-Type' content='text/html; charset=utf-8')
|
%meta(http-equiv='Content-Type' content='text/html; charset=utf-8')
|
||||||
|
|
||||||
@ -33,9 +33,11 @@
|
|||||||
= render 'layouts/flash', flash: flash if flash.present?
|
= render 'layouts/flash', flash: flash if flash.present?
|
||||||
|
|
||||||
%header.top
|
%header.top
|
||||||
%h1= link_to 'Agenda du libre', root_url
|
%h1= link_to "L'Agenda du Libre", root_url
|
||||||
|
%h2 L'agenda des évènements du Logiciel Libre en France
|
||||||
|
|
||||||
= yield
|
%main
|
||||||
|
= yield
|
||||||
|
|
||||||
%footer.bottom
|
%footer.bottom
|
||||||
%nav
|
%nav
|
||||||
|
@ -32,7 +32,11 @@ en:
|
|||||||
|
|
||||||
activerecord:
|
activerecord:
|
||||||
models:
|
models:
|
||||||
|
admin_user: Admin
|
||||||
|
comment: Comment
|
||||||
user: Contributor
|
user: Contributor
|
||||||
|
city: City
|
||||||
|
region: Region
|
||||||
attributes:
|
attributes:
|
||||||
user:
|
user:
|
||||||
login: Id
|
login: Id
|
||||||
|
@ -11,7 +11,11 @@ fr:
|
|||||||
|
|
||||||
activerecord:
|
activerecord:
|
||||||
models:
|
models:
|
||||||
|
admin_user: Admin
|
||||||
|
comment: Commentaire
|
||||||
user: Contributeur
|
user: Contributeur
|
||||||
|
city: Cité
|
||||||
|
region: Région
|
||||||
attributes:
|
attributes:
|
||||||
user:
|
user:
|
||||||
login: Identifiant
|
login: Identifiant
|
||||||
@ -20,6 +24,11 @@ fr:
|
|||||||
lastname: Nom
|
lastname: Nom
|
||||||
firstname: Prénom
|
firstname: Prénom
|
||||||
|
|
||||||
|
helpers:
|
||||||
|
submit:
|
||||||
|
create: "Créer %{model}"
|
||||||
|
update: "Mettre à jour %{model}"
|
||||||
|
|
||||||
layouts:
|
layouts:
|
||||||
application:
|
application:
|
||||||
login: Authentication
|
login: Authentication
|
||||||
|
@ -12,7 +12,6 @@
|
|||||||
@import "active_admin/base"
|
@import "active_admin/base"
|
||||||
@import "font-awesome"
|
@import "font-awesome"
|
||||||
@import "list"
|
@import "list"
|
||||||
@import "all"
|
|
||||||
|
|
||||||
// Overriding any non-variable SASS must be done after the fact.
|
// Overriding any non-variable SASS must be done after the fact.
|
||||||
// For example, to change the default status-tag color:
|
// For example, to change the default status-tag color:
|
Loading…
Reference in New Issue
Block a user