Skip to content

Commit

Permalink
proyecto avanzado, tiene plantillas y mantenimintos hechos
Browse files Browse the repository at this point in the history
  • Loading branch information
exes committed Feb 17, 2019
1 parent 75f0431 commit 910199c
Show file tree
Hide file tree
Showing 198 changed files with 3,846 additions and 310 deletions.
1 change: 1 addition & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
DATABASE_HOST="localhost"
DATABASE_USERNAME="postgres"
DATABASE_PASSWORD="123456789"
GMAPS_API_KEY="AIzaSyDER_9uXL3OuxKC8xktXfEZQIs8jRr0ZaY"
2 changes: 2 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ gem 'cancancan' # Manejo de permisos
gem 'slim-rails' # Hacer HTML mas legible
gem 'dotenv' # Gema para manejar claves y variables de la maquina
gem 'aasm' # Gema para manejar estados
gem 'gmaps-rails'


# Gemas solo para usar en la maquina local
group :development, :test do
Expand Down
5 changes: 4 additions & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ GEM
ffi (1.10.0)
globalid (0.4.2)
activesupport (>= 4.2.0)
gmaps-rails (0.0.2)
rails
i18n (1.5.1)
concurrent-ruby (~> 1.0)
jbuilder (2.8.0)
Expand Down Expand Up @@ -236,6 +238,7 @@ DEPENDENCIES
devise
dotenv
erd
gmaps-rails
jbuilder (~> 2.5)
letter_opener
listen (>= 3.0.5, < 3.2)
Expand All @@ -258,4 +261,4 @@ RUBY VERSION
ruby 2.5.3p105

BUNDLED WITH
1.17.2
1.17.3
3 changes: 3 additions & 0 deletions app/assets/javascripts/access_points.coffee
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Place all the behaviors and hooks related to the matching controller here.
# All this logic will automatically be available in application.js.
# You can use CoffeeScript in this file: http://coffeescript.org/
3 changes: 3 additions & 0 deletions app/assets/javascripts/cordinates.coffee
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Place all the behaviors and hooks related to the matching controller here.
# All this logic will automatically be available in application.js.
# You can use CoffeeScript in this file: http://coffeescript.org/
3 changes: 3 additions & 0 deletions app/assets/javascripts/data.coffee
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Place all the behaviors and hooks related to the matching controller here.
# All this logic will automatically be available in application.js.
# You can use CoffeeScript in this file: http://coffeescript.org/
3 changes: 3 additions & 0 deletions app/assets/javascripts/location_devices.coffee
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Place all the behaviors and hooks related to the matching controller here.
# All this logic will automatically be available in application.js.
# You can use CoffeeScript in this file: http://coffeescript.org/
3 changes: 3 additions & 0 deletions app/assets/javascripts/mobiles.coffee
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Place all the behaviors and hooks related to the matching controller here.
# All this logic will automatically be available in application.js.
# You can use CoffeeScript in this file: http://coffeescript.org/
3 changes: 3 additions & 0 deletions app/assets/javascripts/permises.coffee
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Place all the behaviors and hooks related to the matching controller here.
# All this logic will automatically be available in application.js.
# You can use CoffeeScript in this file: http://coffeescript.org/
3 changes: 3 additions & 0 deletions app/assets/javascripts/permises_roles.coffee
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Place all the behaviors and hooks related to the matching controller here.
# All this logic will automatically be available in application.js.
# You can use CoffeeScript in this file: http://coffeescript.org/
3 changes: 3 additions & 0 deletions app/assets/javascripts/roles.coffee
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Place all the behaviors and hooks related to the matching controller here.
# All this logic will automatically be available in application.js.
# You can use CoffeeScript in this file: http://coffeescript.org/
3 changes: 3 additions & 0 deletions app/assets/javascripts/zone.coffee
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Place all the behaviors and hooks related to the matching controller here.
# All this logic will automatically be available in application.js.
# You can use CoffeeScript in this file: http://coffeescript.org/
3 changes: 3 additions & 0 deletions app/assets/javascripts/zone__devices.coffee
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Place all the behaviors and hooks related to the matching controller here.
# All this logic will automatically be available in application.js.
# You can use CoffeeScript in this file: http://coffeescript.org/
3 changes: 3 additions & 0 deletions app/assets/javascripts/zones.coffee
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Place all the behaviors and hooks related to the matching controller here.
# All this logic will automatically be available in application.js.
# You can use CoffeeScript in this file: http://coffeescript.org/
3 changes: 3 additions & 0 deletions app/assets/stylesheets/access_points.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// Place all the styles related to the access_points controller here.
// They will automatically be included in application.css.
// You can use Sass (SCSS) here: http://sass-lang.com/
3 changes: 3 additions & 0 deletions app/assets/stylesheets/cordinates.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// Place all the styles related to the cordinates controller here.
// They will automatically be included in application.css.
// You can use Sass (SCSS) here: http://sass-lang.com/
3 changes: 3 additions & 0 deletions app/assets/stylesheets/data.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// Place all the styles related to the data controller here.
// They will automatically be included in application.css.
// You can use Sass (SCSS) here: http://sass-lang.com/
3 changes: 3 additions & 0 deletions app/assets/stylesheets/location_devices.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// Place all the styles related to the location_devices controller here.
// They will automatically be included in application.css.
// You can use Sass (SCSS) here: http://sass-lang.com/
3 changes: 3 additions & 0 deletions app/assets/stylesheets/mobiles.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// Place all the styles related to the mobiles controller here.
// They will automatically be included in application.css.
// You can use Sass (SCSS) here: http://sass-lang.com/
3 changes: 3 additions & 0 deletions app/assets/stylesheets/permises.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// Place all the styles related to the permises controller here.
// They will automatically be included in application.css.
// You can use Sass (SCSS) here: http://sass-lang.com/
3 changes: 3 additions & 0 deletions app/assets/stylesheets/permises_roles.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// Place all the styles related to the permises_roles controller here.
// They will automatically be included in application.css.
// You can use Sass (SCSS) here: http://sass-lang.com/
3 changes: 3 additions & 0 deletions app/assets/stylesheets/roles.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// Place all the styles related to the roles controller here.
// They will automatically be included in application.css.
// You can use Sass (SCSS) here: http://sass-lang.com/
84 changes: 84 additions & 0 deletions app/assets/stylesheets/scaffolds.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
body {
background-color: #fff;
color: #333;
margin: 33px;
font-family: verdana, arial, helvetica, sans-serif;
font-size: 13px;
line-height: 18px;
}

p, ol, ul, td {
font-family: verdana, arial, helvetica, sans-serif;
font-size: 13px;
line-height: 18px;
}

pre {
background-color: #eee;
padding: 10px;
font-size: 11px;
}

a {
color: #000;

&:visited {
color: #666;
}

&:hover {
color: #fff;
background-color: #000;
}
}

th {
padding-bottom: 5px;
}

td {
padding: 0 5px 7px;
}

div {
&.field, &.actions {
margin-bottom: 10px;
}
}

#notice {
color: green;
}

.field_with_errors {
padding: 2px;
background-color: red;
display: table;
}

#error_explanation {
width: 450px;
border: 2px solid red;
padding: 7px 7px 0;
margin-bottom: 20px;
background-color: #f0f0f0;

h2 {
text-align: left;
font-weight: bold;
padding: 5px 5px 5px 15px;
font-size: 12px;
margin: -7px -7px 0;
background-color: #c00;
color: #fff;
}

ul li {
font-size: 12px;
list-style: square;
}
}

label {
display: block;
}
3 changes: 3 additions & 0 deletions app/assets/stylesheets/zone.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// Place all the styles related to the zone controller here.
// They will automatically be included in application.css.
// You can use Sass (SCSS) here: http://sass-lang.com/
3 changes: 3 additions & 0 deletions app/assets/stylesheets/zone__devices.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// Place all the styles related to the zone__devices controller here.
// They will automatically be included in application.css.
// You can use Sass (SCSS) here: http://sass-lang.com/
3 changes: 3 additions & 0 deletions app/assets/stylesheets/zones.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// Place all the styles related to the zones controller here.
// They will automatically be included in application.css.
// You can use Sass (SCSS) here: http://sass-lang.com/
74 changes: 74 additions & 0 deletions app/controllers/access_points_controller.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
class AccessPointsController < ApplicationController
before_action :set_access_point, only: [:show, :edit, :update, :destroy]

