Revision 1418:fab9719b189e plugins/redmine_bibliography/app/controllers
| plugins/redmine_bibliography/app/controllers/publications_controller.rb | ||
|---|---|---|
| 15 | 15 |
# we'll always want a new publication to have its bibtex entry |
| 16 | 16 |
@publication.build_bibtex_entry |
| 17 | 17 |
|
| 18 |
# and at least one author |
|
| 19 |
# @publication.authorships.build.build_author |
|
| 20 |
@author_options = [["#{User.current.name} (@#{User.current.mail.partition('@')[2]})", "#{User.current.class.to_s}_#{User.current.id.to_s}"]]
|
|
| 21 | 18 |
end |
| 22 | 19 |
|
| 23 | 20 |
def create |
| 24 | 21 |
@project = Project.find(params[:project_id]) |
| 25 | 22 |
|
| 26 |
@author_options = [] |
|
| 27 |
|
|
| 28 | 23 |
@publication = Publication.new(params[:publication]) |
| 29 | 24 |
@publication.projects << @project unless @project.nil? |
| 30 | 25 |
|
| ... | ... | |
| 91 | 86 |
@publication = Publication.find(params[:id]) |
| 92 | 87 |
@selected_bibtex_entry_type_id = @publication.bibtex_entry.entry_type |
| 93 | 88 |
|
| 94 |
@author_options = [] |
|
| 95 |
|
|
| 96 | 89 |
@bibtype_fields = BibtexEntryType.fields(@selected_bibtex_entry_type_id) |
| 97 | 90 |
end |
| 98 | 91 |
|
| 99 | 92 |
def update |
| 100 | 93 |
@publication = Publication.find(params[:id]) |
| 101 |
@author_options = [] |
|
| 102 | 94 |
|
| 103 | 95 |
if @publication.update_attributes(params[:publication]) |
| 104 | 96 |
flash[:notice] = "Successfully updated Publication." |
Also available in: Unified diff