Klaus V2.0

This commit is contained in:
Florian Bogenhard
2014-08-11 01:35:48 +02:00
parent 4a1a0937d4
commit cedeffd2c6
55 changed files with 1267 additions and 40 deletions
+9
View File
@@ -0,0 +1,9 @@
h2 Sign in
= bootstrap_form_for(resource, as: resource_name, url: session_path(resource_name)) do |f|
= f.email_field :email, autofocus: true
= f.password_field :password, autocomplete: "off"
- if devise_mapping.rememberable?
= f.check_box :remember_me
= f.submit
+5
View File
@@ -0,0 +1,5 @@
div.well
= bootstrap_form_for(@doc_type) do |f|
= f.text_field :name
= f.submit
+4
View File
@@ -0,0 +1,4 @@
- content_for :page_header
| Typ - #{@doc_type.name}
= render 'form'
+18
View File
@@ -0,0 +1,18 @@
<% content_for :page_header do %>
Typ - Index
<% end %>
<%= grid(@doc_types_grid, upper_pagination_panel: true) do |g|
g.blank_slate content_tag(:div, "No records found", class: 'well')
g.column name: 'ID', attribute: 'id'
g.column name: 'Name', attribute: 'name'
g.column do |doc_type|
contant = content_tag(:div, class: 'btn-group') do
link = ''.html_safe
link.concat btn_link_to('Edit', edit_doc_type_path(doc_type), class: 'btn-xs btn-warning') if user_signed_in?
link.concat btn_link_to('Delete', doc_type_path(doc_type), method: "delete", :data => { confirm: 'Are you sure?' }, class: 'btn-xs btn-danger') if user_signed_in?
link
end
end
end
%>
+4
View File
@@ -0,0 +1,4 @@
- content_for :page_header
| Neuer Typ
= render 'form'
+16 -4
View File
@@ -1,4 +1,16 @@
= bootstrap_form_for(@document) do |f|
= f.text_field :name
= f.submit
div.well
= bootstrap_form_for(@document, html: {multipart: true}) do |f|
= f.collection_select :doc_type_id, DocType.order(:name).all, :id, :name, prompt: true
= f.collection_select :semester_id, Semester.order(name: :desc).all, :id, :name, prompt: true
= f.collection_select :lesson_id, Lesson.order(:name).all, :id, :name, prompt: true
= f.collection_select :professor_id, Professor.order(:last_name).all, :id, :last_name, prompt: true
- if @document.new_record?
div.row
div.col-lg-6
= f.file_field :file
div.col-lg-6
- if @document.file_cache
= f.static_control label: 'Uploaded file'
= link_to @document.file.filename, @document.file_url
= f.hidden_field :file_cache, readonly: true
= f.submit
+32 -4
View File
@@ -1,5 +1,33 @@
<%= grid(@documents_grid, upper_pagination_panel: true) do |g|
g.column name: 'ID', attribute: 'id'
g.column name: 'Name', attribute: 'name'
<%
define_grid(@documents_grid, upper_pagination_panel: true) do |g|
g.blank_slate content_tag(:div, "No records found", class: 'well')
g.column name: 'Position', attribute: 'position'
g.column name: 'Semester', attribute: 'id', detach_with_id: 'semester_filter', model: 'Semester', custom_filter: Semester.to_dropdown do |document|
document.semester.name if document.semester
end
g.column name: 'Typ', attribute: 'id', detach_with_id: 'doc_type_filter', model: 'DocType', html:{class: 'text-center'}, custom_filter: DocType.to_dropdown do |document|
document.doc_type.name if document.doc_type
end
g.column name: 'Fach', attribute: 'id', detach_with_id: 'lesson_filter', model: 'Lesson', custom_filter: Lesson.to_dropdown do |document|
document.lesson.name if document.lesson
end
g.column name: 'Professor', attribute: 'id', detach_with_id: 'professor_filter', model: 'Professor', custom_filter: Professor.to_dropdown do |document|
document.professor.name_last_first if document.professor
end
g.column html:{class: 'text-center'} do |document|
contant = content_tag(:div, class: 'btn-group') do
link = ''.html_safe
link.concat btn_link_to('Download', document.file_url, class: 'btn-xs btn-primary')
link.concat btn_link_to('Edit', edit_document_path(document), class: 'btn-xs btn-warning') if user_signed_in?
link.concat btn_link_to('Delete', document_path(document), method: "delete", :data => { confirm: 'Are you sure?' }, class: 'btn-xs btn-danger') if user_signed_in?
link
end
end
end
%>
%>
+4
View File
@@ -0,0 +1,4 @@
- content_for :page_header
| Dokument - #{@document.semester.name} / #{@document.professor.name} / #{@document.lesson.name} / #{@document.doc_type.name}
= render 'form'
+39 -5
View File
@@ -1,6 +1,40 @@
h1 Index
- content_for :page_header
| Dokumente - Index
- render 'grid'
p
= btn_link_to 'New', new_document_path, class: 'btn-primary'
= render 'grid'
div.col-lg-2.col-md-2.text-center
= image_tag 'QR-FS-Logo_-_fsmni.thm.de.png'
div.col-lg-10.col-md-10
div.panel.panel-default
div.panel-heading
h3.panel-title
| &nbsp;Filter
div
div.panel-body
div.form-horizontal
div.col-lg-6.col-md-11
div.form-group
label for="last_name_filter" class="col-sm-2 control-label" Professor
div class="col-sm-10"
= grid_filter @documents_grid, :professor_filter
div class="form-group"
label for="first_name_filter" class="col-sm-2 control-label" Fach
div class="col-sm-10"
= grid_filter @documents_grid, :lesson_filter
div class="col-lg-5 col-md-11"
div class="form-group"
label for="middle_name_filter" class="col-sm-2 control-label" Semester
div class="col-sm-10"
= grid_filter @documents_grid, :semester_filter
div class="form-group"
label for="id_filter" class="col-sm-2 control-label" Type
div class="col-sm-10"
= grid_filter @documents_grid, :doc_type_filter
div class="col-lg-1 col-md-1"
div class="form-group"
button class="btn btn-primary wg-external-submit-button" data-grid-name='grid' Submit
div class="col-lg-1 col-md-1"
div class="form-group"
button class="btn btn-default wg-external-reset-button" data-grid-name='grid' Reset
div.col-lg-12.col-md-12
== render_grid(@documents_grid)
+2
View File
@@ -1 +1,3 @@
- content_for :page_header
| Neues Dokument
== render 'form'
+22 -3
View File
@@ -10,14 +10,23 @@ html
nav.navbar.navbar-default role="navigation"
div.container-fluid
div.navbar-header
button.navbar-toggle type="button" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1"
button.navbar-toggle type="button" data-toggle="collapse" data-target="#navbar"
spansr-only Toggle navigation
spanicon-bar
spanicon-bar
spanicon-bar
= link_to 'Klaus', root_path, class: 'navbar-brand'
div.collapse.navbar-collapse#bs-example-navbar-collapse-1
div.collapse.navbar-collapse#navbar
ul.nav.navbar-nav
li = link_to 'Übersicht', documents_path
li = link_to 'Neues Dokument', new_document_path
li = link_to 'Neuer Dokument Typ', new_doc_type_path
li = link_to 'Neuer Professor', new_professor_path
li = link_to 'Neues Semester', new_semester_path
li = link_to 'Neues Fach', new_lesson_path
div.container
div.page-header
h1 = content_for :page_header
- if notice
div.alert.alert-success.alert-dismissable
button type="button" class="close" data-dismiss="alert" aria-hidden="true"
@@ -28,4 +37,14 @@ html
button type="button" class="close" data-dismiss="alert" aria-hidden="true"
| &times;
= alert
= yield
= yield
footer.text-center
p
| CC BY-NC-SA - Fachschaft MNI - Technische Hochschule Mittelhessen
br
== "Index: #{link_to 'Type', doc_types_path} | #{link_to 'Fach', lessons_path} | #{link_to 'Professor', professors_path} | #{link_to 'Semester', semesters_path}"
br
- if user_signed_in?
= link_to 'Logout', destroy_user_session_path, method: :delete
- else
= link_to 'Login', new_user_session_path
+6
View File
@@ -0,0 +1,6 @@
div.well
= bootstrap_form_for(@lesson) do |f|
= f.text_field :name
= f.text_field :short_name
= f.submit
+4
View File
@@ -0,0 +1,4 @@
- content_for :page_header
| Fach - #{@lesson.name}
= render 'form'
+19
View File
@@ -0,0 +1,19 @@
<% content_for :page_header do %>
Fach - Index
<% end %>
<%= grid(@lessons_grid, upper_pagination_panel: true) do |g|
g.blank_slate content_tag(:div, "No records found", class: 'well')
g.column name: 'ID', attribute: 'id'
g.column name: 'Name', attribute: 'short_name'
g.column name: 'Name', attribute: 'name'
g.column do |lesson|
contant = content_tag(:div, class: 'btn-group') do
link = ''.html_safe
link.concat btn_link_to('Edit', edit_lesson_path(lesson), class: 'btn-xs btn-warning') if user_signed_in?
link.concat btn_link_to('Delete', lesson_path(lesson), method: "delete", :data => { confirm: 'Are you sure?' }, class: 'btn-xs btn-danger') if user_signed_in?
link
end
end
end
%>
+4
View File
@@ -0,0 +1,4 @@
- content_for :page_header
| Neues Fach
= render 'form'
+6
View File
@@ -0,0 +1,6 @@
div.well
= bootstrap_form_for(@professor) do |f|
= f.text_field :first_name
= f.text_field :last_name
= f.submit
+4
View File
@@ -0,0 +1,4 @@
- content_for :page_header
| Professor - #{@professor.name}
= render 'form'
+19
View File
@@ -0,0 +1,19 @@
<% content_for :page_header do %>
Professor - Index
<% end %>
<%= grid(@professors_grid, upper_pagination_panel: true) do |g|
g.blank_slate content_tag(:div, "No records found", class: 'well')
g.column name: 'ID', attribute: 'id'
g.column name: 'First Name', attribute: 'first_name'
g.column name: 'Last Name', attribute: 'last_name'
g.column do |professor|
contant = content_tag(:div, class: 'btn-group') do
link = ''.html_safe
link.concat btn_link_to('Edit', edit_professor_path(professor), class: 'btn-xs btn-warning') if user_signed_in?
link.concat btn_link_to('Delete', professor_path(professor), method: "delete", :data => { confirm: 'Are you sure?' }, class: 'btn-xs btn-danger') if user_signed_in?
link
end
end
end
%>
+4
View File
@@ -0,0 +1,4 @@
- content_for :page_header
| Neuer Professor
= render 'form'
+5
View File
@@ -0,0 +1,5 @@
div.well
= bootstrap_form_for(@semester) do |f|
= f.text_field :name
= f.submit
+4
View File
@@ -0,0 +1,4 @@
- content_for :page_header
| Semester - #{@semester.name}
= render 'form'
+18
View File
@@ -0,0 +1,18 @@
<% content_for :page_header do %>
Semester - Index
<% end %>
<%= grid(@semesters_grid, upper_pagination_panel: true) do |g|
g.blank_slate content_tag(:div, "No records found", class: 'well')
g.column name: 'ID', attribute: 'id'
g.column name: 'Name', attribute: 'name'
g.column do |semester|
contant = content_tag(:div, class: 'btn-group') do
link = ''.html_safe
link.concat btn_link_to('Edit', edit_semester_path(semester), class: 'btn-xs btn-warning') if user_signed_in?
link.concat btn_link_to('Delete', semester_path(semester), method: "delete", :data => { confirm: 'Are you sure?' }, class: 'btn-xs btn-danger') if user_signed_in?
link
end
end
end
%>
+4
View File
@@ -0,0 +1,4 @@
- content_for :page_header
| Neues Semester
= render 'form'