# GET /access_points
# GET /access_points.json
def index
@access_points = AccessPoint.all
end

# GET /access_points/1
# GET /access_points/1.json
def show
end

# GET /access_points/new
def new
@access_point = AccessPoint.new
end

# GET /access_points/1/edit
def edit
end

# POST /access_points
# POST /access_points.json
def create
@access_point = AccessPoint.new(access_point_params)

respond_to do |format|
if @access_point.save
format.html { redirect_to @access_point, notice: 'Access point was successfully created.' }
format.json { render :show, status: :created, location: @access_point }
else
format.html { render :new }
format.json { render json: @access_point.errors, status: :unprocessable_entity }
end
end
end

# PATCH/PUT /access_points/1
# PATCH/PUT /access_points/1.json
def update
respond_to do |format|
if @access_point.update(access_point_params)
format.html { redirect_to @access_point, notice: 'Access point was successfully updated.' }
format.json { render :show, status: :ok, location: @access_point }
else
format.html { render :edit }
format.json { render json: @access_point.errors, status: :unprocessable_entity }
end
end
end

# DELETE /access_points/1
# DELETE /access_points/1.json
def destroy
@access_point.destroy
respond_to do |format|
format.html { redirect_to access_points_url, notice: 'Access point was successfully destroyed.' }
format.json { head :no_content }
end
end

private
# Use callbacks to share common setup or constraints between actions.
def set_access_point
@access_point = AccessPoint.find(params[:id])
end

# Never trust parameters from the scary internet, only allow the white list through.
def access_point_params
params.require(:access_point).permit(:ip_address, :mac_address, :user, :password)
end
end
74 changes: 74 additions & 0 deletions app/controllers/cordinates_controller.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
class CordinatesController < ApplicationController
before_action :set_cordinate, only: [:show, :edit, :update, :destroy]

# GET /cordinates
# GET /cordinates.json
def index
@cordinates = Cordinate.all
end

# GET /cordinates/1
# GET /cordinates/1.json
def show
end

# GET /cordinates/new
def new
@cordinate = Cordinate.new
end

# GET /cordinates/1/edit
def edit
end

# POST /cordinates
# POST /cordinates.json
def create
@cordinate = Cordinate.new(cordinate_params)

respond_to do |format|
if @cordinate.save
format.html { redirect_to @cordinate, notice: 'Cordinate was successfully created.' }
format.json { render :show, status: :created, location: @cordinate }
else
format.html { render :new }
format.json { render json: @cordinate.errors, status: :unprocessable_entity }
end
end
end

# PATCH/PUT /cordinates/1
# PATCH/PUT /cordinates/1.json
def update
respond_to do |format|
if @cordinate.update(cordinate_params)
format.html { redirect_to @cordinate, notice: 'Cordinate was successfully updated.' }
format.json { render :show, status: :ok, location: @cordinate }
else
format.html { render :edit }
format.json { render json: @cordinate.errors, status: :unprocessable_entity }
end
end
end

# DELETE /cordinates/1
# DELETE /cordinates/1.json
def destroy
@cordinate.destroy
respond_to do |format|
format.html { redirect_to cordinates_url, notice: 'Cordinate was successfully destroyed.' }
format.json { head :no_content }
end
end

private
# Use callbacks to share common setup or constraints between actions.
def set_cordinate
@cordinate = Cordinate.find(params[:id])
end

# Never trust parameters from the scary internet, only allow the white list through.
def cordinate_params
params.require(:cordinate).permit(:latitude, :longitude)
end
end
11 changes: 11 additions & 0 deletions app/controllers/dashboard_controller.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,15 @@
class DashboardController < ApplicationController
def home
@map = GMaps.new(div: '#map', lat: -12.043333, lng: -77.028333)
@map.addMarker(lat: -12.043333,
lng: -77.028333,
title: 'Lima',
click: GMaps::JS["function(e) { alert('You clicked in this marker'); }"])
@map.addMarker(lat: -12.042,
lng: -77.028333,
title: 'Marker with InfoWindow',
infoWindow: {
content: '<p>HTML Content</p>'
})
end
end
Loading

0 comments on commit 910199c

Please sign in to comment.