Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

not much

  • Loading branch information...
commit 7cda7c86adac656b3053a48276e0fbebe8e966af 1 parent 2f4e59d
@n3k0rA authored
View
1  Gemfile
@@ -18,6 +18,7 @@ gem 'headliner'
gem 'will_paginate', '~> 3.0'
+
group :development do
gem "rails-erd"
gem 'railroady'
View
6 app/assets/stylesheets/application.css
@@ -2,8 +2,10 @@
* This is a manifest file that'll automatically include all the stylesheets available in this directory
* and any sub-directories. You're free to add application-wide styles to this file and they'll appear at
* the top of the compiled file, but it's generally better to create a new file per style scope.
- *= require_self
- *= require_tree .
+ *= require gmaps4rails
+ *= require events
+ *= require scaffolds
+ *
*/
View
287 app/assets/stylesheets/formtastic.css
@@ -0,0 +1,287 @@
+/* -------------------------------------------------------------------------------------------------
+
+It's *strongly* suggested that you don't modify this file. Instead, load a new stylesheet after
+this one in your layouts (eg formtastic_changes.css) and override the styles to suit your needs.
+This will allow you to update formtastic.css with new releases without clobbering your own changes.
+
+This stylesheet forms part of the Formtastic Rails Plugin
+(c) 2008-2011 Justin French
+
+--------------------------------------------------------------------------------------------------*/
+
+/* NORMALIZE AND RESET - obviously inspired by Yahoo's reset.css, but scoped to just .formtastic
+--------------------------------------------------------------------------------------------------*/
+.formtastic,
+.formtastic ul,
+.formtastic ol,
+.formtastic li,
+.formtastic fieldset,
+.formtastic legend,
+.formtastic input,
+.formtastic button,
+.formtastic textarea,
+.formtastic select,
+.formtastic p {
+ margin:0;
+ padding:0;
+}
+
+.formtastic fieldset {
+ border:0;
+}
+
+.formtastic em,
+.formtastic strong {
+ font-style:normal;
+ font-weight:normal;
+}
+
+.formtastic ol,
+.formtastic ul {
+ list-style:none;
+}
+
+.formtastic abbr,
+.formtastic acronym {
+ border:0;
+ font-variant:normal;
+}
+
+.formtastic input,
+.formtastic button,
+.formtastic textarea {
+ font-family:sans-serif;
+ font-size:inherit;
+ font-weight:inherit;
+}
+
+.formtastic input,
+.formtastic textarea,
+.formtastic select {
+ font-size:100%;
+}
+
+.formtastic legend {
+ white-space:normal;
+ color:#000;
+}
+
+
+/* SEMANTIC ERRORS
+--------------------------------------------------------------------------------------------------*/
+.formtastic .errors {
+ color:#cc0000;
+ margin:0.5em 0 1.5em 25%;
+ list-style:square;
+}
+
+.formtastic .errors li {
+ padding:0;
+ border:none;
+ display:list-item;
+}
+
+
+/* BUTTONS & ACTIONS
+--------------------------------------------------------------------------------------------------*/
+.formtastic .buttons,
+.formtastic .actions {
+ overflow:hidden; /* clear containing floats */
+ padding-left:25%;
+}
+
+.formtastic .button,
+.formtastic .action {
+ float:left;
+ padding-right:0.5em;
+}
+
+.formtastic .button_action button {
+ padding:3px 8px;
+}
+
+.formtastic .link_action a {
+ display:block;
+ padding:3px 0;
+}
+
+
+/* INPUTS
+--------------------------------------------------------------------------------------------------*/
+.formtastic .inputs {
+ overflow:hidden; /* clear containing floats */
+}
+
+.formtastic .input {
+ overflow:hidden; /* clear containing floats */
+ padding:0.5em 0; /* padding and negative margin juggling is for Firefox */
+ margin-top:-0.5em;
+ margin-bottom:1em;
+}
+
+
+/* LEFT ALIGNED LABELS
+--------------------------------------------------------------------------------------------------*/
+.formtastic .input .label {
+ display:block;
+ width:25%;
+ float:left;
+ padding-top:.2em;
+}
+
+.formtastic .fragments .label,
+.formtastic .choices .label {
+ position:absolute;
+ width:95%;
+ left:0px;
+}
+
+.formtastic .fragments .label label,
+.formtastic .choices .label label {
+ position:absolute;
+}
+
+/* NESTED FIELDSETS AND LEGENDS (radio, check boxes and date/time inputs use nested fieldsets)
+--------------------------------------------------------------------------------------------------*/
+.formtastic .choices {
+ position:relative;
+}
+
+.formtastic .choices-group {
+ float:left;
+ width:74%;
+ margin:0;
+ padding:0 0 0 25%;
+}
+
+.formtastic .choice {
+ padding:0;
+ border:0;
+}
+
+
+/* INLINE HINTS
+--------------------------------------------------------------------------------------------------*/
+.formtastic .input .inline-hints {
+ color:#666;
+ margin:0.5em 0 0 25%;
+}
+
+
+/* INLINE ERRORS
+--------------------------------------------------------------------------------------------------*/
+.formtastic .inline-errors {
+ color:#cc0000;
+ margin:0.5em 0 0 25%;
+}
+
+.formtastic .errors {
+ color:#cc0000;
+ margin:0.5em 0 0 25%;
+ list-style:square;
+}
+
+.formtastic .errors li {
+ padding:0;
+ border:none;
+ display:list-item;
+}
+
+
+/* STRING, NUMERIC, PASSWORD, EMAIL, URL, PHONE, SEARCH (ETC) OVERRIDES
+--------------------------------------------------------------------------------------------------*/
+.formtastic .stringish input {
+ width:72%;
+}
+
+.formtastic .stringish input[size] {
+ width:auto;
+ max-width:72%;
+}
+
+
+/* TEXTAREA OVERRIDES
+--------------------------------------------------------------------------------------------------*/
+.formtastic .text textarea {
+ width:72%;
+}
+
+.formtastic .text textarea[cols] {
+ width:auto;
+ max-width:72%;
+}
+
+
+/* HIDDEN OVERRIDES
+--------------------------------------------------------------------------------------------------*/
+.formtastic .hidden {
+ display:none;
+}
+
+
+/* BOOLEAN LABELS
+--------------------------------------------------------------------------------------------------*/
+.formtastic .boolean label {
+ padding-left:25%;
+ display:block;
+}
+
+
+/* CHOICE GROUPS
+--------------------------------------------------------------------------------------------------*/
+.formtastic .choices-group {
+ margin-bottom:-0.5em;
+}
+
+.formtastic .choice {
+ margin:0.1em 0 0.5em 0;
+}
+
+.formtastic .choice label {
+ float:none;
+ width:100%;
+ line-height:100%;
+ padding-top:0;
+ margin-bottom:0.6em;
+}
+
+
+/* ADJUSTMENTS FOR INPUTS INSIDE LABELS (boolean input, radio input, check_boxes input)
+*/
+.formtastic .choice label input,
+.formtastic .boolean label input {
+ margin:0 0.3em 0 0.1em;
+ line-height:100%;
+}
+
+
+/* FRAGMENTED INPUTS (DATE/TIME/DATETIME)
+*/
+.formtastic .fragments {
+ position:relative;
+}
+
+.formtastic .fragments-group {
+ float:left;
+ width:74%;
+ margin:0;
+ padding:0 0 0 25%;
+}
+
+.formtastic .fragment {
+ float:left;
+ width:auto;
+ margin:0 .3em 0 0;
+ padding:0;
+ border:0;
+}
+
+.formtastic .fragment label {
+ display:none;
+}
+
+.formtastic .fragment label input {
+ display:inline;
+ margin:0;
+ padding:0;
+}
View
33 app/assets/stylesheets/formtastic_ie6.css
@@ -0,0 +1,33 @@
+/* additional stylesheets only for IE6, if you wish to support it */
+
+/* legend labels apper to have a left margin or padding I couldn't get rid of cleanly in main stylesheet */
+.formtastic .input fieldset legend.label {
+ margin-left:-7px;
+}
+
+/* checkbox and radio inputs appear to have a margin around them that I couldn't remove in main stylesheet */
+.formtastic .choice label input,
+.formtastic .boolean label input {
+ position:relative;
+ left:-1px;
+ size:15px;
+ margin-left:0;
+ margin-right:0;
+}
+
+/* inline hints and errors appear a few pixel too far over to the left */
+.formtastic .inline-hints,
+.formtastic .inline-errors {
+ padding-left:3px;
+}
+
+/* fragment (eg year, month, day) appear a few pixels too far to the left*/
+.formtastic .fragment {
+ padding-left:3px;
+}
+
+.formtastic .buttons,
+.formtastic .inputs,
+.formtastic .input {
+ zoom:1;
+}
View
23 app/assets/stylesheets/formtastic_ie7.css
@@ -0,0 +1,23 @@
+/* additional stylesheets only for IE7, if you wish to support it */
+
+/* legend labels apper to have a left margin or padding I couldn't get rid of cleanly in main stylesheet */
+.formtastic .input fieldset legend.label {
+ margin-left:-7px;
+}
+
+/* checkbox and radio inputs appear to have a margin around them that I couldn't remove in main stylesheet */
+.formtastic .choice label input,
+.formtastic .boolean label input {
+ position:relative;
+ left:-4px;
+ right:-4px;
+ size:15px;
+ margin-left:0;
+ margin-right:0;
+}
+
+.formtastic .buttons,
+.formtastic .inputs,
+.formtastic .input {
+ zoom:1;
+}
View
3  app/assets/stylesheets/ie6.css
@@ -0,0 +1,3 @@
+/*
+ *= require formtastic_ie6
+*/
View
3  app/assets/stylesheets/ie7.css
@@ -0,0 +1,3 @@
+/*
+ *= require formtastic_ie7
+*/
View
0  app/assets/stylesheets/my_formtastic_changes.css
No changes.
View
6 app/controllers/application_controller.rb
@@ -29,9 +29,9 @@ def create_micropost
def get_events_and_categories
@events_leftbar = if current_user
- categories = current_user.events.map(&:categories).flatten
- categories.map(&:events).flatten - current_user.events
- else
+ # categories = current_user.events.map(&:categories).flatten
+ # categories.map(&:events).flatten - current_user.events
+ #else
Event.all
end
@categories = Category.all
View
2  app/controllers/events_controller.rb
@@ -11,7 +11,7 @@ def category
# GET /events
# GET /events.json
def index
-
+ #@events = Event.all
@events = Event.paginate(:page => params[:page])
View
1  app/models/user.rb
@@ -4,6 +4,7 @@ class User < ActiveRecord::Base
attr_accessor :photo_content_type
attr_accessor :photo_file_size
attr_accessor :photo_updated_at
+ attr_accessor :photo
validates_presence_of :email
validates_presence_of :name
View
7 app/views/events/_form.html.haml
@@ -18,8 +18,7 @@
.field
= check_box_tag "category_ids[]", category.id
= category.name
-
-
+
.field
= f.label t :event_start_date
%br
@@ -39,7 +38,7 @@
.field
= f.label t :event_town
%br
- = f.text_field :town
+ = f.text_field :town, :id => 'search_where'
.field
= f.label t :event_province
%br
@@ -51,7 +50,7 @@
.field
= f.label t :event_description
%br
- = f.text_area :description
+ = f.text_area :description, :class => 'autogrow', :rows => 10
.field
= f.label t :email
%br
View
18 app/views/layouts/application.html.haml
@@ -1,9 +1,11 @@
-%html
+%html{:lang => "en", "xml:lang" => "en", :xmlns => "http://www.w3.org/1999/xhtml"}
+
%head
= title :site => "HiKultura"
= metamagic :title => @title, :description => "My default description."
= stylesheet_link_tag "application"
+
= javascript_include_tag "application"
= csrf_meta_tags
<link type="text/css" href="http://yourwebsite.com/css/ui-lightness/jquery-ui-1.8.custom.css" rel="stylesheet" />
@@ -18,8 +20,7 @@
#right
#loggin
- - flash.each do |name, msg|
- = content_tag :div, msg, :id => "flash#{name}"
+
#user_nav
- if current_user
=I18n.t(:logged_as)
@@ -82,16 +83,7 @@
%b= link_to category.name, category_path(category)
#left
- .block.shadow
- - @events_leftbar.each do |event|
- .entry_side
- - image = image_tag(event.pic.url(:thumb), class: 'side_pic')
- = link_to image, event
- %h4
- = link_to event.title , event
- %h6
- = l event.startDate, :format => :short
- | #{event.town}
+
#right_side
= yield
View
2  app/views/users/_form.html.haml
@@ -29,7 +29,7 @@
%br
= f.text_field :website
.field
- = f.label t :user_pic
+ = f.label t :user_photo
%br
= f.file_field :photo
.actions
View
6 config/environments/production.rb
@@ -44,7 +44,10 @@
# Precompile additional assets (application.js, application.css, and all non-JS/CSS are already added)
# config.assets.precompile += %w( search.js )
-
+ #Enables use of formtastic
+ #config.assets.precompile += %w( ie6.css )
+ #config.assets.precompile += %w( ie7.css )
+
# Disable delivery errors, bad email addresses will be ignored
# config.action_mailer.raise_delivery_errors = false
@@ -69,4 +72,5 @@
:authentication => 'plain',
:enable_starttls_auto => true }
end
+
View
82 config/initializers/formtastic.rb
@@ -0,0 +1,82 @@
+# encoding: utf-8
+
+# Set the default text field size when input is a string. Default is nil.
+# Formtastic::FormBuilder.default_text_field_size = 50
+
+# Set the default text area height when input is a text. Default is 20.
+# Formtastic::FormBuilder.default_text_area_height = 5
+
+# Set the default text area width when input is a text. Default is nil.
+# Formtastic::FormBuilder.default_text_area_width = 50
+
+# Should all fields be considered "required" by default?
+# Defaults to true.
+# Formtastic::FormBuilder.all_fields_required_by_default = true
+
+# Should select fields have a blank option/prompt by default?
+# Defaults to true.
+# Formtastic::FormBuilder.include_blank_for_select_by_default = true
+
+# Set the string that will be appended to the labels/fieldsets which are required
+# It accepts string or procs and the default is a localized version of
+# '<abbr title="required">*</abbr>'. In other words, if you configure formtastic.required
+# in your locale, it will replace the abbr title properly. But if you don't want to use
+# abbr tag, you can simply give a string as below
+# Formtastic::FormBuilder.required_string = "(required)"
+
+# Set the string that will be appended to the labels/fieldsets which are optional
+# Defaults to an empty string ("") and also accepts procs (see required_string above)
+# Formtastic::FormBuilder.optional_string = "(optional)"
+
+# Set the way inline errors will be displayed.
+# Defaults to :sentence, valid options are :sentence, :list, :first and :none
+# Formtastic::FormBuilder.inline_errors = :sentence
+# Formtastic uses the following classes as default for hints, inline_errors and error list
+
+# If you override the class here, please ensure to override it in your stylesheets as well
+# Formtastic::FormBuilder.default_hint_class = "inline-hints"
+# Formtastic::FormBuilder.default_inline_error_class = "inline-errors"
+# Formtastic::FormBuilder.default_error_list_class = "errors"
+
+# Set the method to call on label text to transform or format it for human-friendly
+# reading when formtastic is used without object. Defaults to :humanize.
+# Formtastic::FormBuilder.label_str_method = :humanize
+
+# Set the array of methods to try calling on parent objects in :select and :radio inputs
+# for the text inside each @<option>@ tag or alongside each radio @<input>@. The first method
+# that is found on the object will be used.
+# Defaults to ["to_label", "display_name", "full_name", "name", "title", "username", "login", "value", "to_s"]
+# Formtastic::FormBuilder.collection_label_methods = [
+# "to_label", "display_name", "full_name", "name", "title", "username", "login", "value", "to_s"]
+
+# Additionally, you can customize the order for specific types of inputs.
+# This is configured on a type basis and if a type is not found it will
+# fall back to the default order as defined by #inline_order
+# Formtastic::FormBuilder.custom_inline_order[:checkbox] = [:errors, :hints, :input]
+# Formtastic::FormBuilder.custom_inline_order[:select] = [:hints, :input, :errors]
+
+# Specifies if labels/hints for input fields automatically be looked up using I18n.
+# Default value: true. Overridden for specific fields by setting value to true,
+# i.e. :label => true, or :hint => true (or opposite depending on initialized value)
+# Formtastic::FormBuilder.i18n_lookups_by_default = false
+
+# Specifies if I18n lookups of the default I18n Localizer should be cached to improve performance.
+# Defaults to false.
+# Formtastic::FormBuilder.i18n_cache_lookups = true
+
+# Specifies the class to use for localization lookups. You can create your own
+# class and use it instead by subclassing Formtastic::Localizer (which is the default).
+# Formtastic::FormBuilder.i18n_localizer = MyOwnLocalizer
+
+# You can add custom inputs or override parts of Formtastic by subclassing Formtastic::FormBuilder and
+# specifying that class here. Defaults to Formtastic::FormBuilder.
+# Formtastic::Helpers::FormHelper.builder = MyCustomBuilder
+
+# You can opt-in to Formtastic's use of the HTML5 `required` attribute on `<input>`, `<select>`
+# and `<textarea>` tags by setting this to false (defaults to true).
+# Formtastic::FormBuilder.use_required_attribute = true
+
+# You can opt-in to new HTML5 browser validations (for things like email and url inputs) by setting
+# this to false. Doing so will add a `novalidate` attribute to the `<form>` tag.
+# See http://diveintohtml5.org/forms.html#validation for more info.
+# Formtastic::FormBuilder.perform_browser_validations = true
View
11 db/migrate/20120410133233_rename_columns_pic_in_users.rb
@@ -0,0 +1,11 @@
+class RenameColumnsPicInUsers < ActiveRecord::Migration
+ def up
+ rename_column :users, :pic_file_name, :photo_file_name
+ rename_column :users, :pic_content_type, :photo_content_type
+ rename_column :users, :pic_file_size, :photo_file_size
+ rename_column :users, :pic_updated_at, :photo_updated_at
+ end
+
+ def down
+ end
+end
View
18 db/schema.rb
@@ -11,7 +11,7 @@
#
# It's strongly recommended to check this file into your version control system.
-ActiveRecord::Schema.define(:version => 20120406093537) do
+ActiveRecord::Schema.define(:version => 20120410133233) do
create_table "alarms", :force => true do |t|
t.integer "user_id"
@@ -93,6 +93,8 @@
t.string "title_en"
t.boolean "approved", :default => false
t.boolean "reminded", :default => false
+ t.boolean "cancelled", :default => false
+ t.text "cancel_message"
end
create_table "events_users", :id => false, :force => true do |t|
@@ -151,16 +153,16 @@
t.string "website"
t.datetime "created_at"
t.datetime "updated_at"
- t.string "pic_file_name"
- t.string "pic_content_type"
- t.integer "pic_file_size"
- t.datetime "pic_updated_at"
+ t.string "photo_file_name"
+ t.string "photo_content_type"
+ t.integer "photo_file_size"
+ t.datetime "photo_updated_at"
t.string "crypted_password"
t.string "persistence_token"
- t.boolean "admin", :default => false
+ t.boolean "admin", :default => false
t.string "locale"
- t.string "perishable_token", :default => "", :null => false
- t.integer "attempts", :default => 0
+ t.string "perishable_token", :default => "", :null => false
+ t.integer "attempts", :default => 0
end
add_index "users", ["perishable_token"], :name => "index_users_on_perishable_token"
View
8 lib/templates/haml/scaffold/_form.html.haml
@@ -0,0 +1,8 @@
+= semantic_form_for @<%= singular_name %> do |f|
+ = f.inputs do
+ <%- attributes.each do |attribute| -%>
+ = f.input :<%= attribute.name %>
+ <%- end -%>
+
+ = f.actions do
+ = f.action :submit, :as => :input
View
BIN  photos/12/medium.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  photos/12/original.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  photos/12/thumb.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
4 public/assets/manifest.yml
@@ -1,7 +1,9 @@
---
marker.png: marker-38c7660b998e433ac112b9fec3e19137.png
application.js: application-6fddfe2edc4948de94868d5dffec589b.js
-application.css: application-cd32e5ac61d545bf8c210a39214a2a0a.css
+application.css: application-cba212950850d5c65fc283853f7d2820.css
+ie6.css: ie6-f963ef6f60ee32b38f42db95d36ee38a.css
+ie7.css: ie7-d87a05e06d83b55f41822a24ed97d1e9.css
ui-lightness/images/ui-bg_diagonals-thick_18_b81900_40x40.png: ui-lightness/images/ui-bg_diagonals-thick_18_b81900_40x40-aad52b14967fe4ebe93f0c2a3ed9cb1f.png
ui-lightness/images/ui-bg_diagonals-thick_20_666666_40x40.png: ui-lightness/images/ui-bg_diagonals-thick_20_666666_40x40-149f0f1f12779ce76e2c9ccc01d06475.png
ui-lightness/images/ui-bg_flat_10_000000_40x100.png: ui-lightness/images/ui-bg_flat_10_000000_40x100-b445178f2c744b1d511ad862497ffc57.png
Please sign in to comment.
Something went wrong with that request. Please try again.