Nettoyage: utilisation de _path plutôt que _url partout dans les vues

recurrent
echarp 8 years ago
parent e0554d8ad2
commit d7c963b499

@ -21,7 +21,7 @@ class ModerationsController < ApplicationController
@older_mod = Event.new @event.attributes
respond_to do |format|
if @moderation.update_attributes(moderation_params) && send_mails
format.html { redirect_to moderations_path, notice: t('.ok') }
format.html { redirect_to moderations_url, notice: t('.ok') }
format.json { head :no_content }
else
format.html { render action: 'edit' }
@ -37,7 +37,7 @@ class ModerationsController < ApplicationController
respond_to do |format|
if @moderation.update(moderated: true) && send_accept_mails
tweet
format.html { redirect_to moderations_path, notice: t('.ok') }
format.html { redirect_to moderations_url, notice: t('.ok') }
format.json { head :no_content }
else
format.html { render action: 'edit' }

@ -15,7 +15,7 @@
= month_calendar day_names: 'date.day_names', events: @events,
previous_link: nil, next_link: nil,
title: ->(start_date) { raw link_to l(start_date, format: :month),
root_url(start_date: start_date), class: 'month_selector' } do |date, events|
root_path(start_date: start_date), class: 'month_selector' } do |date, events|
.day_number= date.day
%ul.events.fa-ul
- events.select { |e| (e.start_time.to_date..e.end_time.to_date).cover? date }
@ -32,7 +32,7 @@
- @events = @events.month params[:start_date].try :to_date
= month_calendar day_names: 'date.day_names', events: @events,
title: ->(start_date) { raw "#{I18n.t('date.month_names')[start_date.month]} #{link_to start_date.year,
root_url(year: start_date.year)}" },
root_path(year: start_date.year)}" },
previous_link: ->(param, date_range) { link_to '<<',
{ param => (date_range.first - 1.day).beginning_of_month, tag: params[:tag], region: params[:region] } },
next_link: ->(param, date_range) { link_to '>>',
@ -51,11 +51,11 @@
.formats
%em.fa.fa-rss
=raw t '.calendar_in',
rss: link_to('RSS', events_url(:rss,
rss: link_to('RSS', events_path(:rss,
tag: params[:tag], region: params[:region])),
webcal: link_to('webcal', events_url(:rss,
webcal: link_to('webcal', events_path(:rss,
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_path(:rss,
tag: params[:tag], format: :ics, tag: params[:tag], region: params[:region]))
%a#banner(href='http://april.org/campagne')

@ -82,4 +82,4 @@
%p.tags
%span.label= Event.human_attribute_name :tags
- @event.tags.split.each do |tag|
= link_to tag, tag_url(tag)
= link_to tag, tag_path(tag)

@ -30,7 +30,7 @@
%li.map_suisse
= link_to t('.suisse'), 'http://www.agendadulibre.ch'
%h1= link_to t('.title'), root_url
%h1= link_to t('.title'), root_path
%h2=t '.subtitle'
= render 'layouts/flash', flash: flash if flash.present?
@ -42,28 +42,28 @@
= link_to new_event_path do
%em.fa.fa-pencil
=t '.propose'
= link_to regions_url do
= link_to regions_path do
%em.fa.fa-rss
=t '.feeds'
= link_to maps_url do
= link_to maps_path do
%em.fa.fa-map-marker
=t '.map'
= link_to tags_url do
= link_to tags_path do
%em.fa.fa-tags
=t '.tags'
= link_to lugs_url do
= link_to lugs_path do
%em.fa.fa-users
= Lug.model_name.human.pluralize
= link_to application_infos_url do
= link_to application_infos_path do
%em.fa.fa-info
=t '.infos'
= link_to stats_regions_url do
= link_to stats_regions_path do
%em.fa.fa-signal
=t '.stats'
= link_to application_contact_url do
= link_to application_contact_path do
%em.fa.fa-envelope
=t '.contact'
= link_to moderations_url do
= link_to moderations_path do
%em.fa.fa-gavel
=t '.moderation'

@ -29,6 +29,6 @@
%td
= link_to lug.url, lug.url
%td
= link_to t('show'), lug_url(lug, q: params[:q], page: params[:page]), class: :view_link
= link_to t('show'), lug_path(lug, q: params[:q], page: params[:page]), class: :view_link
= paginate @lugs

@ -11,23 +11,23 @@
%em.fa.fa-arrow-left
= Lug.model_name.human.pluralize
\/
= link_to events_url tag: @lug.name do
= link_to events_path tag: @lug.name do
%em.fa.fa-calendar
Agenda
\/
= link_to events_url format: :rss, tag: @lug.name do
= link_to events_path format: :rss, tag: @lug.name do
%em.fa.fa-rss
RSS
\/
= link_to events_url format: :ics, tag: @lug.name do
= link_to events_path format: :ics, tag: @lug.name do
%em.fa.fa-th-list
iCal
\/
= link_to maps_url tag: @lug.name do
= link_to maps_path tag: @lug.name do
%em.fa.fa-map-marker
OpenStreetMap
\/
= link_to maps_url format: :json, tag: @lug.name do
= link_to maps_path format: :json, tag: @lug.name do
%em.fa.fa-dot-circle-o
GeoJSON

@ -5,14 +5,14 @@
#map.events(data-url="#{maps_path format: :json}")
%nav
= link_to events_url format: :rss, tag: params[:tag] do
= link_to events_path format: :rss, tag: params[:tag] do
%em.fa.fa-rss
RSS
\/
= link_to events_url format: :ics, tag: params[:tag] do
= link_to events_path format: :ics, tag: params[:tag] do
%em.fa.fa-th-list
iCal
\/
= link_to maps_url format: :json, tag: params[:tag] do
= link_to maps_path format: :json, tag: params[:tag] do
%em.fa.fa-dot-circle-o
GeoJSON

@ -23,7 +23,7 @@
= label_tag :reason_text, t('.reason')
= text_area_tag :reason_text, nil, cols: 40, rows: 5
= link_to moderations_url do
= link_to moderations_path do
%em.fa.fa-arrow-left
=t '.ko'

@ -6,7 +6,7 @@
%h2.warning=t '.warning'
= form_for @moderation, url: { action: :accept }, html: { method: :put } do |f|
= link_to moderations_url do
= link_to moderations_path do
%em.fa.fa-arrow-left
=t '.ko'
@ -22,7 +22,7 @@
%h3=t '.tweet_helper'
= @event.to_tweet event_url @event
= @event.to_tweet event_path @event
%fieldset
%legend

@ -20,12 +20,12 @@
:markdown
#{t 'edit_link', scope: [:note_mailer, :notify]}
#{edit_moderation_url @note.event}
#{edit_moderation_path @note.event}
#{t 'signature', scope: [:note_mailer, :notify]}
.actions
= link_to moderations_url do
= link_to moderations_path do
%em.fa.fa-arrow-left
=t '.ko'
= f.button do
@ -34,7 +34,7 @@
- else
.actions
= link_to moderations_url do
= link_to moderations_path do
%em.fa.fa-arrow-left
=t '.ko'
= f.button do

@ -26,7 +26,7 @@
- @year_events.each do |year|
%td.quantity
- line = @month_events.find { |line| line[0][0] == year[0] && line[0][1].try(:to_i) == m }
= link_to root_url(start_date: "#{year[0]}-#{m}-01") do
= link_to root_path(start_date: "#{year[0]}-#{m}-01") do
= number_with_delimiter line[1] if line
%td.sparkline/
@ -47,7 +47,7 @@
%dl
- @region_events.each do |region|
%dt.item
= link_to root_url region: Region.find_by_name(region[0]).id do
= link_to root_path region: Region.find_by_name(region[0]).id do
= region[0]
%dd.quantity= number_with_delimiter region[1]

@ -4,6 +4,6 @@
- @tags.each do |tag|
%span.tag(class="size_#{Math.log2(tag[1]).to_i}")
= link_to tag[0], tag_url(tag[0])
= link_to tag[0], tag_path(tag[0])
%p=t '.limited'

@ -9,23 +9,23 @@
%em.fa.fa-arrow-left
= Event.human_attribute_name(:tag).pluralize
\/
= link_to events_url tag: params[:id] do
= link_to events_path tag: params[:id] do
%em.fa.fa-calendar
Agenda
\/
= link_to events_url format: :rss, tag: params[:id] do
= link_to events_path format: :rss, tag: params[:id] do
%em.fa.fa-rss
RSS
\/
= link_to events_url format: :ics, tag: params[:id] do
= link_to events_path format: :ics, tag: params[:id] do
%em.fa.fa-th-list
iCal
\/
= link_to maps_url tag: params[:id] do
= link_to maps_path tag: params[:id] do
%em.fa.fa-map-marker
OpenStreetMap
\/
= link_to maps_url format: :json, tag: params[:id] do
= link_to maps_path format: :json, tag: params[:id] do
%em.fa.fa-dot-circle-o
GeoJSON

Loading…
Cancel
Save