clean sheets

This commit is contained in:
Nicolas Bally 2013-06-29 23:10:44 +02:00
parent e31190214f
commit e6a521b57f
81 changed files with 209 additions and 418 deletions

View File

@ -1,6 +1,6 @@
# -*- encoding : utf-8 -*-
class NewsgroupsController < ApplicationController
class Admin::NewsgroupsController < ApplicationController
layout 'admin'
@ -18,8 +18,6 @@ class NewsgroupsController < ApplicationController
end
end
# GET /newsgroups/1
# GET /newsgroups/1.xml
def show
@newsgroup = Newsgroup.find(params[:id])
@ -29,8 +27,6 @@ class NewsgroupsController < ApplicationController
end
end
# GET /newsgroups/new
# GET /newsgroups/new.xml
def new
@newsgroup = Newsgroup.new
@ -40,13 +36,11 @@ class NewsgroupsController < ApplicationController
end
end
# GET /newsgroups/1/edit
def edit
@newsgroup = Newsgroup.find(params[:id])
end
# POST /newsgroups
# POST /newsgroups.xml
def create
@newsgroup = Newsgroup.new(params[:newsgroup])
@ -61,13 +55,11 @@ class NewsgroupsController < ApplicationController
end
# PUT /newsgroups/1
# PUT /newsgroups/1.xml
def update
@newsgroup = Newsgroup.find(params[:id])
if @newsgroup.update_attributes(params[:newsgroup])
flash[:notice] = 'Le groupe à bien été éditer.'
redirect_to(newsgroups_url)
redirect_to :action => :index
else
render :action => "edit"
@ -76,15 +68,11 @@ class NewsgroupsController < ApplicationController
end
# DELETE /newsgroups/1
# DELETE /newsgroups/1.xml
def destroy
@newsgroup = Newsgroup.find(params[:id])
@newsgroup.destroy
flash[:notice] = 'Le groupe à bien été supprimé.'
respond_to do |format|
format.html { redirect_to(newsgroups_url) }
format.xml { head :ok }
end
redirect_to :action => :index
end
end

View File

@ -0,0 +1,35 @@
# -*- encoding : utf-8 -*-
class Admin::NoteFilesController < ApplicationController
def show
@note_file = NoteFile.find(params[:id])
if params[:inline] and !params[:force]
else
send_file @note_file.file.path, :filename => @note_file.abstract_file_name_slug, :disposition => (params[:download] ? "attachment" : "inline")
end
end
def create
@note_file = NoteFile.new(:original_filename => params[:files][0].original_filename ,:name => params[:files][0].original_filename, :note_id => params[:note_id], :file =>params[:files][0])
if @note_file.save
else
end
end
def destroy
@note_file = NoteFile.find(params[:id])
@note_file.destroy
end
end

View File

@ -1,5 +1,5 @@
# -*- encoding : utf-8 -*-
class NotesController < ApplicationController
class Admin::NotesController < ApplicationController
def show
@note = Note.find(params[:id])

View File

@ -1,8 +1,8 @@
# -*- encoding : utf-8 -*-
class SheetsController < ApplicationController
class Admin::SheetsController < ApplicationController
before_filter :authenticate_admin!, except: [:show]
before_filter :authenticate_admin!
layout "admin"
@ -59,14 +59,7 @@ require 'iconv'
format.csv { send_data @sheets.to_csv2 }
format.xls
# report.rewind
# converter = Iconv.new('ISO-8859-15//IGNORE//TRANSLIT','UTF-8')
# send_data( converter.iconv(report.read),:type => 'text/csv;',:filename => 'exporation-adherents.csv',:encoding => 'UTF-16')
#}
end
end
@ -74,11 +67,6 @@ require 'iconv'
def show
@sheet = Sheet.find(params[:id])
respond_to do |format|
format.html # show.html.erb
format.js
format.xml { render :xml => @sheet }
end
end
@ -103,7 +91,7 @@ require 'iconv'
respond_to do |format|
if @sheet.save
flash[:notice] = 'Sheet was successfully created.'
format.html { redirect_to(@sheet) }
format.js { render :action => "show" }
else
format.html { render :action => "new" }
@ -132,10 +120,8 @@ require 'iconv'
@sheet = Sheet.find(params[:id])
@sheet.destroy
respond_to do |format|
format.html { redirect_to(sheets_url) }
format.xml { head :ok }
end
redirect_to(admin_sheets_url)
end

