Skip to content

Commit 61bef5e

Browse files
authored
Merge pull request #11 from MetalBlazer/foss_category_table_call
Foss Category : call from table , static html removed
2 parents facfd4a + 536439b commit 61bef5e

3 files changed

Lines changed: 6 additions & 54 deletions

File tree

forums/config.sample.py

Lines changed: 0 additions & 4 deletions
This file was deleted.

static/website/templates/get-question.html

Lines changed: 3 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -261,56 +261,9 @@ <h5>Move the question to:</h5>
261261
<div class="row">
262262
<div class="col-lg-4 col-md-4 col-sm-4 col-xs-4">
263263
<select id="id_category" class="form-control">
264-
<option value="Advanced-C++">Advanced-C++</option>
265-
<option value="BASH">BASH</option>
266-
<option value="Blender">Blender</option>
267-
<option value="C-and-C++">C-and-C++</option>
268-
<option value="CellDesigner">CellDesigner</option>
269-
<option value="Digital-Divide">Digital-Divide</option>
270-
<option value="Drupal">Drupal</option>
271-
<option value="Firefox">Firefox</option>
272-
<option value="GChemPaint">GChemPaint</option>
273-
<option value="Geogebra">Geogebra</option>
274-
<option value="GeoGebra-for-Engineering-drawing">GeoGebra-for-Engineering-drawing</option>
275-
<option value="GIMP">GIMP</option>
276-
<option value="GNS3">GNS3</option>
277-
<option value="GSchem">GSchem</option>
278-
<option value="Inkscape">Inkscape</option>
279-
<option value="Java">Java</option>
280-
<option value="Java-Business-Application">Java-Business-Application</option>
281-
<option value="KiCad">KiCad</option>
282-
<option value="KTouch">KTouch</option>
283-
<option value="KTurtle">KTurtle</option>
284-
<option value="LaTeX">LaTeX</option>
285-
<option value="LibreOffice-Suite-Base">LibreOffice-Suite-Base</option>
286-
<option value="LibreOffice-Suite-Calc">LibreOffice-Suite-Calc</option>
287-
<option value="LibreOffice-Suite-Draw">LibreOffice-Suite-Draw</option>
288-
<option value="LibreOffice-Suite-Impress">LibreOffice-Suite-Impress</option>
289-
<option value="LibreOffice-Suite-Math">LibreOffice-Suite-Math</option>
290-
<option value="LibreOffice-Suite-Writer">LibreOffice-Suite-Writer</option>
291-
<option value="Linux">Linux</option>
292-
<option value="Netbeans">Netbeans</option>
293-
<option value="Ngspice">Ngspice</option>
294-
<option value="OpenFOAM">OpenFOAM</option>
295-
<option value="Orca">Orca</option>
296-
<option value="Oscad">Oscad</option>
297-
<option value="PERL">PERL</option>
298-
<option value="PHP-and-MySQL">PHP-and-MySQL</option>
299-
<option value="Python">Python</option>
300-
<option value="Python-Old-Version">Python-Old-Version</option>
301-
<option value="QCad">QCad</option>
302-
<option value="R">R</option>
303-
<option value="Ruby">Ruby</option>
304-
<option value="Scilab">Scilab</option>
305-
<option value="Selenium">Selenium</option>
306-
<option value="Single-Board-Heater-System">Single-Board-Heater-System</option>
307-
<option value="Spoken-Tutorial-Technology">Spoken-Tutorial-Technology</option>
308-
<option value="Step">Step</option>
309-
<option value="Thunderbird">Thunderbird</option>
310-
<option value="Tux-Typing">Tux-Typing</option>
311-
<option value="What-is-Spoken-Tutorial">What-is-Spoken-Tutorial</option>
312-
<option value="Xfig">Xfig</option>
313-
<option value="General">General FOSS</option>
264+
{%for a_foss in category %}
265+
<option value={{a_foss.foss.id}}>{{a_foss.foss}}</option>
266+
{% endfor %}
314267
</select>
315268
</div>
316269
<div class="col-lg-4 col-md-4 col-sm-4 col-xs-4">

website/views.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
from website.helpers import get_video_info, prettify
1616
from forums.config import VIDEO_PATH
1717
from website.templatetags.permission_tags import can_edit
18+
from spoken_auth.models import FossCategory
1819

1920
User = get_user_model()
2021
categories = []
@@ -71,13 +72,15 @@ def hidden_questions(request):
7172
def get_question(request, question_id=None, pretty_url=None):
7273
question = get_object_or_404(Question, id=question_id)
7374
pretty_title = prettify(question.title)
75+
category = FossCategory.objects.all().order_by('foss')
7476
if pretty_url != pretty_title:
7577
return HttpResponseRedirect('/question/' + question_id + '/' + pretty_title)
7678
answers = question.answer_set.all()
7779
form = AnswerQuesitionForm()
7880
context = {
7981
'question': question,
8082
'answers': answers,
83+
'category': category,
8184
'form': form
8285
}
8386
context.update(csrf(request))

0 commit comments

Comments
 (0)