Trouve ton Gull!
This commit is contained in:
parent
f7ecdfdfbf
commit
4559b8dc1a
|
@ -36,3 +36,7 @@ $(document).on 'page:change ready', ->
|
||||||
$(document).on 'page:load', ->
|
$(document).on 'page:load', ->
|
||||||
# Reload polyfill when turbolinks loads a new page
|
# Reload polyfill when turbolinks loads a new page
|
||||||
$(this).updatePolyfill()
|
$(this).updatePolyfill()
|
||||||
|
|
||||||
|
$(document).ready ->
|
||||||
|
$("img").error ->
|
||||||
|
$(this).hide()
|
||||||
|
|
|
@ -7,10 +7,11 @@ table
|
||||||
padding: 0.3em 0.6em
|
padding: 0.3em 0.6em
|
||||||
|
|
||||||
&.list
|
&.list
|
||||||
tr:nth-child(odd)
|
tbody
|
||||||
background-color: #D1EAFF
|
tr:nth-child(odd)
|
||||||
tr:nth-child(even)
|
background-color: #D1EAFF
|
||||||
background-color: #C9E2F5
|
tr:nth-child(even)
|
||||||
|
background-color: #C9E2F5
|
||||||
th
|
th
|
||||||
font-size: larger
|
font-size: larger
|
||||||
td
|
td
|
||||||
|
@ -22,13 +23,19 @@ dl
|
||||||
margin: 1em auto
|
margin: 1em auto
|
||||||
max-width: 40em
|
max-width: 40em
|
||||||
dt
|
dt
|
||||||
|
clear: left
|
||||||
float: left
|
float: left
|
||||||
padding: 0.2em 1em
|
padding: 0.2em 1em
|
||||||
.quantity
|
min-width: 50%
|
||||||
text-align: right
|
text-align: right
|
||||||
dd
|
dd
|
||||||
padding: 0.2em 1em
|
padding: 0.2em 1em
|
||||||
border-top: 1px solid #999
|
border-top: 1px solid #999
|
||||||
|
text-align: left
|
||||||
|
&.quantity
|
||||||
|
text-align: right
|
||||||
|
h3
|
||||||
|
display: inline
|
||||||
|
|
||||||
.view_link:link, .edit_link:link, .delete_link:link
|
.view_link:link, .edit_link:link, .delete_link:link
|
||||||
font-size: 0
|
font-size: 0
|
||||||
|
|
|
@ -0,0 +1,6 @@
|
||||||
|
@import "compass"
|
||||||
|
|
||||||
|
img.favicon
|
||||||
|
max-height: 2em
|
||||||
|
vertical-align: middle
|
||||||
|
@include border-radius(3px)
|
|
@ -1,5 +1,5 @@
|
||||||
@media all and (min-width: 1600px)
|
@media all and (min-width: 1600px)
|
||||||
body.events.index table
|
main
|
||||||
font-size: larger
|
font-size: larger
|
||||||
|
|
||||||
sidebar#lug-list
|
sidebar#lug-list
|
||||||
|
|
|
@ -5,8 +5,6 @@ h2.warning
|
||||||
table.list
|
table.list
|
||||||
min-width: 90%
|
min-width: 90%
|
||||||
margin-top: 15px
|
margin-top: 15px
|
||||||
thead tr
|
|
||||||
background-color: transparent
|
|
||||||
td
|
td
|
||||||
padding-top: 0.5em
|
padding-top: 0.5em
|
||||||
padding-bottom: 0.5em
|
padding-bottom: 0.5em
|
||||||
|
|
|
@ -4,6 +4,9 @@ class EventsController < ApplicationController
|
||||||
before_filter :set_mailer_host
|
before_filter :set_mailer_host
|
||||||
|
|
||||||
def index
|
def index
|
||||||
|
# So we can use the search form from the central calendar page
|
||||||
|
@search = Lug.search params[:q]
|
||||||
|
|
||||||
@events = Event.moderated
|
@events = Event.moderated
|
||||||
if params[:region] && params[:region].present? && params[:region] != 'all'
|
if params[:region] && params[:region].present? && params[:region] != 'all'
|
||||||
@events = @events.region params[:region]
|
@events = @events.region params[:region]
|
||||||
|
|
|
@ -0,0 +1,30 @@
|
||||||
|
class LugsController < ApplicationController
|
||||||
|
before_action :set_lug, only: [:show]
|
||||||
|
|
||||||
|
def index
|
||||||
|
@search = Lug.search params[:q]
|
||||||
|
@search.sorts = 'name' if @search.sorts.empty?
|
||||||
|
@lugs = @search.result().page params[:page]
|
||||||
|
end
|
||||||
|
|
||||||
|
def show
|
||||||
|
@search = Lug.search params[:q]
|
||||||
|
end
|
||||||
|
|
||||||
|
private
|
||||||
|
# Use callbacks to share common setup or constraints between actions.
|
||||||
|
def set_lug
|
||||||
|
@lug = Lug.find params[:id]
|
||||||
|
|
||||||
|
set_meta_tags title: @lug.name,
|
||||||
|
description: @lug.url,
|
||||||
|
DC: {
|
||||||
|
title: @lug.name
|
||||||
|
},
|
||||||
|
geo: {
|
||||||
|
region: @lug.related_region,
|
||||||
|
placename: @lug.city,
|
||||||
|
position: "#{@lug.related_city.try :latitude};#{@lug.related_city.try :longitude}"
|
||||||
|
}
|
||||||
|
end
|
||||||
|
end
|
|
@ -54,3 +54,5 @@
|
||||||
tag: params[:tag], protocol: 'webcal', format: :ics, tag: params[:tag], region: params[:region])),
|
tag: params[:tag], protocol: 'webcal', format: :ics, tag: params[:tag], region: params[:region])),
|
||||||
ical: link_to('iCal', events_url(:rss,
|
ical: link_to('iCal', events_url(:rss,
|
||||||
tag: params[:tag], format: :ics, tag: params[:tag], region: params[:region]))
|
tag: params[:tag], format: :ics, tag: params[:tag], region: params[:region]))
|
||||||
|
|
||||||
|
= render '/lugs/search'
|
||||||
|
|
|
@ -0,0 +1,8 @@
|
||||||
|
%h2
|
||||||
|
%em.fa.fa-users
|
||||||
|
= title t '.title', entity: Lug.model_name.human
|
||||||
|
|
||||||
|
= search_form_for @search do |f|
|
||||||
|
= f.label :name_cont
|
||||||
|
= f.search_field :name_cont
|
||||||
|
= f.submit
|
|
@ -0,0 +1,30 @@
|
||||||
|
= render 'search'
|
||||||
|
|
||||||
|
%table.list.autopagerize_page_element
|
||||||
|
%thead
|
||||||
|
%th= sort_link @search, :name
|
||||||
|
%th= sort_link @search, :city
|
||||||
|
%th= sort_link @search, :department
|
||||||
|
%th= sort_link @search, :related_region_name, Lug.human_attribute_name(:related_region)
|
||||||
|
%th= sort_link @search, :url
|
||||||
|
%th/
|
||||||
|
|
||||||
|
%tbody
|
||||||
|
- @lugs.each do |lug|
|
||||||
|
%tr
|
||||||
|
%td
|
||||||
|
= lug.name
|
||||||
|
%td
|
||||||
|
= lug.city
|
||||||
|
%td
|
||||||
|
= lug.department
|
||||||
|
%td
|
||||||
|
= lug.related_region
|
||||||
|
%td
|
||||||
|
- if lug.url =~ /^http/
|
||||||
|
= image_tag lug.url+'/favicon.ico', alt: '', class: :favicon
|
||||||
|
= link_to lug.url, lug.url
|
||||||
|
%td
|
||||||
|
= link_to t('show'), lug_url(lug, q: params[:q]), class: :view_link
|
||||||
|
|
||||||
|
= paginate @lugs
|
|
@ -0,0 +1,24 @@
|
||||||
|
= render 'search'
|
||||||
|
|
||||||
|
%dl
|
||||||
|
%dt= Lug.human_attribute_name :name
|
||||||
|
%dd
|
||||||
|
%h3
|
||||||
|
= image_tag @lug.url+'/favicon.ico', alt: '', class: :favicon
|
||||||
|
= @lug.name
|
||||||
|
%dt= Lug.human_attribute_name :city
|
||||||
|
%dd= @lug.city
|
||||||
|
%dt= Lug.human_attribute_name :department
|
||||||
|
%dd= @lug.department
|
||||||
|
%dt= Lug.human_attribute_name :related_region
|
||||||
|
%dd= @lug.related_region
|
||||||
|
%dt= Lug.human_attribute_name :url
|
||||||
|
%dd= link_to @lug.url, @lug.url
|
||||||
|
|
||||||
|
%iframe(src="#{@lug.url}" width='1000' height='400' frameborder='none'
|
||||||
|
allowTransparency='true')
|
||||||
|
|
||||||
|
%nav
|
||||||
|
= link_to lugs_path(q: params[:q]), class: :back do
|
||||||
|
%em.fa.fa-arrow-left
|
||||||
|
= Lug.model_name.human.pluralize
|
|
@ -1,4 +1,4 @@
|
||||||
development:
|
developmen:
|
||||||
adapter: sqlite3
|
adapter: sqlite3
|
||||||
pool: 5
|
pool: 5
|
||||||
timeout: 5000
|
timeout: 5000
|
||||||
|
@ -13,7 +13,8 @@ test:
|
||||||
timeout: 5000
|
timeout: 5000
|
||||||
database: db/test.sqlite3
|
database: db/test.sqlite3
|
||||||
|
|
||||||
production:
|
#production:
|
||||||
|
development:
|
||||||
adapter: mysql2
|
adapter: mysql2
|
||||||
encoding: utf8
|
encoding: utf8
|
||||||
database: adl_fr
|
database: adl_fr
|
||||||
|
|
|
@ -244,10 +244,8 @@ Exemple: `%{daylimit}`"
|
||||||
sign_in:
|
sign_in:
|
||||||
title: Identification
|
title: Identification
|
||||||
lugs:
|
lugs:
|
||||||
index:
|
search:
|
||||||
title: Groupes d'Utilisateurs de Logiciels Libres
|
title: Trouve ton %{entity}!
|
||||||
show:
|
|
||||||
title: Groupe d'Utilisateurs de Logiciels Libres
|
|
||||||
|
|
||||||
devise:
|
devise:
|
||||||
sessions:
|
sessions:
|
||||||
|
|
|
@ -0,0 +1,9 @@
|
||||||
|
fr:
|
||||||
|
views:
|
||||||
|
pagination:
|
||||||
|
first: "«"
|
||||||
|
last: "»"
|
||||||
|
previous: "‹"
|
||||||
|
next: "›"
|
||||||
|
truncate: "..."
|
||||||
|
|
|
@ -0,0 +1,17 @@
|
||||||
|
require 'test_helper'
|
||||||
|
|
||||||
|
class LugsControllerTest < ActionController::TestCase
|
||||||
|
setup do
|
||||||
|
@lug = lugs :one
|
||||||
|
end
|
||||||
|
|
||||||
|
test "should get index" do
|
||||||
|
get :index
|
||||||
|
assert_response :success
|
||||||
|
end
|
||||||
|
|
||||||
|
test "should get show" do
|
||||||
|
get :show, id: @lug
|
||||||
|
assert_response :success
|
||||||
|
end
|
||||||
|
end
|
Loading…
Reference in New Issue