Description:
assigns users to a unique contest, small styling on contest title
Commit status:
[Not Reviewed]
References:
Comments:
0 Commit comments 0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
Add another comment

r281:ddf493b045db - - 4 files changed: 37 inserted, 27 deleted

@@ -184,7 +184,7
184
184
185 operation = params[:operation]
185 operation = params[:operation]
186
186
187 - if operation!='add' and operation!='remove'
187 + if not ['add','remove','assign'].include? operation
188 flash[:notice] = 'You did not choose the operation to perform.'
188 flash[:notice] = 'You did not choose the operation to perform.'
189 redirect_to :action => 'contest_management' and return
189 redirect_to :action => 'contest_management' and return
190 end
190 end
@@ -203,8 +203,10
203 if user
203 if user
204 if operation=='add'
204 if operation=='add'
205 user.contests << contest
205 user.contests << contest
206 + elsif operation=='remove'
207 + user.contests.delete(contest)
206 else
208 else
207 - user.contests.delete(contest)
209 + user.contests = [contest]
208 end
210 end
209 note << user.login
211 note << user.login
210 end
212 end
@@ -6,7 +6,7
6 = text_area_tag 'login_list', nil, :rows => 25, :cols => 80
6 = text_area_tag 'login_list', nil, :rows => 25, :cols => 80
7 %br/
7 %br/
8 You want to
8 You want to
9 - = select(nil,"operation",[['add users to','add'],['remove users from','remove']])
9 + = select(nil,"operation",[['assign users to','assign'],['add users to','add'],['remove users from','remove']])
10 contest
10 contest
11 = select("contest","id",Contest.all.collect {|c| [c.title, c.id]})
11 = select("contest","id",Contest.all.collect {|c| [c.title, c.id]})
12 &nbsp;&nbsp;&nbsp;&nbsp;
12 &nbsp;&nbsp;&nbsp;&nbsp;
@@ -160,16 +160,17
160 padding-left: 20px;
160 padding-left: 20px;
161 background: #feeefe; }
161 background: #feeefe; }
162
162
163 - div.announcementbox {
163 + .announcementbox {
164 margin: 10px 0px;
164 margin: 10px 0px;
165 background: #bbddee;
165 background: #bbddee;
166 padding: 1px; }
166 padding: 1px; }
167 - div.announcementbox span.title {
167 + .announcementbox span.title {
168 font-weight: bold;
168 font-weight: bold;
169 color: #224455;
169 color: #224455;
170 padding-left: 10px;
170 padding-left: 10px;
171 line-height: 1.6em; }
171 line-height: 1.6em; }
172 - div.announcement {
172 +
173 + .announcement {
173 margin: 2px;
174 margin: 2px;
174 background: white;
175 background: white;
175 padding: 1px;
176 padding: 1px;
@@ -182,11 +183,11
182 font-size: 12px;
183 font-size: 12px;
183 margin: 2px; }
184 margin: 2px; }
184
185
185 - div.pub-info {
186 + .pub-info {
186 text-align: right;
187 text-align: right;
187 font-style: italic;
188 font-style: italic;
188 font-size: 9px; }
189 font-size: 9px; }
189 - div.pub-info p {
190 + .pub-info p {
190 text-align: right;
191 text-align: right;
191 font-style: italic;
192 font-style: italic;
192 font-size: 9px; }
193 font-size: 9px; }
@@ -235,3 +236,7
235 margin: 10px 0;
236 margin: 10px 0;
236 font-size: 12px;
237 font-size: 12px;
237 line-height: 1.5em; }
238 line-height: 1.5em; }
239 +
240 + h2.contest-title {
241 + margin-top: 5px;
242 + margin-bottom: 5px; }
@@ -194,26 +194,25
194 background: #feeefe
194 background: #feeefe
195
195
196
196
197 - div
197 + .announcementbox
198 - &.announcementbox
198 + margin: 10px 0px
199 - margin: 10px 0px
199 + background: #bbddee
200 - background: #bbddee
200 + padding: 1px
201 - padding: 1px
202
201
203 - span.title
202 + span.title
204 - font-weight: bold
203 + font-weight: bold
205 - color: #224455
204 + color: #224455
206 - padding-left: 10px
205 + padding-left: 10px
207 - line-height: 1.6em
206 + line-height: 1.6em
208
207
209 - &.announcement
208 + .announcement
210 - margin: 2px
209 + margin: 2px
211 - background: white
210 + background: white
212 - padding: 1px
211 + padding: 1px
213 - padding-left: 10px
212 + padding-left: 10px
214 - padding-right: 10px
213 + padding-right: 10px
215 - padding-top: 5px
214 + padding-top: 5px
216 - padding-bottom: 5px
215 + padding-bottom: 5px
217
216
218
217
219 .announcement p
218 .announcement p
@@ -221,7 +220,7
221 margin: 2px
220 margin: 2px
222
221
223
222
224 - div.pub-info
223 + .pub-info
225 text-align: right
224 text-align: right
226 font-style: italic
225 font-style: italic
227 font-size: 9px
226 font-size: 9px
@@ -288,3 +287,7
288 margin: 10px 0
287 margin: 10px 0
289 font-size: 12px
288 font-size: 12px
290 line-height: 1.5em
289 line-height: 1.5em
290 +
291 + h2.contest-title
292 + margin-top: 5px
293 + margin-bottom: 5px No newline at end of file
You need to be logged in to leave comments. Login now