Skip to content

Commit

Permalink
Merge pull request #33 from AresMUSH/dev
Browse files Browse the repository at this point in the history
Beta 33
  • Loading branch information
lynnfaraday authored Dec 1, 2018
2 parents 8fce781 + aeb71fa commit ac66631
Show file tree
Hide file tree
Showing 47 changed files with 441 additions and 160 deletions.
47 changes: 47 additions & 0 deletions engine/styles/ares.scss
Original file line number Diff line number Diff line change
Expand Up @@ -936,6 +936,29 @@ input[type='file'] {
overflow-x: hidden;
}

.chat-button {
width: 100%;
}

.chat-button-active {
color: $primary-words-color;
background-color: $primary-color;
}

.chat-button-active:focus {
color: $primary-words-color;
background-color: $primary-color;
}

.chat-nav > li > a {
padding: 0px;
}


.job-status {
background-color: gray;
}

.job-status-DONE {
background-color: gray;
color: white;
Expand All @@ -956,6 +979,30 @@ input[type='file'] {
color: white;
}

.job-category {
background-color: gray;
}

.job-category-ALERT, .job-category-BUG {
background-color: red;
color: white;
}

.job-category-BUILD, .job-category-CODE {
background-color: orange;
color: black;
}

.job-category-APP {
background-color: purple;
color: white;
}

.job-category-APP, .job-category-REQ {
background-color: purple;
color: white;
}

.small-who-icon {
float:left;
padding:15px;
Expand Down
2 changes: 2 additions & 0 deletions install/game.distr/config/describe.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
---
describe:
always_show_idle_in_rooms: false
glance_format: "%{height_title} height, %{age} year-old %{gender_noun} with %{hair}
hair and %{eyes} eyes."
shortcuts:
l: look
desc: describe
Expand Down
5 changes: 3 additions & 2 deletions install/game.distr/config/jobs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ jobs:
APP:
color: "%xm"
BUILD:
color: "%xc"
color: "%xy"
roles:
- builder
BUG:
color: "%xy"
color: "%xr"
roles:
- coder
CODE:
Expand Down Expand Up @@ -52,3 +52,4 @@ jobs:
job/mine: job/filter mine
job/active: job/filter active
job/deletecomment: job/deletereply
job/category: job/cat
3 changes: 3 additions & 0 deletions install/game.distr/config/page.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,6 @@ page:
page/lock: page/ignore
pagelock: page/ignore
tell: page
pm: page
page_start_marker: "<"
page_end_marker: ">"
5 changes: 2 additions & 3 deletions install/game.distr/config/scenes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,8 @@ scenes:
pose/remove: pose/drop
po: pose
me: pose
whisper: pemit
whisp: pemit
mutter: pemit
whisp: whisper
mutter: whisper
repose/nudge: pose/nudge
repose/notify: pose/notify
repose/drop: pose/drop
Expand Down
2 changes: 1 addition & 1 deletion install/game.distr/config/website.yml
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,6 @@ website:
url: https://aresmush.com/mush-101/
- page: jobs
title: Requests
website_code_path: "/home/ares/ares-webportal"
website_code_path: "/Users/lynn/Code/ares-webportal"
wiki_aliases:
main: home
36 changes: 36 additions & 0 deletions install/migrations/0018_beta33_update.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
module AresMUSH
module Migrations
class MigrationBeta33Update
def require_restart
false
end

def migrate
Global.logger.debug "Adding pm shortcut and page markers."
config = DatabaseMigrator.read_config_file("page.yml")
config['page']['shortcuts']['pm'] = 'page'
config['page']['page_start_marker'] = '<'
config['page']['page_end_marker'] = '>'
DatabaseMigrator.write_config_file("page.yml", config)

Global.logger.debug "Adding glance format."
default_config = DatabaseMigrator.read_distr_config_file("describe.yml")
config = DatabaseMigrator.read_config_file("describe.yml")
config['describe']['glance_format'] = default_config['describe']['glance_format']
DatabaseMigrator.write_config_file("describe.yml", config)

Global.logger.debug "Adding job category shortcut."
config = DatabaseMigrator.read_config_file("jobs.yml")
config['jobs']['shortcuts']['job/category'] = 'job/cat'
DatabaseMigrator.write_config_file("jobs.yml", config)

Global.logger.debug "Adding whisper shortcuts."
config = DatabaseMigrator.read_config_file("scenes.yml")
config['scenes']['shortcuts']['whisp'] = 'whisper'
config['scenes']['shortcuts']['mutter'] = 'whisper'
config['scenes']['shortcuts'].delete 'whisper'
DatabaseMigrator.write_config_file("scenes.yml", config)
end
end
end
end
14 changes: 8 additions & 6 deletions plugins/chargen/commands/app_submit_cmd.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,23 @@ module Chargen
class AppSubmitCmd
include CommandHandler

def check_approval
return t('chargen.you_are_already_approved') if enactor.is_approved?
return nil
attr_accessor :app_notes

def parse_args
self.app_notes = cmd.args
end

def check_can_advance
return t('chargen.not_started') if !enactor.chargen_stage
def check_approval
return t('chargen.you_are_already_approved') if enactor.is_approved?
return nil
end

def handle
if (cmd.switch_is?("confirm"))
client.emit_success Chargen.submit_app(enactor)
client.emit_success Chargen.submit_app(enactor, client.program[:app_notes])
client.emit_ooc t('chargen.approval_reminder')
else
client.program[:app_notes] = self.app_notes
client.emit_ooc t('chargen.app_confirm')
end
end
Expand Down
2 changes: 1 addition & 1 deletion plugins/chargen/help/en/apps.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ This game uses an Applications system for character approvals. As you are going

Once you're happy with your character, you can submit it for review. Application admins will make sure it's a good fit for the game's theme, that the skills are reasonable given the background, and that you haven't missed anything important in chargen.

`app/submit` - Submits your application.
`app/submit [<optional notes about your app>]` - Submits your application.

You can't make further changes while your app is under review. If you realize you need to change something, you can withdraw or un-submit your application. Make the necessary changes using the chargen commands. The app will be on hold while you do this, and you can use the submit command again when you're done.

Expand Down
2 changes: 2 additions & 0 deletions plugins/chargen/public/chargen_api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ def self.approval_job_notice(char)
def self.submit_app(char, app_notes = nil)
job = char.approval_job

app_notes = app_notes || t('global.none')

if (!job)
result = Jobs.create_job(Global.read_config("chargen", "app_category"),
t('chargen.application_title', :name => char.name),
Expand Down
2 changes: 0 additions & 2 deletions plugins/describe/locales/locale_en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,4 @@ en:
vistas_title: "Vistas for %{name}"

notify_set: "You turn the notifications when someone looks at you %{status}."

glance: "%{height} height, %{age} year-old %{gender} with %{hair} hair and %{eyes} eyes."

19 changes: 11 additions & 8 deletions plugins/describe/templates/glance_template.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,17 @@ def online_chars
end

def glance(char)
height = char.demographic(:height) || "-"
eyes = char.demographic(:eyes) || "-"
hair = char.demographic(:hair) || "-"
t('describe.glance', :height => height.titlecase,
:gender => Demographics.gender_noun(char),
:age => char.age,
:hair => hair.downcase,
:eyes => eyes.downcase)
glance_format = Global.read_config("describe", "glance_format")
glance_args = {
name: char.name,
age: char.age,
gender_noun: Demographics.gender_noun(char) }
Demographics.basic_demographics.each do |k|
glance_args[k.downcase.to_sym] = (char.demographic(k) || "-").downcase
glance_args["#{k.downcase}_title".to_sym] = (char.demographic(k) || "-").titlecase
end
output = (glance_format % glance_args) || ""
output
end

def shortdesc(char)
Expand Down
22 changes: 11 additions & 11 deletions plugins/events/helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -99,21 +99,21 @@ def self.format_timestamp(time)

def self.events_updated
File.open(Events.ical_path, 'w') do |f|
f.puts "BEGIN:VCALENDAR"
f.puts "VERSION:2.0"
f.puts "PRODID:-//hacksw/handcal//NONSGML v1.0//EN"
f.puts "BEGIN:VCALENDAR\r\n"
f.puts "VERSION:2.0\r\n"
f.puts "PRODID:-//hacksw/handcal//NONSGML v1.0//EN\r\n"

Event.all.each do |event|
f.puts "BEGIN:VEVENT"
f.puts "UID:#{event.ical_uid}"
f.puts "DTSTART:#{Events.format_timestamp(event.starts)}"
f.puts "DTSTAMP:#{Events.format_timestamp(event.created_at)}"
f.puts "SUMMARY:#{event.title}"
f.puts "DESCRIPTION:#{event.description.gsub("%r", "\r\n ")}"
f.puts "END:VEVENT"
f.puts "BEGIN:VEVENT\r\n"
f.puts "UID:#{event.ical_uid}\r\n"
f.puts "DTSTART:#{Events.format_timestamp(event.starts)}\r\n"
f.puts "DTSTAMP:#{Events.format_timestamp(event.created_at)}\r\n"
f.puts "SUMMARY:#{event.title}\r\n"
f.puts "DESCRIPTION:#{event.description.gsub("%r", "\r\n ")}\r\n"
f.puts "END:VEVENT\r\n"
end

f.puts "END:VCALENDAR"
f.puts "END:VCALENDAR\r\n"
end
end

Expand Down
2 changes: 1 addition & 1 deletion plugins/friends/help/en/friends.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ The Friends system helps you to interact with people you have designated as your

You can use the friends list to control whose connect/disconnect messages you see. See [Watch](/help/watch).

If you have an AresMUSH Player Handle, you can add other players as your friends at AresCentral. These friendships will apply to all Ares games, so you can easily find out which of your friends are playing here. For more information on player handles, see: [AresMUSH Handles Tutorial](http://aresmush.com/handles/).
If you have an AresMUSH Player Handle, you can add other players as your friends at AresCentral. This carries over to all your Ares games. The friends command will then show you which characters your friends are playing, and all of their characters are automatically considered friends. For more information on player handles, see: [AresMUSH Handles Tutorial](http://aresmush.com/handles/).
2 changes: 2 additions & 0 deletions plugins/help/help.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ def self.get_web_request_handler(request)
return HelpIndexRequestHandler
when "helpTopic"
return HelpTopicRequestHandler
when "searchHelp"
return SearchHelpRequestHandler
end
nil
end
Expand Down
22 changes: 21 additions & 1 deletion plugins/help/helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,36 @@ def self.topic_url(topic, search = nil)
"#{Game.web_portal_url}/help/#{topic}"
end

# {
# section_titleA: [ 'topic1', 'topic2', 'topic3' ],
# section_titleB: [ 'topic4', 'topic5' ]
# }
def self.toc
Global.help_reader.help_toc
end

# {
# alias1: cmd1,
# alias2: cmd1,
# alias3: cmd2
# }
def self.topic_keys
Global.help_reader.help_keys
end

# {
# topic1: { summary: "X", aliases: [], path: "/", etc. },
# topic2: { summary: "Y", aliases: [], path: "/", etc. }
# }
def self.topic_index
Global.help_reader.help_file_index
end

# Given one of the sections from Help.toc (e.g. "section_titleA", returns info about topics in that section):
# {
# "topic1": { summary: "X", aliases: [], path: "/", etc. },
# "topic2": { summary: "Y", aliases: [], path: "/", etc. }
# }
def self.toc_section_topic_data(section)
topics = {}
topic_names = Help.toc[section]
Expand All @@ -29,13 +47,15 @@ def self.toc_section_topic_data(section)
topics
end

# Finds topic keys that are a partial match for the command being searched.
def self.find_quickref(topic)
search = strip_prefix(topic).downcase.gsub(/[\/ ]/, "_")
search = search.split("_").first
return Help.topic_keys.select { |k, v| k =~ /#{search}/ }
end


# Finds topic keys for topic names and aliases matching the search string - with some added logic
# to account for plurals, partials.
def self.find_topic(topic)
search = strip_prefix(topic).downcase.gsub(/[\/ ]/, "_")

Expand Down
31 changes: 31 additions & 0 deletions plugins/help/web/search_help_request_handler.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
module AresMUSH
module Help
class SearchHelpRequestHandler
def handle(request)

searchText = (request.args[:searchText] || "").strip

topics_by_name = Help.find_topic(searchText).uniq.sort
topics_by_text = Global.help_reader.help_text.select { |k, v| v =~ /\b#{searchText}\b/i }.keys.uniq.sort

{
probable_matches: topics_by_name.map { |t|
{
id: t,
name: t.titleize,
summary: (Help.topic_index[t] || {})['summary']
}
},
possible_matches: topics_by_text.empty? ? nil : topics_by_text.map { |t|
{
id: t,
name: t.titleize,
summary: (Help.topic_index[t] || {})['summary']
}
}
}

end
end
end
end
Loading

0 comments on commit ac66631

Please sign in to comment.