View File

@ -1,5 +1,5 @@
# -*- encoding : utf-8 -*-
class TopicsController < ApplicationController
class Admin::TopicsController < ApplicationController
before_filter :authenticate_admin!
layout "admin"

View File

@ -1,83 +0,0 @@
# -*- encoding : utf-8 -*-
class NoteFilesController < ApplicationController
# GET /note_files
# GET /note_files.json
def index
@note_files = NoteFile.all
respond_to do |format|
format.html # index.html.erb
format.json { render json: @note_files }
end
end
# GET /note_files/1
# GET /note_files/1.json
def show
@note_file = NoteFile.find(params[:id])
if params[:inline] and !params[:force]
else
send_file @note_file.file.path, :filename => @note_file.abstract_file_name_slug, :disposition => (params[:download] ? "attachment" : "inline")
end
end
# GET /note_files/new
# GET /note_files/new.json
def new
@note_file = NoteFile.new
respond_to do |format|
format.html # new.html.erb
format.json { render json: @note_file }
end
end
# GET /note_files/1/edit
def edit
@note_file = NoteFile.find(params[:id])
end
# POST /note_files
# POST /note_files.json
def create
puts "AAAAAAAAAAAAAAAA"
puts params[:files][0].original_filename
puts "AAAAAAAAAAAAAAAA"
@note_file = NoteFile.new(:original_filename => params[:files][0].original_filename ,:name => params[:files][0].original_filename, :note_id => params[:note_id], :file =>params[:files][0])
if @note_file.save
else
end
end
# PUT /note_files/1
# PUT /note_files/1.json
def update
@note_file = NoteFile.find(params[:id])
respond_to do |format|
if @note_file.update_attributes(params[:note_file])
format.html { redirect_to @note_file, notice: 'Note file was successfully updated.' }
format.json { head :no_content }
else
format.html { render action: "edit" }
format.json { render json: @note_file.errors, status: :unprocessable_entity }
end
end
end
# DELETE /note_files/1
# DELETE /note_files/1.json
def destroy
@note_file = NoteFile.find(params[:id])
@note_file.destroy
end
end

View File

@ -9,7 +9,7 @@ module DocumentLineHelper
def link_to_add_fields(name, f, association)
new_object = f.object.class.reflect_on_association(association).klass.new()
fields = f.fields_for(association, new_object, :child_index => "new_#{association}") do |builder|
render(association.to_s + "/form", :form => builder)
render("admin/"+association.to_s + "/form", :form => builder)
end
link_to_function(name, "add_fields(this, \"#{association}\", \"#{escape_javascript(fields)}\");")
end

View File

@ -1,4 +1,4 @@
= form_for(@newsgroup) do |f|
= form_for([:admin, @newsgroup]) do |f|
%table

View File

@ -0,0 +1,30 @@
.links
= link_to 'Ajouter un groupe', new_admin_newsgroup_path, :class => "lien" if has_permission?('adherent.add')
%h1 Liste des groupes
%table.admin_table
%thead
%tr
%th{:style=>"width:80%;"} Nom du groupe
%th{:style=>"width:20%;"}
%tbody
-@newsgroups.each do |newsgroup|
%tr
%td=h newsgroup.name
%td.link-column
=link = link_to( 'Editer', edit_admin_newsgroup_path(newsgroup),:class => "lien" ) if has_permission?('adherent.edit')
=link = link_to('Supprimer', [:admin, newsgroup], :confirm => 'Êtes-vous sure de supprimer le groupe ?', :method => :delete, :class => "lien") if has_permission?('adherent.delete')
%br

View File

