This commit is contained in:
Thomas Blazek
2013-08-19 20:58:39 +02:00
10 changed files with 60 additions and 27 deletions

2
.gitignore vendored
View File

@@ -6,7 +6,7 @@
# Ignore bundler config
/.bundle
*.*~
# Ignore the default SQLite database.
/db/*.sqlite3
/db/schema.rb

View File

@@ -44,8 +44,8 @@ class FotosController < ApplicationController
respond_to do |format|
if @foto.save
format.html { redirect_to @foto, notice: 'Foto was successfully created.' }
format.json { render json: @foto, status: :created, location: @foto }
format.html { redirect_to gallery_foto_path(@foto.gallery,@foto), notice: 'Foto was successfully created.' }
format.json { render json: gallery_foto_path(@foto.gallery,@foto), status: :created, location: @foto }
else
format.html { render action: "new" }
format.json { render json: @foto.errors, status: :unprocessable_entity }
@@ -60,7 +60,7 @@ class FotosController < ApplicationController
respond_to do |format|
if @foto.update_attributes(params[:foto])
format.html { redirect_to @foto, notice: 'Foto was successfully updated.' }
format.html { redirect_to gallery_foto_path(@foto.gallery,@foto), notice: 'Foto was successfully updated.' }
format.json { head :no_content }
else
format.html { render action: "edit" }

View File

@@ -7,4 +7,7 @@ class HomeController < ApplicationController
def startdev
render 'setup_fetsite_dev'
end
def linksnotimplemented
render 'links_notimplemented'
end
end

View File

@@ -1,3 +1,6 @@
class Foto < ActiveRecord::Base
attr_accessible :datei, :desc, :gallery_id, :title
belongs_to :gallery
mount_uploader :datei, FotoUploader
end

View File

@@ -1,3 +1,4 @@
class Gallery < ActiveRecord::Base
attr_accessible :datum, :desc, :name
has_many :fotos
end

View File

@@ -1,25 +1,31 @@
<p id="notice"><%= notice %></p>
<p>
<b>Title:</b>
<%= @foto.title %>
</p>
<div class="container-fluid">
<p>
<b>Desc:</b>
<%= @foto.desc %>
</p>
<div class="row-fluid">
<div class="span12">
<%= link_to image_tag(@foto.datei.resized.url), gallery_foto_path(@foto.gallery, ((@foto.gallery.fotos[@foto.gallery.fotos.index(@foto)+1].nil?) ? (@foto.gallery.fotos[0].try(:id).to_i) : @foto.gallery.fotos[@foto.gallery.fotos.index(@foto)+1].try(:id).to_i) ) %>
</div>
</div>
<p>
<b>Gallery:</b>
<%= @foto.gallery_id %>
</p>
<div class="row-fluid">
<div class="span9">
<h2><%= @foto.title %></h2>
<p><%= @foto.desc %></p>
</div>
<div class="span3">
<p>
<%= link_to 'last' , gallery_foto_path(@foto.gallery, @foto.gallery.fotos[@foto.gallery.fotos.index(@foto)-1].try(:id).to_i) unless @foto.gallery.fotos.index(@foto)==0 %>
<%= link_to 'next' , gallery_foto_path(@foto.gallery, @foto.gallery.fotos[@foto.gallery.fotos.index(@foto)+1].try(:id).to_i) unless @foto.gallery.fotos[@foto.gallery.fotos.index(@foto)+1].nil? %>
<%= link_to 'Edit', edit_foto_path(@foto) %> |
<%= link_to 'Back', gallery_path(@foto.gallery) %>
</p>
</div>
</div>
<div class="row-fluid">
<div class="span12">
<p id="notice"><%= notice %></p>
</div>
</div>
</div>
<p>
<b>Datei:</b>
<%= @foto.datei %>
</p>
<%= link_to 'Edit', edit_foto_path(@foto) %> |
<%= link_to 'Back', fotos_path %>

View File

@@ -14,7 +14,14 @@
<b>Datum:</b>
<%= @gallery.datum %>
</p>
<% @gallery.fotos.each do |f| %>
<%= link_to image_tag(f.datei.big_thumb.url,{:class=>"img-polaroid"}) , gallery_foto_path(@gallery,f) %>
<% end %>
<%= link_to 'NewFoto' , new_gallery_foto_path(@gallery) %> |
<%= link_to 'Edit', edit_gallery_path(@gallery) %> |
<%= link_to 'Back', galleries_path %>

View File

@@ -1,4 +1,5 @@
<h1>Entwicklungsprojekt</h1>
<%= link_to "notimplemented", home_linksnotimplemented_path %>
<h2>Feature List: 2013-07-17</h2>
<ul>
<li>Info zu Studien/Studienpläne</li>

View File

@@ -0,0 +1,7 @@
Vorhandene Resourcen
<ul>
<li><%= link_to "galleries", galleries_path %></li>
<li><%= link_to "fotos", fotos_path %></li>
<li><%= link_to "gremien", gremien_path %></li>
<li><%= link_to "memberships", memberships_path %></li>
</ul>

View File

@@ -36,8 +36,10 @@
get 'verwalten/studien', :controller=>:studien, :action=>:verwalten, :as=>'studien_verwalten'
resources :fetzneditions
resources :fotos
resources :galleries
resources :fotos, :except=>[:new, :show]
resources :galleries do
resources :fotos, :only=>[:new,:show]
end
resources :memberships
resources :gremien
resources :fetprofiles
@@ -59,6 +61,9 @@
resources :home, :only=>[:index]
get 'home/dev', :controller=>:home, :action=>:dev, :as=>'home_dev'
get 'home/startdev', :controller=>:home, :action=>:startdev, :as=>'home_startdev'
get 'home/linksnotimplemented', :controller=>:home, :action=>:linksnotimplemented, :as=>'home_linksnotimplemented'
resources :beispiele
resources :themen
resources :themengruppen do