##// END OF EJS Templates
- Finalizado el formulario del Login al proyecto.
jsalyrosas -
r199:200
parent child
Show More
@@ -1,161 +1,161
1 1 # Django settings for abs_webapp_dev project.
2 2
3 3 import os, sys
4 4 PROJECT_DIR = os.path.split(os.path.dirname(__file__))[0]
5 5 API_DIR = "/home/dev/workspace/absclient"
6 6 sys.path.append(API_DIR)
7 7
8 8 DEBUG = True
9 9 TEMPLATE_DEBUG = DEBUG
10 10
11 11 ADMINS = (
12 12 # ('Your Name', 'your_email@example.com'),
13 13 )
14 14
15 15 MANAGERS = ADMINS
16 16
17 17 DATABASES = {
18 18 'default': {
19 19 'ENGINE': 'django.db.backends.mysql', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
20 20 'NAME': 'db_jrowebapp_dev', # Or path to database file if using sqlite3.
21 21 'USER': 'abscontrol', # Not used with sqlite3.
22 22 'PASSWORD': 'abscontrol', # Not used with sqlite3.
23 23 'HOST': 'localhost', # Set to empty string for localhost. Not used with sqlite3.
24 24 'PORT': '3306', # Set to empty string for default. Not used with sqlite3.
25 25 }
26 26 }
27 27
28 28 # Local time zone for this installation. Choices can be found here:
29 29 # http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
30 30 # although not all choices may be available on all operating systems.
31 31 # In a Windows environment this must be set to your system time zone.
32 32 TIME_ZONE = 'America/Lima'
33 33
34 34 # Language code for this installation. All choices can be found here:
35 35 # http://www.i18nguy.com/unicode/language-identifiers.html
36 36 LANGUAGE_CODE = 'en-us'
37 37
38 38 SITE_ID = 1
39 39
40 40 # If you set this to False, Django will make some optimizations so as not
41 41 # to load the internationalization machinery.
42 42 USE_I18N = True
43 43
44 44 # If you set this to False, Django will not format dates, numbers and
45 45 # calendars according to the current locale.
46 46 USE_L10N = True
47 47
48 48 # If you set this to False, Django will not use timezone-aware datetimes.
49 49 USE_TZ = True
50 50
51 51 # Absolute filesystem path to the directory that will hold user-uploaded files.
52 52 # Example: "/home/media/media.lawrence.com/media/"
53 53 MEDIA_ROOT = os.path.join(PROJECT_DIR, 'media').replace('\\', '/')
54 54
55 55 # URL that handles the media served from MEDIA_ROOT. Make sure to use a
56 56 # trailing slash.
57 57 # Examples: "http://media.lawrence.com/media/", "http://example.com/media/"
58 58 MEDIA_URL = '/media/'
59 59
60 60 # Absolute path to the directory static files should be collected to.
61 61 # Don't put anything in this directory yourself; store your static files
62 62 # in apps' "static/" subdirectories and in STATICFILES_DIRS.
63 63 # Example: "/home/media/media.lawrence.com/static/"
64 64 #STATIC_ROOT = os.path.join(PROJECT_DIR, 'static-serve').replace('\\', '/'),
65 65 STATIC_ROOT = ''
66 66
67 67 # URL prefix for static files.
68 68 # Example: "http://media.lawrence.com/static/"
69 69 STATIC_URL = '/static/'
70 70
71 71 # Additional locations of static files
72 72 STATICFILES_DIRS = (
73 73 # Put strings here, like "/home/html/static" or "C:/www/django/static".
74 74 # Always use forward slashes, even on Windows.
75 75 # Don't forget to use absolute paths, not relative paths.
76 76 #os.path.join(PROJECT_DIR, "static").replace('\\', '/'),
77 77 ("static", os.path.join(PROJECT_DIR, "static").replace('\\', '/')),
78 78 )
79 79
80 80 # List of finder classes that know how to find static files in
81 81 # various locations.
82 82 STATICFILES_FINDERS = (
83 83 'django.contrib.staticfiles.finders.FileSystemFinder',
84 84 'django.contrib.staticfiles.finders.AppDirectoriesFinder',
85 85 # 'django.contrib.staticfiles.finders.DefaultStorageFinder',
86 86 )
87 87
88 88 # Make this unique, and don't share it with anybody.
89 89 SECRET_KEY = '=^abu)gd=)7hf#rme_vw=tv!bdh7+tts*^&)h(n=7@7(9#__@e'
90 90
91 91 # List of callables that know how to import templates from various sources.
92 92 TEMPLATE_LOADERS = (
93 93 'django.template.loaders.filesystem.Loader',
94 94 'django.template.loaders.app_directories.Loader',
95 95 # 'django.template.loaders.eggs.Loader',
96 96 )
97 97
98 98 MIDDLEWARE_CLASSES = (
99 99 'django.middleware.common.CommonMiddleware',
100 100 'django.contrib.sessions.middleware.SessionMiddleware',
101 #'django.middleware.csrf.CsrfViewMiddleware',
101 'django.middleware.csrf.CsrfViewMiddleware',
102 102 'django.contrib.auth.middleware.AuthenticationMiddleware',
103 103 'django.contrib.messages.middleware.MessageMiddleware',
104 104 # Uncomment the next line for simple clickjacking protection:
105 105 # 'django.middleware.clickjacking.XFrameOptionsMiddleware',
106 106 )
107 107
108 108 ROOT_URLCONF = 'abs_webapp_dev.urls'
109 109
110 110 # Python dotted path to the WSGI application used by Django's runserver.
111 111 WSGI_APPLICATION = 'abs_webapp_dev.wsgi.application'
112 112
113 113 TEMPLATE_DIRS = (
114 114 # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
115 115 # Always use forward slashes, even on Windows.
116 116 # Don't forget to use absolute paths, not relative paths.
117 117 os.path.join(PROJECT_DIR, "templates").replace('\\', '/'),
118 118 )
119 119
120 120 INSTALLED_APPS = (
121 121 'django.contrib.auth',
122 122 'django.contrib.contenttypes',
123 123 'django.contrib.sessions',
124 124 'django.contrib.sites',
125 125 'django.contrib.messages',
126 126 'django.contrib.staticfiles',
127 127 # Uncomment the next line to enable the admin:
128 128 'django.contrib.admin',
129 129 # Uncomment the next line to enable admin documentation:
130 130 # 'django.contrib.admindocs',
131 131 'abscontrol',
132 132 )
133 133
134 134 # A sample logging configuration. The only tangible logging
135 135 # performed by this configuration is to send an email to
136 136 # the site admins on every HTTP 500 error when DEBUG=False.
137 137 # See http://docs.djangoproject.com/en/dev/topics/logging for
138 138 # more details on how to customize your logging configuration.
139 139 LOGGING = {
140 140 'version': 1,
141 141 'disable_existing_loggers': False,
142 142 'filters': {
143 143 'require_debug_false': {
144 144 '()': 'django.utils.log.RequireDebugFalse'
145 145 }
146 146 },
147 147 'handlers': {
148 148 'mail_admins': {
149 149 'level': 'ERROR',
150 150 'filters': ['require_debug_false'],
151 151 'class': 'django.utils.log.AdminEmailHandler'
152 152 }
153 153 },
154 154 'loggers': {
155 155 'django.request': {
156 156 'handlers': ['mail_admins'],
157 157 'level': 'ERROR',
158 158 'propagate': True,
159 159 },
160 160 }
161 161 }
@@ -1,26 +1,27
1 1 from django.conf.urls import patterns, include, url
2 2 from django.conf import settings
3 3
4 4 # Uncomment the next two lines to enable the admin:
5 5 from django.contrib import admin
6 6 admin.autodiscover()
7 7
8 8 urlpatterns = patterns('',
9 9 # Examples:
10 10 # url(r'^$', 'abs_webapp_dev.views.home', name='home'),
11 11 # url(r'^abs_webapp_dev/', include('abs_webapp_dev.foo.urls')),
12 12
13 13 # Uncomment the admin/doc line below to enable admin documentation:
14 14 # url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
15 15
16 16 # Uncomment the next line to enable the admin:
17 17 url(r'^admin/', include(admin.site.urls)),
18 18 url(r'^abscontrol/', include('abscontrol.urls')),
19 19 url(r'^accounts/login/$', 'django.contrib.auth.views.login'),
20 url(r'^$', 'abscontrol.views.index'),
20 21
21 22 )
22 23
23 24 if settings.DEBUG:
24 25 urlpatterns = patterns('',
25 26 url(r'^media/(?P<path>.*)$', 'django.views.static.serve',{'document_root': settings.MEDIA_ROOT, 'show_indexes': True}),
26 27 ) + urlpatterns No newline at end of file
@@ -1,502 +1,504
1 1 from django.shortcuts import render_to_response, redirect
2 2 from django.http import HttpResponse
3 3 from django.conf import settings
4 4 from django.utils.encoding import smart_str
5 5 from django.core.servers.basehttp import FileWrapper
6 6 import mimetypes
7 from django.contrib.auth.decorators import login_required
7 8
8 9 from datetime import datetime
9 10
10 11 from abscontrol.models import Profile, Pattern, AntennaDown, AntennaUp
11 12
12 13 from util.readABSFile import readABSFile
13 14 from util.saveABSFile import saveABSFile
14 15 from util.ABSData import ABSData
15 16 from scripts.sendFile import sendFile
16 17
17 18 txtAntenna = "[[0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5]," \
18 19 "[1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0]," \
19 20 "[0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5]," \
20 21 "[0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5]," \
21 22 "[1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0]," \
22 23 "[0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5]," \
23 24 "[1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0]," \
24 25 "[0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5]]"
25 26
26 27 txtTxUp = "[[1,1,1,1,1,1,1,1]," \
27 28 "[1,1,1,1,1,1,1,1]," \
28 29 "[1,1,1,1,1,1,1,1]," \
29 30 "[1,1,1,1,1,1,1,1]," \
30 31 "[1,1,1,1,1,1,1,1]," \
31 32 "[1,1,1,1,1,1,1,1]," \
32 33 "[1,1,1,1,1,1,1,1]," \
33 34 "[1,1,1,1,1,1,1,1]]"
34 35
35 36 txtTxDown = "[[1,1,1,1,0,0,0,0]," \
36 37 "[1,1,1,1,0,0,0,0]," \
37 38 "[1,1,1,1,0,0,0,0]," \
38 39 "[1,1,1,1,0,0,0,0]," \
39 40 "[0,0,0,0,1,1,1,1]," \
40 41 "[0,0,0,0,1,1,1,1]," \
41 42 "[0,0,0,0,1,1,1,1]," \
42 43 "[0,0,0,0,1,1,1,1]]"
43 44
44 45 txtRxUp = "[[0,0,0,0,1,1,1,1]," \
45 46 "[0,0,0,0,1,1,1,1]," \
46 47 "[0,0,0,0,1,1,1,1]," \
47 48 "[0,0,0,0,1,1,1,1]," \
48 49 "[1,1,1,1,1,1,1,1]," \
49 50 "[1,1,1,1,1,1,1,1]," \
50 51 "[1,1,1,1,1,1,1,1]," \
51 52 "[1,1,1,1,1,1,1,1]]"
52 53
53 54 txtRxDown = "[[1,1,1,1,1,1,1,1]," \
54 55 "[1,1,1,1,1,1,1,1]," \
55 56 "[1,1,1,1,1,1,1,1]," \
56 57 "[1,1,1,1,1,1,1,1]," \
57 58 "[1,1,1,1,1,1,1,1]," \
58 59 "[1,1,1,1,1,1,1,1]," \
59 60 "[1,1,1,1,1,1,1,1]," \
60 61 "[1,1,1,1,1,1,1,1]]"
61 62
62 63 arrayTx = [["0","0","0","0","0","0","0","0"],\
63 64 ["0","0","0","0","0","0","0","0"],\
64 65 ["0","0","0","0","0","0","0","0"],\
65 66 ["0","0","0","0","0","0","0","0"],\
66 67 ["0","0","0","0","0","0","0","0"],\
67 68 ["0","0","0","0","0","0","0","0"],\
68 69 ["0","0","0","0","0","0","0","0"],\
69 70 ["0","0","0","0","0","0","0","0"]]
70 71
71 72 arrayUes = ["0.533333","0.00000","1.06667","0.00000"]
72 73
74 @login_required(login_url='/accounts/login/')
73 75 def index(request):
74 76 #latest_poll_list = profileAntenna.objects.all().order_by('-pub_date')[:5]
75 77 profile_list = Profile.objects.filter(state=1)
76 78 return render_to_response('abscontrol/index.html', {'profile_list': profile_list})
77 79
78 80 def new(request):
79 81 profile_list = Profile.objects.filter(state=1)
80 82 txtProfile = datetime.now().strftime("%Y%m%d%H%M%S%f")
81 83 newprofile = Profile(name=txtProfile)
82 84 newprofile.save()
83 85
84 86 lsPatterns = None
85 87
86 88 return render_to_response('abscontrol/new.html', {'profile_list': profile_list,
87 89 'profile_name' : newprofile.name,
88 90 'profile_id' : newprofile.id,
89 91 'lsPatterns' : lsPatterns,
90 92 'range' : range(8), 'arrayUes' : arrayUes,
91 93 })
92 94
93 95 def save(request):
94 96
95 97 txtProfile = request.POST["txtProfile"]
96 98
97 99 txtAntennaUp = request.POST["txtAntennaUp"]
98 100 txtTxUp = request.POST["txtTxUp"]
99 101 txtRxUp = request.POST["txtRxUp"]
100 102 txtUesUp = request.POST["txtUesUp"]
101 103
102 104 txtAntennaDown = request.POST["txtAntennaDown"]
103 105 txtTxDown = request.POST["txtTxDown"]
104 106 txtRxDown = request.POST["txtRxDown"]
105 107 txtUesDown = request.POST["txtUesDown"]
106 108
107 109 newprofile = Profile(name=txtProfile)
108 110 newprofile.save()
109 111
110 112 newpattern = newprofile.pattern_set.create(value=1)
111 113 newpattern.antennaup_set.create(value=txtAntennaUp,tx=txtTxUp,rx=txtRxUp,ues=txtUesUp)
112 114 newpattern.antennadown_set.create(value=txtAntennaDown,tx=txtTxDown,rx=txtRxDown,ues=txtUesDown)
113 115
114 116 newurl = '/abscontrol/view/%d' % newprofile.id
115 117
116 118 return redirect(newurl)
117 119
118 120 # Update temporal experiment
119 121 def upgrade(request, profile_id):
120 122 txtAntennaUp = request.POST["txtAntennaUp"]
121 123 txtTxUp = request.POST["txtTxUp"]
122 124 txtRxUp = request.POST["txtRxUp"]
123 125 txtUesUp = request.POST["txtUesUp"]
124 126
125 127 txtAntennaDown = request.POST["txtAntennaDown"]
126 128 txtTxDown = request.POST["txtTxDown"]
127 129 txtRxDown = request.POST["txtRxDown"]
128 130 txtUesDown = request.POST["txtUesDown"]
129 131
130 132 objProfile = Profile.objects.get(pk=profile_id)
131 133 newpattern = objProfile.pattern_set.create(value=1)
132 134 newpattern.antennaup_set.create(value=txtAntennaUp,tx=txtTxUp,rx=txtRxUp,ues=txtUesUp)
133 135 newpattern.antennadown_set.create(value=txtAntennaDown,tx=txtTxDown,rx=txtRxDown,ues=txtUesDown)
134 136
135 137 newurl = '/abscontrol/%d/edit/%d' % (int(profile_id), newpattern.id)
136 138 return redirect(newurl)
137 139
138 140 def update(request, profile_id):
139 141 txtProfile = request.POST["txtProfile"]
140 142
141 143 objProfile = Profile.objects.get(pk=profile_id)
142 144 objProfile.name = txtProfile
143 145 objProfile.state = 1
144 146 objProfile.save()
145 147
146 148 newurl = '/abscontrol/view/%d' % objProfile.id
147 149 return redirect(newurl)
148 150
149 151 def changeName(request, profile_id):
150 152 profile_list = Profile.objects.filter(state=1)
151 153 objProfile = Profile.objects.get(pk=profile_id)
152 154 lsPatterns = objProfile.pattern_set.all()
153 155
154 156 return render_to_response('abscontrol/changeName.html', {'profile_list': profile_list,
155 157 'objProfile': objProfile,
156 158 'lsPatterns' : lsPatterns,
157 159 })
158 160
159 161 def view(request, profile_id):
160 162 nextPattern = 0
161 163
162 164 if request.method == 'GET' and 'pattern' in request.GET:
163 165 pattern_value = request.GET["pattern"]
164 166 else:
165 167 pattern_value = 1
166 168
167 169 profile_list = Profile.objects.filter(state=1)
168 170 objProfile = Profile.objects.get(pk=profile_id)
169 171
170 172 lsPatterns = objProfile.pattern_set.all()
171 173 patternChoosen = objProfile.pattern_set.get(value=pattern_value)
172 174 objAntennaUp = patternChoosen.antennaup_set.get()
173 175 objAntennaDown = patternChoosen.antennadown_set.get()
174 176
175 177 if len(lsPatterns) > 1:
176 178 if pattern_value == 1:
177 179 nextValuePattern = pattern_value + 1
178 180 nextPattern = objProfile.pattern_set.get(value=nextValuePattern)
179 181
180 182
181 183 return render_to_response('abscontrol/view.html', {'objProfile': objProfile, 'profile_list': profile_list,
182 184 'patternChoosen' : patternChoosen, 'lsPatterns' : lsPatterns,
183 185 'antennaUp' : objAntennaUp, 'antennaDown' : objAntennaDown,
184 186 'nextPattern' : nextPattern,
185 187 })
186 188
187 189 def edit(request, profile_id):
188 190 if request.method == 'GET' and 'pattern' in request.GET:
189 191 pattern_value = request.GET["pattern"]
190 192 else:
191 193 pattern_value = 1
192 194
193 195 absData = ABSData()
194 196 profile_list = Profile.objects.filter(state=1)
195 197 objProfile = Profile.objects.get(pk=profile_id)
196 198
197 199 lsPatterns = objProfile.pattern_set.all()
198 200 patternChoosen = objProfile.pattern_set.get(value=pattern_value)
199 201 objAntennaUp = patternChoosen.antennaup_set.get()
200 202 objAntennaDown = patternChoosen.antennadown_set.get()
201 203
202 204 arrayAntennaUp = absData.convertStringtoList2(objAntennaUp.value)
203 205 if objAntennaUp.tx != None:
204 206 arrayTxUp = absData.convertStringtoList2(objAntennaUp.tx)
205 207 else:
206 208 arrayTxUp = arrayTx
207 209 if objAntennaUp.rx != None:
208 210 arrayRxUp = absData.convertStringtoList2(objAntennaUp.rx)
209 211 else:
210 212 arrayRxUp = arrayTx
211 213 if objAntennaUp.ues != None:
212 214 arrayUesUp = absData.convertStringtoList1(objAntennaUp.ues)
213 215 else:
214 216 arrayUesUp = arrayUes
215 217
216 218
217 219 arrayAntennaDown = absData.convertStringtoList2(objAntennaDown.value)
218 220 if objAntennaDown.tx != None:
219 221 arrayTxDown = absData.convertStringtoList2(objAntennaDown.tx)
220 222 else:
221 223 arrayTxDown = arrayTx
222 224 if objAntennaDown.rx != None:
223 225 arrayRxDown = absData.convertStringtoList2(objAntennaDown.rx)
224 226 else:
225 227 arrayRxDown = arrayTx
226 228 if objAntennaDown.ues != None:
227 229 arrayUesDown = absData.convertStringtoList1(objAntennaDown.ues)
228 230 else:
229 231 arrayUesDown = arrayUes
230 232
231 233 return render_to_response('abscontrol/edit.html', {'objProfile': objProfile, 'profile_list': profile_list,
232 234 'patternChoosen' : patternChoosen, 'lsPatterns' : lsPatterns,
233 235 'antennaUp' : objAntennaUp, 'antennaDown' : objAntennaDown,
234 236 'arrayAntennaUp' : arrayAntennaUp, 'arrayTxUp' : arrayTxUp,
235 237 'arrayRxUp' : arrayRxUp, 'arrayRxDown' : arrayRxDown,
236 238 'arrayAntennaDown' : arrayAntennaDown, 'arrayTxDown' : arrayTxDown,
237 239 'arrayUesUp' : arrayUesUp, 'arrayUesDown' : arrayUesDown,
238 240 })
239 241
240 242 def addPattern(request, profile_id):
241 243 profile_list = Profile.objects.filter(state=1)
242 244 objProfile = Profile.objects.get(pk=profile_id)
243 245
244 246 return render_to_response('abscontrol/addPattern.html', {'objProfile': objProfile, 'profile_list': profile_list,
245 247 'range' : range(8), 'arrayUes' : arrayUes,
246 248 })
247 249
248 250 def editPattern(request, profile_id, pattern_id):
249 251 absData = ABSData()
250 252 profile_list = Profile.objects.filter(state=1)
251 253 objProfile = Profile.objects.get(pk=profile_id)
252 254 lsPatterns = objProfile.pattern_set.all()
253 255 patternChoosen = Pattern.objects.get(pk=pattern_id)
254 256 objAntennaUp = patternChoosen.antennaup_set.get()
255 257 objAntennaDown = patternChoosen.antennadown_set.get()
256 258
257 259 arrayAntennaUp = absData.convertStringtoList2(objAntennaUp.value)
258 260 if objAntennaUp.tx != None:
259 261 arrayTxUp = absData.convertStringtoList2(objAntennaUp.tx)
260 262 else:
261 263 arrayTxUp = arrayTx
262 264 if objAntennaUp.rx != None:
263 265 arrayRxUp = absData.convertStringtoList2(objAntennaUp.rx)
264 266 else:
265 267 arrayRxUp = arrayTx
266 268 if objAntennaUp.ues != None:
267 269 arrayUesUp = absData.convertStringtoList1(objAntennaUp.ues)
268 270 else:
269 271 arrayUesUp = arrayUes
270 272
271 273
272 274 arrayAntennaDown = absData.convertStringtoList2(objAntennaDown.value)
273 275 if objAntennaDown.tx != None:
274 276 arrayTxDown = absData.convertStringtoList2(objAntennaDown.tx)
275 277 else:
276 278 arrayTxDown = arrayTx
277 279 if objAntennaDown.rx != None:
278 280 arrayRxDown = absData.convertStringtoList2(objAntennaDown.rx)
279 281 else:
280 282 arrayRxDown = arrayTx
281 283 if objAntennaDown.ues != None:
282 284 arrayUesDown = absData.convertStringtoList1(objAntennaDown.ues)
283 285 else:
284 286 arrayUesDown = arrayUes
285 287
286 288 return render_to_response('abscontrol/editPattern.html', {'objProfile': objProfile, 'profile_list': profile_list,
287 289 'patternChoosen' : patternChoosen, 'lsPatterns' : lsPatterns,
288 290 'antennaUp' : objAntennaUp, 'antennaDown' : objAntennaDown,
289 291 'arrayAntennaUp' : arrayAntennaUp, 'arrayTxUp' : arrayTxUp,
290 292 'arrayRxUp' : arrayRxUp, 'arrayRxDown' : arrayRxDown,
291 293 'arrayAntennaDown' : arrayAntennaDown, 'arrayTxDown' : arrayTxDown,
292 294 'arrayUesUp' : arrayUesUp, 'arrayUesDown' : arrayUesDown,
293 295 })
294 296
295 297 def savePattern(request, profile_id):
296 298 pattern_id = 0
297 299 method = "save"
298 300
299 301 if 'pattern_id' in request.POST:
300 302 pattern_id = request.POST["pattern_id"]
301 303 method = "update"
302 304
303 305 maxValuePattern = 0
304 306 txtAntennaUp = request.POST["txtAntennaUp"]
305 307 txtTxUp = request.POST["txtTxUp"]
306 308 txtRxUp = request.POST["txtRxUp"]
307 309 txtUesUp = request.POST["txtUesUp"]
308 310
309 311 txtAntennaDown = request.POST["txtAntennaDown"]
310 312 txtTxDown = request.POST["txtTxDown"]
311 313 txtRxDown = request.POST["txtRxDown"]
312 314 txtUesDown = request.POST["txtUesDown"]
313 315
314 316 mode = request.POST["mode"]
315 317
316 318 if method == "save":
317 319 objProfile = Profile.objects.get(pk=profile_id)
318 320 lsPatterns = objProfile.pattern_set.all()
319 321 if len(lsPatterns) > 0:
320 322 for element in lsPatterns:
321 323 if element.value > maxValuePattern:
322 324 maxPattern = element.value
323 325 else:
324 326 maxPattern = 0
325 327
326 328 if maxPattern < 10 :
327 329 newValuePattern = maxPattern + 1
328 330 newpattern = objProfile.pattern_set.create(value=newValuePattern)
329 331 newpattern.antennaup_set.create(value=txtAntennaUp,tx=txtTxUp,rx=txtRxUp,ues=txtUesUp)
330 332 newpattern.antennadown_set.create(value=txtAntennaDown,tx=txtTxDown,rx=txtRxDown,ues=txtUesDown)
331 333 error = 0
332 334 else:
333 335 error = 1 # Can not add more patterns
334 336
335 337 if mode == "e":
336 338 newurl = '/abscontrol/%d/edit/%d' % (int(profile_id), newpattern.id)
337 339 else:
338 340 newurl = '/abscontrol/%d/view/%d' % (int(profile_id), newpattern.id)
339 341 else:
340 342 txtAntennaUpId = request.POST["txtAntennaUpId"]
341 343 objAntennaUp = AntennaUp.objects.get(pk=txtAntennaUpId)
342 344 objAntennaUp.value = txtAntennaUp
343 345 objAntennaUp.tx = txtTxUp
344 346 objAntennaUp.rx = txtRxUp
345 347 objAntennaUp.ues = txtUesUp
346 348 objAntennaUp.save()
347 349
348 350 txtAntennaDownId = request.POST["txtAntennaDownId"]
349 351 objAntennaDown = AntennaDown.objects.get(pk=txtAntennaDownId)
350 352 objAntennaDown.value = txtAntennaDown
351 353 objAntennaDown.tx = txtTxDown
352 354 objAntennaDown.rx = txtRxDown
353 355 objAntennaDown.ues = txtUesDown
354 356 objAntennaDown.save()
355 357
356 358 if mode == "e":
357 359 newurl = '/abscontrol/%d/edit/%d' % (int(profile_id), int(pattern_id))
358 360 else:
359 361 newurl = '/abscontrol/%d/view/%d' % (int(profile_id), int(pattern_id))
360 362
361 363 return redirect(newurl)
362 364
363 365 def viewPattern(request, profile_id, pattern_id):
364 366
365 367 profile_list = Profile.objects.filter(state=1)
366 368 objProfile = Profile.objects.get(pk=profile_id)
367 369
368 370 patternChoosen = Pattern.objects.get(pk=pattern_id)
369 371
370 372 objAntennaUp = patternChoosen.antennaup_set.get()
371 373 objAntennaDown = patternChoosen.antennadown_set.get()
372 374
373 375 lsPatterns = objProfile.pattern_set.all()
374 376
375 377 return render_to_response('abscontrol/viewPattern.html', {'objProfile': objProfile, 'profile_list': profile_list,
376 378 'patternChoosen' : patternChoosen, 'lsPatterns' : lsPatterns,
377 379 'antennaUp' : objAntennaUp, 'antennaDown' : objAntennaDown,
378 380 })
379 381
380 382 def deletePattern(request, profile_id, pattern_id):
381 383 newurl = '/abscontrol/edit/%d' % int(profile_id)
382 384
383 385 return redirect(newurl)
384 386
385 387 def importProfile(request):
386 388 profile_list = Profile.objects.filter(state=1)
387 389 return render_to_response('abscontrol/import.html', {'profile_list': profile_list,})
388 390
389 391 def upload(request):
390 392 profile_list = Profile.objects.filter(state=1)
391 393 if request.method == 'POST':
392 394 txtFilename = request.FILES['txtFile']
393 395 if txtFilename:
394 396 destination = open('/tmp/'+txtFilename.name, 'wb+')
395 397 for chunk in txtFilename.chunks():
396 398 destination.write(chunk)
397 399 destination.close()
398 400 filename = '/tmp/'+txtFilename.name
399 401 readFile = readABSFile(filename)
400 402 expName, num_patterns, patterns = readFile.getMetadata()
401 403
402 404 if expName != "" and num_patterns > 0:
403 405 newprofile = Profile(name=expName)
404 406 newprofile.save()
405 407 newprofile.state = 1
406 408
407 409 for element in patterns:
408 410 newpattern = newprofile.pattern_set.create(value=element["number"])
409 411 newpattern.antennaup_set.create(value=element["up"])
410 412 newpattern.antennadown_set.create(value=element["down"])
411 413
412 414 newprofile.save()
413 415
414 416 newurl = '/abscontrol/edit/%d' % int(newprofile.id)
415 417 return redirect(newurl)
416 418 else:
417 419 txtError = "Experiment's name not found or the number of patterns is 0."
418 420 return render_to_response('abscontrol/error.html', {'profile_list': profile_list,
419 421 'txtError' : txtError, })
420 422 else:
421 423 txtError = "No file."
422 424
423 425 return render_to_response('abscontrol/error.html', {'profile_list': profile_list, 'txtError' : txtError, })
424 426
425 427 def overJRO(request, profile_id, pattern_id, antenna_id):
426 428 if request.GET["beam"] == "Up":
427 429 objAntenna = AntennaUp.objects.get(pk=antenna_id)
428 430 else:
429 431 objAntenna = AntennaDown.objects.get(pk=antenna_id)
430 432 objProfile = Profile.objects.get(pk=profile_id)
431 433 exp_name = objProfile.name
432 434
433 435 phase_tx = objAntenna.value
434 436 gain_tx = objAntenna.tx
435 437 gain_rx = objAntenna.rx
436 438 ues_tx = objAntenna.ues
437 439 only_rx = objAntenna.only_rx
438 440
439 441 return exp_name, phase_tx, gain_tx, gain_rx, ues_tx, only_rx
440 442
441 443 def export(request, profile_id):
442 444 listPatterns = []
443 445 objProfile = Profile.objects.get(pk=profile_id)
444 446 exp_name = objProfile.name
445 447 lsPatterns = objProfile.pattern_set.all()
446 448 for element in lsPatterns:
447 449 objAntennaUp = element.antennaup_set.get()
448 450 objAntennaDown = element.antennadown_set.get()
449 451 dicPatterns = {"number" : element.value, "up" : objAntennaUp.value, "down" : objAntennaDown.value}
450 452 listPatterns.append(dicPatterns)
451 453
452 454 absFile = saveABSFile()
453 455 absFile.setParameters(settings.MEDIA_ROOT, exp_name, listPatterns)
454 456 filename, filesize = absFile.save()
455 457
456 458 wrapper = FileWrapper( open( filename, "r" ) )
457 459 content_type = mimetypes.guess_type( filename )[0]
458 460
459 461 response = HttpResponse(wrapper, content_type = content_type)
460 462 response['Content-Description'] = 'File Transfer'
461 463 response['Content-Disposition'] = 'attachment; filename=%s' % smart_str(filename)
462 464 response['Content-Transfer-Encoding'] = 'binary'
463 465 response['Expires'] = '0'
464 466 response['Cache-Control'] = 'must-revalidate'
465 467 response['Pragma'] = 'public'
466 468 response['Content-Length'] = '%s' % str(filesize)
467 469 response['X-Sendfile'] = '%s' % smart_str(filename)
468 470
469 471 return response
470 472
471 473 def send(request, profile_id):
472 474 listPatterns = []
473 475 objProfile = Profile.objects.get(pk=profile_id)
474 476 exp_name = objProfile.name
475 477
476 478 lsPatterns = objProfile.pattern_set.all()
477 479 for element in lsPatterns:
478 480 objAntennaUp = element.antennaup_set.get()
479 481 objAntennaDown = element.antennadown_set.get()
480 482 dicPatterns = {"number" : element.value, "up" : objAntennaUp.value, "down" : objAntennaDown.value}
481 483 listPatterns.append(dicPatterns)
482 484
483 485 absFile = saveABSFile()
484 486 absFile.setParameters(settings.MEDIA_ROOT, exp_name, listPatterns)
485 487 filename, filesize = absFile.save()
486 488
487 489 apiclient = sendFile()
488 490 apiclient.execute(filename)
489 491 output = apiclient.getOutput()
490 492
491 493 if output == "OK":
492 494 message = "File sent successfully."
493 495 objProfile.hits += 1
494 496 objProfile.save()
495 497 else:
496 498 message = "Error sending file."
497 499
498 500 profile_list = Profile.objects.all()
499 501
500 502 return render_to_response('abscontrol/sendFile.html', {'message': message, "profile_list" : profile_list,
501 503 'objProfile': objProfile,
502 504 })
@@ -1,577 +1,649
1 1 /*
2 2 * font-family: 'Droid Sans', sans-serif;
3 3 * font-family: 'Ubuntu', sans-serif;
4 4 * font-family: 'Open Sans', sans-serif;
5 5 * font-family: 'Open Sans Condensed', sans-serif;
6 6 * font-family: 'Roboto Condensed', sans-serif;
7 7 */
8 8
9 9 body {
10 10 padding: 0;
11 11 margin: 0;
12 12 font-size: 12px; }
13 13
14 14 header {
15 15 width: 980px;
16 16 height: 50px;
17 17 text-align: center;
18 18 line-height: 50px;
19 19 border: 0px solid #fcc !important; }
20 20
21 21 #schema {
22 22 margin: 0 auto;
23 23 width: 980px;
24 24 padding: 10px 10px;
25 25 border: 0px solid #f00 !important; }
26 26
27 27 #content {
28 28 margin: 5px 0px;
29 29 border: 0px solid #1cc; }
30 30
31 31 #topcolumn {
32 32 float: left;
33 33 width: 980px;
34 34 height: 40px;
35 35 line-height: 35px;
36 36 margin: 2px 0px;
37 37 border: 1px solid #ddd !important;
38 38 box-shadow: 2px 2px 5px #888; }
39 39
40 40 #maincolumn {
41 41 float: left;
42 42 width: 980px;
43 43 margin: 2px 0px;
44 44 padding: 0px 0px;
45 45 border: 1px solid #ddd !important;
46 46 box-shadow: 2px 2px 5px #666; }
47 47
48 48 footer {
49 49 height: 30px;
50 50 line-height: 30px;
51 51 text-align: center;
52 52 margin: 0px 0px;
53 53 border: 0px solid #200 !important;
54 54 box-shadow: 2px 2px 5px #888; }
55 55
56 56 .cleardivs {
57 57 clear: both;
58 58 border: 0px solid #400;
59 59 height: 0px; }
60 60
61 61 textarea {
62 62 resize: none;
63 63 overflow: hidden; }
64 64
65 65 /****************************************************************************************/
66 66 /****** ESTILOS GENERALES *****************/
67 67 /****************************************************************************************/
68 68 .mnu {
69 69 height: 22px;
70 70 border: 0px solid #c55 !important; }
71 71
72 72 .mnu li {
73 73 display:inline; }
74 74
75 75 .MnuVertical, .MnuHorizontal {
76 76 font-family: 'Droid Sans', sans-serif;
77 77 font-size: inherit;
78 78 font-style: normal;
79 79 text-shadow: 2px 2px #eee; }
80 80
81 81 .MnuHorizontal ul {
82 82 list-style: none;
83 83 list-style-type: none;
84 84 margin: 0; }
85 85
86 86 /*.MnuHorizontal{
87 87 display: -webkit-box;
88 88 -webkit-box-orient:horizontal; }
89 89
90 90 .MnuHorizontal a{
91 91 display:block;
92 92 padding:10px;
93 93 -webkit-box-flex:1;
94 94 text-align:center; }*/
95 95
96 96 /****************************************************************************************/
97 97 /****** MENU DE NAVEGACION DE PERFILES *************/
98 98 /****************************************************************************************/
99 99 #infoProfiles {
100 100 float: left;
101 101 width: 300px;
102 102 margin: 0px;
103 103 padding: 2px 0px;
104 104 border: 0px solid #1cc !important; }
105 105
106 106 #infoProfiles label {
107 107 padding: 10px 10px 10px 12px;
108 108 margin: 10px 0;
109 109 font-family: 'Droid Sans', sans-serif;
110 110 /*font-family: 'Roboto Condensed', sans-serif;*/
111 111 /*letter-spacing: 0.046em;*/ }
112 112
113 113 #infoProfiles select {
114 114 padding: 4px 0px; margin: 0;
115 115 font-family: 'Droid Sans', sans-serif;
116 116 font-size: 12px;
117 117 letter-spacing: 0.006;
118 118 width: 200px; }
119 119
120 120 #mnuProfiles {
121 121 margin: 0;
122 122 float: right;
123 123 padding: 2px 10px;
124 124 border: 0px solid #1494F6 !important; }
125 125
126 126 #mnuProfiles ul {
127 127 list-style: none;
128 128 list-style-type: none;
129 129 margin: 0;
130 130 padding-left: 20px;
131 131 border: 0px solid #f00 !important; }
132 132
133 133 #mnuProfiles li {
134 134 width: 80px;
135 135 float: left;
136 136 padding: 2px;
137 137 border: 0px solid #c55 !important; }
138 138
139 139 #mnuProfiles a {
140 140 font-weight: normal;
141 141 color: #1494F6;
142 142 display: block;
143 143 text-align: center;
144 144 border-bottom: 1px solid #1494F6 !important;
145 145 text-decoration: none;
146 146 padding: 0px 4px;
147 147 line-height: 18px;
148 148 margin: 6px; }
149 149
150 150 /****************************************************************************************/
151 151 /******** FORMULARIO DE PERFILES *************************************/
152 152 /****************************************************************************************/
153 153 #divProfile {
154 154 margin: 10px 0px;
155 155 padding: 10px 10px;
156 156 width: 500px;
157 157 border: 0px solid #dff !important; }
158 158
159 159 #divProfile label,input[type=text],input[type=file] {
160 160 font-family: 'Open Sans', sans-serif;
161 161 /*font-family: 'Roboto Condensed', sans-serif;*/
162 162 font-size: inherit; }
163 163
164 164 #divPattern textarea,input[type=text],label,input[type=file],input[type=button],input[type=submit] {
165 165 font-family: 'Roboto Condensed', sans-serif;
166 166 font-size: inherit; }
167 167
168 168 .antenna, .NewAntenna {
169 169 box-shadow: 1px 1px 2px #666;
170 170 padding: 5px;
171 171 margin: 10px auto;
172 172 display: block;
173 173 border: 0px solid #fee !important; }
174 174
175 175 .antenna {
176 176 width: 520px; }
177 177
178 178 .NewAntenna {
179 179 width: 750px;
180 180 border: 0px solid #f00 !important; }
181 181
182 182 .flsAntenna, .NewFlsAntenna {
183 183 margin: 0;
184 184 padding: 0px;
185 185 border: 1px solid #fee !important; }
186 186
187 187 .flsAntenna {
188 188 width: 510px; }
189 189
190 190 .NewFlsAntenna {
191 191 width: 100%; }
192 192
193 193 .legendAntenna {
194 194 font-family: 'Roboto Condensed', sans-serif;
195 195 font-size: inherit;
196 196 text-align: left;
197 197 margin-left: 10px; }
198 198
199 199 .infoAntenna {
200 200 width: 500px;
201 201 float: left;
202 202 border: 0px solid #f00 !important; }
203 203
204 204 .overJRO {
205 205 width: 250px;
206 206 float: left;
207 207 margin: 0px 5px;
208 208 border: 0px solid #1cc !important; }
209 209
210 210 .divAntenna, .NewDivAntenna, .NewDivTx {
211 211 float: left;
212 212 margin: 10px;
213 213 border: 0px solid #fcc !important; }
214 214
215 215 .divAntenna {
216 216 width: 220px;
217 217 border: 0px solid #fcc !important; }
218 218
219 219 .NewDivAntenna {
220 220 border: 0px solid #fcc !important; }
221 221
222 222 .NewDivTx {
223 223 border: 0px solid #fcc !important; }
224 224
225 225 .titleField {
226 226 display: block;
227 227 text-align: center;
228 228 font-family: 'Roboto Condensed', sans-serif;
229 229 letter-spacing: 0.086em; }
230 230
231 231 .txtAntenna, .view-textAntenna {
232 232 width: 175px;
233 233 max-width: 180px;
234 234 height: 160px;
235 235 max-height: 165px;
236 236 background: #fdfdfb;
237 237 border: 2px solid #eee !important;
238 238 text-align: justify;
239 239 margin: 0 auto;
240 240 line-height: 20px; }
241 241
242 242 .txtAntenna {
243 243 padding: 4px;
244 244 }
245 245
246 246 .view-textAntenna {
247 247 padding: 2px;
248 248 font-family: "Ubuntu";
249 249 font-size: inherit; }
250 250
251 251 .boxAntenna, .boxTR {
252 252 border: 2px solid #eee !important;
253 253 text-align: center;
254 254 display: block;
255 255 float: left;
256 256 margin: 0;
257 257 padding: 0; }
258 258
259 259 .boxAntenna {
260 260 padding: 3px; }
261 261
262 262 .boxTR {
263 263 padding: 3px; }
264 264
265 265 .fullLine{
266 266 font-size: 0.95em; }
267 267
268 268 .lineInputs, .lineInputsTx {
269 269 text-align: left;
270 270 line-height: 1.4em;
271 271 padding: 0;
272 272 margin: 0px;
273 273 display: block;
274 274 float: left;
275 275 border: 0px solid #1cc !important; }
276 276
277 277 .lineInputs {
278 278 /*width: 240px;*/
279 279 border: 0px solid #1cc !important; }
280 280
281 281 .lineInputsTx {
282 282 /*width: 185px;*/
283 283 border: 0px solid #1cc !important; }
284 284
285 285 .divValuesAntenna, .divValuesTx {
286 286 float: left;
287 287 display: block;
288 288 margin: 0 auto;
289 289 border: 0px solid #bbb !important; }
290 290
291 291 .divValuesAntenna {
292 292 /*width: 230px;*/
293 293 border: 0px solid #2eb !important; }
294 294
295 295 .divValuesTx {
296 296 /*width: 175px;*/
297 297 border: 0px solid #bbb !important; }
298 298
299 299 .divValuesAntenna input[type=text], .divValuesTx input[type=text] {
300 300 border: 0px;
301 301 border-bottom: 1px solid #666 !important;
302 302 line-height: 1.1em;
303 303 font-family: 'Roboto Condensed', sans-serif; }
304 304
305 305 .divValuesAntenna input[type=text] {
306 306 width: 18px; }
307 307
308 308 .divValuesTx input[type=text]{
309 309 width: 11px; }
310 310
311 311 .lblSign, .lblSignTx {
312 312 font-family: 'Roboto Condensed', sans-serif;
313 313 color: #666;
314 314 float: left;
315 315 margin: 0px;
316 316 border: 0px solid #bbb !important; }
317 317
318 318 .lblSignLeft {
319 319 font-family: 'Roboto Condensed', sans-serif;
320 320 color: #666;
321 321 float: left;
322 322 margin: 0px 2px 0px 0px;
323 323 padding: 0;
324 324 border: 0px solid #f00 !important; }
325 325
326 326 .lblSignRight {
327 327 font-family: 'Roboto Condensed', sans-serif;
328 328 color: #666;
329 329 float: left;
330 330 margin: 0;
331 331 padding: 0;
332 332 border: 0px solid #f00 !important; }
333 333
334 334 .lblNewSignLeft, .lblNewSignRight {
335 335 font-family: 'Roboto Condensed', sans-serif;
336 336 color: #666;
337 337 float: left;
338 338 padding: 0; }
339 339
340 340 .lblNewSignLeft {
341 341 margin: 0px 2px 0px 0px;
342 342 border: 0px solid #f00 !important; }
343 343
344 344 .lblNewSignRight {
345 345 margin: 0;
346 346 border: 0px solid #f00 !important; }
347 347
348 348 .divTx {
349 349 display: block;
350 350 float: left;
351 351 margin: 10px;
352 352 border: 0px solid #f00 !important; }
353 353
354 354 .divTx label {
355 355 display: block; }
356 356
357 357 .divTx textarea {
358 358 width: 100px;
359 359 max-width: 100px;
360 360 height: 160px;
361 361 max-height: 165px;
362 362 text-align: justify;
363 363 border: 2px solid #eee !important;
364 364 font-family: "Ubuntu";
365 365 font-size: inherit;
366 366 line-height: 20px; }
367 367
368 368 .divTx p {
369 369 width: 100px;
370 370 max-width: 105px;
371 371 height: 160px;
372 372 max-height: 165px;
373 373 background: #fdfdfb;
374 374 padding: 2px;
375 375 border: 1px solid #eee !important;
376 376 font-family: 'Ubuntu', sans-serif;
377 377 font-size: inherit;
378 378 text-align: justify;
379 379 margin: 0 auto;
380 380 line-height: 20px; }
381 381
382 382 .divUes {
383 383 display: block;
384 384 margin: 10px; }
385 385
386 386 .divUes input[type=text] {
387 387 width: 240px;
388 388 max-width: 240px;
389 389 font-family: 'Ubuntu', sans-serif;
390 390 font-size: inherit; }
391 391
392 392 .divNewUes {
393 393 width: 350px;
394 394 display: block;
395 395 margin: 0px 10px;
396 396 padding: 0;
397 397 font-family: 'Roboto Condensed', sans-serif;
398 398 /*overflow: hidden;*/
399 399 border: 0px solid #f00 !important; }
400 400
401 401 .titleUes {
402 402 width: 35px;
403 403 text-align: right;
404 404 padding-right: 5px;
405 405 float: left;
406 406 line-height: 22px;
407 407 font-family: 'Roboto Condensed', sans-serif;
408 408 letter-spacing: 0.086em;
409 409 border: 0px solid #266 !important; }
410 410
411 411 .valueUes {
412 412 width: 300px;
413 413 float: left;
414 414 border: 0px solid #2f4 !important;
415 415 line-height: 22px; }
416 416
417 417 .lblUes {
418 418 font-family: 'Roboto Condensed', sans-serif;
419 419 color: #666;
420 420 font-size: 1.1em; }
421 421
422 422 .txtUnitUes {
423 423 width: 60px;
424 424 border: 0;
425 425 padding: 0px 2px;
426 426 text-align: center;
427 427 font-family: 'Roboto Condensed', sans-serif;
428 428 font-size: 0.95em;
429 429 border-bottom: 1px solid #666 !important; }
430 430 /*
431 431 .divNewUes input[type=text] {
432 432 width: 240px;
433 433 max-width: 240px;
434 434 line-height: 22px; }
435 435 */
436 436 .checkOnly {
437 437 width: 120px;
438 438 float: left;
439 439 display: block;
440 440 line-height: 25px;
441 441 border: 0px solid #1cc !important; }
442 442
443 443 .overJRO img {
444 444 width: 400px;
445 445 height: 200px;
446 446 text-align: center;
447 447 vertical-align: middle;
448 448 margin: 40px 5px 5px 5px;
449 449 display: block;
450 450 background: #fdfdfb;
451 451 border: 1px solid #eee !important; }
452 452
453 453 .overJRO a {
454 454 text-align: center;
455 455 margin: 0 auto;
456 456 display: block; }
457 457
458 458 /****************************************************************************************/
459 459 /****** MENU DE NAVEGACION DE PATRONES **********************************/
460 460 /****************************************************************************************/
461 461 #divMnuPattern {
462 462 width: 280px;
463 463 height: 25px;
464 464 display: block;
465 465 float: right;
466 466 margin: 5px 40px 5px 0px;
467 467 border: 0px solid #1cc !important; }
468 468
469 469 #divMnuPattern li {
470 470 float: right;
471 471 display: block;
472 472 width: 60px;
473 473 border: 0px solid #2cc !important; }
474 474
475 475 #divMnuPattern a {
476 476 display: block;
477 477 line-height: 22px;
478 478 text-decoration: none;
479 479 padding: 0px 5px;
480 480 margin: 0px 2px;
481 481 text-align: center;
482 482 color: #1494F6;
483 483 border-bottom: 1px solid #1494F6 !important; }
484 484
485 485 #infoPattern {
486 486 display: block;
487 487 margin: 0px 25px;
488 488 border: 0px solid #1494f6 !important; }
489 489
490 490 #navPatterns {
491 491 margin: 0 auto;
492 492 width: 700px;
493 493 height: 30px;
494 494 border: 0px solid #d00 !important;
495 495 font-family: 'Ubuntu', sans-serif;
496 496 font-size: 14px;
497 497 padding: 5px 0px; }
498 498
499 499 #navPatternList {
500 500 margin: 0 auto;
501 501 border: 0px solid #ecc !important; }
502 502
503 503 #navPatternList ul {
504 504 list-style: none;
505 505 list-style-type: none;
506 506 margin: 0; }
507 507
508 508 #navPatternList ul li {
509 509 float: left;
510 510 width: 50px;
511 511 border: 1px solid #eee !important; }
512 512
513 513 #navPatternList a {
514 514 width: 50px;
515 515 display: block;
516 516 text-align: center;
517 517 line-height: 30px;
518 518 padding: 1px 0px;
519 519 border: 0px solid #1cc !important; }
520 520
521 521 .lnkPattern {
522 522 background-color: #ccc !important;
523 523 color: #eee; }
524 524
525 525 .lnkPatternSelected {
526 526 background-color: #2cc !important;
527 527 color: #fff; }
528 528
529 529 .divListofPatterns {
530 530 width: 650px;
531 531 display: block;
532 532 border: 1px solid #1cc !important;
533 533 margin: 0 auto; }
534 534
535 535 .divPattern {
536 536 width: 600px;
537 537 display: block;
538 538 border: 1px solid #f00 !important;
539 539 margin: 2px auto; }
540 540
541 541 /****************************************************************************************/
542 542 /****** HEADER *************/
543 543 /****************************************************************************************/
544 544 header nav {
545 545 width: 960px;
546 546 margin: 0 auto;
547 547 height: 100%;
548 548 border: 0px solid #1cc !important; }
549 549
550 550 header nav a {
551 551 font-family: 'Roboto Condensed', sans-serif;
552 552 font-size: 1.98em;
553 553 text-transform: uppercase;
554 554 width: 232px;
555 555 padding: 2px;
556 556 text-align: center;
557 557 border: 1px solid #ddd !important;
558 558 box-shadow: 1px 1px 2px #ddd;
559 559 display: block;
560 560 float: left;
561 561 height: 45px;
562 562 text-decoration: none;
563 563 background: #eee;
564 564 line-height: 45px;
565 565 color: #15425d;
566 566 margin: 0px 1px; }
567 567
568 568 header nav a.selected {
569 569 background: #666;
570 570 color: #fff; }
571 571
572 #Main_Head {
573 margin: 0 auto;
574 height: 100%;
575 border: 1px solid #ddd !important;
576 box-shadow: 1px 1px 2px #ddd;
577 border-radius: 5px;
578 display: block; }
579
580 .Main_Title {
581 font-size: 2em;
582 letter-spacing: 0.06em;
583 color: #444;
584 text-shadow: 2px 2px #ccc; }
585
572 586 /****************************************************************************************/
573 587 /****** FOOTER *************/
574 588 /****************************************************************************************/
575 589 footer p {
576 590 font-family: 'Roboto Condensed', sans-serif;
577 font-size: 0.98em; } No newline at end of file
591 font-size: 0.98em; }
592
593 /****************************************************************************************/
594 /****** LOGIN *************/
595 /****************************************************************************************/
596 #contentLogin {
597 margin: 0;
598 padding: 0;
599 border: 0px solid #1cc; }
600
601 #MainColumnLogin {
602 margin: 2px auto;
603 border: 0px solid #f00 !important;
604 box-shadow: 1px 1px 2px #ddd;
605 border-radius: 2px;
606 background-color: #eee;
607 width: 100%;
608 padding: 5px 0px;
609 }
610
611 .row_reg {
612 margin: 5px auto;
613 display: block;
614 width: 90%;
615 border: 0px solid #1cc !important;
616 line-height: 22px;
617 }
618
619 .row_reg label, .row_reg input[type=text] {
620 float: left;
621 line-height: 22px;
622 }
623
624 #id_username, #id_password {
625 width: 160px;
626 line-height: 22px;
627 }
628
629 .row_reg label {
630 width: 400px;
631 text-align: right;
632 padding-right: 10px;
633 border: 0px solid #d22 !important;
634 }
635
636 .row_reg input[type=submit], .row_reg input[type=button] {
637 margin-left: 410px;
638 width: 80px;
639 }
640
641 #lblTitleLogin {
642 width: 100%;
643 text-align: center;
644 font-size: 1.2em;
645 font-weight: normal;
646 color: #222;
647 border: 0px solid #f00 !important;
648 background-color: #ccc;
649 } No newline at end of file
@@ -1,63 +1,71
1 1 {% extends "base.html" %}
2 2
3 3 {% block title %}ABS CONTROL:::::{% endblock %}
4 4 {% block scripting %}
5 5 {% if profile_list %}
6 6 <script src="/static/static/js/profiles.js"></script>
7 7 {% endif %}
8 {% endblock %}
9 {% block header %}
10 <nav id="header">
11 <a href="{% url abscontrol.views.index %}" class="selected">ABS</a>
12 <a href="#">CR</a>
13 <a href="#">DDS</a>
14 <a href="#">JARS</a>
15 </nav>
8 16 {% endblock %}
9 17 {% block content %}
10 18 <div id="content">
11 19 {% block topcolumn %}
12 20 <div id="topcolumn">
13 21 <div id="lsProfiles">
14 22 <div id="infoProfiles">
15 23 <label for="lblProfile" class="lblInfo">Profiles: </label>
16 24 {% if profile_list %}
17 25 <select name="lsProfiles" id="listProfiles">
18 26 <option value="-1">Choose ...</option>
19 27 {% for entry in profile_list %}
20 28 {% if objProfile %}
21 29 {% if objProfile.id == entry.id %}
22 30 <option value="{{ entry.id }}" selected>{{ entry.name }}</option>
23 31 {% else %}
24 32 <option value="{{ entry.id }}">{{ entry.name }}</option>
25 33 {% endif %}
26 34 {% else %}
27 35 <option value="{{ entry.id }}">{{ entry.name }}</option>
28 36 {% endif %}
29 37 {% endfor %}
30 38 </select>
31 39 {% else %}
32 40 <label for="lblMessage" class="lblInfo">No profiles.</label>
33 41 {% endif %}
34 42 </div>
35 43 </div>
36 44 {% block mnu_profile %}
37 45 <div id="mnuProfiles">
38 46 <nav class="MnuHorizontal" id="navProfiles">
39 47 <ul>
40 48 <li><a href="{% url abscontrol.views.new %}">New</a></li>
41 49 {% if objProfile %}
42 50 <li><a href="/abscontrol/edit/{{ objProfile.id }}">Edit</a></li>
43 51 <li><a href="#">Save</a></li>
44 52 {% endif %}
45 53 <li><a href="{% url abscontrol.views.importProfile %}">Import</a></li>
46 54 {% if objProfile %}
47 55 <li><a href="#" id="lnkExport" alt="{{ objProfile.id }}">Export</a></li>
48 56 <li><a href="#" id="lnkSendFile" alt="{{ objProfile.id }}">Send</a></li>
49 57 {% endif %}
50 58 </ul>
51 59 <div class="cleardivs"></div>
52 60 </nav>
53 61 </div>
54 62 {% endblock %}
55 63 <div class="cleardivs"></div>
56 64 </div>
57 65 {% endblock %}
58 66 {% block maincolumn %}
59 67 <div id="maincolumn" style="height: 50px"></div>
60 68 {% endblock %}
61 69 <div class="cleardivs"></div>
62 70 </div>
63 71 {% endblock %} No newline at end of file
@@ -1,48 +1,45
1 1 {% load static %}
2 2 <!DOCTYPE html>
3 3 <html lang="en">
4 4 <head>
5 5 <meta charset="utf-8" />
6 6 {% comment %}
7 7 <!-- Always force latest IE rendering engine (even in intranet) & Chrome Frame
8 8 Remove this if you use the .htaccess -->
9 9 <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
10 10 {% endcomment %}
11 11 <link href='http://fonts.googleapis.com/css?family=Droid+Sans|Ubuntu:400,500,300italic|Open+Sans:400,300,600|Open+Sans+Condensed:300,700|Roboto+Condensed:400,300' rel='stylesheet' type='text/css'>
12 12 <link rel="stylesheet" href="{% static 'static/css/style.css' %}" type="text/css" />
13 13 <script src="{% static 'static/js/jquery-1.9.1.min.js' %}"></script>
14 14 {% block scripting %}{% endblock %}
15 15 <title>{% block title %}JRO WEB APPS::::{% endblock %}</title>
16 16 <meta name="description" content="JRO WEB APPLICATIONS" />
17 17 <meta name="author" content="Jose Antonio Sal y Rosas Celi" />
18 18
19 19 {# <meta name="viewport" content="width=device-width; initial-scale=1.0" /> #}
20 20 {% comment %}
21 21 <!-- Replace favicon.ico & apple-touch-icon.png in the root of your domain and delete these references -->
22 22 <link rel="shortcut icon" href="/favicon.ico" />
23 23 <link rel="apple-touch-icon" href="/apple-touch-icon.png" />
24 24 {% endcomment %}
25 25 </head>
26 26 <body>
27 27 <div id="schema">
28 28 <header>
29 {% block header %}
30 <nav id="header">
31 <a href="/abscontrol/" class="selected">ABS</a>
32 <a href="#">CR</a>
33 <a href="#">DDS</a>
34 <a href="#">JARS</a>
35 </nav>
36 {% endblock %}
29 {% block header %}
30 <div id="Main_Head">
31 <label class="Main_Title">Jicamarca Radio Observatory</label>
32 </div>
33 {% endblock %}
37 34 </header>
38 35 {% block content %}
39 36 <div id="content"></div>
40 37 {% endblock %}
41 38 <footer>
42 39 {% block footer %}
43 40 <p>&copy; Copyright 2013 by Jicamarca Radio Observatory</p>
44 41 {% endblock %}
45 42 </footer>
46 43 </div>
47 44 </body>
48 45 </html>
@@ -1,28 +1,39
1 1 {% extends "base.html" %}
2 2 {% load url from future %}
3 3
4 4 {% block content %}
5
6 {% if form.errors %}
7 <p>Your username and password didn't match. Please try again.</p>
8 {% endif %}
9
10 <form method="post" action="{% url 'django.contrib.auth.views.login' %}">
11 {% csrf_token %}
12 <table>
13 <tr>
14 <td>{{ form.username.label_tag }}</td>
15 <td>{{ form.username }}</td>
16 </tr>
17 <tr>
18 <td>{{ form.password.label_tag }}</td>
19 <td>{{ form.password }}</td>
20 </tr>
21 </table>
22
23 <input type="submit" value="login" />
24 <input type="hidden" name="next" value="{{ next }}" />
25 </form>
26
27 {% endblock %}
28
5 <div id="contentLogin">
6 <div class="content_message">
7 {% if form.errors %}
8 <p>Your username and password didn't match. Please try again.</p>
9 {% endif %}
10 </div>
11 <div id="MainColumnLogin">
12 <form method="post" action="{% url 'django.contrib.auth.views.login' %}">
13 {% csrf_token %}
14 <div class="row_reg">
15 <label id="lblTitleLogin">Access</label>
16 <div class="cleardivs"></div>
17 </div>
18 <div class="cleardivs"></div>
19 <div class="row_reg">
20 <label>{{ form.username.label_tag }}</label>
21 {{ form.username }}
22 <div class="cleardivs"></div>
23 </div>
24 <div class="cleardivs"></div>
25 <div class="row_reg">
26 <label>{{ form.password.label_tag }}</label>
27 {{ form.password }}
28 <div class="cleardivs"></div>
29 </div>
30 <div class="cleardivs"></div>
31 <div class="row_reg">
32 <input type="submit" value="Ok" />
33 </div>
34 <div class="cleardivs"></div>
35 <input type="hidden" name="next" value="{% url 'abscontrol.views.index' %}" />
36 </form>
37 </div>
38 </div>
39 {% endblock %} No newline at end of file
General Comments 0
You need to be logged in to leave comments. Login now