@ -1,9 +1,9 @@
%form.fileupload{:action => note_files_path(:note_id => note.id), :enctype => "multipart/form-data", :method => "POST"}
%form.fileupload{:action => admin_note_files_path(:note_id => note.id), :enctype => "multipart/form-data", :method => "POST"}
.upload
%button.add_files ajouter des fichiers
%button.add_files.btn ajouter des fichiers
%input{:multiple => "", :name => "files[]", :type => "file", :style => "float:right;"}
%input{:multiple => "", :name => "files[]", :type => "file", :style => "float:right;display:none;"}
.progress

View File

@ -0,0 +1,9 @@
.note_file#note_file{:id => note_file.id}
-ext = File.extname(note_file.file.path)[1..-1]
%div{:style => "display:inline-block;text-align:center;width:30px;"}=image_tag "admin/file_types/"+ext+".png"
=l note_file.created_at, :format => :short
=note_file.name
=link_to "supprimer", admin_note_file_path(note_file), :remote => true, :method => :delete, :confirm => "Voulez-vous vraiment supprimer ce fichier ?"
=link_to "voir", admin_note_file_path(note_file), :target => "_blank"
=link_to "télécharger", admin_note_file_path(note_file, :download => true)

View File

@ -1,4 +1,4 @@
%a{:href => "#", :onclick => "$(this).closest('#file_prev').remove();return false;"} retour
%iframe{:src => note_file_path(@note_file, :inline => true, :force => true)}
%iframe{:src => admin_note_file_path(@note_file, :inline => true, :force => true)}

View File

@ -1,6 +1,6 @@
#note_form
%p ```
= form_for @note, :remote => true do |f|
= form_for [:admin, @note], :remote => true do |f|
=f.hidden_field :topic_id
=f.text_area :message, :class => "markdown"

View File

@ -10,12 +10,12 @@
.date=l note.created_at, :format => :short
.right
.links
=link_to "modifier", edit_note_path(note), :remote => true
=link_to "suprimer", note_path(note), :remote => true, :method => :delete, :confirm => "Voulez-vous vraiment supprimer cette note ?"
=link_to "modifier", edit_admin_note_path(note), :remote => true
=link_to "suprimer", admin_note_path(note), :remote => true, :method => :delete, :confirm => "Voulez-vous vraiment supprimer cette note ?"
=markdown note.message
.bottom
=render :partial => "note_files/form", :locals => {:note => note}
=render :partial => "admin/note_files/form", :locals => {:note => note}
#note_files.note_files{:id => note.id}=render note.note_files
:javascript

View File

@ -8,7 +8,7 @@
.people_form
=form.semantic_fields_for :people do |form|
=render :partial => "people/form", :locals => {:form => form}
=render :partial => "admin/people/form", :locals => {:form => form}
%h3 Généralités
@ -25,13 +25,13 @@
%p= link_to_add_fields "Ajouter une année", form, :sheet_years
.sheet_years_form
=form.semantic_fields_for :sheet_years do |form|
=render :partial => "sheet_years/form", :locals => {:form => form}
=render :partial => "admin/sheet_years/form", :locals => {:form => form}
%h3 Dons
%p= link_to_add_fields "Ajouter un don", form, :donates
.donates_form
=form.semantic_fields_for :donates do |form|
=render :partial => "donates/form", :locals => {:form => form}
=render :partial => "admin/donates/form", :locals => {:form => form}
= form.submit 'Enregistrer', :class => "btn"

View File

@ -0,0 +1,24 @@
%tr#sheet_line{:id => sheet.id}
%td.hidden-phone
=sheet.sheet_number
-if sheet.corporate and sheet.corporate != ""
%td{:colspan => 2}=sheet.corporate
-else
%td= sheet.person.surname if sheet.person
%td= sheet.person.firstname if sheet.person
%td
-if sheet.person and sheet.person.phone and sheet.person.phone != ""
=sheet.person.phone
-else
=sheet.other_phone
%td.hidden-phone
-if sheet.person and sheet.person.email and sheet.person.email != ""
=sheet.person.email
-else
=sheet.other_mail
%td.link-column
=link_to i(:trash), [:admin, sheet], :method => :delete, :confirm => "*********ATTENTION*********\n Supprimer cette fiche entrainera la suppression de toutes traces concernant celle-ci : y compris les traces d'années d'adhésion, pouvant donc fausser les statistiques de l'ensemble du fichier. \n \nVous pouvez convertir la fiche en fiche 'sympathisant'.\n\n\ Pour annuler cliquez sur 'annuler', pour supprimer cette fiche malgrès cet avertissement cliquez sur 'OK'. \n\n", :class => "lien"
=link_to i(:info), [:admin, sheet], :class => "lien", :remote => true
=link_to i(:pencil), edit_admin_sheet_path(sheet), :method => :get, :remote => true

View File

@ -1,13 +1,13 @@
#sheet_show.edit
.links
=link_to i(:info), @sheet, :class => "button", :remote => true, :confirm => "Attention, les changements éventuellements apportés ne seront pas sauvegardés."
=link_to i(:info), [:admin, @sheet], :class => "button", :remote => true, :confirm => "Attention, les changements éventuellements apportés ne seront pas sauvegardés."
= link_to i(:remove), "#",:class => "button", :onclick => "$('#sheet_show').remove();$('body').css('overflow', 'auto');return false;"
%input{:type => "submit", :onclick => "$(this).closest('#sheet_show').find('form').submit();return false;", :value => "Sauvegarder", :class => "btn"}
.content
%h1 Modifier une fiche
= semantic_form_for [@sheet], :remote => true do |form|
= semantic_form_for [:admin, @sheet], :remote => true do |form|
=render :partial => "form", :locals => {:form => form}

View File

@ -0,0 +1,3 @@
$('#sheet_show').remove();
$('body').append("<%= escape_javascript(render(:template => "admin/sheets/edit.html.haml")); %>");
$("body").css("overflow", "hidden");

View File

@ -3,7 +3,7 @@
-y = last_year
#stat_years
=link_to "fiches", sheets_path()
=link_to "fiches", admin_sheets_path()
| Stats :
-while y >= first_year
@ -17,12 +17,12 @@
%h1 Liste des fiches
=render :partial => "sheets_search", :locals => {:url => ""}
%br
= link_to 'Ajouter une fiche', new_sheet_path, :remote => true, :class => "btn"
= link_to 'Ajouter une fiche', new_admin_sheet_path, :remote => true, :class => "btn"
%br
%br
#sheets
=render :partial => "sheets"
=link_to "Exporter au format XLS", sheets_path(:format => :xls), :class => "btn"
=link_to "Exporter au format XLS", admin_sheets_path(:format => :xls), :class => "btn"
%br
%br

View File

@ -5,7 +5,7 @@
.content
%h1 Nouvelle fiche
= semantic_form_for [@sheet], :remote => true do |form|
= semantic_form_for [:admin, @sheet], :remote => true do |form|
=render :partial => "form", :locals => {:form => form}

View File

@ -0,0 +1,3 @@
$('#sheet_show').remove();
$('body').append("<%= escape_javascript(render(:template => "admin/sheets/new.html.haml")); %>");
$("body").css("overflow", "hidden");

View File

@ -1,6 +1,6 @@
#sheet_show.show
.links
= link_to i(:pencil), edit_sheet_path(@sheet), :class => "button", :method => :get, :remote => true
= link_to i(:pencil), edit_admin_sheet_path(@sheet), :class => "button", :method => :get, :remote => true
= link_to i(:remove), "#", :class => "button", :onclick => "$('#sheet_show').remove();$('body').css('overflow', 'auto');return false;"
@ -20,7 +20,7 @@
%h2 Cette adhésion regroupe :
= link_to 'Ajouter', :class => "button", :url => new_person_path(:sheet_id => @sheet), :update => "new_sheet_people", :method => :get, :remote => true #if has_permission?('adherent.edit')
#new_sheet_people
#sheet_peoples
=render @sheet.people

View File

@ -0,0 +1,3 @@
$('#sheet_show').remove();
$('body').append("<%= escape_javascript(render(:template => "admin/sheets/show.html.haml")); %>");
$("body").css("overflow", "hidden");

View File

@ -3,7 +3,7 @@
-y = last_year
#stat_years
=link_to "fiches", sheets_path()
=link_to "fiches", admin_sheets_path()
| Stats :
-while y >= first_year

View File

@ -1,4 +1,4 @@
= form_for @topic do |f|
= form_for [:admin, @topic] do |f|
-if @topic.errors.any?
#error_explanation
%h2= "#{pluralize(@topic.errors.count, "error")} prohibited this topic from being saved:"

View File

@ -0,0 +1,15 @@
.topic_links
= link_to 'Modifier', edit_admin_topic_path(@topic), :remote => true
= link_to 'Suprimer', admin_topic_path(@topic), :remote => true, :method => :delete, :confirm => "Voulez-vous vraiment supprimer ce topic, et tout son contenu ?"
%h1.topic_title= @topic.title
%p
Lancé par
= @topic.admin.username
#notes=render @topic.notes
=link_to "Ajouter une note", new_admin_note_path(:topic_id => @topic), :remote => true, :id => "add_note"
#note_form_place

View File

@ -0,0 +1 @@
= link_to topic.title, [:admin, topic], :class => "topic_line", :remote => true, :id => "topic_line_#{topic.id}"

View File

@ -3,7 +3,7 @@ var new_topic_name = prompt("Topic :\n <%= "Vous n'avez spécifié aucun nom pou
if(new_topic_name){
$.ajax({url : '<%= topic_path(@topic) %>', type: "PUT", data : {
$.ajax({url : '<%= admin_topic_path(@topic) %>', type: "PUT", data : {
topic : {
title: new_topic_name
}

View File

@ -0,0 +1,14 @@
#topic_app_index
#left
= link_to '+ ajouter un topic', new_admin_topic_path, :remote => true, :id => "add_topic"
#topics=render @topics
#topic_show

View File

@ -3,7 +3,7 @@ var new_topic_name = prompt("Topic :\n <%= "Vous n'avez spécifié aucun nom pou
if(new_topic_name){
$.ajax({url : '<%= topics_path() %>', type: "POST", data : {
$.ajax({url : '<%= admin_topics_path() %>', type: "POST", data : {
topic : {
title: new_topic_name
}

View File

@ -43,7 +43,7 @@
Adhérents
%b.caret
%ul.dropdown-menu
%li=link_to "liste des adhérents", sheets_path
%li=link_to "liste des adhérents", admin_sheets_path
%li=link_to "gestion newsletters", newsletters_path
%li.divider
%li=link_to "Sondages", admin_survey_types_path
@ -52,7 +52,7 @@
%li=link_to "notes", topics_path
%li=link_to "notes", admin_topics_path
%li=link_to "urls courtes", admin_tiny_urls_path
%ul.nav.pull-right

View File

@ -1,30 +0,0 @@
.links
= link_to 'Ajouter un groupe', new_newsgroup_path, :class => "lien" if has_permission?('adherent.add')
%h1 Liste des groupes
%table.admin_table
%thead
%tr
%th{:style=>"width:80%;"} Nom du groupe
%th{:style=>"width:20%;"}
%tbody
-@newsgroups.each do |newsgroup|
%tr
%td=h newsgroup.name
%td.link-column
=link = link_to( 'Editer', edit_newsgroup_path(newsgroup),:class => "lien" ) if has_permission?('adherent.edit')
=link = link_to('Supprimer', newsgroup, :confirm => 'Êtes-vous sure de supprimer le groupe ?', :method => :delete, :class => "lien") if has_permission?('adherent.delete')
%br

View File

@ -1,13 +0,0 @@
<p>
<b>Name:</b>
<%=h @newsgroup.name %>
</p>
<p>
<b>Description:</b>
<%=h @newsgroup.description %>
</p>
<%= link_to 'Edit', edit_newsgroup_path(@newsgroup) %> |
<%= link_to 'Back', newsgroups_path %>

View File

@ -1,2 +0,0 @@
= @content

View File

@ -1 +0,0 @@
= @content

View File

@ -1,9 +0,0 @@
.note_file#note_file{:id => note_file.id}
-ext = File.extname(note_file.file.path)[1..-1]
%div{:style => "display:inline-block;text-align:center;width:30px;"}=image_tag "admin/file_types/"+ext+".png", :class => "icon"
=l note_file.created_at, :format => :short
=note_file.name
=link_to "supprimer", note_file_path(note_file), :remote => true, :method => :delete, :confirm => "Voulez-vous vraiment supprimer ce fichier ?"
=link_to "voir", note_file_path(note_file), :target => "_blank"
=link_to "télécharger", note_file_path(note_file, :download => true)

View File

@ -1,7 +0,0 @@
%h1 Editing note_file
= render 'form'
= link_to 'Show', @note_file
\|
= link_to 'Back', note_files_path

View File

@ -1,25 +0,0 @@
%h1 Listing note_files
%table
%tr
%th File
%th Name
%th Slug
%th Description
%th
%th
%th
- @note_files.each do |note_file|
%tr
%td= note_file.file
%td= note_file.name
%td= note_file.slug
%td= note_file.description
%td= link_to 'Show', note_file
%td= link_to 'Edit', edit_note_file_path(note_file)
%td= link_to 'Destroy', note_file, :confirm => 'Are you sure?', :method => :delete
%br
= link_to 'New Note file', new_note_file_path

View File

@ -1,5 +0,0 @@
%h1 New note_file
= render 'form'
= link_to 'Back', note_files_path

View File

@ -1,7 +0,0 @@
%h1 Editing note
= render 'form'
= link_to 'Show', @note
\|
= link_to 'Back', notes_path

View File

@ -1,23 +0,0 @@
%h1 Listing notes
%table
%tr
%th Subject
%th Message
%th User
%th
%th
%th
- @notes.each do |note|
%tr
%td= note.subject
%td= note.message
%td= note.user
%td= link_to 'Show', note
%td= link_to 'Edit', edit_note_path(note)
%td= link_to 'Destroy', note, :confirm => 'Are you sure?', :method => :delete
%br
= link_to 'New Note', new_note_path

View File

@ -1,24 +0,0 @@
%tr#sheet_line{:id => sheet.id}
%td.hidden-phone
=sheet.sheet_number
-if sheet.corporate and sheet.corporate != ""
%td{:colspan => 2}=sheet.corporate
-else
%td= sheet.person.surname if sheet.person
%td= sheet.person.firstname if sheet.person
%td
-if sheet.person and sheet.person.phone and sheet.person.phone != ""
=sheet.person.phone
-else
=sheet.other_phone
%td.hidden-phone
-if sheet.person and sheet.person.email and sheet.person.email != ""
=sheet.person.email
-else
=sheet.other_mail
%td.link-column
=link_to i(:trash), sheet, :method => :delete, :confirm => "*********ATTENTION*********\n Supprimer cette fiche entrainera la suppression de toutes traces concernant celle-ci : y compris les traces d'années d'adhésion, pouvant donc fausser les statistiques de l'ensemble du fichier. \n \nVous pouvez convertir la fiche en fiche 'sympathisant'.\n\n\ Pour annuler cliquez sur 'annuler', pour supprimer cette fiche malgrès cet avertissement cliquez sur 'OK'. \n\n", :class => "lien"
=link_to i(:info), sheet, :class => "lien", :remote => true
=link_to i(:pencil), edit_sheet_path(sheet), :method => :get, :remote => true

View File

@ -1,3 +0,0 @@
$('#sheet_show').remove();
$('body').append("<%= escape_javascript(render(:template => "sheets/edit.html.haml")); %>");
$("body").css("overflow", "hidden");

View File

@ -1,3 +0,0 @@
$('#sheet_show').remove();
$('body').append("<%= escape_javascript(render(:template => "sheets/new.html.haml")); %>");
$("body").css("overflow", "hidden");

View File

@ -1,3 +0,0 @@
$('#sheet_show').remove();
$('body').append("<%= escape_javascript(render(:template => "sheets/show.html.haml")); %>");
$("body").css("overflow", "hidden");

View File

@ -1,15 +0,0 @@
.topic_links
= link_to 'Modifier', edit_topic_path(@topic), :remote => true
= link_to 'Suprimer', topic_path(@topic), :remote => true, :method => :delete, :confirm => "Voulez-vous vraiment supprimer ce topic, et tout son contenu ?"
%h1.topic_title= @topic.title
%p
Lancé par
= @topic.admin.username
#notes=render @topic.notes
=link_to "Ajouter une note", new_note_path(:topic_id => @topic), :remote => true, :id => "add_note"
#note_form_place

View File

@ -1 +0,0 @@
= link_to topic.title, topic, :class => "topic_line", :remote => true, :id => "topic_line_#{topic.id}"

View File

@ -1,14 +0,0 @@
#topic_app_index
#left
= link_to '+ ajouter un topic', new_topic_path, :remote => true, :id => "add_topic"
#topics=render @topics
#topic_show

View File

@ -1,19 +1,48 @@
# -*- encoding : utf-8 -*-
Survey::Application.routes.draw do
devise_for :admins, :controllers => {:sessions => "admins/sessions", :passwords => "admins/passwords"}
match 'plaquettes/:slug.:f' => 'plaquettes#show', :as => :plaquette, :f => "html"
get "forum_user/index"
#admin
namespace :admin do
root :to => "dashboard#index"
resources :admins
resources :survey_types
resources :petitions
resources :tiny_urls
#note files
resources :note_files
resources :notes
resources :topics
#sheets
resources :sheets do
collection do
get 'stats'
get 'recus'
put 'index'
end
end
resources :newsgroups
resources :donates
resources :sheet_years
resources :people do
member do
get 'principal'
end
end
end
#forum
namespace :forum do
root :to => "forums#show", :id => 1
resources :forum_topics
@ -34,11 +63,7 @@ Survey::Application.routes.draw do
end
resources :note_files
resources :notes
resources :topics
resources :newsletters do
member do
@ -49,32 +74,8 @@ Survey::Application.routes.draw do
end
end
resources :newsgroups
resources :donates
resources :sheet_years
resources :people do
member do
get 'principal'
end
end
resources :sheets do
collection do
get 'stats'
get 'recus'
put 'index'
end
end
devise_for :admins, :controllers => {:sessions => "admins/sessions", :passwords => "admins/passwords"}
match 'u/:id' => 'tiny_urls#show', :as => :tiny_url
@ -104,60 +105,7 @@ Survey::Application.routes.draw do
end
# The priority is based upon order of creation:
# first created -> highest priority.
# Sample of regular route:
# match 'products/:id' => 'catalog#view'
# Keep in mind you can assign values other than :controller and :action
# Sample of named route:
# match 'products/:id/purchase' => 'catalog#purchase', :as => :purchase
# This route can be invoked with purchase_url(:id => product.id)
# Sample resource route (maps HTTP verbs to controller actions automatically):
# resources :products
# Sample resource route with options:
# resources :products do
# member do
# get 'short'
# post 'toggle'
# end
#
# collection do
# get 'sold'
# end
# end
# Sample resource route with sub-resources:
# resources :products do
# resources :comments, :sales
# resource :seller
# end
# Sample resource route with more complex sub-resources
# resources :products do
# resources :comments
# resources :sales do
# get 'recent', :on => :collection
# end
# end
# Sample resource route within a namespace:
# namespace :admin do
# # Directs /admin/products/* to Admin::ProductsController
# # (app/controllers/admin/products_controller.rb)
# resources :products
# end
# You can have the root of your site routed with "root"
# just remember to delete public/index.html.
root :to => 'admin/dashboard#index'
# See how all your routes lay out with "rake routes"
# This is a legacy wild controller route that's not recommended for RESTful applications.
# Note: This route will make all actions in every controller accessible via GET requests.
# match ':controller(/:action(/:id))(.:format)'
end