Commit 9b8a5fe2 authored by Matthieu Gautier's avatar Matthieu Gautier

Remove the radio_name setting.

As we now have only one radio per box, the radio_name is somehow a
duplicate of server_name and it is confusing.

Let's remove radio_name setting and use server_name instead.

Fix #37
parent bcae5701
from ideascube.configuration import get_config
def radio(request):
return {
'radio_name': get_config('irfi', 'radio-name'),
}
......@@ -44,24 +44,11 @@ TEMPLATES = [
"ideascube.context_processors.server",
"ideascube.context_processors.settings",
"ideascube.context_processors.version",
"irfi.context_processors.radio",
)
}
},
]
IDEASCUBE_CONFIGURATION_EXTRA_REGISTRY = {
'irfi': {
'radio-name': {
'summary': 'The name of the radio, as seen by users of '
'the web interface.',
'pretty_type': 'A string',
'type': str,
'default': 'Ideas Cube',
}
}
}
# Add our translations
LOCALE_PATHS = (
os.path.join(IRFI_BASE_DIR, 'irfi', 'locale'),
......
......@@ -6,7 +6,7 @@
{% comment %}Translators: Do not translate this, the translation is in Ideascube{% endcomment %}
<span class="theme discover">{% trans "discover" %}</span>
<span>
{% blocktrans with radio_name=radio_name %}Listen to {{ radio_name }}{% endblocktrans %}
{% blocktrans with radio_name=server_name %}Listen to {{ radio_name }}{% endblocktrans %}
</span>
</h4>
<p>
......
......@@ -6,7 +6,7 @@
{% comment %}Translators: Do not translate this, the translation is in Ideascube{% endcomment %}
<span class="theme info">{% trans "info" %}</span>
<span>
{% blocktrans with radio_name=radio_name %}News from {{ radio_name }}{% endblocktrans %}
{% blocktrans with radio_name=server_name %}News from {{ radio_name }}{% endblocktrans %}
</span>
</h4>
<p>
......
......@@ -14,7 +14,7 @@
{% comment %}Translators: Do not translate this, the translation is in Ideascube{% endcomment %}
<span class="theme discover">{% trans "discover" %}</span>
{% blocktrans with radio_name=radio_name %}Listen to {{ radio_name }}{% endblocktrans %}
{% blocktrans with radio_name=server_name %}Listen to {{ radio_name }}{% endblocktrans %}
</h2>
{% endblock %}
......
......@@ -12,7 +12,6 @@
<ul>
{% comment %}Translators: Do not translate this, the translation is in Ideascube{% endcomment %}
<li>{% fa 'info-circle' 'fa-fw' %} <a href="{% url 'server:settings' %}">{% trans "Server Info" %}</a></li>
<li>{% fa 'music' 'fa-fw' %} <a href="{% url 'server_radio' %}">{% trans "Radio Name" %}</a></li>
{% comment %}Translators: Do not translate this, the translation is in Ideascube{% endcomment %}
<li>{% fa 'language' 'fa-fw' %} <a href="{% url 'server:languages' %}">{% trans "Languages" %}</a></li>
{% comment %}Translators: Do not translate this, the translation is in Ideascube{% endcomment %}
......
{% extends 'serveradmin/index.html' %}
{% load i18n %}
{% block twothird %}
<h2>{% trans 'Radio Name' %}</h4>
<form method="POST" action="">
{% csrf_token %}
<input type="text" id="radio_name" name="radio_name" value="{{ radio_name }}" />
{% comment %}Translators: Do not translate this, the translation is in Ideascube{% endcomment %}
<input type="submit" value="{% trans 'Submit' %}" />
</form>
{% endblock %}
{% block extra_foot %}
<script type="text/javascript">
ID.focusOn('[name=radio_name]');
</script>
{% endblock extra_foot %}
......@@ -7,8 +7,6 @@ from . import views
urlpatterns += i18n.i18n_patterns(
url(r'^irfi/serveradmin/radio/$', views.radio_name, name='server_radio'),
url(r'^rfi/message/new/$', views.message_create, name='message_create'),
url(r'^rfi/message/thank/$',
TemplateView.as_view(template_name='irfi/message_thank.html'),
......
......@@ -28,21 +28,6 @@ from .forms import ContentForm, MessageForm, RadioForm
from .models import RadioShow
@staff_member_required
def radio_name(request):
if request.method == 'POST':
new_name = request.POST.get('radio_name')
if new_name:
set_config('irfi', 'radio-name', new_name, request.user)
messages.success(request, _('Radio name changed successfully'))
else:
messages.error(request, _('Radio name cannot be empty'))
return render(request, 'serveradmin/radio_name.html')
class MessageCreate(FormView):
form_class = MessageForm
template_name = 'irfi/message_form.html'
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment