Merge branch 'master' of https://github.com/andreassteph/fetsite
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@@ -6,7 +6,7 @@
|
||||
|
||||
# Ignore bundler config
|
||||
/.bundle
|
||||
|
||||
*.*~
|
||||
# Ignore the default SQLite database.
|
||||
/db/*.sqlite3
|
||||
/db/schema.rb
|
||||
|
||||
@@ -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" }
|
||||
|
||||
@@ -7,4 +7,7 @@ class HomeController < ApplicationController
|
||||
def startdev
|
||||
render 'setup_fetsite_dev'
|
||||
end
|
||||
def linksnotimplemented
|
||||
render 'links_notimplemented'
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
class Foto < ActiveRecord::Base
|
||||
attr_accessible :datei, :desc, :gallery_id, :title
|
||||
belongs_to :gallery
|
||||
mount_uploader :datei, FotoUploader
|
||||
|
||||
end
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
class Gallery < ActiveRecord::Base
|
||||
attr_accessible :datum, :desc, :name
|
||||
has_many :fotos
|
||||
end
|
||||
|
||||
@@ -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 %>
|
||||
|
||||
@@ -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 %>
|
||||
|
||||
@@ -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>
|
||||
|
||||
7
app/views/home/links_notimplemented.html.erb
Normal file
7
app/views/home/links_notimplemented.html.erb
Normal 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>
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user